[llvm-commits] [llvm] r121432 - /llvm/trunk/tools/opt/opt.cpp

Devang Patel dpatel at apple.com
Thu Dec 9 15:37:07 PST 2010


Author: dpatel
Date: Thu Dec  9 17:37:07 2010
New Revision: 121432

URL: http://llvm.org/viewvc/llvm-project?rev=121432&view=rev
Log:
Print breakpoints for call instructions. This is used by optimized debug info test harness.

Modified:
    llvm/trunk/tools/opt/opt.cpp

Modified: llvm/trunk/tools/opt/opt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=121432&r1=121431&r2=121432&view=diff
==============================================================================
--- llvm/trunk/tools/opt/opt.cpp (original)
+++ llvm/trunk/tools/opt/opt.cpp Thu Dec  9 17:37:07 2010
@@ -364,6 +364,19 @@
       } while (BI != I->begin());
       break;
     }
+    BasicBlock &EntryBB = F.getEntryBlock();
+    for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) {
+      BasicBlock *BB = I;
+      if (BB == &EntryBB) continue;
+      for (BasicBlock::iterator BI = I->begin(), BE = I->end(); BI != BE; ++BI)
+        if (CallInst *CI = dyn_cast<CallInst>(BI)) {
+          const DebugLoc DL = CI->getDebugLoc();
+          if (!DL.isUnknown()) {
+            DIScope S(DL.getScope(getGlobalContext()));
+            Out << S.getFilename() << " " << DL.getLine() << "\n";
+          }
+        }
+    }
     return false;
   }
 





More information about the llvm-commits mailing list