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/Analysis/ScalarEvolution.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/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index fd5b86b4634..06dbde58c10 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -4512,12 +4512,13 @@ ScalarEvolution::ComputeExitLimit(const Loop *L, BasicBlock *ExitingBlock) { // lead to the loop header. bool MustExecuteLoopHeader = true; BasicBlock *Exit = nullptr; - for (BasicBlock *Succ : successors(ExitingBlock)) - if (!L->contains(Succ)) { + for (succ_iterator SI = succ_begin(ExitingBlock), SE = succ_end(ExitingBlock); + SI != SE; ++SI) + if (!L->contains(*SI)) { if (Exit) // Multiple exit successors. return getCouldNotCompute(); - Exit = Succ; - } else if (Succ != L->getHeader()) { + Exit = *SI; + } else if (*SI != L->getHeader()) { MustExecuteLoopHeader = false; } |