summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-17 17:29:08 +0000
committerChris Lattner <sabre@nondot.org>2004-03-17 17:29:08 +0000
commit425726d9c2499b4fdf3776e9d1ce9976b4fbdde4 (patch)
treeb85788880deee32cec45a4f864a1e031668fb1ce /llvm/tools
parent28202356891d6b6d36ce9fbffc1801a90b169fb5 (diff)
downloadbcm5719-llvm-425726d9c2499b4fdf3776e9d1ce9976b4fbdde4.tar.gz
bcm5719-llvm-425726d9c2499b4fdf3776e9d1ce9976b4fbdde4.zip
Fix an iterator invalidation problem in a "buggy" pass
llvm-svn: 12468
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/bugpoint/TestPasses.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/tools/bugpoint/TestPasses.cpp b/llvm/tools/bugpoint/TestPasses.cpp
index ee2c0d72483..1a58e60804b 100644
--- a/llvm/tools/bugpoint/TestPasses.cpp
+++ b/llvm/tools/bugpoint/TestPasses.cpp
@@ -44,7 +44,7 @@ namespace {
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 @@ namespace {
if (!CI->use_empty())
CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
CI->getParent()->getInstList().erase(CI);
+ break;
}
return false;
}
OpenPOWER on IntegriCloud