diff options
author | Tanya Lattner <tonic@nondot.org> | 2008-04-01 23:41:44 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2008-04-01 23:41:44 +0000 |
commit | 48afd9f8a94e8db7b9894d97a7e85fff97cff1bd (patch) | |
tree | b0533581c5f921c47aad2b2ddc3b36856b3c4bec | |
parent | ffe2eb0120e52db74746b7e5117f8ffd80f1348f (diff) |
Reverting 49056 due to the build being broken.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49060 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/LoopIndexSplit.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/LoopIndexSplit.cpp b/lib/Transforms/Scalar/LoopIndexSplit.cpp index 48b45351a0..8053554c17 100644 --- a/lib/Transforms/Scalar/LoopIndexSplit.cpp +++ b/lib/Transforms/Scalar/LoopIndexSplit.cpp @@ -232,8 +232,8 @@ bool LoopIndexSplit::runOnLoop(Loop *IncomingLoop, LPPassManager &LPM_Ref) { return false; // First see if it is possible to eliminate loop itself or not. - for (SmallVector<SplitInfo, 4>::iterator SI = SplitData.begin(); - SI != SplitData.end();) { + for (SmallVector<SplitInfo, 4>::iterator SI = SplitData.begin(), + E = SplitData.end(); SI != E;) { SplitInfo &SD = *SI; ICmpInst *CI = dyn_cast<ICmpInst>(SD.SplitCondition); if (SD.SplitCondition->getOpcode() == Instruction::And) { @@ -244,7 +244,8 @@ bool LoopIndexSplit::runOnLoop(Loop *IncomingLoop, LPPassManager &LPM_Ref) { return Changed; } else { SmallVector<SplitInfo, 4>::iterator Delete_SI = SI; - SI = SplitData.erase(Delete_SI); + ++SI; + SplitData.erase(Delete_SI); } } else if (CI && CI->getPredicate() == ICmpInst::ICMP_EQ) { @@ -255,7 +256,8 @@ bool LoopIndexSplit::runOnLoop(Loop *IncomingLoop, LPPassManager &LPM_Ref) { return Changed; } else { SmallVector<SplitInfo, 4>::iterator Delete_SI = SI; - SI = SplitData.erase(Delete_SI); + ++SI; + SplitData.erase(Delete_SI); } } else ++SI; |