diff options
Diffstat (limited to 'include/llvm/Analysis/DebugInfo.h')
-rw-r--r-- | include/llvm/Analysis/DebugInfo.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h index b0cf17a..1022302 100644 --- a/include/llvm/Analysis/DebugInfo.h +++ b/include/llvm/Analysis/DebugInfo.h @@ -579,6 +579,17 @@ namespace llvm { DIFile F = getFieldAs<DIFile>(6); return F.getCompileUnit(); } + StringRef getFilename() const { + if (getVersion() <= llvm::LLVMDebugVersion10) + return getContext().getFilename(); + return getFieldAs<DIFile>(6).getFilename(); + } + StringRef getDirectory() const { + if (getVersion() <= llvm::LLVMDebugVersion10) + return getContext().getDirectory(); + return getFieldAs<DIFile>(6).getDirectory(); + + } unsigned getLineNumber() const { return getUnsignedField(7); } DIType getType() const { return getFieldAs<DIType>(8); } |