[llvm-commits] [llvm] r100145 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Devang Patel dpatel at apple.com
Thu Apr 1 15:47:30 PDT 2010


Author: dpatel
Date: Thu Apr  1 17:47:29 2010
New Revision: 100145

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

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

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=100145&r1=100144&r2=100145&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Thu Apr  1 17:47:29 2010
@@ -2147,8 +2147,6 @@
 
   DenseMap<const MachineInstr *, unsigned> MIIndexMap;
   unsigned MIIndex = 0;
-  MDNode *PrevScope = NULL;
-  MDNode *PrevInlinedAt = NULL;
   // Scan each instruction and create scopes. First build working set of scopes.
   for (MachineFunction::const_iterator I = MF->begin(), E = MF->end();
        I != E; ++I) {
@@ -2162,23 +2160,17 @@
       if (DL.isUnknown()) continue;
       DILocation DLT = MF->getDILocation(DL);
       DIScope DLTScope = DLT.getScope();
-      MDNode *NewScope = DLTScope.getNode();
-      if (!NewScope) continue;
+      if (!DLTScope.getNode()) continue;
       // There is no need to create another DIE for compile unit. For all
       // other scopes, create one DbgScope now. This will be translated
       // into a scope DIE at the end.
       if (DLTScope.isCompileUnit()) continue;
-      MDNode *NewInlinedAt = DLT.getOrigLocation().getNode();
-      if (NewScope == PrevScope && NewInlinedAt == PrevInlinedAt) continue;
-      createDbgScope(NewScope, NewInlinedAt);
-      PrevScope = NewScope;
-      PrevInlinedAt = NewInlinedAt;
+      createDbgScope(DLTScope.getNode(), DLT.getOrigLocation().getNode());
     }
   }
 
+
   // Build scope hierarchy using working set of scopes.
-  PrevScope = NULL;
-  PrevInlinedAt = NULL;
   for (MachineFunction::const_iterator I = MF->begin(), E = MF->end();
        I != E; ++I) {
     for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
@@ -2190,18 +2182,14 @@
       if (DL.isUnknown())  continue;
       DILocation DLT = MF->getDILocation(DL);
       DIScope DLTScope = DLT.getScope();
-      MDNode *NewScope = DLTScope.getNode();
-      if (!NewScope) continue;
+      if (!DLTScope.getNode()) continue;
       // There is no need to create another DIE for compile unit. For all
       // other scopes, create one DbgScope now. This will be translated
       // into a scope DIE at the end.
       if (DLTScope.isCompileUnit()) continue;
-      MDNode *NewInlinedAt = DLT.getOrigLocation().getNode();
-      if (NewScope == PrevScope && NewInlinedAt == PrevInlinedAt) continue;
-      DbgScope *Scope = getUpdatedDbgScope(NewScope, MInsn, NewInlinedAt);
+      DbgScope *Scope = getUpdatedDbgScope(DLTScope.getNode(), MInsn, 
+                                           DLT.getOrigLocation().getNode());
       Scope->setLastInsn(MInsn);
-      PrevScope = NewScope;
-      PrevInlinedAt = NewInlinedAt;
     }
   }
 





More information about the llvm-commits mailing list