summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/PruneEH.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/IPO/PruneEH.cpp')
-rw-r--r--lib/Transforms/IPO/PruneEH.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp
index f7bf241882..7b979d36f2 100644
--- a/lib/Transforms/IPO/PruneEH.cpp
+++ b/lib/Transforms/IPO/PruneEH.cpp
@@ -144,10 +144,11 @@ bool PruneEH::SimplifyFunction(Function *F) {
if (DoesNotUnwind.count(CG[F])) {
// Insert a call instruction before the invoke...
std::string Name = II->getName(); II->setName("");
- Value *Call = new CallInst(II->getCalledValue(),
- std::vector<Value*>(II->op_begin()+3,
- II->op_end()),
- Name, II);
+ CallInst *Call = new CallInst(II->getCalledValue(),
+ std::vector<Value*>(II->op_begin()+3,
+ II->op_end()),
+ Name, II);
+ Call->setCallingConv(II->getCallingConv());
// Anything that used the value produced by the invoke instruction
// now uses the value produced by the call instruction.