mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges.
Summary: This patch introduces two new iterator ranges and updates existing code to use it. No functional change intended. Test Plan: All tests (make check-all) still pass. Reviewers: dblaikie Reviewed By: dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D4481 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213474 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -233,9 +233,7 @@ BasicBlock *llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum,
|
||||
if (PN->getIncomingBlock(i) != NewBB)
|
||||
OtherPreds.push_back(PN->getIncomingBlock(i));
|
||||
} else {
|
||||
for (pred_iterator I = pred_begin(DestBB), E = pred_end(DestBB);
|
||||
I != E; ++I) {
|
||||
BasicBlock *P = *I;
|
||||
for (BasicBlock *P : predecessors(DestBB)) {
|
||||
if (P != NewBB)
|
||||
OtherPreds.push_back(P);
|
||||
}
|
||||
@ -321,9 +319,7 @@ BasicBlock *llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum,
|
||||
// the predecessor must be directly in TIL, not in a subloop, or again
|
||||
// LoopSimplify doesn't hold.
|
||||
SmallVector<BasicBlock *, 4> LoopPreds;
|
||||
for (pred_iterator I = pred_begin(DestBB), E = pred_end(DestBB); I != E;
|
||||
++I) {
|
||||
BasicBlock *P = *I;
|
||||
for (BasicBlock *P : predecessors(DestBB)) {
|
||||
if (P == NewBB)
|
||||
continue; // The new block is known.
|
||||
if (LI->getLoopFor(P) != TIL) {
|
||||
|
Reference in New Issue
Block a user