[llvm-branch-commits] [llvm-branch] r95270 - /llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Devang Patel dpatel at apple.com
Wed Feb 3 17:30:06 PST 2010


Author: dpatel
Date: Wed Feb  3 19:30:06 2010
New Revision: 95270

URL: http://llvm.org/viewvc/llvm-project?rev=95270&view=rev
Log:
Merge r93967 from mainline.

Modified:
    llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=95270&r1=95269&r2=95270&view=diff

==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Feb  3 19:30:06 2010
@@ -2048,10 +2048,18 @@
   // Each scope has first instruction and last instruction to mark beginning
   // and end of a scope respectively. Create an inverse map that list scopes
   // starts (and ends) with an instruction. One instruction may start (or end)
-  // multiple scopes.
-  for (ValueMap<MDNode *, DbgScope *>::iterator DI = DbgScopeMap.begin(),
-	 DE = DbgScopeMap.end(); DI != DE; ++DI) {
-    DbgScope *S = DI->second;
+  // multiple scopes. Ignore scopes that are not reachable.
+  SmallVector<DbgScope *, 4> WorkList;
+  WorkList.push_back(CurrentFnDbgScope);
+  while (!WorkList.empty()) {
+    DbgScope *S = WorkList.back(); WorkList.pop_back();
+
+    SmallVector<DbgScope *, 4> &Children = S->getScopes();
+    if (!Children.empty()) 
+      for (SmallVector<DbgScope *, 4>::iterator SI = Children.begin(),
+             SE = Children.end(); SI != SE; ++SI)
+        WorkList.push_back(*SI);
+
     if (S->isAbstractScope())
       continue;
     const MachineInstr *MI = S->getFirstInsn();





More information about the llvm-branch-commits mailing list