Swap the DIFile in DILexicalBlockFile out for the raw name/directory pair
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 22 Mar 2013 20:18:46 +0000 (20:18 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 22 Mar 2013 20:18:46 +0000 (20:18 +0000)
This is the last change in transitioning all DIScopes to have a common prefix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177756 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/DebugInfo.h
lib/IR/DIBuilder.cpp
lib/IR/DebugInfo.cpp

index 05ca3853c0cc75bc89ec1613502514809e4e1b36..3a2aff3f15ce959450947b510fabdd023419f24b 100644 (file)
@@ -604,12 +604,6 @@ namespace llvm {
     DIScope getContext() const { if (getScope().isSubprogram()) return getScope(); return getScope().getContext(); }
     unsigned getLineNumber() const { return getScope().getLineNumber(); }
     unsigned getColumnNumber() const { return getScope().getColumnNumber(); }
-    StringRef getDirectory() const {
-      return getFieldAs<DIFile>(1).getDirectory();
-    }
-    StringRef getFilename() const {
-      return getFieldAs<DIFile>(1).getFilename();
-    }
     DILexicalBlock getScope() const { return getFieldAs<DILexicalBlock>(2); }
     bool Verify() const;
   };
index 56024573deaab4d1e6866e6999dd96778805164d..033af3bd1d711b12b1bcd359f8a6a1e74f73231c 100644 (file)
@@ -1007,7 +1007,7 @@ DILexicalBlockFile DIBuilder::createLexicalBlockFile(DIDescriptor Scope,
                                                      DIFile File) {
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_lexical_block),
-    File,
+    File.getFileNode(),
     Scope
   };
   DILexicalBlockFile R(MDNode::get(VMContext, Elts));
index 990233404e71680d5ffa95ac86356ae125afcce6..5ab64265e49fc2fb2b32015f37f7fcd401b574ca 100644 (file)
@@ -664,16 +664,12 @@ DIArray DISubprogram::getVariables() const {
 StringRef DIScope::getFilename() const {
   if (!DbgNode)
     return StringRef();
-  if (isLexicalBlockFile())
-    return DILexicalBlockFile(DbgNode).getFilename();
   return ::getStringField(getNodeField(DbgNode, 1), 0);
 }
 
 StringRef DIScope::getDirectory() const {
   if (!DbgNode)
     return StringRef();
-  if (isLexicalBlockFile())
-    return DILexicalBlockFile(DbgNode).getDirectory();
   return ::getStringField(getNodeField(DbgNode, 1), 1);
 }