aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2016-01-18 11:29:00 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2016-01-18 11:29:00 +0000
commit9a1bdc314ba086904861838838bc2e0743476dcd (patch)
tree9b5a32fc16b8443b82e93e51c4c082d86cb64a11 /gcc/ada/gcc-interface/decl.c
parentf5460595a488ce9c131815016d0c89dc0d17ca14 (diff)
downloadgcc-9a1bdc314ba086904861838838bc2e0743476dcd.zip
gcc-9a1bdc314ba086904861838838bc2e0743476dcd.tar.gz
gcc-9a1bdc314ba086904861838838bc2e0743476dcd.tar.bz2
gigi.h (build_call_raise_column): Adjust prototype.
* gcc-interface/gigi.h (build_call_raise_column): Adjust prototype. (build_call_raise_range): Likewise. (gnat_unsigned_type): Delete. (gnat_signed_type): Likewise. (gnat_signed_or_unsigned_type_for): New prototype. (gnat_unsigned_type_for): New inline function. (gnat_signed_type_for): Likewise. * gcc-interface/cuintp.c (build_cst_from_int): Call build_int_cst. * gcc-interface/decl.c (gnat_to_gnu_entity): Likewise. (gnat_to_gnu_entity) <E_Array_Type>: Always translate the index types and compute their base type from that. <E_Array_Subtype>: Remove duplicate declaration. * gcc-interface/misc.c (get_array_bit_stride): Call build_int_cst. * gcc-interface/trans.c (get_type_length): Likewise. (Attribute_to_gnu): Likewise. (Loop_Statement_to_gnu): Likewise. (Call_to_gnu): Likewise. (gnat_to_gnu): Call build_real, build_int_cst, gnat_unsigned_type_for and gnat_signed_type_for. Minor tweaks. (build_binary_op_trapv): Likewise. (emit_check): Likewise. (convert_with_check): Likewise. (Raise_Error_to_gnu): Adjust calls to the build_call_raise family of functions. Minor tweaks. (Case_Statement_to_gnu): Remove dead code. (gnat_to_gnu): Call gnat_unsigned_type_for and gnat_signed_type_for. (init_code_table): Minor reordering. * gcc-interface/utils.c (gnat_unsigned_type): Delete. (gnat_signed_type): Likewise. (gnat_signed_or_unsigned_type_for): New function. (unchecked_convert): Use directly the size in the test for precision vs size adjustments. (install_builtin_elementary_types): Call gnat_signed_type_for. * gcc-interface/utils2.c (nonbinary_modular_operation): Call build_int_cst. (build_goto_raise): New function taken from... (build_call_raise): ...here. Call it. (build_call_raise_column): Add KIND parameter and call it. (build_call_raise_range): Likewise. From-SVN: r232503
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 34e9e91..556f079 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -1716,7 +1716,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
TYPE_MODULAR_P (gnu_type) = 1;
SET_TYPE_MODULUS (gnu_type, gnu_modulus);
gnu_high = fold_build2 (MINUS_EXPR, gnu_type, gnu_modulus,
- convert (gnu_type, integer_one_node));
+ build_int_cst (gnu_type, 1));
}
/* If the upper bound is not maximal, make an extra subtype. */
@@ -2113,8 +2113,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnat_index = Next_Index (gnat_index))
{
char field_name[16];
- tree gnu_index_base_type
- = get_unpadded_type (Base_Type (Etype (gnat_index)));
+ tree gnu_index_type = get_unpadded_type (Etype (gnat_index));
+ tree gnu_index_base_type = get_base_type (gnu_index_type);
tree gnu_lb_field, gnu_hb_field, gnu_orig_min, gnu_orig_max;
tree gnu_min, gnu_max, gnu_high;
@@ -2173,7 +2173,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* Update the maximum size of the array in elements. */
if (gnu_max_size)
{
- tree gnu_index_type = get_unpadded_type (Etype (gnat_index));
tree gnu_min
= convert (sizetype, TYPE_MIN_VALUE (gnu_index_type));
tree gnu_max
@@ -2495,8 +2494,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
{
tree gnu_base_min = convert (sizetype, gnu_base_orig_min);
tree gnu_base_max = convert (sizetype, gnu_base_orig_max);
- tree gnu_base_index_base_type
- = get_base_type (gnu_base_index_type);
tree gnu_base_base_min
= convert (sizetype,
TYPE_MIN_VALUE (gnu_base_index_base_type));