From 4a1a44e3bf1d3dfba1652409f3f7fe0ef1000010 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Thu, 9 Oct 2014 17:56:39 +0000 Subject: Sink DwarfDebug.cpp::constructVariableDIE into DwarfCompileUnit. llvm-svn: 219419 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index a45e5ba0684..75206d2d85d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -330,16 +330,6 @@ bool DwarfDebug::isLexicalScopeDIENull(LexicalScope *Scope) { return !getLabelAfterInsn(Ranges.front().second); } -static std::unique_ptr 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> &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(); -- cgit v1.2.3