This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to easily identify that a FUNCTION_DECL is a lambda

On Tue, Jul 17, 2018 at 1:35 PM Martin Liška <> wrote:
> On 07/16/2018 06:09 PM, Nathan Sidwell wrote:
> > On 07/16/2018 12:04 PM, Richard Biener wrote:
> >
> >> Just use a spare bit in function_decl, then we can simply stream it.
> >
> > If there's one, then sure.  (you've reminded me that there are a bunch of mutually disjoint flags in function_decl that could be collapsed to an enumeration.  This may be another such bit.)
> There wasn't, but I was able to stole one unused (tm_clone_flag). About mutual disjoint, I believe following 3 can be
> an enum:

Well, /* No bits left.  */ is a lie on 64bit hosts.  There's actually
32bits left on those ;)
Similar in tree_decl_with_vis which _does_ have 14 unused bits left.
So we could
shrink FUNCTION_DECLs by 8 bytes by moving the function-decl flags to
decl_with_vis inside sth like

  union {
     struct { .... } function_decl_bits;
  } u;

if we ever choose to have other decl_with_vis nodes have flags.  But yes, the
function_decl_bits part would then be all taken.  OTOH decl_with_vis already
has a lot of FUNCTION_DECL-only flags already.

Care to move the bits?

>   unsigned static_ctor_flag : 1;
>   unsigned static_dtor_flag : 1;
>   unsigned lambda_function: 1;
> I'm attaching patch candidate, is the location where I set the flag correct?
> Do I miss any other location where that should be set?

> Thanks,
> Martin
> >
> > nathan
> >

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]