summaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/DebugInfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Analysis/DebugInfo.h')
-rw-r--r--include/llvm/Analysis/DebugInfo.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h
index 9b1d1b30..4e8c4c8 100644
--- a/include/llvm/Analysis/DebugInfo.h
+++ b/include/llvm/Analysis/DebugInfo.h
@@ -395,8 +395,21 @@ namespace llvm {
}
unsigned isArtificial() const { return getUnsignedField(14); }
- StringRef getFilename() const { return getCompileUnit().getFilename();}
- StringRef getDirectory() const { return getCompileUnit().getDirectory();}
+ StringRef getFilename() const {
+ if (getVersion() == llvm::LLVMDebugVersion7)
+ return getCompileUnit().getFilename();
+
+ DIFile F = getFieldAs<DIFile>(6);
+ return F.getFilename();
+ }
+
+ StringRef getDirectory() const {
+ if (getVersion() == llvm::LLVMDebugVersion7)
+ return getCompileUnit().getFilename();
+
+ DIFile F = getFieldAs<DIFile>(6);
+ return F.getDirectory();
+ }
/// Verify - Verify that a subprogram descriptor is well formed.
bool Verify() const;
OpenPOWER on IntegriCloud