mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
DebugInfo: Sink DwarfDebug::ScopeVariables down into DwarfFile
(part of refactoring to allow subprogram emission in both the skeleton and main units to enable -gmlt-like data to be included in the skeleton for live inlined backtracing purposes) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220578 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
be5d8bfddd
commit
7f6ba1758b
@ -530,7 +530,7 @@ DIE *DwarfCompileUnit::createScopeChildrenDIE(
|
||||
unsigned *ChildScopeCount) {
|
||||
DIE *ObjectPointer = nullptr;
|
||||
|
||||
for (DbgVariable *DV : DD->getScopeVariables().lookup(Scope))
|
||||
for (DbgVariable *DV : DU->getScopeVariables().lookup(Scope))
|
||||
Children.push_back(constructVariableDIE(*DV, *Scope, ObjectPointer));
|
||||
|
||||
unsigned ChildCountWithoutScopes = Children.size();
|
||||
|
@ -1284,7 +1284,7 @@ void DwarfDebug::endFunction(const MachineFunction *MF) {
|
||||
// subroutines inside it.
|
||||
if (TheCU.getCUNode().getEmissionKind() == DIBuilder::LineTablesOnly &&
|
||||
LScopes.getAbstractScopesList().empty() && !IsDarwin) {
|
||||
assert(ScopeVariables.empty());
|
||||
assert(InfoHolder.getScopeVariables().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.
|
||||
@ -1323,7 +1323,7 @@ void DwarfDebug::endFunction(const MachineFunction *MF) {
|
||||
// Ownership of DbgVariables is a bit subtle - ScopeVariables owns all the
|
||||
// DbgVariables except those that are also in AbstractVariables (since they
|
||||
// can be used cross-function)
|
||||
ScopeVariables.clear();
|
||||
InfoHolder.getScopeVariables().clear();
|
||||
DbgValues.clear();
|
||||
LabelsBeforeInsn.clear();
|
||||
LabelsAfterInsn.clear();
|
||||
|
@ -193,11 +193,6 @@ class DwarfDebug : public AsmPrinterHandler {
|
||||
// Collection of abstract subprogram DIEs.
|
||||
DenseMap<const MDNode *, DIE *> AbstractSPDies;
|
||||
|
||||
// Collection of dbg variables of a scope.
|
||||
typedef DenseMap<LexicalScope *, SmallVector<DbgVariable *, 8> >
|
||||
ScopeVariablesMap;
|
||||
ScopeVariablesMap ScopeVariables;
|
||||
|
||||
// Collection of abstract variables.
|
||||
DenseMap<const MDNode *, std::unique_ptr<DbgVariable>> AbstractVariables;
|
||||
SmallVector<std::unique_ptr<DbgVariable>, 64> ConcreteVariables;
|
||||
@ -659,8 +654,6 @@ public:
|
||||
return AbstractSPDies;
|
||||
}
|
||||
|
||||
ScopeVariablesMap &getScopeVariables() { return ScopeVariables; }
|
||||
|
||||
SmallPtrSet<const MDNode *, 16> &getProcessedSPNodes() {
|
||||
return ProcessedSPNodes;
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ void DwarfFile::emitStrings(const MCSection *StrSection,
|
||||
}
|
||||
|
||||
void DwarfFile::addScopeVariable(LexicalScope *LS, DbgVariable *Var) {
|
||||
SmallVectorImpl<DbgVariable *> &Vars = DD.getScopeVariables()[LS];
|
||||
SmallVectorImpl<DbgVariable *> &Vars = ScopeVariables[LS];
|
||||
DIVariable DV = Var->getVariable();
|
||||
// Variables with positive arg numbers are parameters.
|
||||
if (unsigned ArgNum = DV.getArgNumber()) {
|
||||
|
@ -50,6 +50,9 @@ class DwarfFile {
|
||||
|
||||
DwarfStringPool StrPool;
|
||||
|
||||
// Collection of dbg variables of a scope.
|
||||
DenseMap<LexicalScope *, SmallVector<DbgVariable *, 8>> ScopeVariables;
|
||||
|
||||
public:
|
||||
DwarfFile(AsmPrinter *AP, DwarfDebug &DD, StringRef Pref,
|
||||
BumpPtrAllocator &DA);
|
||||
@ -85,6 +88,10 @@ public:
|
||||
DwarfStringPool &getStringPool() { return StrPool; }
|
||||
|
||||
void addScopeVariable(LexicalScope *LS, DbgVariable *Var);
|
||||
|
||||
DenseMap<LexicalScope *, SmallVector<DbgVariable *, 8>> &getScopeVariables() {
|
||||
return ScopeVariables;
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user