[LLVMdev] Left-to-right push of formal parameters

Duncan Sands baldrick at free.fr
Mon Jun 6 12:00:42 PDT 2011


Hi Yiannis,

> I am working on an LLVM backend for a language that has a runtime system
> and the Application Binary Interface (ABI) defines that the formal
> parameters should be pushed to stack in *left-to-right* order (in
> contrast to common C calling convention). What is the "llvm-way" to
> define that in my custom Calling Convention?

I don't know the answer to your question, but you can always cheat and have
your front-end produce LLVM IR with parameters in reverse order.  For example,
if you have f(int x, double y) in the original language, generate the IR
@f(double %y, i32 %x).

Ciao, Duncan.



More information about the llvm-dev mailing list