Sink DwarfDebug.cpp::constructVariableDIE into DwarfCompileUnit.
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 9 Oct 2014 17:56:39 +0000 (17:56 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 9 Oct 2014 17:56:39 +0000 (17:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219419 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 973997ecd4c570fe3cba17b4caa0a6add6a42b03..26cca502216e0d585ffc8cc8187cb3f48bebcf4b 100644 (file)
@@ -542,4 +542,12 @@ DwarfCompileUnit::constructVariableDIEImpl(const DbgVariable &DV,
   return VariableDie;
 }
 
   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
 } // end llvm namespace
index 06fab23d5c6ecbdfbf919ddf862a4b28e2969b05..9ad503cb8823f6ed2f600d32b4b2c8094362804f 100644 (file)
@@ -106,6 +106,10 @@ public:
   /// constructVariableDIE - Construct a DIE for the given DbgVariable.
   std::unique_ptr<DIE> constructVariableDIE(DbgVariable &DV,
                                             bool Abstract = false);
   /// 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
 };
 
 } // end llvm namespace
index a45e5ba06849409544df397bcd1b9cdf72dd8616..75206d2d85d7516f359f7e590cef855a5a908bb5 100644 (file)
@@ -330,16 +330,6 @@ bool DwarfDebug::isLexicalScopeDIENull(LexicalScope *Scope) {
   return !getLabelAfterInsn(Ranges.front().second);
 }
 
   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,
 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))
   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();
 
 
   unsigned ChildCountWithoutScopes = Children.size();
 
@@ -433,7 +423,7 @@ void DwarfDebug::constructSubprogramScopeDIE(DwarfCompileUnit &TheCU,
   for (DbgVariable *ArgDV : CurrentFnArguments)
     if (ArgDV)
       ScopeDIE.addChild(
   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();
 
   // If this is a variadic function, add an unspecified parameter.
   DITypeArray FnArgs = Sub.getType().getTypeArray();