On Tue, 26 Jan 2016, H.J. Lu wrote:

On Tue, Jan 26, 2016 at 12:23 PM, Marc Glisse <marc.gli...@inria.fr> wrote:
On Tue, 26 Jan 2016, H.J. Lu wrote:

On Tue, Jan 26, 2016 at 11:27 AM, Jason Merrill <ja...@redhat.com> wrote:

On 12/14/2015 05:08 PM, H.J. Lu wrote:


+  if (abi_version_at_least (10))
+    TYPE_EMPTY_RECORD (t) = is_really_empty_class (t);



This should use is_empty_class or CLASSTYPE_EMPTY_P.  We don't want to
change how classes with just a vptr are passed.

Otherwise, it looks OK to me.


Is true_type an empty class here?  is_empty_class returns false
on this:


It isn't empty in the usual C++ sense (we can't apply the empty base
optimization to something that derives from it, for instance), or the one
described in the itanium ABI (the relevant one here I guess). On the other
hand, it is rather useless to pass it by value, so a different notion of

llvm/clang treats it as empty class and I think it should be treated
as "empty" class.

Is it still empty if there are several empty members? Is there a clear definition somewhere of what empty means? I guess it makes sense to recursively allow "empty" members for this purpose.

empty might have been useful when the ABI was defined...

I proposed to update x86-64 psABI:

https://groups.google.com/forum/#!topic/x86-64-abi/VTE-LJ9VnDk

Does the full document have a definition of empty anywhere?

[hjl@gnu-skl-1 gcc]$ cat x.cc
struct dummy { };
struct true_type { struct dummy i; };

extern true_type y;
extern void xxx (true_type c);

void
yyy (void)
{
 xxx (y);
}
[hjl@gnu-skl-1 gcc]$


--
Marc Glisse

--
Marc Glisse

Reply via email to