[LLVMdev] Calling Conventions Cont'd

Chris Lattner sabre at nondot.org
Mon Apr 14 12:35:02 PDT 2008

On Mon, 14 Apr 2008, Jon Sargeant wrote:
> Ugh, this isn't what I wanted to hear.  Passing "complex" differently
> than a structure containing two doubles is a bad design, but alas,
> calling conventions are beyond our control.  How many special cases like
> this are there?  If "complex" is the only special case, LLVM could

There are a huge number of special cases.  Take a look at the craziness in 
the x86-64 ABI structure passing rules for an example.

> entirely in the back end.  Apart from calling conventions, the front end
> doesn't need to know the specific target, only the data layout and which
> intrinsics the target supports.  This approach makes a clean division
> between the front end and back end.

If you want to map from a C type/calling convetion to LLVM IR, clang is a 
good way to go.  It isn't fully up to snuff with all the ABIs out there, 
but will be doing much better over the next few months.



More information about the llvm-dev mailing list