Backward compatibility. Gracefully handle older versions of debug info.

llvm-svn: 117595
This commit is contained in:
Devang Patel 2010-10-28 20:08:13 +00:00
parent 63760ba38e
commit 9f414eee8c
1 changed files with 6 additions and 0 deletions

View File

@ -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();
}