diff options
-rw-r--r-- | include/llvm/Analysis/DebugInfo.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h index 41d8e14aae..54508a77b1 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<DIFile>(3); return F.getDirectory(); } StringRef getFilename() const { + if (getVersion() == llvm::LLVMDebugVersion7) + return getCompileUnit().getFilename(); + DIFile F = getFieldAs<DIFile>(3); return F.getFilename(); } |