DebugInfo: Reuse existing LexicalScope to retrieve the scope's MDNode, rather than...
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 5 Jun 2014 01:30:50 +0000 (01:30 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 5 Jun 2014 01:30:50 +0000 (01:30 +0000)
No functional change intended, just streamlines the abstract variable
lookup/construction to use a common entry point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210234 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 1bb8f26ae01dcbdbcdf4966fe78b16006a7d561e..46640f85f42c799415af8c9913bb2febc1aaffcc 100644 (file)
@@ -1047,11 +1047,6 @@ void DwarfDebug::endModule() {
 }
 
 // Find abstract variable, if any, associated with Var.
-DbgVariable *DwarfDebug::findAbstractVariable(DIVariable &DV,
-                                              DebugLoc ScopeLoc) {
-  return findAbstractVariable(DV, ScopeLoc.getScope(DV->getContext()));
-}
-
 DbgVariable *DwarfDebug::getExistingAbstractVariable(DIVariable &DV,
                                                      DIVariable &Cleansed) {
   LLVMContext &Ctx = DV->getContext();
@@ -1131,7 +1126,8 @@ void DwarfDebug::collectVariableInfoFromMMITable(
     if (!Scope)
       continue;
 
-    DbgVariable *AbsDbgVariable = findAbstractVariable(DV, VI.Loc);
+    DbgVariable *AbsDbgVariable =
+        findAbstractVariable(DV, Scope->getScopeNode());
     DbgVariable *RegVar = new DbgVariable(DV, AbsDbgVariable, this);
     RegVar->setFrameIndex(VI.Slot);
     addScopeVariable(Scope, RegVar);
index a3b0242fd5f72f148c34a620c803c8605975475e..165eb5a2da0cefd5a1f2dca7f1ccbec319cd1263 100644 (file)
@@ -348,7 +348,6 @@ class DwarfDebug : public AsmPrinterHandler {
   DbgVariable *createAbstractVariable(DIVariable &DV, LexicalScope *Scope);
   DbgVariable *getOrCreateAbstractVariable(DIVariable &Var,
                                            const MDNode *Scope);
-  DbgVariable *findAbstractVariable(DIVariable &Var, DebugLoc Loc);
   DbgVariable *findAbstractVariable(DIVariable &Var, const MDNode *Scope);
 
   /// \brief Find DIE for the given subprogram and attach appropriate