mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-19 04:31:17 +00:00
Fix an iterator invalidation problem when we decide a phi has a constant value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22675 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9a59fbb896
commit
80f4d88a97
@ -189,7 +189,8 @@ void BasicBlock::removePredecessor(BasicBlock *Pred,
|
||||
// Okay, now we know that we need to remove predecessor #pred_idx from all
|
||||
// PHI nodes. Iterate over each PHI node fixing them up
|
||||
PHINode *PN;
|
||||
for (iterator II = begin(); (PN = dyn_cast<PHINode>(II)); ++II) {
|
||||
for (iterator II = begin(); (PN = dyn_cast<PHINode>(II)); ) {
|
||||
++II;
|
||||
PN->removeIncomingValue(Pred, false);
|
||||
// If all incoming values to the Phi are the same, we can replace the Phi
|
||||
// with that value.
|
||||
|
Loading…
x
Reference in New Issue
Block a user