mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
ReplaceUsesOfBlockWith() can modify the predecessors list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37441 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e004317c66
commit
a1a9f408da
@ -756,9 +756,10 @@ void IfConverter::MergeBlocks(BBInfo &ToBBI, BBInfo &FromBBI) {
|
|||||||
ToBBI.BB->removeSuccessor(FromBBI.BB);
|
ToBBI.BB->removeSuccessor(FromBBI.BB);
|
||||||
|
|
||||||
// Redirect all branches to FromBB to ToBB.
|
// Redirect all branches to FromBB to ToBB.
|
||||||
for (MachineBasicBlock::pred_iterator I = FromBBI.BB->pred_begin(),
|
std::vector<MachineBasicBlock *> Preds(FromBBI.BB->pred_begin(),
|
||||||
E = FromBBI.BB->pred_end(); I != E; ++I)
|
FromBBI.BB->pred_end());
|
||||||
(*I)->ReplaceUsesOfBlockWith(FromBBI.BB, ToBBI.BB);
|
for (unsigned i = 0, e = Preds.size(); i != e; ++i)
|
||||||
|
Preds[i]->ReplaceUsesOfBlockWith(FromBBI.BB, ToBBI.BB);
|
||||||
|
|
||||||
// Transfer preds / succs and update size.
|
// Transfer preds / succs and update size.
|
||||||
TransferPreds(ToBBI.BB, FromBBI.BB);
|
TransferPreds(ToBBI.BB, FromBBI.BB);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user