From 48afd9f8a94e8db7b9894d97a7e85fff97cff1bd Mon Sep 17 00:00:00 2001 From: Tanya Lattner Date: Tue, 1 Apr 2008 23:41:44 +0000 Subject: 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 --- lib/Transforms/Scalar/LoopIndexSplit.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/Transforms/Scalar/LoopIndexSplit.cpp') 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::iterator SI = SplitData.begin(); - SI != SplitData.end();) { + for (SmallVector::iterator SI = SplitData.begin(), + E = SplitData.end(); SI != E;) { SplitInfo &SD = *SI; ICmpInst *CI = dyn_cast(SD.SplitCondition); if (SD.SplitCondition->getOpcode() == Instruction::And) { @@ -244,7 +244,8 @@ bool LoopIndexSplit::runOnLoop(Loop *IncomingLoop, LPPassManager &LPM_Ref) { return Changed; } else { SmallVector::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::iterator Delete_SI = SI; - SI = SplitData.erase(Delete_SI); + ++SI; + SplitData.erase(Delete_SI); } } else ++SI; -- cgit v1.2.3