[llvm] r221005 - Sink most of DwarfDebug::constructAbstractSubprogramScopeDIE into DwarfCompileUnit
David Blaikie
dblaikie at gmail.com
Fri Oct 31 14:57:03 PDT 2014
Author: dblaikie
Date: Fri Oct 31 16:57:02 2014
New Revision: 221005
URL: http://llvm.org/viewvc/llvm-project?rev=221005&view=rev
Log:
Sink most of DwarfDebug::constructAbstractSubprogramScopeDIE into DwarfCompileUnit
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=221005&r1=221004&r2=221005&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Fri Oct 31 16:57:02 2014
@@ -586,8 +586,12 @@ DIE *DwarfCompileUnit::createAndAddScope
return ObjectPointer;
}
-DIE &
+void
DwarfCompileUnit::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) {
+ DIE *&AbsDef = DD->getAbstractSPDies()[Scope->getScopeNode()];
+ if (AbsDef)
+ return;
+
DISubprogram SP(Scope->getScopeNode());
DIE *ContextDIE;
@@ -604,15 +608,14 @@ DwarfCompileUnit::constructAbstractSubpr
// Passing null as the associated DIDescriptor because the abstract definition
// shouldn't be found by lookup.
- DIE &AbsDef =
- createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, DIDescriptor());
- applySubprogramAttributesToDefinition(SP, AbsDef);
+ AbsDef =
+ &createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, DIDescriptor());
+ applySubprogramAttributesToDefinition(SP, *AbsDef);
if (getCUNode().getEmissionKind() != DIBuilder::LineTablesOnly)
- addUInt(AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined);
- if (DIE *ObjectPointer = createAndAddScopeChildren(Scope, AbsDef))
- addDIEEntry(AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer);
- return AbsDef;
+ addUInt(*AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined);
+ if (DIE *ObjectPointer = createAndAddScopeChildren(Scope, *AbsDef))
+ addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer);
}
std::unique_ptr<DIE>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=221005&r1=221004&r2=221005&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Fri Oct 31 16:57:02 2014
@@ -121,7 +121,7 @@ public:
DIE *createAndAddScopeChildren(LexicalScope *Scope, DIE &ScopeDIE);
- DIE &constructAbstractSubprogramScopeDIE(LexicalScope *Scope);
+ void constructAbstractSubprogramScopeDIE(LexicalScope *Scope);
/// \brief Construct import_module DIE.
std::unique_ptr<DIE>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=221005&r1=221004&r2=221005&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Oct 31 16:57:02 2014
@@ -337,15 +337,11 @@ void DwarfDebug::constructAbstractSubpro
const MDNode *SP = Scope->getScopeNode();
- DIE *&AbsDef = AbstractSPDies[SP];
- if (AbsDef)
- return;
-
ProcessedSPNodes.insert(SP);
// Find the subprogram's DwarfCompileUnit in the SPMap in case the subprogram
// was inlined from another compile unit.
- AbsDef = &SPMap[SP]->constructAbstractSubprogramScopeDIE(Scope);
+ SPMap[SP]->constructAbstractSubprogramScopeDIE(Scope);
}
void DwarfDebug::addGnuPubAttributes(DwarfUnit &U, DIE &D) const {
More information about the llvm-commits
mailing list