[llvm-commits] CVS: llvm/tools/bugpoint/TestPasses.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Mar 17 11:30:01 PST 2004


Changes in directory llvm/tools/bugpoint:

TestPasses.cpp updated: 1.6 -> 1.7

---
Log message:

Fix an iterator invalidation problem in a "buggy" pass



---
Diffs of the changes:  (+2 -1)

Index: llvm/tools/bugpoint/TestPasses.cpp
diff -u llvm/tools/bugpoint/TestPasses.cpp:1.6 llvm/tools/bugpoint/TestPasses.cpp:1.7
--- llvm/tools/bugpoint/TestPasses.cpp:1.6	Tue Nov 11 16:41:34 2003
+++ llvm/tools/bugpoint/TestPasses.cpp	Wed Mar 17 11:29:08 2004
@@ -44,7 +44,7 @@
 
 namespace {
   /// DeleteCalls - This pass is used to test bugpoint.  It intentionally
-  /// deletes all call instructions, "misoptimizing" the program.
+  /// deletes some call instructions, "misoptimizing" the program.
   class DeleteCalls : public BasicBlockPass {
     bool runOnBasicBlock(BasicBlock &BB) {
       for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I)
@@ -52,6 +52,7 @@
           if (!CI->use_empty())
             CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
           CI->getParent()->getInstList().erase(CI);
+          break;
         }
       return false;
     }





More information about the llvm-commits mailing list