From 1742de5cbed6477b0fc52ea993110ae18897ca8e Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 28 Oct 2010 19:14:28 +0000 Subject: [PATCH] Do not rely on context to find file info. It is already provided as a separate field. llvm-svn: 117577 --- llvm/include/llvm/Analysis/DebugInfo.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/Analysis/DebugInfo.h b/llvm/include/llvm/Analysis/DebugInfo.h index 1c1b595576f0..3bd0943cb1d7 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(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(3); + return F.getDirectory(); + } + StringRef getFilename() const { + DIFile F = getFieldAs(3); + return F.getFilename(); + } DICompileUnit getCompileUnit() const{ if (getVersion() == llvm::LLVMDebugVersion7) return getFieldAs(3);