Merge pull request #62480 from eeckstein/instruction-iteration

SIL: simplify deleting instructions while iterating over instructions.
This commit is contained in:
eeckstein
2022-12-13 10:45:06 +01:00
committed by GitHub
34 changed files with 642 additions and 476 deletions

View File

@@ -3895,9 +3895,9 @@ static void deleteRewrittenInstructions(AddressLoweringState &pass) {
continue;
}
// willDeleteInstruction was already called for open_existential_value to
// update the registered type. Carry out the remaining deletion steps.
deadInst->getParent()->remove(deadInst);
pass.getModule()->scheduleForDeletion(deadInst);
// update the registered type. Now fully erase the instruction, which will
// harmlessly call willDeleteInstruction again.
deadInst->getParent()->erase(deadInst);
}
pass.valueStorageMap.clear();