How to easily identify that a FUNCTION_DECL is a lambda

Martin Liška mliska@suse.cz
Tue Jul 17 11:35:00 GMT 2018


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:

  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
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lambda.patch
Type: text/x-patch
Size: 2151 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20180717/2db02e05/attachment.bin>


More information about the Gcc mailing list