- if (II->doesNotThrow()) {
- SmallVector<Value*, 8> Args(II->op_begin()+3, II->op_end());
- // Insert a call instruction before the invoke.
- CallInst *Call = CallInst::Create(II->getCalledValue(),
- Args.begin(), Args.end(), "", II);
- Call->takeName(II);
- Call->setCallingConv(II->getCallingConv());
- Call->setParamAttrs(II->getParamAttrs());
-
- // Anything that used the value produced by the invoke instruction
- // now uses the value produced by the call instruction.
- II->replaceAllUsesWith(Call);