[cfe-dev] Passing StructType arguments directly
Rafael Ávila de Espíndola
rafael.espindola at gmail.com
Wed Sep 28 20:20:31 PDT 2011
> In retrospect, the old multiple return value approach was probably
> less complex overall, but there's too much inertia behind FCAs at
> this point to easily go back.
IMHO one of the nice things of FCAs is that they don't force an address
into something that will not have one in the end. In that way, they are
a good abstraction for small structs and structs in general in the
caller side. They are a bad abstractions on the callee for larger
structs that are passed in memory, since there is no address visible in
the IL.
My old idea on how to fix this was to allow passing a FCA to a byval.
The caller IL has a value, the callee IL has a pointer.
But I think I agree with you. If the FE advantages are not seen as
substantial and since the FE have to know the ABIs anyway, it seems
reasonable to require them to split the arguments and use byval for
things that must be in memory.
>
> Dan
Cheers,
Rafael
More information about the cfe-dev
mailing list