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