Preserve calling convention during function cloning

llvm-svn: 48708
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index 976dda45..7387144 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -83,6 +83,9 @@
   // 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.