mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-22 10:24:26 +00:00
Sink DwarfDebug::createScopeChildrenDIE down into DwarfCompileUnit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219422 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -330,31 +330,11 @@ bool DwarfDebug::isLexicalScopeDIENull(LexicalScope *Scope) {
|
||||
return !getLabelAfterInsn(Ranges.front().second);
|
||||
}
|
||||
|
||||
DIE *DwarfDebug::createScopeChildrenDIE(
|
||||
DwarfCompileUnit &TheCU, LexicalScope *Scope,
|
||||
SmallVectorImpl<std::unique_ptr<DIE>> &Children,
|
||||
unsigned *ChildScopeCount) {
|
||||
DIE *ObjectPointer = nullptr;
|
||||
|
||||
for (DbgVariable *DV : ScopeVariables.lookup(Scope))
|
||||
Children.push_back(TheCU.constructVariableDIE(*DV, *Scope, ObjectPointer));
|
||||
|
||||
unsigned ChildCountWithoutScopes = Children.size();
|
||||
|
||||
for (LexicalScope *LS : Scope->getChildren())
|
||||
TheCU.constructScopeDIE(LS, Children);
|
||||
|
||||
if (ChildScopeCount)
|
||||
*ChildScopeCount = Children.size() - ChildCountWithoutScopes;
|
||||
|
||||
return ObjectPointer;
|
||||
}
|
||||
|
||||
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 = createScopeChildrenDIE(TheCU, Scope, Children);
|
||||
DIE *ObjectPointer = TheCU.createScopeChildrenDIE(Scope, Children);
|
||||
|
||||
// Add children
|
||||
for (auto &I : Children)
|
||||
@ -1483,6 +1463,8 @@ void DwarfDebug::endFunction(const MachineFunction *MF) {
|
||||
assert(ScopeVariables.empty());
|
||||
assert(CurrentFnArguments.empty());
|
||||
assert(DbgValues.empty());
|
||||
// FIXME: This wouldn't be true in LTO with a -g (with inlining) CU followed
|
||||
// by a -gmlt CU. Add a test and remove this assertion.
|
||||
assert(AbstractVariables.empty());
|
||||
LabelsBeforeInsn.clear();
|
||||
LabelsAfterInsn.clear();
|
||||
|
Reference in New Issue
Block a user