[LLVMdev] Problem with stack arguments

Chris Stavrakakis stavr.chris at gmail.com
Fri Jul 29 04:47:01 PDT 2011


I use a custom calling convention in which the first 4 arguments are 
promoted to registers and the rest to the stack, and the callee is 
responsible for popping the stack arguments.

So when calling a function with 5 arguments  i get this code:

     movq    ARG_5, (%rsp)
     callq    fun_foo_1
     subq    $8, %rsp

I use a garbage collector with postcall safe points (.Ltmp4 is such) 
which needs to know the frame size, for
each safe point. The problem is that at .Ltmp4  the frame size is 
actually different from what getFrameSize() would return.

So is there a way to force generation of code which pushes arguments ?

For example :

pushq ARG_5
callq fun_foo_1

Chris Stavrakakis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110729/83b82af4/attachment.html>

More information about the llvm-dev mailing list