summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 976dda45bf..7387144b5e 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.