diff options
author | Devang Patel <dpatel@apple.com> | 2010-10-28 19:14:28 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-10-28 19:14:28 +0000 |
commit | 1742de5cbed6477b0fc52ea993110ae18897ca8e (patch) | |
tree | 48de89e37b488dea548fef1086f28b5df1bc7631 | |
parent | faadd7b72db1a97b5b4c3b5ac2056435bf7ffc77 (diff) | |
download | llvm-1742de5cbed6477b0fc52ea993110ae18897ca8e.zip llvm-1742de5cbed6477b0fc52ea993110ae18897ca8e.tar.gz llvm-1742de5cbed6477b0fc52ea993110ae18897ca8e.tar.bz2 |
Do not rely on context to find file info. It is already provided as a separate field.
llvm-svn: 117577
-rw-r--r-- | llvm/include/llvm/Analysis/DebugInfo.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/include/llvm/Analysis/DebugInfo.h b/llvm/include/llvm/Analysis/DebugInfo.h index 1c1b595..3bd0943c 100644 --- a/llvm/include/llvm/Analysis/DebugInfo.h +++ b/llvm/include/llvm/Analysis/DebugInfo.h @@ -582,8 +582,14 @@ namespace llvm { explicit DINameSpace(const MDNode *N = 0) : DIScope(N) {} DIScope getContext() const { return getFieldAs<DIScope>(1); } StringRef getName() const { return getStringField(2); } - StringRef getDirectory() const { return getContext().getDirectory(); } - StringRef getFilename() const { return getContext().getFilename(); } + StringRef getDirectory() const { + DIFile F = getFieldAs<DIFile>(3); + return F.getDirectory(); + } + StringRef getFilename() const { + DIFile F = getFieldAs<DIFile>(3); + return F.getFilename(); + } DICompileUnit getCompileUnit() const{ if (getVersion() == llvm::LLVMDebugVersion7) return getFieldAs<DICompileUnit>(3); |