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/Sink.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/Sink.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/Sink.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/Sink.cpp b/llvm/lib/Transforms/Scalar/Sink.cpp index 2f7a9f9a65c..7348c45c5d3 100644 --- a/llvm/lib/Transforms/Scalar/Sink.cpp +++ b/llvm/lib/Transforms/Scalar/Sink.cpp @@ -258,11 +258,10 @@ bool Sinking::SinkInstruction(Instruction *Inst, // If no suitable postdominator was found, look at all the successors and // decide which one we should sink to, if any. - for (BasicBlock *Succ : successors(Inst->getParent())) { - if (SuccToSinkTo) - break; - if (IsAcceptableTarget(Inst, Succ)) - SuccToSinkTo = Succ; + for (succ_iterator I = succ_begin(Inst->getParent()), + E = succ_end(Inst->getParent()); I != E && !SuccToSinkTo; ++I) { + if (IsAcceptableTarget(Inst, *I)) + SuccToSinkTo = *I; } // If we couldn't find a block to sink to, ignore this instruction. |

