[prev in list] [next in list] [prev in thread] [next in thread]
List: cfe-commits
Subject: Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct
From: "H.J. Lu via cfe-commits" <cfe-commits () lists ! llvm ! org>
Date: 2016-02-07 19:36:56
Message-ID: CAMe9rOp_6ZpR1YSJZ7AiLpa+FPRGJoLm5fTPkiH5BgF4Tkg3RA () mail ! gmail ! com
[Download RAW message or body]
On Sun, Feb 7, 2016 at 11:31 AM, Florian Weimer <fw@deneb.enyo.de> wrote:
> * H. J. Lu:
>
>> I am proposing to update Intel386, x86-64 and IA MCU psABIs to specify
>> how to pass/return empty struct:
>>
>> 1. "collection". A collection is a structure, union or C++ class.
>> 2. "empty collection". An empty collection is:
>> a. A collection without member. Or
>> b. A collection with only empty collections. Or
>> c. An array of empty collections.
>> 3. "empty record". An empty record is Plain Old Data (POD) for the purpose
>> of layout and
>> a. A collection without member. Or
>> b. A collection with only empty collections.
>> 4. No memory slot nor register should be used to pass or return an object of
>> empty collection.
>
> "Aggregate" may be the more standard term instead of collection.
Aggregate also include array, which is excluded here.
> I think you mean "empty record" under 4.
Yes. I will fix it.
> Any syntactical array argument (at the C level) is should be passed as
> a pointer. The language appears to change that.
I didn't use aggregate so that array is excluded here.
> For 2., static members and non-data members do not count.
They do count here. That is why I used "POD for the purpose of
layout.
> Does the definition of POD vary between C++ standards? Then the
> calling convention would vary as well, which is probably not what we
> want.
I believe that POD for the purpose of layout doesn't change between
C++ standards.
> How do existing C++ compilers implement empty array members (an
> extension)? Does the type of such members affect whether a class is a
> standard-layout class?
>
> Florian
Are they "POD for the purpose of layout"? If yes, they are covered here.
--
H.J.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic