diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-07-21 17:06:51 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-07-21 17:06:51 +0000 |
| commit | 6c99015fe2c1814f793530adc96f48050081612e (patch) | |
| tree | 6dd9bd97817fed538386fcedbf363d38470ace2a /llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | |
| parent | 1aaad6970cee96c214cc663bc7ae2cecb6fd1e7c (diff) | |
| download | bcm5719-llvm-6c99015fe2c1814f793530adc96f48050081612e.tar.gz bcm5719-llvm-6c99015fe2c1814f793530adc96f48050081612e.zip | |
Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges."
This reverts commit r213474 (and r213475), which causes a miscompile on
a stage2 LTO build. I'll reply on the list in a moment.
llvm-svn: 213562
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopUnswitch.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp index 68bd4b82959..977c53a3bc6 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -515,9 +515,9 @@ static bool isTrivialLoopExitBlockHelper(Loop *L, BasicBlock *BB, } // Otherwise, this is an unvisited intra-loop node. Check all successors. - for (BasicBlock *Succ : successors(BB)) { + for (succ_iterator SI = succ_begin(BB), E = succ_end(BB); SI != E; ++SI) { // Check to see if the successor is a trivial loop exit. - if (!isTrivialLoopExitBlockHelper(L, Succ, ExitBB, Visited)) + if (!isTrivialLoopExitBlockHelper(L, *SI, ExitBB, Visited)) return false; } @@ -861,7 +861,9 @@ void LoopUnswitch::UnswitchNontrivialCondition(Value *LIC, Constant *Val, PHINode *PN = PHINode::Create(LPad->getType(), 0, "", ExitSucc->getFirstInsertionPt()); - for (BasicBlock *BB : predecessors(ExitSucc)) { + for (pred_iterator I = pred_begin(ExitSucc), E = pred_end(ExitSucc); + I != E; ++I) { + BasicBlock *BB = *I; LandingPadInst *LPI = BB->getLandingPadInst(); LPI->replaceAllUsesWith(PN); PN->addIncoming(LPI, BB); |

