[llvm-commits] [llvm] r73231 - /llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp

Nick Lewycky nicholas at mxc.ca
Fri Jun 12 09:04:02 PDT 2009


Author: nicholas
Date: Fri Jun 12 11:04:00 2009
New Revision: 73231

URL: http://llvm.org/viewvc/llvm-project?rev=73231&view=rev
Log:
Don't forget to match the calling convention when producing a thunk.

Modified:
    llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp

Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=73231&r1=73230&r2=73231&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Fri Jun 12 11:04:00 2009
@@ -478,6 +478,7 @@
 
   CallInst *CI = CallInst::Create(F, Args.begin(), Args.end(), "", BB);
   CI->setTailCall();
+  CI->setCallingConv(F->getCallingConv());
   if (NewG->getReturnType() == Type::VoidTy) {
     ReturnInst::Create(BB);
   } else if (CI->getType() != NewG->getReturnType()) {
@@ -492,8 +493,7 @@
   G->replaceAllUsesWith(NewG);
   G->eraseFromParent();
 
-  // TODO: look at direct callers to G and make them all direct callers to F
-  // iff G->hasAddressTaken() is false.
+  // TODO: look at direct callers to G and make them all direct callers to F.
 }
 
 static void AliasGToF(Function *F, Function *G) {





More information about the llvm-commits mailing list