aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-03-23 16:03:00 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-03-23 16:03:00 +0000
commit649382f14391db6ef684db6d6ce2ae693b123b1b (patch)
tree200f2dd8a0e8b3781fa7e9063ef5fe8785529bc0
parent9ac72c4f15fa35c29fb04cb27949eb293801d969 (diff)
downloadexternal_llvm-649382f14391db6ef684db6d6ce2ae693b123b1b.zip
external_llvm-649382f14391db6ef684db6d6ce2ae693b123b1b.tar.gz
external_llvm-649382f14391db6ef684db6d6ce2ae693b123b1b.tar.bz2
Preserve calling convention during function cloning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48708 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Utils/CloneFunction.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp
index 976dda45..7387144 100644
--- a/lib/Transforms/Utils/CloneFunction.cpp
+++ b/lib/Transforms/Utils/CloneFunction.cpp
@@ -83,6 +83,9 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
// Clone the parameter attributes
NewFunc->setParamAttrs(OldFunc->getParamAttrs());
+ // Clone the calling convention
+ NewFunc->setCallingConv(OldFunc->getCallingConv());
+
// Loop over all of the basic blocks in the function, cloning them as
// appropriate. Note that we save BE this way in order to handle cloning of
// recursive functions into themselves.