summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-06-12 16:04:00 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-06-12 16:04:00 +0000
commitd5bf51faa2a6fb63fc544578a1d367b57d6eeede (patch)
tree9e8faf003d3fad639e0e7c4c7cc4a7648d5a9d4a /llvm/lib/Transforms
parent25675ac14abd78ed63800deea72741be7a1b2aa2 (diff)
downloadbcm5719-llvm-d5bf51faa2a6fb63fc544578a1d367b57d6eeede.tar.gz
bcm5719-llvm-d5bf51faa2a6fb63fc544578a1d367b57d6eeede.zip
Don't forget to match the calling convention when producing a thunk.
llvm-svn: 73231
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/MergeFunctions.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/MergeFunctions.cpp b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
index e237fcde026..a1d91c256e5 100644
--- a/llvm/lib/Transforms/IPO/MergeFunctions.cpp
+++ b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
@@ -478,6 +478,7 @@ static void ThunkGToF(Function *F, Function *G) {
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 @@ static void ThunkGToF(Function *F, Function *G) {
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) {
OpenPOWER on IntegriCloud