[cfe-commits] [PATCH] Emit returned aggregates directly into sret slot when applicable

Eli Friedman eli.friedman at gmail.com
Thu Dec 3 10:36:49 PST 2009


On Thu, Dec 3, 2009 at 8:51 AM, Mike Stump <mrs at apple.com> wrote:
> On Dec 2, 2009, at 10:59 PM, Eli Friedman wrote:
>>
>> Patch attached.  This seems blindingly obvious, but since it hasn't
>> been done yet, I have a feeling I'm missing something.
>
> What happens when CurFnInfo->getReturnInfo().getKind() ==
> ABIArgInfo::Indirect is false and
> hasAggregateLLVMType(CurFnInfo->getReturnType())) is true?  I'm thinking
> that might be a can't happen scenario, but if so, it should just assert
> CurFnInfo->getReturnInfo().getKind() == ABIArgInfo::Indirect, right?

The other possibility is ABIArgInfo::Coerce; for example, take the
following testcase on x86_64:
struct a { int x; int y; };
struct a x() { return (struct a) {1}; }

> Aside from this, I think this is safe...

Okay.

-Eli




More information about the cfe-commits mailing list