[llvm-commits] [llvm] r117595 - /llvm/trunk/include/llvm/Analysis/DebugInfo.h
Devang Patel
dpatel at apple.com
Thu Oct 28 13:08:13 PDT 2010
Author: dpatel
Date: Thu Oct 28 15:08:13 2010
New Revision: 117595
URL: http://llvm.org/viewvc/llvm-project?rev=117595&view=rev
Log:
Backward compatibility. Gracefully handle older versions of debug info.
Modified:
llvm/trunk/include/llvm/Analysis/DebugInfo.h
Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=117595&r1=117594&r2=117595&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Thu Oct 28 15:08:13 2010
@@ -272,10 +272,16 @@
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();
}
More information about the llvm-commits
mailing list