From 61ef2be3e52d49cbe62aa39808ba89af62def3e2 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 22 Mar 2013 20:18:46 +0000 Subject: [PATCH] Swap the DIFile in DILexicalBlockFile out for the raw name/directory pair This is the last change in transitioning all DIScopes to have a common prefix. llvm-svn: 177756 --- llvm/include/llvm/DebugInfo.h | 6 ------ llvm/lib/IR/DIBuilder.cpp | 2 +- llvm/lib/IR/DebugInfo.cpp | 4 ---- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/llvm/include/llvm/DebugInfo.h b/llvm/include/llvm/DebugInfo.h index 05ca3853c0cc..3a2aff3f15ce 100644 --- a/llvm/include/llvm/DebugInfo.h +++ b/llvm/include/llvm/DebugInfo.h @@ -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(1).getDirectory(); - } - StringRef getFilename() const { - return getFieldAs(1).getFilename(); - } DILexicalBlock getScope() const { return getFieldAs(2); } bool Verify() const; }; diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp index 56024573deaa..033af3bd1d71 100644 --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/lib/IR/DIBuilder.cpp @@ -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)); diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 990233404e71..5ab64265e49f 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -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); }