[PATCH] c++: cp_walk_subtrees simplification for *_CAST_EXPR

Jason Merrill jason@redhat.com
Thu Nov 18 19:26:39 GMT 2021


On 11/18/21 13:47, Patrick Palka wrote:
> Let walk_tree_1 do the operand walking for us.
> 
> Bootstrap and regtest on x86_64-pc-linux-gnu in progress, does this look
> OK for trunk if successful?

OK.

> gcc/cp/ChangeLog:
> 
> 	* tree.c (cp_walk_subtrees) <case *_CAST_EXPR>: Simplify.
> ---
>   gcc/cp/tree.c | 7 -------
>   1 file changed, 7 deletions(-)
> 
> diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
> index 32ddf835a91..7050a53abc2 100644
> --- a/gcc/cp/tree.c
> +++ b/gcc/cp/tree.c
> @@ -5352,13 +5352,6 @@ cp_walk_subtrees (tree *tp, int *walk_subtrees_p, walk_tree_fn func,
>       case BIT_CAST_EXPR:
>         if (TREE_TYPE (*tp))
>   	WALK_SUBTREE (TREE_TYPE (*tp));
> -
> -      {
> -        int i;
> -        for (i = 0; i < TREE_CODE_LENGTH (TREE_CODE (*tp)); ++i)
> -	  WALK_SUBTREE (TREE_OPERAND (*tp, i));
> -      }
> -      *walk_subtrees_p = 0;
>         break;
>   
>       case CONSTRUCTOR:
> 



More information about the Gcc-patches mailing list