Make sure to preserve the calling convention when changing an invoke into
authorChris Lattner <sabre@nondot.org>
Sat, 14 May 2005 12:21:56 +0000 (12:21 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 14 May 2005 12:21:56 +0000 (12:21 +0000)
a call.  This fixes Prolangs-C++/deriv2, kimwitu++, and Misc-C++/bigfib
on X86 with -enable-x86-fastcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22023 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/SimplifyCFG.cpp

index 5f023f1dd117cee1b7a5c7b5c2ee27a96ecee470..15ea761f2ce78d82a12b036c9db7bd2bb8934947 100644 (file)
@@ -1066,6 +1066,7 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
           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 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
             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;