[llvm] r220578 - DebugInfo: Sink DwarfDebug::ScopeVariables down into DwarfFile
David Blaikie
dblaikie at gmail.com
Fri Oct 24 10:57:35 PDT 2014
Author: dblaikie
Date: Fri Oct 24 12:57:34 2014
New Revision: 220578
URL: http://llvm.org/viewvc/llvm-project?rev=220578&view=rev
Log:
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)
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=220578&r1=220577&r2=220578&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Fri Oct 24 12:57:34 2014
@@ -530,7 +530,7 @@ DIE *DwarfCompileUnit::createScopeChildr
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();
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=220578&r1=220577&r2=220578&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Oct 24 12:57:34 2014
@@ -1284,7 +1284,7 @@ void DwarfDebug::endFunction(const Machi
// 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 Machi
// 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();
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=220578&r1=220577&r2=220578&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Fri Oct 24 12:57:34 2014
@@ -193,11 +193,6 @@ class DwarfDebug : public AsmPrinterHand
// 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;
}
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.cpp?rev=220578&r1=220577&r2=220578&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.cpp Fri Oct 24 12:57:34 2014
@@ -156,7 +156,7 @@ void DwarfFile::emitStrings(const MCSect
}
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()) {
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.h?rev=220578&r1=220577&r2=220578&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.h Fri Oct 24 12:57:34 2014
@@ -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
More information about the llvm-commits
mailing list