Make sure to preserve the calling convention when changing an invoke into
a call. This fixes Prolangs-C++/deriv2, kimwitu++, and Misc-C++/bigfib
on X86 with -enable-x86-fastcc.
llvm-svn: 22023
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 5f023f1..15ea761 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -1066,6 +1066,7 @@
std::vector<Value*> Args(II->op_begin()+3, II->op_end());
CallInst *CI = new CallInst(II->getCalledValue(), Args,
II->getName(), BI);
+ CI->setCallingConv(II->getCallingConv());
// If the invoke produced a value, the Call now does instead
II->replaceAllUsesWith(CI);
delete II;
@@ -1280,6 +1281,7 @@
std::vector<Value*> Args(II->op_begin()+3, II->op_end());
CallInst *CI = new CallInst(II->getCalledValue(), Args,
II->getName(), BI);
+ CI->setCallingConv(II->getCallingConv());
// If the invoke produced a value, the Call does now instead.
II->replaceAllUsesWith(CI);
delete II;