[LLVMdev] struct passing on X86-64
David A. Greene
greened at obbligato.org
Tue Jun 14 15:29:53 PDT 2011
Nick Lewycky <nicholas at mxc.ca> writes:
> Why should the backends know about the frontend language? It seems
> sensible to me that if I create a new language and a new ABI for my
> language then I can expect to need to teach the backend about my new
> ABI.
And so the backend has to be taught about the language. To me, it is
about conveying the necessary information in a more portable way so the
mapping code only has to be written once.
> with only a few special cases. We could add ABI notes to the
> llvm::Function which specify that parameter 3 is an arm-abi-name
> "foo-style-passing", and the ARM backend would have to be taught how
> to handle that. (It would also be nice if TargetData could tell you
> whether a given ABI note applies to your current target.)
How are those ABI notes different from source language information?
> That's orthogonal to the concern of PR4246 which talks about providing
> a generic layer for lowering from the C type system to the ABI.
> Does this sound like a sensible start?
Comment 1 of PR4246 is something like what I was getting at. What's not
specified in the bug is how the type mapping is represented. I'm with
Eli in that it should be a dirt-simple structure to convey the necessary
information. Something that just says, for example, this use of i8 * is
a char * and this other use of i8 * is a void *.
-Dave
More information about the llvm-dev
mailing list