From: Devang Patel Date: Thu, 28 Oct 2010 20:08:13 +0000 (+0000) Subject: Backward compatibility. Gracefully handle older versions of debug info. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8f6a281e979df1578526fc8a72a3c1bd33aa3efa;p=oota-llvm.git Backward compatibility. Gracefully handle older versions of debug info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117595 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h index 41d8e14aaed..54508a77b13 100644 --- a/include/llvm/Analysis/DebugInfo.h +++ b/include/llvm/Analysis/DebugInfo.h @@ -272,10 +272,16 @@ namespace llvm { return DbgNode && (isBasicType() || isDerivedType() || isCompositeType()); } StringRef getDirectory() const { + if (getVersion() == llvm::LLVMDebugVersion7) + return getCompileUnit().getDirectory(); + DIFile F = getFieldAs(3); return F.getDirectory(); } StringRef getFilename() const { + if (getVersion() == llvm::LLVMDebugVersion7) + return getCompileUnit().getFilename(); + DIFile F = getFieldAs(3); return F.getFilename(); }