mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-04 08:16:49 +00:00
[Coroutines] Simplify implementation using removePredecessor
Differential Revision: https://reviews.llvm.org/D77035
This commit is contained in:
parent
aef0877b1b
commit
9c6f32a0ff
@ -941,11 +941,7 @@ static bool simplifyTerminatorLeadingToRet(Instruction *InitialInst) {
|
||||
// If InitialInst is an unconditional branch,
|
||||
// remove PHI values that come from basic block of InitialInst
|
||||
if (UnconditionalSucc)
|
||||
for (PHINode &PN : UnconditionalSucc->phis()) {
|
||||
int idx = PN.getBasicBlockIndex(InitialInst->getParent());
|
||||
if (idx != -1)
|
||||
PN.removeIncomingValue(idx);
|
||||
}
|
||||
UnconditionalSucc->removePredecessor(InitialInst->getParent(), true);
|
||||
ReplaceInstWithInst(InitialInst, I->clone());
|
||||
}
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user