diff options
author | Bernhard Reutner-Fischer <aldot@gcc.gnu.org> | 2023-05-14 00:35:12 +0200 |
---|---|---|
committer | Bernhard Reutner-Fischer <aldot@gcc.gnu.org> | 2023-05-18 21:49:02 +0200 |
commit | 04682fe764004b09cdae76e94950623c8a0fe39f (patch) | |
tree | c0973fcb3f003685702635899d729f1906ebf9b5 /gcc/ada/gcc-interface/trans.cc | |
parent | c072df1ab144506cd8bb0ac81fb8f1aad69f0bd2 (diff) | |
download | gcc-04682fe764004b09cdae76e94950623c8a0fe39f.zip gcc-04682fe764004b09cdae76e94950623c8a0fe39f.tar.gz gcc-04682fe764004b09cdae76e94950623c8a0fe39f.tar.bz2 |
ada: use _P() defines from tree.h
gcc/ada/ChangeLog:
* gcc-interface/decl.cc (gnat_to_gnu_entity): Use _P defines
from tree.h.
(constructor_address_p): Ditto.
(elaborate_expression_1): Ditto.
* gcc-interface/trans.cc (Identifier_to_gnu): Ditto.
(is_nrv_p): Ditto.
(Subprogram_Body_to_gnu): Ditto.
(gnat_to_gnu): Ditto.
(gnat_to_gnu_external): Ditto.
(add_decl_expr): Ditto.
(gnat_gimplify_expr): Ditto.
* gcc-interface/utils.cc (create_var_decl): Ditto.
* gcc-interface/utils2.cc (get_base_type): Ditto.
(build_binary_op): Ditto.
(build_unary_op): Ditto.
(gnat_protect_expr): Ditto.
(gnat_invariant_expr): Ditto.
Diffstat (limited to 'gcc/ada/gcc-interface/trans.cc')
-rw-r--r-- | gcc/ada/gcc-interface/trans.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc index 5fc1a26..c26f1b6 100644 --- a/gcc/ada/gcc-interface/trans.cc +++ b/gcc/ada/gcc-interface/trans.cc @@ -1241,7 +1241,7 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p) /* Do the final dereference. */ gnu_result = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_result); - if ((TREE_CODE (gnu_result) == INDIRECT_REF + if ((INDIRECT_REF_P (gnu_result) || TREE_CODE (gnu_result) == UNCONSTRAINED_ARRAY_REF) && No (Address_Clause (gnat_entity))) TREE_THIS_NOTRAP (gnu_result) = 1; @@ -3391,7 +3391,7 @@ struct nrv_data static inline bool is_nrv_p (bitmap nrv, tree t) { - return TREE_CODE (t) == VAR_DECL && bitmap_bit_p (nrv, DECL_UID (t)); + return VAR_P (t) && bitmap_bit_p (nrv, DECL_UID (t)); } /* Helper function for walk_tree, used by finalize_nrv below. */ @@ -4136,7 +4136,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node) gnat_param = Next_Formal_With_Extras (gnat_param)) { tree gnu_param = get_gnu_tree (gnat_param); - bool is_var_decl = (TREE_CODE (gnu_param) == VAR_DECL); + bool is_var_decl = VAR_P (gnu_param); annotate_object (gnat_param, TREE_TYPE (gnu_param), NULL_TREE, DECL_BY_REF_P (gnu_param)); @@ -6908,7 +6908,7 @@ gnat_to_gnu (Node_Id gnat_node) && TYPE_CONTAINS_TEMPLATE_P (gnu_result_type)) gnu_aggr_type = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_result_type))); - else if (TREE_CODE (gnu_result_type) == VECTOR_TYPE) + else if (VECTOR_TYPE_P (gnu_result_type)) gnu_aggr_type = TYPE_REPRESENTATIVE_ARRAY (gnu_result_type); else gnu_aggr_type = gnu_result_type; @@ -7740,7 +7740,7 @@ gnat_to_gnu (Node_Id gnat_node) gnu_result = build2 (INIT_EXPR, void_type_node, gnu_ret_deref, gnu_ret_val); /* Avoid a useless copy with __builtin_return_slot. */ - if (TREE_CODE (gnu_ret_val) == INDIRECT_REF) + if (INDIRECT_REF_P (gnu_ret_val)) gnu_result = build3 (COND_EXPR, void_type_node, fold_build2 (NE_EXPR, boolean_type_node, @@ -8415,7 +8415,7 @@ gnat_to_gnu (Node_Id gnat_node) /* If we're supposed to return something of void_type, it means we have something we're elaborating for effect, so just return. */ - if (TREE_CODE (gnu_result_type) == VOID_TYPE) + if (VOID_TYPE_P (gnu_result_type)) return gnu_result; /* If the result is a constant that overflowed, raise Constraint_Error. */ @@ -8588,7 +8588,7 @@ gnat_to_gnu_external (Node_Id gnat_node) current_function_decl = NULL_TREE; /* Do not import locations from external units. */ - if (gnu_result && EXPR_P (gnu_result)) + if (CAN_HAVE_LOCATION_P (gnu_result)) SET_EXPR_LOCATION (gnu_result, UNKNOWN_LOCATION); return gnu_result; @@ -8722,7 +8722,7 @@ add_decl_expr (tree gnu_decl, Node_Id gnat_node) Note that walk_tree knows how to deal with TYPE_DECL, but neither VAR_DECL nor CONST_DECL. This appears to be somewhat arbitrary. */ MARK_VISITED (gnu_stmt); - if (TREE_CODE (gnu_decl) == VAR_DECL + if (VAR_P (gnu_decl) || TREE_CODE (gnu_decl) == CONST_DECL) { MARK_VISITED (DECL_SIZE (gnu_decl)); @@ -8739,7 +8739,7 @@ add_decl_expr (tree gnu_decl, Node_Id gnat_node) && !TYPE_FAT_POINTER_P (type)) MARK_VISITED (TYPE_ADA_SIZE (type)); - if (TREE_CODE (gnu_decl) == VAR_DECL && (gnu_init = DECL_INITIAL (gnu_decl))) + if (VAR_P (gnu_decl) && (gnu_init = DECL_INITIAL (gnu_decl))) { /* If this is a variable and an initializer is attached to it, it must be valid for the context. Similar to init_const in create_var_decl. */ @@ -9000,7 +9000,7 @@ gnat_gimplify_expr (tree *expr_p, gimple_seq *pre_p, /* The expressions for the RM bounds must be gimplified to ensure that they are properly elaborated. See gimplify_decl_expr. */ - if ((TREE_CODE (op) == TYPE_DECL || TREE_CODE (op) == VAR_DECL) + if ((TREE_CODE (op) == TYPE_DECL || VAR_P (op)) && !TYPE_SIZES_GIMPLIFIED (TREE_TYPE (op)) && (INTEGRAL_TYPE_P (TREE_TYPE (op)) || SCALAR_FLOAT_TYPE_P (TREE_TYPE (op)))) |