summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2008-01-27 18:35:00 +0000
committerNick Lewycky <nicholas@mxc.ca>2008-01-27 18:35:00 +0000
commitefb16f7057e91c41923f5c01bd60966e0d048f7c (patch)
tree42d18595f4702cdda4591e403463cfe39a509139 /llvm/lib
parent053c9871cdcb716edbcf223ba1f438da0df2d8a8 (diff)
downloadbcm5719-llvm-efb16f7057e91c41923f5c01bd60966e0d048f7c.tar.gz
bcm5719-llvm-efb16f7057e91c41923f5c01bd60966e0d048f7c.zip
Be more careful modifying the use_list while also iterating through it.
llvm-svn: 46417
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnroll.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnroll.cpp b/llvm/lib/Transforms/Scalar/LoopUnroll.cpp
index ff2168ac8de..b514156a1af 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnroll.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnroll.cpp
@@ -365,8 +365,9 @@ bool LoopUnroll::unrollLoop(Loop *L, unsigned Count, unsigned Threshold) {
// be updated specially after unrolling all the way.
if (*BB != LatchBlock)
for (Value::use_iterator UI = (*BB)->use_begin(), UE = (*BB)->use_end();
- UI != UE; ++UI) {
+ UI != UE;) {
Instruction *UseInst = cast<Instruction>(*UI);
+ ++UI;
if (isa<PHINode>(UseInst) && !L->contains(UseInst->getParent())) {
PHINode *phi = cast<PHINode>(UseInst);
Value *Incoming = phi->getIncomingValueForBlock(*BB);
OpenPOWER on IntegriCloud