[llvm-commits] [PATCH] Add support for VarArg function calls

Chad Rosier mcrosier at apple.com
Wed Jul 18 10:47:58 PDT 2012


Jush,

   case CallingConv::ARM_AAPCS_VFP:
-    return (Return ? RetCC_ARM_AAPCS_VFP: CC_ARM_AAPCS_VFP);
+    if (!isVarArg)
+      return (Return ? RetCC_ARM_AAPCS_VFP: CC_ARM_AAPCS_VFP);
   case CallingConv::ARM_AAPCS:
     return (Return ? RetCC_ARM_AAPCS: CC_ARM_AAPCS);

Possibly add a comment that this fall-thru is intentional with comments as to why.

Otherwise, LGTM.

 Chad


On Jul 17, 2012, at 6:39 PM, Jush Lu wrote:

> 
> Ping??
> 
> I attach the same patch again, and you can find what this patch does from previous email copy below. Thanks.
> 
> On Wed, Jul 11, 2012 at 9:02 PM, Jush Lu <jush.msn at gmail.com> wrote:
> Hi,
> 
> 
> 
> This patch turns on VarArg function calls for ARMFastISel, and I only modified few lines of code in this patch, because variadic function calls use base standard calling convention to pass arguments and return results, that means a variadic function call works as noraml function calls, all we need to do is to avoid using co-processor registers to pass arguments and results, then variadic function calls will work well.
> 
> I also update the test case “test/CodeGen/Thumb2/large-call.ll”, basically I just replace the “str” with “vstr” in this testcase, becasue FastIsel uses vfp instructions to handle double precision FP arguments, and I have run several tests on my arm ios device for large call.
> 
> This patch will not give any compiler warning and it passes all test cases on my mac air and ubuntu desktop. Please review this patch, thanks.
> 
> Jush
> 
> <fast-isel-vararg.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120718/8524b659/attachment.html>


More information about the llvm-commits mailing list