mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-24 12:29:33 +00:00
Sink DwarfDebug::createAndAddScopeChildren down into DwarfCompileUnit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219437 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7cb5e0f56d
commit
db0ec65e79
@ -599,8 +599,7 @@ void DwarfCompileUnit::constructSubprogramScopeDIE(LexicalScope *Scope) {
|
|||||||
// Collect lexical scope children first.
|
// Collect lexical scope children first.
|
||||||
// ObjectPointer might be a local (non-argument) local variable if it's a
|
// ObjectPointer might be a local (non-argument) local variable if it's a
|
||||||
// block's synthetic this pointer.
|
// block's synthetic this pointer.
|
||||||
if (DIE *BlockObjPtr =
|
if (DIE *BlockObjPtr = createAndAddScopeChildren(Scope, ScopeDIE)) {
|
||||||
DD->createAndAddScopeChildren(*this, Scope, ScopeDIE)) {
|
|
||||||
assert(!ObjectPointer && "multiple object pointers can't be described");
|
assert(!ObjectPointer && "multiple object pointers can't be described");
|
||||||
ObjectPointer = BlockObjPtr;
|
ObjectPointer = BlockObjPtr;
|
||||||
}
|
}
|
||||||
@ -609,4 +608,17 @@ void DwarfCompileUnit::constructSubprogramScopeDIE(LexicalScope *Scope) {
|
|||||||
addDIEEntry(ScopeDIE, dwarf::DW_AT_object_pointer, *ObjectPointer);
|
addDIEEntry(ScopeDIE, dwarf::DW_AT_object_pointer, *ObjectPointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DIE *DwarfCompileUnit::createAndAddScopeChildren(LexicalScope *Scope,
|
||||||
|
DIE &ScopeDIE) {
|
||||||
|
// We create children when the scope DIE is not null.
|
||||||
|
SmallVector<std::unique_ptr<DIE>, 8> Children;
|
||||||
|
DIE *ObjectPointer = createScopeChildrenDIE(Scope, Children);
|
||||||
|
|
||||||
|
// Add children
|
||||||
|
for (auto &I : Children)
|
||||||
|
ScopeDIE.addChild(std::move(I));
|
||||||
|
|
||||||
|
return ObjectPointer;
|
||||||
|
}
|
||||||
|
|
||||||
} // end llvm namespace
|
} // end llvm namespace
|
||||||
|
@ -118,6 +118,8 @@ public:
|
|||||||
|
|
||||||
/// \brief Construct a DIE for this subprogram scope.
|
/// \brief Construct a DIE for this subprogram scope.
|
||||||
void constructSubprogramScopeDIE(LexicalScope *Scope);
|
void constructSubprogramScopeDIE(LexicalScope *Scope);
|
||||||
|
|
||||||
|
DIE *createAndAddScopeChildren(LexicalScope *Scope, DIE &ScopeDIE);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end llvm namespace
|
} // end llvm namespace
|
||||||
|
@ -330,19 +330,6 @@ bool DwarfDebug::isLexicalScopeDIENull(LexicalScope *Scope) {
|
|||||||
return !getLabelAfterInsn(Ranges.front().second);
|
return !getLabelAfterInsn(Ranges.front().second);
|
||||||
}
|
}
|
||||||
|
|
||||||
DIE *DwarfDebug::createAndAddScopeChildren(DwarfCompileUnit &TheCU,
|
|
||||||
LexicalScope *Scope, DIE &ScopeDIE) {
|
|
||||||
// We create children when the scope DIE is not null.
|
|
||||||
SmallVector<std::unique_ptr<DIE>, 8> Children;
|
|
||||||
DIE *ObjectPointer = TheCU.createScopeChildrenDIE(Scope, Children);
|
|
||||||
|
|
||||||
// Add children
|
|
||||||
for (auto &I : Children)
|
|
||||||
ScopeDIE.addChild(std::move(I));
|
|
||||||
|
|
||||||
return ObjectPointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DwarfDebug::constructAbstractSubprogramScopeDIE(DwarfCompileUnit &TheCU,
|
void DwarfDebug::constructAbstractSubprogramScopeDIE(DwarfCompileUnit &TheCU,
|
||||||
LexicalScope *Scope) {
|
LexicalScope *Scope) {
|
||||||
assert(Scope && Scope->getScopeNode());
|
assert(Scope && Scope->getScopeNode());
|
||||||
@ -380,7 +367,7 @@ void DwarfDebug::constructAbstractSubprogramScopeDIE(DwarfCompileUnit &TheCU,
|
|||||||
|
|
||||||
if (TheCU.getCUNode().getEmissionKind() != DIBuilder::LineTablesOnly)
|
if (TheCU.getCUNode().getEmissionKind() != DIBuilder::LineTablesOnly)
|
||||||
SPCU.addUInt(*AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined);
|
SPCU.addUInt(*AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined);
|
||||||
if (DIE *ObjectPointer = createAndAddScopeChildren(SPCU, Scope, *AbsDef))
|
if (DIE *ObjectPointer = SPCU.createAndAddScopeChildren(Scope, *AbsDef))
|
||||||
SPCU.addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer);
|
SPCU.addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -682,9 +682,6 @@ public:
|
|||||||
SmallVector<DbgVariable *, 8> &getCurrentFnArguments() {
|
SmallVector<DbgVariable *, 8> &getCurrentFnArguments() {
|
||||||
return CurrentFnArguments;
|
return CurrentFnArguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
DIE *createAndAddScopeChildren(DwarfCompileUnit &TheCU, LexicalScope *Scope,
|
|
||||||
DIE &ScopeDIE);
|
|
||||||
};
|
};
|
||||||
} // End of namespace llvm
|
} // End of namespace llvm
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user