public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* How to easily identify that a FUNCTION_DECL is a lambda
@ 2018-07-16  7:23 Martin Liška
  2018-07-16 14:30 ` Nathan Sidwell
  2018-07-18  1:46 ` Jason Merrill
  0 siblings, 2 replies; 11+ messages in thread
From: Martin Liška @ 2018-07-16  7:23 UTC (permalink / raw)
  To: GCC Development; +Cc: Jason Merrill, Nathan Sidwell

Hi.

For purpose of --coverage I would like to distinguish lambda functions
among DECL_ARTIFICIAL functions. Currently, cp-tree.h provides macro:

/* Test if FUNCTION_DECL is a lambda function.  */
#define LAMBDA_FUNCTION_P(FNDECL)				\
  (DECL_DECLARES_FUNCTION_P (FNDECL)				\
   && DECL_OVERLOADED_OPERATOR_P (FNDECL)			\
   && DECL_OVERLOADED_OPERATOR_IS (FNDECL, CALL_EXPR)		\
   && LAMBDA_TYPE_P (CP_DECL_CONTEXT (FNDECL)))

That's FE-specific function that probably should not be called from
middle-end. Any idea how to distinguish lambdas?

Thanks,
Martin

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-08-01 13:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-16  7:23 How to easily identify that a FUNCTION_DECL is a lambda Martin Liška
2018-07-16 14:30 ` Nathan Sidwell
2018-07-16 16:04   ` Richard Biener
2018-07-16 16:09     ` Nathan Sidwell
2018-07-17 11:35       ` Martin Liška
2018-07-17 11:51         ` Richard Biener
2018-07-18  1:46 ` Jason Merrill
2018-07-18  9:03   ` Martin Liška
2018-07-18 12:40     ` Jason Merrill
2018-07-18 13:49       ` Martin Liška
2018-08-01 13:35         ` Martin Liška

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).