// Replace all uses of this instruction with the PHI node created by
// the eradication of setjmp.
Inst->replaceAllUsesWith(PHI);
- Inst->getParent()->getInstList().erase(Inst);
+ Inst->eraseFromParent();
++SetJmpsTransformed;
}
// Replace the old call inst with the invoke inst and remove the call.
CI.replaceAllUsesWith(II);
- CI.getParent()->getInstList().erase(&CI);
+ CI.eraseFromParent();
// The old terminator is useless now that we have the invoke inst.
- Term->getParent()->getInstList().erase(Term);
+ Term->eraseFromParent();
++CallsTransformed;
}
BranchInst::Create(II->getNormalDest(), I);
// Delete the old call site
- MI->getParent()->getInstList().erase(I);
+ I->eraseFromParent();
Changed = true;
++NumRaised;
}
// Remove the dead instruction.
WorkList.erase(I);
- I->getParent()->getInstList().erase(I);
+ I->eraseFromParent();
// We made a change to the function...
Changed = true;
}
// Erase the instruction from the program.
- I->getParent()->getInstList().erase(I);
+ I->eraseFromParent();
}
ReturnInst::Create(Constant::getNullValue(OldFnRetTy), TheSwitch);
}
- TheSwitch->getParent()->getInstList().erase(TheSwitch);
+ TheSwitch->eraseFromParent();
break;
case 1:
// Only a single destination, change the switch into an unconditional
// branch.
BranchInst::Create(TheSwitch->getSuccessor(1), TheSwitch);
- TheSwitch->getParent()->getInstList().erase(TheSwitch);
+ TheSwitch->eraseFromParent();
break;
case 2:
BranchInst::Create(TheSwitch->getSuccessor(1), TheSwitch->getSuccessor(2),
call, TheSwitch);
- TheSwitch->getParent()->getInstList().erase(TheSwitch);
+ TheSwitch->eraseFromParent();
break;
default:
// Otherwise, make the default destination of the switch instruction be one
BranchInst::Create(InvokeDest, UI);
// Delete the unwind instruction!
- UI->getParent()->getInstList().pop_back();
+ UI->eraseFromParent();
// Update any PHI nodes in the exceptional block to indicate that
// there is now a new entry in them.
TheCall->replaceAllUsesWith(R->getReturnValue());
}
// Since we are now done with the Call/Invoke, we can delete it.
- TheCall->getParent()->getInstList().erase(TheCall);
+ TheCall->eraseFromParent();
// Since we are now done with the return instruction, delete it also.
- Returns[0]->getParent()->getInstList().erase(Returns[0]);
+ Returns[0]->eraseFromParent();
// We are now done with the inlining.
return true;
BranchInst::Create(SI->getSuccessor(1), SI->getSuccessor(0), Cond, SI);
// Delete the old switch...
- SI->getParent()->getInstList().erase(SI);
+ SI->eraseFromParent();
return true;
}
}