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 | a514a4e17284617f7bff0ffa694d699da45fc882 (patch) | |
tree | f3fd2049b1f168adfa78c737558d3a38a2e39b9c | |
parent | 29129728f1d4febe44792d1481077cc47fe83a08 (diff) |
Do not rely on context to find file info. It is already provided as a separate field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117577 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Analysis/DebugInfo.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h index 1c1b595576..3bd0943cb1 100644 --- a/include/llvm/Analysis/DebugInfo.h +++ b/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); |