While printing "interesting" breakpoint locations for debug info quality test harness...
authorDevang Patel <dpatel@apple.com>
Mon, 31 Jan 2011 21:36:24 +0000 (21:36 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 31 Jan 2011 21:36:24 +0000 (21:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124610 91177308-0d34-0410-b5e6-96231b3b80d8

tools/opt/opt.cpp

index ff8f65cfff7738b6ff77b018c06ff03813ee3b9d..64c08ab56af3b16e6efa5d7eff2f8e8df96a7958 100644 (file)
@@ -349,34 +349,19 @@ struct BreakpointPrinter : public FunctionPass {
     }
 
   virtual bool runOnFunction(Function &F) {
-    for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) {
-      BasicBlock::const_iterator BI = I->end();
-      --BI;
-      do {
-        const Instruction *In = BI;
-        const DebugLoc DL = In->getDebugLoc();
-        if (!DL.isUnknown()) {
-          DIScope S(DL.getScope(getGlobalContext()));
-          Out << S.getFilename() << " " << DL.getLine() << "\n";
-          break;
-        }
-        --BI;
-      } 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";
-          }
-        }
-    }
+    BasicBlock::const_iterator BI = EntryBB.end();
+    --BI;
+    do {
+      const Instruction *In = BI;
+      const DebugLoc DL = In->getDebugLoc();
+      if (!DL.isUnknown()) {
+        DIScope S(DL.getScope(getGlobalContext()));
+        Out << S.getFilename() << " " << DL.getLine() << "\n";
+        break;
+      }
+      --BI;
+    } while (BI != EntryBB.begin());
     return false;
   }