[llvm] r219419 - Sink DwarfDebug.cpp::constructVariableDIE into DwarfCompileUnit.
David Blaikie
dblaikie at gmail.com
Thu Oct 9 10:56:39 PDT 2014
Author: dblaikie
Date: Thu Oct 9 12:56:39 2014
New Revision: 219419
URL: http://llvm.org/viewvc/llvm-project?rev=219419&view=rev
Log:
Sink DwarfDebug.cpp::constructVariableDIE into DwarfCompileUnit.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=219419&r1=219418&r2=219419&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Thu Oct 9 12:56:39 2014
@@ -542,4 +542,12 @@ DwarfCompileUnit::constructVariableDIEIm
return VariableDie;
}
+std::unique_ptr<DIE> DwarfCompileUnit::constructVariableDIE(
+ DbgVariable &DV, const LexicalScope &Scope, DIE *&ObjectPointer) {
+ auto Var = constructVariableDIE(DV, Scope.isAbstractScope());
+ if (DV.isObjectPointer())
+ ObjectPointer = Var.get();
+ return Var;
+}
+
} // end llvm namespace
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=219419&r1=219418&r2=219419&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Thu Oct 9 12:56:39 2014
@@ -106,6 +106,10 @@ public:
/// constructVariableDIE - Construct a DIE for the given DbgVariable.
std::unique_ptr<DIE> constructVariableDIE(DbgVariable &DV,
bool Abstract = false);
+
+ std::unique_ptr<DIE> constructVariableDIE(DbgVariable &DV,
+ const LexicalScope &Scope,
+ DIE *&ObjectPointer);
};
} // end llvm namespace
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=219419&r1=219418&r2=219419&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Thu Oct 9 12:56:39 2014
@@ -330,16 +330,6 @@ bool DwarfDebug::isLexicalScopeDIENull(L
return !getLabelAfterInsn(Ranges.front().second);
}
-static std::unique_ptr<DIE> constructVariableDIE(DwarfCompileUnit &TheCU,
- DbgVariable &DV,
- const LexicalScope &Scope,
- DIE *&ObjectPointer) {
- auto Var = TheCU.constructVariableDIE(DV, Scope.isAbstractScope());
- if (DV.isObjectPointer())
- ObjectPointer = Var.get();
- return Var;
-}
-
DIE *DwarfDebug::createScopeChildrenDIE(
DwarfCompileUnit &TheCU, LexicalScope *Scope,
SmallVectorImpl<std::unique_ptr<DIE>> &Children,
@@ -347,7 +337,7 @@ DIE *DwarfDebug::createScopeChildrenDIE(
DIE *ObjectPointer = nullptr;
for (DbgVariable *DV : ScopeVariables.lookup(Scope))
- Children.push_back(constructVariableDIE(TheCU, *DV, *Scope, ObjectPointer));
+ Children.push_back(TheCU.constructVariableDIE(*DV, *Scope, ObjectPointer));
unsigned ChildCountWithoutScopes = Children.size();
@@ -433,7 +423,7 @@ void DwarfDebug::constructSubprogramScop
for (DbgVariable *ArgDV : CurrentFnArguments)
if (ArgDV)
ScopeDIE.addChild(
- constructVariableDIE(TheCU, *ArgDV, *Scope, ObjectPointer));
+ TheCU.constructVariableDIE(*ArgDV, *Scope, ObjectPointer));
// If this is a variadic function, add an unspecified parameter.
DITypeArray FnArgs = Sub.getType().getTypeArray();
More information about the llvm-commits
mailing list