[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-23 16:28:04
Message-ID: CAMe9rOodKH1HXoTyd5j+jXui9ByzHVw3O1wEGYADtRT6D+sw8g () mail ! gmail ! com
[Download RAW message or body]

On Tue, Feb 23, 2016 at 8:15 AM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> On Tue, 23 Feb 2016, H.J. Lu wrote:
>
>> I thought
>>
>> ---
>> An empty type is a type where it and all of its subobjects (recursively)
>> are of class, structure, union, or array type.
>> ---
>>
>> excluded
>>
>> struct empty
>> {
>> empty () = default;
>> };
>
>
> Why would that be excluded?  There are no subobjects, hence all of them
> are of class, structure, union or array type, hence this is an empty type.
> (And that's good, it indeed looks quite empty to me).  Even if you would
> add a non-trivial copy ctor, making this thing not trivially copyable
> anymore, it would still be empty.  Hence, given your proposed language in
> the psABI, without reference to any other ABI (in particular not to the
> Itanium C++ ABI), you would then need to pass it without registers.  That
> can't be done, and that's exactly why I find that wording incomplete.  It
> needs implicit references to other languages ABIs to work.
>

It is clear to me now.  Let's go with

---
An empty type is a type where it and all of its subobjects (recursively)
are of class, structure, union, or array type.  No memory slot nor
register should be used to pass or return an object of empty type that's
trivially copyable.
---

Any comments?


-- 
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