[llvm-commits] [llvm] r117577 - /llvm/trunk/include/llvm/Analysis/DebugInfo.h

Devang Patel dpatel at apple.com
Thu Oct 28 12:14:28 PDT 2010


Author: dpatel
Date: Thu Oct 28 14:14:28 2010
New Revision: 117577

URL: http://llvm.org/viewvc/llvm-project?rev=117577&view=rev
Log:
Do not rely on context to find file info. It is already provided as a separate field.

Modified:
    llvm/trunk/include/llvm/Analysis/DebugInfo.h

Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=117577&r1=117576&r2=117577&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Thu Oct 28 14:14:28 2010
@@ -582,8 +582,14 @@
     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);





More information about the llvm-commits mailing list