Backward compatibility. Gracefully handle older versions of debug info.
llvm-svn: 117595
This commit is contained in:
parent
63760ba38e
commit
9f414eee8c
|
@ -272,10 +272,16 @@ namespace llvm {
|
|||
return DbgNode && (isBasicType() || isDerivedType() || isCompositeType());
|
||||
}
|
||||
StringRef getDirectory() const {
|
||||
if (getVersion() == llvm::LLVMDebugVersion7)
|
||||
return getCompileUnit().getDirectory();
|
||||
|
||||
DIFile F = getFieldAs<DIFile>(3);
|
||||
return F.getDirectory();
|
||||
}
|
||||
StringRef getFilename() const {
|
||||
if (getVersion() == llvm::LLVMDebugVersion7)
|
||||
return getCompileUnit().getFilename();
|
||||
|
||||
DIFile F = getFieldAs<DIFile>(3);
|
||||
return F.getFilename();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue