[Patch] Fix for incorrect ABI in case we have an unused union argument passed by value
rjmccall at apple.com
Wed Aug 21 10:56:38 PDT 2013
On Aug 21, 2013, at 2:31 AM, Karthik Bhat <blitz.opensource at gmail.com> wrote:
> Thanks for the reply. Please correct me if i'm wrong but shouldn't this be general for all unions and not just transparent unions?
> Shouldn't we be handling union in similar way we are handling structures in this function except that the size of union will be calculated differently?
The method you’re modifying is part of a best-effort attempt to try to pass aggregates as individual scalar values in order to generate prettier IR and enable better optimization. By design, it should not return “true” in any case where doing so would affect the ABI.
The correct behavior for transparent unions is to look through the transparent union (to its first member, not its largest) when deciding how to pass the object.
More information about the cfe-commits