mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 12:50:30 +00:00
ReplaceUsesOfBlockWith() can modify the predecessors list.
llvm-svn: 37441
This commit is contained in:
parent
f2a2a5a025
commit
acf719bf83
@ -756,9 +756,10 @@ void IfConverter::MergeBlocks(BBInfo &ToBBI, BBInfo &FromBBI) {
|
||||
ToBBI.BB->removeSuccessor(FromBBI.BB);
|
||||
|
||||
// Redirect all branches to FromBB to ToBB.
|
||||
for (MachineBasicBlock::pred_iterator I = FromBBI.BB->pred_begin(),
|
||||
E = FromBBI.BB->pred_end(); I != E; ++I)
|
||||
(*I)->ReplaceUsesOfBlockWith(FromBBI.BB, ToBBI.BB);
|
||||
std::vector<MachineBasicBlock *> Preds(FromBBI.BB->pred_begin(),
|
||||
FromBBI.BB->pred_end());
|
||||
for (unsigned i = 0, e = Preds.size(); i != e; ++i)
|
||||
Preds[i]->ReplaceUsesOfBlockWith(FromBBI.BB, ToBBI.BB);
|
||||
|
||||
// Transfer preds / succs and update size.
|
||||
TransferPreds(ToBBI.BB, FromBBI.BB);
|
||||
|
Loading…
Reference in New Issue
Block a user