forked from OSchip/llvm-project
Sink DwarfDebug.cpp::constructVariableDIE into DwarfCompileUnit.
llvm-svn: 219419
This commit is contained in:
parent
ee7df55306
commit
4a1a44e3bf
|
@ -542,4 +542,12 @@ DwarfCompileUnit::constructVariableDIEImpl(const DbgVariable &DV,
|
|||
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -330,16 +330,6 @@ bool DwarfDebug::isLexicalScopeDIENull(LexicalScope *Scope) {
|
|||
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::constructSubprogramScopeDIE(DwarfCompileUnit &TheCU,
|
|||
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();
|
||||
|
|
Loading…
Reference in New Issue