mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-28 04:29:44 +00:00
DwarfDebug: Push DISubprogram through updateSubprogramScopeDIE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194879 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4634338655
commit
14f41e7e18
@ -366,17 +366,15 @@ bool DwarfDebug::isSubprogramContext(const MDNode *Context) {
|
|||||||
// Find DIE for the given subprogram and attach appropriate DW_AT_low_pc
|
// Find DIE for the given subprogram and attach appropriate DW_AT_low_pc
|
||||||
// and DW_AT_high_pc attributes. If there are global variables in this
|
// and DW_AT_high_pc attributes. If there are global variables in this
|
||||||
// scope then create and insert DIEs for these variables.
|
// scope then create and insert DIEs for these variables.
|
||||||
DIE *DwarfDebug::updateSubprogramScopeDIE(CompileUnit *SPCU,
|
DIE *DwarfDebug::updateSubprogramScopeDIE(CompileUnit *SPCU, DISubprogram SP) {
|
||||||
const MDNode *SPNode) {
|
DIE *SPDie = SPCU->getDIE(SP);
|
||||||
DIE *SPDie = SPCU->getDIE(DIDescriptor(SPNode));
|
|
||||||
|
|
||||||
assert(SPDie && "Unable to find subprogram DIE!");
|
assert(SPDie && "Unable to find subprogram DIE!");
|
||||||
DISubprogram SP(SPNode);
|
|
||||||
|
|
||||||
// If we're updating an abstract DIE, then we will be adding the children and
|
// If we're updating an abstract DIE, then we will be adding the children and
|
||||||
// object pointer later on. But what we don't want to do is process the
|
// object pointer later on. But what we don't want to do is process the
|
||||||
// concrete DIE twice.
|
// concrete DIE twice.
|
||||||
if (DIE *AbsSPDIE = AbstractSPDies.lookup(SPNode)) {
|
if (DIE *AbsSPDIE = AbstractSPDies.lookup(SP)) {
|
||||||
// Pick up abstract subprogram DIE.
|
// Pick up abstract subprogram DIE.
|
||||||
SPDie = SPCU->createAndAddDIE(dwarf::DW_TAG_subprogram, *SPCU->getCUDie());
|
SPDie = SPCU->createAndAddDIE(dwarf::DW_TAG_subprogram, *SPCU->getCUDie());
|
||||||
SPCU->addDIEEntry(SPDie, dwarf::DW_AT_abstract_origin, AbsSPDIE);
|
SPCU->addDIEEntry(SPDie, dwarf::DW_AT_abstract_origin, AbsSPDIE);
|
||||||
@ -624,7 +622,7 @@ DIE *DwarfDebug::constructScopeDIE(CompileUnit *TheCU, LexicalScope *Scope) {
|
|||||||
AbstractSPDies.insert(std::make_pair(DS, ScopeDIE));
|
AbstractSPDies.insert(std::make_pair(DS, ScopeDIE));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ScopeDIE = updateSubprogramScopeDIE(TheCU, DS);
|
ScopeDIE = updateSubprogramScopeDIE(TheCU, DISubprogram(DS));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Early exit when we know the scope DIE is going to be null.
|
// Early exit when we know the scope DIE is going to be null.
|
||||||
|
@ -486,7 +486,7 @@ private:
|
|||||||
/// DW_AT_low_pc and DW_AT_high_pc attributes. If there are global
|
/// DW_AT_low_pc and DW_AT_high_pc attributes. If there are global
|
||||||
/// variables in this scope then create and insert DIEs for these
|
/// variables in this scope then create and insert DIEs for these
|
||||||
/// variables.
|
/// variables.
|
||||||
DIE *updateSubprogramScopeDIE(CompileUnit *SPCU, const MDNode *SPNode);
|
DIE *updateSubprogramScopeDIE(CompileUnit *SPCU, DISubprogram SP);
|
||||||
|
|
||||||
/// \brief Construct new DW_TAG_lexical_block for this scope and
|
/// \brief Construct new DW_TAG_lexical_block for this scope and
|
||||||
/// attach DW_AT_low_pc/DW_AT_high_pc labels.
|
/// attach DW_AT_low_pc/DW_AT_high_pc labels.
|
||||||
|
Loading…
Reference in New Issue
Block a user