mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-16 00:33:10 +00:00
Eliminate unnecessary scopes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32020 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
619965d32e
commit
36729ddd23
@ -1872,6 +1872,7 @@ private:
|
|||||||
/// ConstructScope - Construct the components of a scope.
|
/// ConstructScope - Construct the components of a scope.
|
||||||
///
|
///
|
||||||
void ConstructScope(DebugScope *ParentScope,
|
void ConstructScope(DebugScope *ParentScope,
|
||||||
|
unsigned ParentStartID, unsigned ParentEndID,
|
||||||
DIE *ParentDie, CompileUnit *Unit) {
|
DIE *ParentDie, CompileUnit *Unit) {
|
||||||
// Add variables to scope.
|
// Add variables to scope.
|
||||||
std::vector<DebugVariable *> &Variables = ParentScope->getVariables();
|
std::vector<DebugVariable *> &Variables = ParentScope->getVariables();
|
||||||
@ -1895,6 +1896,10 @@ private:
|
|||||||
if (StartID == EndID && StartID != 0) continue;
|
if (StartID == EndID && StartID != 0) continue;
|
||||||
if (Scope->getScopes().empty() && Scope->getVariables().empty()) continue;
|
if (Scope->getScopes().empty() && Scope->getVariables().empty()) continue;
|
||||||
|
|
||||||
|
if (StartID == ParentStartID && EndID == ParentEndID) {
|
||||||
|
// Just add stuff to the parent scope.
|
||||||
|
ConstructScope(Scope, ParentStartID, ParentEndID, ParentDie, Unit);
|
||||||
|
} else {
|
||||||
DIE *ScopeDie = new DIE(DW_TAG_lexical_block);
|
DIE *ScopeDie = new DIE(DW_TAG_lexical_block);
|
||||||
|
|
||||||
// Add the scope bounds.
|
// Add the scope bounds.
|
||||||
@ -1914,10 +1919,11 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add the scope contents.
|
// Add the scope contents.
|
||||||
ConstructScope(Scope, ScopeDie, Unit);
|
ConstructScope(Scope, StartID, EndID, ScopeDie, Unit);
|
||||||
ParentDie->AddChild(ScopeDie);
|
ParentDie->AddChild(ScopeDie);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// ConstructRootScope - Construct the scope for the subprogram.
|
/// ConstructRootScope - Construct the scope for the subprogram.
|
||||||
///
|
///
|
||||||
@ -1943,7 +1949,7 @@ private:
|
|||||||
MachineLocation Location(RI->getFrameRegister(*MF));
|
MachineLocation Location(RI->getFrameRegister(*MF));
|
||||||
AddAddress(SPDie, DW_AT_frame_base, Location);
|
AddAddress(SPDie, DW_AT_frame_base, Location);
|
||||||
|
|
||||||
ConstructScope(RootScope, SPDie, Unit);
|
ConstructScope(RootScope, 0, 0, SPDie, Unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// EmitInitial - Emit initial Dwarf declarations. This is necessary for cc
|
/// EmitInitial - Emit initial Dwarf declarations. This is necessary for cc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user