return ObjectPointer;
}
-DIE &
+void
DwarfCompileUnit::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) {
+ DIE *&AbsDef = DD->getAbstractSPDies()[Scope->getScopeNode()];
+ if (AbsDef)
+ return;
+
DISubprogram SP(Scope->getScopeNode());
DIE *ContextDIE;
// 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>
DIE *createAndAddScopeChildren(LexicalScope *Scope, DIE &ScopeDIE);
- DIE &constructAbstractSubprogramScopeDIE(LexicalScope *Scope);
+ void constructAbstractSubprogramScopeDIE(LexicalScope *Scope);
/// \brief Construct import_module DIE.
std::unique_ptr<DIE>
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 {