[llvm-commits] [llvm] r104172 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DwarfDebug.cpp DwarfDebug.h

Devang Patel dpatel at apple.com
Wed May 19 14:58:28 PDT 2010


Author: dpatel
Date: Wed May 19 16:58:28 2010
New Revision: 104172

URL: http://llvm.org/viewvc/llvm-project?rev=104172&view=rev
Log:
Revert r104165.

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=104172&r1=104171&r2=104172&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed May 19 16:58:28 2010
@@ -2230,8 +2230,11 @@
         Label = recordSourceLine(DL.getLine(), DL.getCol(), 0);
         PrevInstLoc = DL;
         PrevLabel = Label;
-        LabelsBeforeInsn[MI] = Label;
       }
+
+      // If this instruction begins a scope then note down corresponding label.
+      if (InsnsBeginScopeSet.count(MI) != 0)
+        LabelsBeforeInsn[MI] = Label;
     }
 
     return;
@@ -2255,7 +2258,6 @@
         Label = recordSourceLine(DL.getLine(), DL.getCol(), Scope);
         PrevInstLoc = DL;
         PrevLabel = Label;
-        LabelsBeforeInsn[MI] = Label;
       }
       DI->second->setDbgValueLabel(Label);
     }
@@ -2271,9 +2273,11 @@
     Label = recordSourceLine(DL.getLine(), DL.getCol(), Scope);
     PrevInstLoc = DL;
     PrevLabel = Label;
-    LabelsBeforeInsn[MI] = Label;
   }
 
+  // If this instruction begins a scope then note down corresponding label.
+  if (InsnsBeginScopeSet.count(MI) != 0)
+    LabelsBeforeInsn[MI] = Label;
 }
 
 /// endScope - Process end of a scope.
@@ -2531,8 +2535,9 @@
       continue;
     for (SmallVector<DbgRange, 4>::const_iterator RI = Ranges.begin(),
            RE = Ranges.end(); RI != RE; ++RI) {
-      assert(RI->first && "DbgRange does not have first instruction!");
-      assert(RI->second && "DbgRange does not have second instruction!");
+      assert(RI->first && "DbgRange does not have first instruction!");      
+      assert(RI->second && "DbgRange does not have second instruction!");      
+      InsnsBeginScopeSet.insert(RI->first);
       InsnsEndScopeSet.insert(RI->second);
     }
   }
@@ -2626,6 +2631,7 @@
   // Clear debug info
   CurrentFnDbgScope = NULL;
   DeleteContainerSeconds(DbgScopeMap);
+  InsnsBeginScopeSet.clear();
   InsnsEndScopeSet.clear();
   DbgValueStartMap.clear();
   ConcreteScopes.clear();

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=104172&r1=104171&r2=104172&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Wed May 19 16:58:28 2010
@@ -179,6 +179,8 @@
   /// corresponds to the MDNode mapped with the subprogram DIE.
   DenseMap<DIE *, const MDNode *> ContainingTypeMap;
 
+  typedef SmallVector<DbgScope *, 2> ScopeVector;
+  SmallPtrSet<const MachineInstr *, 8> InsnsBeginScopeSet;
   SmallPtrSet<const MachineInstr *, 8> InsnsEndScopeSet;
 
   /// InlineInfo - Keep track of inlined functions and their location.  This





More information about the llvm-commits mailing list