diff options
author | James Molloy <james.molloy@arm.com> | 2011-09-26 17:40:42 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2011-09-26 17:40:42 +0000 |
commit | 439780eeaef1a2c6a1105fb705a27c5c819e8d0e (patch) | |
tree | 46b65cbbddb15ffedd5e7fd1ab952d194a2e5b04 /include | |
parent | 6272c5d874bb2b342b02a16aacc9806b4ac55ffe (diff) | |
download | external_llvm-439780eeaef1a2c6a1105fb705a27c5c819e8d0e.zip external_llvm-439780eeaef1a2c6a1105fb705a27c5c819e8d0e.tar.gz external_llvm-439780eeaef1a2c6a1105fb705a27c5c819e8d0e.tar.bz2 |
Fix emission of debug data for global variables. getContext() on DIGlobalVariables is not valid any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140539 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-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); } |