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/decl.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/decl.cc')
-rw-r--r-- | gcc/ada/gcc-interface/decl.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index 20f43de..ec61593 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -785,7 +785,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) if ((TREE_CODE (gnu_type) == UNCONSTRAINED_ARRAY_TYPE && No (gnat_renamed_obj)) || TYPE_IS_DUMMY_P (gnu_type) - || TREE_CODE (gnu_type) == VOID_TYPE) + || VOID_TYPE_P (gnu_type)) { gcc_assert (type_annotate_only); if (this_global) @@ -840,7 +840,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) if (TREE_CODE (gnu_expr) == COMPONENT_REF && TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_expr, 0))) - && TREE_CODE (TREE_OPERAND (gnu_expr, 0)) == VAR_DECL + && VAR_P (TREE_OPERAND (gnu_expr, 0)) && (TREE_READONLY (TREE_OPERAND (gnu_expr, 0)) || DECL_READONLY_ONCE_ELAB (TREE_OPERAND (gnu_expr, 0)))) @@ -1077,7 +1077,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) /* We need to detect the case where a temporary is created to hold the return value, since we cannot safely rename it at top level as it lives only in the elaboration routine. */ - || (TREE_CODE (inner) == VAR_DECL + || (VAR_P (inner) && DECL_RETURN_VALUE_P (inner)) /* We also need to detect the case where the front-end creates a dangling 'reference to a function call at top level and @@ -1093,10 +1093,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) We cannot safely rename the rewritten expression since the underlying object lives only in the elaboration routine. */ - || (TREE_CODE (inner) == INDIRECT_REF + || (INDIRECT_REF_P (inner) && (inner = remove_conversions (TREE_OPERAND (inner, 0), true)) - && TREE_CODE (inner) == VAR_DECL + && VAR_P (inner) && DECL_RETURN_VALUE_P (inner))) ; @@ -1611,7 +1611,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) and optimization isn't enabled, then force it in memory so that a register won't be allocated to it with possible subparts left uninitialized and reaching the register allocator. */ - else if (TREE_CODE (gnu_decl) == VAR_DECL + else if (VAR_P (gnu_decl) && !DECL_EXTERNAL (gnu_decl) && !TREE_STATIC (gnu_decl) && DECL_MODE (gnu_decl) != BLKmode @@ -6717,8 +6717,7 @@ range_cannot_be_superflat (Node_Id gnat_range) static bool constructor_address_p (tree gnu_expr) { - while (TREE_CODE (gnu_expr) == NOP_EXPR - || TREE_CODE (gnu_expr) == CONVERT_EXPR + while (CONVERT_EXPR_P (gnu_expr) || TREE_CODE (gnu_expr) == NON_LVALUE_EXPR) gnu_expr = TREE_OPERAND (gnu_expr, 0); @@ -7061,7 +7060,7 @@ elaborate_expression_1 (tree gnu_expr, Entity_Id gnat_entity, const char *s, expr_variable_p = !(inner - && TREE_CODE (inner) == VAR_DECL + && VAR_P (inner) && (TREE_READONLY (inner) || DECL_READONLY_ONCE_ELAB (inner))); } |