- if (II->doesNotThrow()) {
- SmallVector<Value*, 8> Args(II->op_begin(), II->op_end() - 3);
- // 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->setAttributes(II->getAttributes());
-
- // Anything that used the value produced by the invoke instruction
- // now uses the value produced by the call instruction. Note that we
- // do this even for void functions and calls with no uses so that the
- // callgraph edge is updated.
- II->replaceAllUsesWith(Call);