[llvm] r210234 - DebugInfo: Reuse existing LexicalScope to retrieve the scope's MDNode, rather than looking it up through the DebugLoc.

David Blaikie dblaikie at gmail.com
Wed Jun 4 18:30:51 PDT 2014


Author: dblaikie
Date: Wed Jun  4 20:30:50 2014
New Revision: 210234

URL: http://llvm.org/viewvc/llvm-project?rev=210234&view=rev
Log:
DebugInfo: Reuse existing LexicalScope to retrieve the scope's MDNode, rather than looking it up through the DebugLoc.

No functional change intended, just streamlines the abstract variable
lookup/construction to use a common entry point.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=210234&r1=210233&r2=210234&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Jun  4 20:30:50 2014
@@ -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::collectVariableInfoFrom
     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);

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=210234&r1=210233&r2=210234&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Wed Jun  4 20:30:50 2014
@@ -348,7 +348,6 @@ class DwarfDebug : public AsmPrinterHand
   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





More information about the llvm-commits mailing list