diff mbox series

c++: remove LAMBDA_EXPR_CAPTURES_THIS_P

Message ID 20250129204905.1759283-1-ppalka@redhat.com
State New
Headers show
Series c++: remove LAMBDA_EXPR_CAPTURES_THIS_P | expand

Commit Message

Patrick Palka Jan. 29, 2025, 8:49 p.m. UTC
Built on x86_64-pc-linux-gnu, does this look OK for trunk?

-- >8 --

This unused accessor is just a simple alias of LAMBDA_EXPR_THIS_CAPTURE
and contrary to the documentation doesn't actually use TREE_LANG_FLAG_0.
Might as well remove it.

gcc/cp/ChangeLog:

	* cp-tree.h (LAMBDA_EXPR_CAPTURES_THIS_P): Remove.
---
 gcc/cp/cp-tree.h | 5 -----
 1 file changed, 5 deletions(-)

Comments

Jason Merrill Jan. 30, 2025, 3:09 p.m. UTC | #1
On 1/29/25 3:49 PM, Patrick Palka wrote:
> Built on x86_64-pc-linux-gnu, does this look OK for trunk?

OK.

> -- >8 --
> 
> This unused accessor is just a simple alias of LAMBDA_EXPR_THIS_CAPTURE
> and contrary to the documentation doesn't actually use TREE_LANG_FLAG_0.
> Might as well remove it.
> 
> gcc/cp/ChangeLog:
> 
> 	* cp-tree.h (LAMBDA_EXPR_CAPTURES_THIS_P): Remove.
> ---
>   gcc/cp/cp-tree.h | 5 -----
>   1 file changed, 5 deletions(-)
> 
> diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
> index 21011d0b003..ec976928f5f 100644
> --- a/gcc/cp/cp-tree.h
> +++ b/gcc/cp/cp-tree.h
> @@ -429,7 +429,6 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
>         LAMBDA_CAPTURE_EXPLICIT_P (in a TREE_LIST in LAMBDA_EXPR_CAPTURE_LIST)
>         PARENTHESIZED_LIST_P (in the TREE_LIST for a parameter-declaration-list)
>         CONSTRUCTOR_IS_DIRECT_INIT (in CONSTRUCTOR)
> -      LAMBDA_EXPR_CAPTURES_THIS_P (in LAMBDA_EXPR)
>         DECLTYPE_FOR_LAMBDA_CAPTURE (in DECLTYPE_TYPE)
>         VEC_INIT_EXPR_IS_CONSTEXPR (in VEC_INIT_EXPR)
>         DECL_OVERRIDE_P (in FUNCTION_DECL)
> @@ -1543,10 +1542,6 @@ enum cp_lambda_default_capture_mode_type {
>   #define LAMBDA_EXPR_THIS_CAPTURE(NODE) \
>     (((struct tree_lambda_expr *)LAMBDA_EXPR_CHECK (NODE))->this_capture)
>   
> -/* Predicate tracking whether `this' is in the effective capture set.  */
> -#define LAMBDA_EXPR_CAPTURES_THIS_P(NODE) \
> -  LAMBDA_EXPR_THIS_CAPTURE(NODE)
> -
>   /* True iff uses of a const variable capture were optimized away.  */
>   #define LAMBDA_EXPR_CAPTURE_OPTIMIZED(NODE) \
>     TREE_LANG_FLAG_2 (LAMBDA_EXPR_CHECK (NODE))
diff mbox series

Patch

diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 21011d0b003..ec976928f5f 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -429,7 +429,6 @@  extern GTY(()) tree cp_global_trees[CPTI_MAX];
       LAMBDA_CAPTURE_EXPLICIT_P (in a TREE_LIST in LAMBDA_EXPR_CAPTURE_LIST)
       PARENTHESIZED_LIST_P (in the TREE_LIST for a parameter-declaration-list)
       CONSTRUCTOR_IS_DIRECT_INIT (in CONSTRUCTOR)
-      LAMBDA_EXPR_CAPTURES_THIS_P (in LAMBDA_EXPR)
       DECLTYPE_FOR_LAMBDA_CAPTURE (in DECLTYPE_TYPE)
       VEC_INIT_EXPR_IS_CONSTEXPR (in VEC_INIT_EXPR)
       DECL_OVERRIDE_P (in FUNCTION_DECL)
@@ -1543,10 +1542,6 @@  enum cp_lambda_default_capture_mode_type {
 #define LAMBDA_EXPR_THIS_CAPTURE(NODE) \
   (((struct tree_lambda_expr *)LAMBDA_EXPR_CHECK (NODE))->this_capture)
 
-/* Predicate tracking whether `this' is in the effective capture set.  */
-#define LAMBDA_EXPR_CAPTURES_THIS_P(NODE) \
-  LAMBDA_EXPR_THIS_CAPTURE(NODE)
-
 /* True iff uses of a const variable capture were optimized away.  */
 #define LAMBDA_EXPR_CAPTURE_OPTIMIZED(NODE) \
   TREE_LANG_FLAG_2 (LAMBDA_EXPR_CHECK (NODE))