mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 06:24:57 +00:00
Sink most of DwarfDebug::constructAbstractSubprogramScopeDIE into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221005 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -586,8 +586,12 @@ DIE *DwarfCompileUnit::createAndAddScopeChildren(LexicalScope *Scope,
|
|||||||
return ObjectPointer;
|
return ObjectPointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
DIE &
|
void
|
||||||
DwarfCompileUnit::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) {
|
DwarfCompileUnit::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) {
|
||||||
|
DIE *&AbsDef = DD->getAbstractSPDies()[Scope->getScopeNode()];
|
||||||
|
if (AbsDef)
|
||||||
|
return;
|
||||||
|
|
||||||
DISubprogram SP(Scope->getScopeNode());
|
DISubprogram SP(Scope->getScopeNode());
|
||||||
|
|
||||||
DIE *ContextDIE;
|
DIE *ContextDIE;
|
||||||
@ -604,15 +608,14 @@ DwarfCompileUnit::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) {
|
|||||||
|
|
||||||
// Passing null as the associated DIDescriptor because the abstract definition
|
// Passing null as the associated DIDescriptor because the abstract definition
|
||||||
// shouldn't be found by lookup.
|
// shouldn't be found by lookup.
|
||||||
DIE &AbsDef =
|
AbsDef =
|
||||||
createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, DIDescriptor());
|
&createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, DIDescriptor());
|
||||||
applySubprogramAttributesToDefinition(SP, AbsDef);
|
applySubprogramAttributesToDefinition(SP, *AbsDef);
|
||||||
|
|
||||||
if (getCUNode().getEmissionKind() != DIBuilder::LineTablesOnly)
|
if (getCUNode().getEmissionKind() != DIBuilder::LineTablesOnly)
|
||||||
addUInt(AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined);
|
addUInt(*AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined);
|
||||||
if (DIE *ObjectPointer = createAndAddScopeChildren(Scope, AbsDef))
|
if (DIE *ObjectPointer = createAndAddScopeChildren(Scope, *AbsDef))
|
||||||
addDIEEntry(AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer);
|
addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer);
|
||||||
return AbsDef;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<DIE>
|
std::unique_ptr<DIE>
|
||||||
|
@ -121,7 +121,7 @@ public:
|
|||||||
|
|
||||||
DIE *createAndAddScopeChildren(LexicalScope *Scope, DIE &ScopeDIE);
|
DIE *createAndAddScopeChildren(LexicalScope *Scope, DIE &ScopeDIE);
|
||||||
|
|
||||||
DIE &constructAbstractSubprogramScopeDIE(LexicalScope *Scope);
|
void constructAbstractSubprogramScopeDIE(LexicalScope *Scope);
|
||||||
|
|
||||||
/// \brief Construct import_module DIE.
|
/// \brief Construct import_module DIE.
|
||||||
std::unique_ptr<DIE>
|
std::unique_ptr<DIE>
|
||||||
|
@ -337,15 +337,11 @@ void DwarfDebug::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) {
|
|||||||
|
|
||||||
const MDNode *SP = Scope->getScopeNode();
|
const MDNode *SP = Scope->getScopeNode();
|
||||||
|
|
||||||
DIE *&AbsDef = AbstractSPDies[SP];
|
|
||||||
if (AbsDef)
|
|
||||||
return;
|
|
||||||
|
|
||||||
ProcessedSPNodes.insert(SP);
|
ProcessedSPNodes.insert(SP);
|
||||||
|
|
||||||
// Find the subprogram's DwarfCompileUnit in the SPMap in case the subprogram
|
// Find the subprogram's DwarfCompileUnit in the SPMap in case the subprogram
|
||||||
// was inlined from another compile unit.
|
// was inlined from another compile unit.
|
||||||
AbsDef = &SPMap[SP]->constructAbstractSubprogramScopeDIE(Scope);
|
SPMap[SP]->constructAbstractSubprogramScopeDIE(Scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DwarfDebug::addGnuPubAttributes(DwarfUnit &U, DIE &D) const {
|
void DwarfDebug::addGnuPubAttributes(DwarfUnit &U, DIE &D) const {
|
||||||
|
Reference in New Issue
Block a user