[cfe-dev] Struct parameters being converted to other types

Tim Northover t.p.northover at gmail.com
Tue Jan 15 07:54:26 PST 2013


Hi Jaymie,

> Is there a way to avoid generating all these variations? For example, is there a Clang argument that would cause all structs to be passed as "byval" pointers?

I believe not. These machinations are necessary to conform to the ABI
in question; picking any single one of those would almost certainly
give code that doesn't interoperate with other compilers or libraries.

If you really don't care about that, your best option would probably
be to implement an intentionally simpler ABI in Clang. This is all
decided for the various targets in lib/CodeGen/TargetInfo.cpp. Beware
that the LLVM backend may not be expecting this "simpler" system, so
you could encounter more errors there. And you'd almost certainly
break variadic functions, if they matter to you.

Cheers.

Tim.



More information about the cfe-dev mailing list