From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 984AE3858401 for ; Thu, 1 Jun 2023 15:24:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 984AE3858401 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685633061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f1abbqhFidb5mtWGxw9/fyBJwVZ37kQxHZQZaduBIuM=; b=EP+ZmBxA2p2YjkOA14zKkzFhLvpM1ga5s96HndjtR+KJNViAD9Vc1M2iM+7s/vrdrniCN1 utfwuIzEL+vUOmNlJ92ytucOP+Vc0RBIqKARCt3Jfp/Bi9meSViI4p4PASyV3LouoffD4K 9ySPZDJJXs8rvXa6QBA6SUAUcWo0mWE= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-413-0QWCpiz-ObeGHGCo3jalPQ-1; Thu, 01 Jun 2023 11:24:19 -0400 X-MC-Unique: 0QWCpiz-ObeGHGCo3jalPQ-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2b1a7e54365so1968461fa.2 for ; Thu, 01 Jun 2023 08:24:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685633058; x=1688225058; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f1abbqhFidb5mtWGxw9/fyBJwVZ37kQxHZQZaduBIuM=; b=AewVYNBcm+zapy3ZXuiaZvB2xk8Trym2INZOJRn83zXQZvsqxnOtScpEt6410D+t2Z te2/M3gD+FP08nqaqFn20sYU4I879/zwzX+BuxqfPakY5dBE5Haq/Rjsqci87+w60rMI VsU9+RotAgEbKiqDEieCVFv5SO3uMGGgOph76Jte+SMKuXQsDt1qULdM8DQvPhEzS0ix rWuNxYY4bk7w/OJd74q/KeEXRQ/OZtpgpqGrgJFvU4tVeRQ63kGfdt4KB+9R11HwuR0M ecJftr7JdWt9yy+CQ4KdAXe4STNhgFWoyUj0L+E2weZiMYlA4QUzYcvDN1Xej1HQgap8 ibFg== X-Gm-Message-State: AC+VfDzg4/WkTnzPSVJvP3ZfqgapIAEjPa+I5I/G5ycnGqZbAbiKeRtn 1nnsXhuceipJ1iDV3w9EQevshDa4TLZrHqNs8XDgcscGYo2yGXKJSzJZmZnP1jDNTzkwwu2NHyc m8pZ7G7piYA5357q5bOth43QEUYNt4jfDqQ== X-Received: by 2002:a2e:7005:0:b0:2b1:a873:cfbd with SMTP id l5-20020a2e7005000000b002b1a873cfbdmr211835ljc.4.1685633057714; Thu, 01 Jun 2023 08:24:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ708bB5Qs7mi8LWlGkmjTAkZLeelMhscX+JK/kY4p20944GF/CyAzCD6Pnv2AeAaZ72h+0b/QiUhEc7wj6EzWg= X-Received: by 2002:a2e:7005:0:b0:2b1:a873:cfbd with SMTP id l5-20020a2e7005000000b002b1a873cfbdmr211794ljc.4.1685633057117; Thu, 01 Jun 2023 08:24:17 -0700 (PDT) MIME-Version: 1.0 References: <20230513232321.279733-1-rep.dot.nop@gmail.com> <20230513232321.279733-5-rep.dot.nop@gmail.com> In-Reply-To: <20230513232321.279733-5-rep.dot.nop@gmail.com> From: Patrick Palka Date: Thu, 1 Jun 2023 11:24:06 -0400 Message-ID: Subject: Re: [PATCH 04/14] c++: use _P() defines from tree.h To: Bernhard Reutner-Fischer Cc: gcc-patches@gcc.gnu.org, Bernhard Reutner-Fischer X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sat, May 13, 2023 at 7:26=E2=80=AFPM Bernhard Reutner-Fischer via Gcc-patches wrote: > > From: Bernhard Reutner-Fischer > > gcc/cp/ChangeLog: > > * call.cc (promoted_arithmetic_type_p): Use _P defines from tree.= h. > (build_conditional_expr): Ditto. > (convert_like_internal): Ditto. > (convert_arg_to_ellipsis): Ditto. > (build_over_call): Ditto. > (compare_ics): Ditto. > * class.cc (is_empty_base_ref): Ditto. > * coroutines.cc (rewrite_param_uses): Ditto. > * cp-tree.h (DECL_DISCRIMINATOR_P): Ditto. > (ARITHMETIC_TYPE_P): Ditto. > * cvt.cc (ocp_convert): Ditto. > * cxx-pretty-print.cc (pp_cxx_template_argument_list): Ditto. > * decl.cc (layout_var_decl): Ditto. > (get_tuple_size): Ditto. > * error.cc (dump_simple_decl): Ditto. > * lambda.cc (start_lambda_scope): Ditto. > * mangle.cc (write_template_arg): Ditto. > * method.cc (spaceship_comp_cat): Ditto. > * module.cc (node_template_info): Ditto. > (trees_out::start): Ditto. > (trees_out::decl_node): Ditto. > (trees_in::read_var_def): Ditto. > (set_instantiating_module): Ditto. > * name-lookup.cc (maybe_record_mergeable_decl): Ditto. > (consider_decl): Ditto. > (maybe_add_fuzzy_decl): Ditto. > * pt.cc (convert_nontype_argument): Ditto. > * semantics.cc (handle_omp_array_sections_1): Ditto. > (finish_omp_clauses): Ditto. > (finish_omp_target_clauses_r): Ditto. > (is_this_parameter): Ditto. > * tree.cc (build_cplus_array_type): Ditto. > (is_this_expression): Ditto. > * typeck.cc (do_warn_enum_conversions): Ditto. > * typeck2.cc (store_init_value): Ditto. > (check_narrowing): Ditto. > --- > gcc/cp/call.cc | 42 +++++++++++++++++++------------------- > gcc/cp/class.cc | 2 +- > gcc/cp/coroutines.cc | 2 +- > gcc/cp/cp-tree.h | 4 ++-- > gcc/cp/cvt.cc | 2 +- > gcc/cp/cxx-pretty-print.cc | 2 +- > gcc/cp/decl.cc | 4 ++-- > gcc/cp/error.cc | 2 +- > gcc/cp/lambda.cc | 2 +- > gcc/cp/mangle.cc | 2 +- > gcc/cp/method.cc | 2 +- > gcc/cp/module.cc | 12 +++++------ > gcc/cp/name-lookup.cc | 6 +++--- > gcc/cp/pt.cc | 2 +- > gcc/cp/semantics.cc | 24 +++++++++++----------- > gcc/cp/tree.cc | 4 ++-- > gcc/cp/typeck.cc | 4 ++-- > gcc/cp/typeck2.cc | 10 ++++----- > 18 files changed, 64 insertions(+), 64 deletions(-) > > diff --git a/gcc/cp/call.cc b/gcc/cp/call.cc > index 2a06520c0c1..6e13d17f6b8 100644 > --- a/gcc/cp/call.cc > +++ b/gcc/cp/call.cc > @@ -2746,7 +2746,7 @@ promoted_arithmetic_type_p (tree type) > integral types plus floating types. */ > return ((CP_INTEGRAL_TYPE_P (type) > && same_type_p (type_promotes_to (type), type)) > - || TREE_CODE (type) =3D=3D REAL_TYPE); > + || SCALAR_FLOAT_TYPE_P (type)); > } > > /* Create any builtin operator overload candidates for the operator in > @@ -5759,10 +5759,10 @@ build_conditional_expr (const op_location_t &loc, > if ((TREE_CODE (arg2) =3D=3D EXCESS_PRECISION_EXPR > || TREE_CODE (arg3) =3D=3D EXCESS_PRECISION_EXPR) > && (TREE_CODE (arg2_type) =3D=3D INTEGER_TYPE > - || TREE_CODE (arg2_type) =3D=3D REAL_TYPE > + || SCALAR_FLOAT_TYPE_P (arg2_type) > || TREE_CODE (arg2_type) =3D=3D COMPLEX_TYPE) > && (TREE_CODE (arg3_type) =3D=3D INTEGER_TYPE > - || TREE_CODE (arg3_type) =3D=3D REAL_TYPE > + || SCALAR_FLOAT_TYPE_P (arg3_type) > || TREE_CODE (arg3_type) =3D=3D COMPLEX_TYPE)) > { > semantic_result_type > @@ -5775,8 +5775,8 @@ build_conditional_expr (const op_location_t &loc, > t1 =3D TREE_TYPE (t1); > if (TREE_CODE (t2) =3D=3D COMPLEX_TYPE) > t2 =3D TREE_TYPE (t2); > - gcc_checking_assert (TREE_CODE (t1) =3D=3D REAL_TYPE > - && TREE_CODE (t2) =3D=3D REAL_TYPE > + gcc_checking_assert (SCALAR_FLOAT_TYPE_P (t1) > + && SCALAR_FLOAT_TYPE_P (t2) > && (extended_float_type_p (t1) > || extended_float_type_p (t2)) > && cp_compare_floating_point_conversion_ra= nks > @@ -6127,8 +6127,8 @@ build_conditional_expr (const op_location_t &loc, > t1 =3D TREE_TYPE (t1); > if (TREE_CODE (t2) =3D=3D COMPLEX_TYPE) > t2 =3D TREE_TYPE (t2); > - gcc_checking_assert (TREE_CODE (t1) =3D=3D REAL_TYPE > - && TREE_CODE (t2) =3D=3D REAL_TYPE > + gcc_checking_assert (SCALAR_FLOAT_TYPE_P (t1) > + && SCALAR_FLOAT_TYPE_P (t2) > && (extended_float_type_p (t1) > || extended_float_type_p (t2)) > && cp_compare_floating_point_conversion_ra= nks > @@ -6147,8 +6147,8 @@ build_conditional_expr (const op_location_t &loc, > t1 =3D TREE_TYPE (t1); > if (TREE_CODE (t2) =3D=3D COMPLEX_TYPE) > t2 =3D TREE_TYPE (t2); > - gcc_checking_assert (TREE_CODE (t1) =3D=3D REAL_TYPE > - && TREE_CODE (t2) =3D=3D REAL_TYPE > + gcc_checking_assert (SCALAR_FLOAT_TYPE_P (t1) > + && SCALAR_FLOAT_TYPE_P (t2) > && (extended_float_type_p (t1) > || extended_float_type_p (t2)) > && cp_compare_floating_point_conversion_ra= nks > @@ -6185,8 +6185,8 @@ build_conditional_expr (const op_location_t &loc, > else if ((complain & tf_warning) > && warn_deprecated_enum_float_conv > && ((TREE_CODE (arg2_type) =3D=3D ENUMERAL_TYPE > - && TREE_CODE (arg3_type) =3D=3D REAL_TYPE) > - || (TREE_CODE (arg2_type) =3D=3D REAL_TYPE > + && SCALAR_FLOAT_TYPE_P (arg3_type)) > + || (SCALAR_FLOAT_TYPE_P (arg2_type) > && TREE_CODE (arg3_type) =3D=3D ENUMERAL_TYPE))) > { > if (TREE_CODE (arg2_type) =3D=3D ENUMERAL_TYPE) > @@ -8321,8 +8321,8 @@ convert_like_internal (conversion *convs, tree expr= , tree fn, int argnum, > "direct-initialization", > totype, TREE_TYPE (expr)); > > - if (TREE_CODE (TREE_TYPE (expr)) =3D=3D REAL_TYPE > - && TREE_CODE (totype) =3D=3D REAL_TYPE > + if (SCALAR_FLOAT_TYPE_P (TREE_TYPE (expr)) > + && SCALAR_FLOAT_TYPE_P (totype) > && (extended_float_type_p (TREE_TYPE (expr)) > || extended_float_type_p (totype))) > switch (cp_compare_floating_point_conversion_ranks (TREE_TYPE (ex= pr), > @@ -8976,7 +8976,7 @@ convert_arg_to_ellipsis (tree arg, tsubst_flags_t c= omplain) > type that is subject to the floating-point promotion > (_conv.fpprom_), the value of the argument is converted to the > promoted type before the call. */ > - if (TREE_CODE (arg_type) =3D=3D REAL_TYPE > + if (SCALAR_FLOAT_TYPE_P (arg_type) > && (TYPE_PRECISION (arg_type) > < TYPE_PRECISION (double_type_node)) > && !DECIMAL_FLOAT_MODE_P (TYPE_MODE (arg_type)) > @@ -9798,7 +9798,7 @@ build_over_call (struct z_candidate *cand, int flag= s, tsubst_flags_t complain) > obj_arg =3D NULL_TREE; > } > /* Look through *(const T *)&obj. */ > - else if (obj_arg && TREE_CODE (obj_arg) =3D=3D INDIRECT_REF) > + else if (obj_arg && INDIRECT_REF_P (obj_arg)) > { > tree addr =3D TREE_OPERAND (obj_arg, 0); > STRIP_NOPS (addr); > @@ -10462,7 +10462,7 @@ build_over_call (struct z_candidate *cand, int fl= ags, tsubst_flags_t complain) > obj_arg =3D NULL_TREE; > } > /* Look through *(const T *)&obj. */ > - else if (obj_arg && TREE_CODE (obj_arg) =3D=3D INDIRECT_REF) > + else if (obj_arg && INDIRECT_REF_P (obj_arg)) > { > tree addr =3D TREE_OPERAND (obj_arg, 0); > STRIP_NOPS (addr); > @@ -12199,7 +12199,7 @@ compare_ics (conversion *ics1, conversion *ics2) > std::swap (fp3, t3); > } > if (TYPE_MAIN_VARIANT (fp1) =3D=3D TYPE_MAIN_VARIANT (fp3) > - && TREE_CODE (fp1) =3D=3D REAL_TYPE > + && SCALAR_FLOAT_TYPE_P (fp1) > /* Only apply this rule if at least one of the 3 types is > extended floating-point type, otherwise keep them as > before for compatibility reasons with types like __float128. > @@ -12207,15 +12207,15 @@ compare_ics (conversion *ics1, conversion *ics2= ) > ranks and so when just those 3 types are involved, this > rule doesn't trigger. */ > && (extended_float_type_p (fp1) > - || (TREE_CODE (fp2) =3D=3D REAL_TYPE && extended_float_type_p= (fp2)) > - || (TREE_CODE (t3) =3D=3D REAL_TYPE && extended_float_type_p = (t3)))) > + || (SCALAR_FLOAT_TYPE_P (fp2) && extended_float_type_p (fp2)) > + || (SCALAR_FLOAT_TYPE_P (t3) && extended_float_type_p (t3)))) > { > if (TREE_CODE (fp2) !=3D REAL_TYPE) > { > ret =3D -ret; > std::swap (fp2, t3); > } > - if (TREE_CODE (fp2) =3D=3D REAL_TYPE) > + if (SCALAR_FLOAT_TYPE_P (fp2)) > { > /* cp_compare_floating_point_conversion_ranks returns -1, 0 o= r 1 > if the conversion rank is equal (-1 or 1 if the subrank is > @@ -12242,7 +12242,7 @@ compare_ics (conversion *ics1, conversion *ics2) > FP1 <-> T3 conversion is better. */ > return -ret; > } > - else if (TREE_CODE (t3) =3D=3D REAL_TYPE > + else if (SCALAR_FLOAT_TYPE_P (t3) > && IN_RANGE (cp_compare_floating_point_conversion_ra= nks > (fp1, t3)= , > -1, 1)) > diff --git a/gcc/cp/class.cc b/gcc/cp/class.cc > index 68b62086340..bc84f4f731a 100644 > --- a/gcc/cp/class.cc > +++ b/gcc/cp/class.cc > @@ -673,7 +673,7 @@ convert_to_base_statically (tree expr, tree base) > bool > is_empty_base_ref (tree expr) > { > - if (TREE_CODE (expr) =3D=3D INDIRECT_REF) > + if (INDIRECT_REF_P (expr)) > expr =3D TREE_OPERAND (expr, 0); > if (TREE_CODE (expr) !=3D NOP_EXPR) > return false; > diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc > index 59a240ebd40..3493d3c6ed3 100644 > --- a/gcc/cp/coroutines.cc > +++ b/gcc/cp/coroutines.cc > @@ -3780,7 +3780,7 @@ rewrite_param_uses (tree *stmt, int *do_subtree ATT= RIBUTE_UNUSED, void *d) > param_frame_data *data =3D (param_frame_data *) d; > > /* For lambda closure content, we have to look specifically. */ > - if (TREE_CODE (*stmt) =3D=3D VAR_DECL && DECL_HAS_VALUE_EXPR_P (*stmt)= ) > + if (VAR_P (*stmt) && DECL_HAS_VALUE_EXPR_P (*stmt)) > { > tree t =3D DECL_VALUE_EXPR (*stmt); > return cp_walk_tree (&t, rewrite_param_uses, d, NULL); > diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h > index 714b6d55f4f..a1b882f11fe 100644 > --- a/gcc/cp/cp-tree.h > +++ b/gcc/cp/cp-tree.h > @@ -3189,7 +3189,7 @@ struct GTY(()) lang_decl { > > /* Nonzero if NODE has DECL_DISCRIMINATOR and not DECL_ACCESS. */ > #define DECL_DISCRIMINATOR_P(NODE) \ > - (((TREE_CODE (NODE) =3D=3D VAR_DECL && TREE_STATIC (NODE)) \ > + (((VAR_P (NODE) && TREE_STATIC (NODE)) \ > || DECL_IMPLICIT_TYPEDEF_P (NODE)) \ > && DECL_FUNCTION_SCOPE_P (NODE)) > > @@ -4453,7 +4453,7 @@ get_vec_init_expr (tree t) > Keep these checks in ascending code order. */ > #define ARITHMETIC_TYPE_P(TYPE) \ > (CP_INTEGRAL_TYPE_P (TYPE) \ > - || TREE_CODE (TYPE) =3D=3D REAL_TYPE \ > + || SCALAR_FLOAT_TYPE_P (TYPE) \ > || TREE_CODE (TYPE) =3D=3D COMPLEX_TYPE) > > /* [basic.types] > diff --git a/gcc/cp/cvt.cc b/gcc/cp/cvt.cc > index 17827d06a4a..c6b52f07050 100644 > --- a/gcc/cp/cvt.cc > +++ b/gcc/cp/cvt.cc > @@ -810,7 +810,7 @@ ocp_convert (tree type, tree expr, int convtype, int = flags, > /* enum =3D enum, enum =3D int, enum =3D float, (enum)pointer a= re all > errors. */ > if (((INTEGRAL_OR_ENUMERATION_TYPE_P (intype) > - || TREE_CODE (intype) =3D=3D REAL_TYPE) > + || SCALAR_FLOAT_TYPE_P (intype)) > && ! (convtype & CONV_STATIC)) > || TYPE_PTR_P (intype)) > { > diff --git a/gcc/cp/cxx-pretty-print.cc b/gcc/cp/cxx-pretty-print.cc > index 4b547c77ef4..909a9dc917f 100644 > --- a/gcc/cp/cxx-pretty-print.cc > +++ b/gcc/cp/cxx-pretty-print.cc > @@ -1966,7 +1966,7 @@ pp_cxx_template_argument_list (cxx_pretty_printer *= pp, tree t) > if (TYPE_P (arg) || (TREE_CODE (arg) =3D=3D TEMPLATE_DECL > && TYPE_P (DECL_TEMPLATE_RESULT (arg)))) > pp->type_id (arg); > - else if (TREE_CODE (arg) =3D=3D VAR_DECL && DECL_NTTP_OBJECT_P = (arg)) > + else if (VAR_P (arg) && DECL_NTTP_OBJECT_P (arg)) > pp->expression (DECL_INITIAL (arg)); > else > pp->expression (arg); > diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc > index 23a2b2fef0b..a672e4844f1 100644 > --- a/gcc/cp/decl.cc > +++ b/gcc/cp/decl.cc > @@ -6349,7 +6349,7 @@ layout_var_decl (tree decl) > && !vec_safe_is_empty (CONSTRUCTOR_ELTS (DECL_INITIAL (decl))) > && DECL_SIZE (decl) !=3D NULL_TREE > && TREE_CODE (DECL_SIZE (decl)) =3D=3D INTEGER_CST > - && TYPE_SIZE (type) !=3D NULL_TREE > + && COMPLETE_TYPE_P (type) > && TREE_CODE (TYPE_SIZE (type)) =3D=3D INTEGER_CST > && tree_int_cst_equal (DECL_SIZE (decl), TYPE_SIZE (type))) > { > @@ -8927,7 +8927,7 @@ get_tuple_size (tree type) > return NULL_TREE; > tree val =3D lookup_qualified_name (inst, value_identifier, > LOOK_want::NORMAL, /*complain*/false)= ; > - if (TREE_CODE (val) =3D=3D VAR_DECL || TREE_CODE (val) =3D=3D CONST_DE= CL) > + if (VAR_P (val) || TREE_CODE (val) =3D=3D CONST_DECL) > val =3D maybe_constant_value (val); > if (TREE_CODE (val) =3D=3D INTEGER_CST) > return val; > diff --git a/gcc/cp/error.cc b/gcc/cp/error.cc > index 9b967ce409d..31319aa9e87 100644 > --- a/gcc/cp/error.cc > +++ b/gcc/cp/error.cc > @@ -1140,7 +1140,7 @@ dump_global_iord (cxx_pretty_printer *pp, tree t) > static void > dump_simple_decl (cxx_pretty_printer *pp, tree t, tree type, int flags) > { > - if (TREE_CODE (t) =3D=3D VAR_DECL && DECL_NTTP_OBJECT_P (t)) > + if (VAR_P (t) && DECL_NTTP_OBJECT_P (t)) > return dump_expr (pp, DECL_INITIAL (t), flags); > > if (flags & TFF_DECL_SPECIFIERS) > diff --git a/gcc/cp/lambda.cc b/gcc/cp/lambda.cc > index 9925209b2ed..a359bc6ee8d 100644 > --- a/gcc/cp/lambda.cc > +++ b/gcc/cp/lambda.cc > @@ -1474,7 +1474,7 @@ void > start_lambda_scope (tree decl) > { > gcc_checking_assert (decl); > - if (current_function_decl && TREE_CODE (decl) =3D=3D VAR_DECL) > + if (current_function_decl && VAR_P (decl)) > // If we're inside a function, we ignore variable scope. Don't push= . > lambda_scope.nesting++; > else > diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc > index a235f23459d..826c5e76c1d 100644 > --- a/gcc/cp/mangle.cc > +++ b/gcc/cp/mangle.cc > @@ -3793,7 +3793,7 @@ write_template_arg (tree node) > } > } > > - if (TREE_CODE (node) =3D=3D VAR_DECL && DECL_NTTP_OBJECT_P (node)) > + if (VAR_P (node) && DECL_NTTP_OBJECT_P (node)) > /* We want to mangle the argument, not the var we stored it in. */ > node =3D tparm_object_argument (node); > > diff --git a/gcc/cp/method.cc b/gcc/cp/method.cc > index 00eae56eb5b..cbcc7948b37 100644 > --- a/gcc/cp/method.cc > +++ b/gcc/cp/method.cc > @@ -1048,7 +1048,7 @@ spaceship_comp_cat (tree optype) > { > if (INTEGRAL_OR_ENUMERATION_TYPE_P (optype) || TYPE_PTROBV_P (optype)) > return cc_strong_ordering; > - else if (TREE_CODE (optype) =3D=3D REAL_TYPE) > + else if (SCALAR_FLOAT_TYPE_P (optype)) > return cc_partial_ordering; > > /* ??? should vector <=3D> produce a vector of one of the above? */ > diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc > index ac2fe66b080..ecde98d69b4 100644 > --- a/gcc/cp/module.cc > +++ b/gcc/cp/module.cc > @@ -4042,7 +4042,7 @@ node_template_info (tree decl, int &use) > } > } > else if (DECL_LANG_SPECIFIC (decl) > - && (TREE_CODE (decl) =3D=3D VAR_DECL > + && (VAR_P (decl) > || TREE_CODE (decl) =3D=3D TYPE_DECL > || TREE_CODE (decl) =3D=3D FUNCTION_DECL > || TREE_CODE (decl) =3D=3D FIELD_DECL > @@ -5151,7 +5151,7 @@ trees_out::start (tree t, bool code_streamed) > switch (TREE_CODE (t)) > { > default: > - if (TREE_CODE_CLASS (TREE_CODE (t)) =3D=3D tcc_vl_exp) > + if (VL_EXP_CLASS_P (t)) > u (VL_EXP_OPERAND_LENGTH (t)); > break; > > @@ -8551,7 +8551,7 @@ trees_out::decl_node (tree decl, walk_kind ref) > { > tinfo: > /* A typeinfo, tt_tinfo_typedef or tt_tinfo_var. */ > - bool is_var =3D TREE_CODE (decl) =3D=3D VAR_DECL; > + bool is_var =3D VAR_P (decl); > tree type =3D TREE_TYPE (decl); > unsigned ix =3D get_pseudo_tinfo_index (type); > if (streaming_p ()) > @@ -8651,7 +8651,7 @@ trees_out::decl_node (tree decl, walk_kind ref) > Mostly things that can be defined outside of their (original > declaration) context. */ > gcc_checking_assert (TREE_CODE (decl) =3D=3D TEMPLATE_DECL > - || TREE_CODE (decl) =3D=3D VAR_DECL > + || VAR_P (decl) > || TREE_CODE (decl) =3D=3D FUNCTION_DECL > || TREE_CODE (decl) =3D=3D TYPE_DECL > || TREE_CODE (decl) =3D=3D USING_DECL > @@ -11702,7 +11702,7 @@ bool > trees_in::read_var_def (tree decl, tree maybe_template) > { > /* Do not mark the virtual table entries as used. */ > - bool vtable =3D TREE_CODE (decl) =3D=3D VAR_DECL && DECL_VTABLE_OR_VTT= _P (decl); > + bool vtable =3D VAR_P (decl) && DECL_VTABLE_OR_VTT_P (decl); > unused +=3D vtable; > tree init =3D tree_node (); > tree dyn_init =3D init ? NULL_TREE : tree_node (); > @@ -18776,7 +18776,7 @@ void > set_instantiating_module (tree decl) > { > gcc_assert (TREE_CODE (decl) =3D=3D FUNCTION_DECL > - || TREE_CODE (decl) =3D=3D VAR_DECL > + || VAR_P (decl) > || TREE_CODE (decl) =3D=3D TYPE_DECL > || TREE_CODE (decl) =3D=3D CONCEPT_DECL > || TREE_CODE (decl) =3D=3D TEMPLATE_DECL > diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc > index ad03141df43..eb5c333b5ea 100644 > --- a/gcc/cp/name-lookup.cc > +++ b/gcc/cp/name-lookup.cc > @@ -3488,7 +3488,7 @@ maybe_record_mergeable_decl (tree *slot, tree name,= tree decl) > > tree not_tmpl =3D STRIP_TEMPLATE (decl); > if ((TREE_CODE (not_tmpl) =3D=3D FUNCTION_DECL > - || TREE_CODE (not_tmpl) =3D=3D VAR_DECL) > + || VAR_P (not_tmpl)) > && DECL_THIS_STATIC (not_tmpl)) > /* Internal linkage. */ > return; > @@ -6932,7 +6932,7 @@ consider_decl (tree decl, best_match &bm, > { > /* Skip compiler-generated variables (e.g. __for_begin/__for_end > within range for). */ > - if (TREE_CODE (decl) =3D=3D VAR_DECL && DECL_ARTIFICIAL (decl)) > + if (VAR_P (decl) && DECL_ARTIFICIAL (decl)) > return; > > tree suggestion =3D DECL_NAME (decl); > @@ -6967,7 +6967,7 @@ maybe_add_fuzzy_decl (auto_vec &vec, tree dec= l) > { > /* Skip compiler-generated variables (e.g. __for_begin/__for_end > within range for). */ > - if (TREE_CODE (decl) =3D=3D VAR_DECL && DECL_ARTIFICIAL (decl)) > + if (VAR_P (decl) && DECL_ARTIFICIAL (decl)) > return false; > > tree suggestion =3D DECL_NAME (decl); > diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc > index 696df2bdd9f..16d658e3c6a 100644 > --- a/gcc/cp/pt.cc > +++ b/gcc/cp/pt.cc > @@ -7487,7 +7487,7 @@ convert_nontype_argument (tree type, tree expr, tsu= bst_flags_t complain) > integral promotions (_conv.prom_) and integral conversions > (_conv.integral_) are applied. */ > if (INTEGRAL_OR_ENUMERATION_TYPE_P (type) > - || TREE_CODE (type) =3D=3D REAL_TYPE) > + || SCALAR_FLOAT_TYPE_P (type)) > { > if (cxx_dialect < cxx11) > { > diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc > index 13c6582b628..05df6282302 100644 > --- a/gcc/cp/semantics.cc > +++ b/gcc/cp/semantics.cc > @@ -5169,7 +5169,7 @@ handle_omp_array_sections_1 (tree c, tree t, vec &types, > && TREE_CODE (TREE_OPERAND (t, 0)) =3D=3D COMPONENT_REF) > t =3D TREE_OPERAND (t, 0); > ret =3D t; > - while (TREE_CODE (t) =3D=3D INDIRECT_REF) > + while (INDIRECT_REF_P (t)) > { > t =3D TREE_OPERAND (t, 0); > STRIP_NOPS (t); > @@ -5206,7 +5206,7 @@ handle_omp_array_sections_1 (tree c, tree t, vec &types, > } > t =3D TREE_OPERAND (t, 0); > while (TREE_CODE (t) =3D=3D MEM_REF > - || TREE_CODE (t) =3D=3D INDIRECT_REF > + || INDIRECT_REF_P (t) > || TREE_CODE (t) =3D=3D ARRAY_REF) > { > t =3D TREE_OPERAND (t, 0); > @@ -8097,7 +8097,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region= _type ort) > if (REFERENCE_REF_P (t)) > t =3D TREE_OPERAND (t, 0); > if (TREE_CODE (t) =3D=3D MEM_REF > - || TREE_CODE (t) =3D=3D INDIRECT_REF) > + || INDIRECT_REF_P (t)) > { > t =3D TREE_OPERAND (t, 0); > STRIP_NOPS (t); > @@ -8182,7 +8182,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region= _type ort) > && OMP_CLAUSE_MAP_KIND (c) !=3D GOMP_MAP_ATTACH_DETACH) > OMP_CLAUSE_DECL (c) =3D t; > } > - while (TREE_CODE (t) =3D=3D INDIRECT_REF > + while (INDIRECT_REF_P (t) > || TREE_CODE (t) =3D=3D ARRAY_REF) > { > t =3D TREE_OPERAND (t, 0); > @@ -8201,7 +8201,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region= _type ort) > remove =3D true; > indir_component_ref_p =3D false; > if (TREE_CODE (t) =3D=3D COMPONENT_REF > - && (TREE_CODE (TREE_OPERAND (t, 0)) =3D=3D INDIRECT_REF > + && (INDIRECT_REF_P (TREE_OPERAND (t, 0)) > || TREE_CODE (TREE_OPERAND (t, 0)) =3D=3D ARRAY_REF)) > { > t =3D TREE_OPERAND (TREE_OPERAND (t, 0), 0); > @@ -8255,7 +8255,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region= _type ort) > t =3D TREE_OPERAND (t, 0); > } > while (TREE_CODE (t) =3D=3D MEM_REF > - || TREE_CODE (t) =3D=3D INDIRECT_REF > + || INDIRECT_REF_P (t) > || TREE_CODE (t) =3D=3D ARRAY_REF) > { > t =3D TREE_OPERAND (t, 0); > @@ -8706,7 +8706,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region= _type ort) > t =3D OMP_CLAUSE_DECL (c); > while (TREE_CODE (t) =3D=3D TREE_LIST) > t =3D TREE_CHAIN (t); > - while (TREE_CODE (t) =3D=3D INDIRECT_REF > + while (INDIRECT_REF_P (t) > || TREE_CODE (t) =3D=3D ARRAY_REF) > t =3D TREE_OPERAND (t, 0); > } > @@ -9021,7 +9021,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region= _type ort) > { > t =3D OMP_CLAUSE_DECL (c); > while (handled_component_p (t) > - || TREE_CODE (t) =3D=3D INDIRECT_REF > + || INDIRECT_REF_P (t) > || TREE_CODE (t) =3D=3D ADDR_EXPR > || TREE_CODE (t) =3D=3D MEM_REF > || TREE_CODE (t) =3D=3D NON_LVALUE_EXPR) > @@ -9070,7 +9070,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region= _type ort) > if (TREE_CODE (t) =3D=3D POINTER_PLUS_EXPR) > t =3D TREE_OPERAND (t, 0); > if (TREE_CODE (t) =3D=3D ADDR_EXPR > - || TREE_CODE (t) =3D=3D INDIRECT_REF) > + || INDIRECT_REF_P (t)) > t =3D TREE_OPERAND (t, 0); > if (DECL_P (t)) > bitmap_clear_bit (&aligned_head, DECL_UID (t)); > @@ -9609,7 +9609,7 @@ finish_omp_target_clauses_r (tree *tp, int *walk_su= btrees, void *ptr) > of DECL_VALUE_EXPRs during the target body walk seems the only way = to > find them. */ > if (current_closure > - && (TREE_CODE (t) =3D=3D VAR_DECL > + && (VAR_P (t) > || TREE_CODE (t) =3D=3D PARM_DECL > || TREE_CODE (t) =3D=3D RESULT_DECL) > && DECL_HAS_VALUE_EXPR_P (t) > @@ -12362,8 +12362,8 @@ is_this_parameter (tree t) > if (!DECL_P (t) || DECL_NAME (t) !=3D this_identifier) > return false; > gcc_assert (TREE_CODE (t) =3D=3D PARM_DECL > - || (TREE_CODE (t) =3D=3D VAR_DECL && DECL_HAS_VALUE_EXPR_P = (t)) > - || (cp_binding_oracle && TREE_CODE (t) =3D=3D VAR_DECL)); > + || (VAR_P (t) && DECL_HAS_VALUE_EXPR_P (t)) > + || (cp_binding_oracle && VAR_P (t))); > return true; > } > > diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc > index 131b212ff73..19dfb3ed782 100644 > --- a/gcc/cp/tree.cc > +++ b/gcc/cp/tree.cc > @@ -1173,7 +1173,7 @@ build_cplus_array_type (tree elt_type, tree index_t= ype, int dependent) > } > > /* Avoid spurious warnings with VLAs (c++/54583). */ > - if (TYPE_SIZE (t) && EXPR_P (TYPE_SIZE (t))) > + if (CAN_HAVE_LOCATION_P (TYPE_SIZE (t))) Hmm, this change seems undesirable... > suppress_warning (TYPE_SIZE (t), OPT_Wunused); > > /* Push these needs up to the ARRAY_TYPE so that initialization takes > @@ -3911,7 +3911,7 @@ is_this_expression (tree t) > { > t =3D get_innermost_component (t); > /* See through deferences and no-op conversions. */ > - if (TREE_CODE (t) =3D=3D INDIRECT_REF) > + if (INDIRECT_REF_P (t)) > t =3D TREE_OPERAND (t, 0); > if (TREE_CODE (t) =3D=3D NOP_EXPR) > t =3D TREE_OPERAND (t, 0); > diff --git a/gcc/cp/typeck.cc b/gcc/cp/typeck.cc > index 53ac925a092..a4ceb8a1703 100644 > --- a/gcc/cp/typeck.cc > +++ b/gcc/cp/typeck.cc > @@ -4996,8 +4996,8 @@ do_warn_enum_conversions (location_t loc, enum tree= _code code, tree type0, > } > } > else if ((TREE_CODE (type0) =3D=3D ENUMERAL_TYPE > - && TREE_CODE (type1) =3D=3D REAL_TYPE) > - || (TREE_CODE (type0) =3D=3D REAL_TYPE > + && SCALAR_FLOAT_TYPE_P (type1)) > + || (SCALAR_FLOAT_TYPE_P (type0) > && TREE_CODE (type1) =3D=3D ENUMERAL_TYPE)) > { > const bool enum_first_p =3D TREE_CODE (type0) =3D=3D ENUMERAL_TYPE= ; > diff --git a/gcc/cp/typeck2.cc b/gcc/cp/typeck2.cc > index bf03967a71f..6affdc73fb1 100644 > --- a/gcc/cp/typeck2.cc > +++ b/gcc/cp/typeck2.cc > @@ -907,7 +907,7 @@ store_init_value (tree decl, tree init, vec** cleanups, int flags) > here it should have been digested into an actual value for the type= . */ > gcc_checking_assert (TREE_CODE (value) !=3D CONSTRUCTOR > || processing_template_decl > - || TREE_CODE (type) =3D=3D VECTOR_TYPE > + || VECTOR_TYPE_P (type) > || !TREE_HAS_CONSTRUCTOR (value)); > > /* If the initializer is not a constant, fill in DECL_INITIAL with > @@ -974,7 +974,7 @@ check_narrowing (tree type, tree init, tsubst_flags_t= complain, > return ok; > > if (CP_INTEGRAL_TYPE_P (type) > - && TREE_CODE (ftype) =3D=3D REAL_TYPE) > + && SCALAR_FLOAT_TYPE_P (ftype)) > ok =3D false; > else if (INTEGRAL_OR_ENUMERATION_TYPE_P (ftype) > && CP_INTEGRAL_TYPE_P (type)) > @@ -992,8 +992,8 @@ check_narrowing (tree type, tree init, tsubst_flags_t= complain, > } > /* [dcl.init.list]#7.2: "from long double to double or float, or from > double to float". */ > - else if (TREE_CODE (ftype) =3D=3D REAL_TYPE > - && TREE_CODE (type) =3D=3D REAL_TYPE) > + else if (SCALAR_FLOAT_TYPE_P (ftype) > + && SCALAR_FLOAT_TYPE_P (type)) > { > if ((extended_float_type_p (ftype) || extended_float_type_p (type)= ) > ? /* "from a floating-point type T to another floating-point ty= pe > @@ -1030,7 +1030,7 @@ check_narrowing (tree type, tree init, tsubst_flags= _t complain, > } > } > else if (INTEGRAL_OR_ENUMERATION_TYPE_P (ftype) > - && TREE_CODE (type) =3D=3D REAL_TYPE) > + && SCALAR_FLOAT_TYPE_P (type)) > { > ok =3D false; > if (TREE_CODE (init) =3D=3D INTEGER_CST) > -- > 2.30.2 >