diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2016-01-18 11:29:00 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2016-01-18 11:29:00 +0000 |
commit | 9a1bdc314ba086904861838838bc2e0743476dcd (patch) | |
tree | 9b5a32fc16b8443b82e93e51c4c082d86cb64a11 /gcc/ada/gcc-interface/gigi.h | |
parent | f5460595a488ce9c131815016d0c89dc0d17ca14 (diff) | |
download | gcc-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/gigi.h')
-rw-r--r-- | gcc/ada/gcc-interface/gigi.h | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index cef9341..cd3d5b6 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -6,7 +6,7 @@ * * * C Header File * * * - * Copyright (C) 1992-2015, Free Software Foundation, Inc. * + * Copyright (C) 1992-2016, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -538,11 +538,9 @@ extern tree gnat_type_for_mode (machine_mode mode, int unsignedp); /* Perform final processing on global declarations. */ extern void gnat_write_global_declarations (void); -/* Return the unsigned version of a TYPE_NODE, a scalar type. */ -extern tree gnat_unsigned_type (tree type_node); - -/* Return the signed version of a TYPE_NODE, a scalar type. */ -extern tree gnat_signed_type (tree type_node); +/* Return the signed or unsigned version of TYPE_NODE, a scalar type, the + signedness being specified by UNSIGNEDP. */ +extern tree gnat_signed_or_unsigned_type_for (int unsignedp, tree type_node); /* Return 1 if the types T1 and T2 are compatible, i.e. if they can be transparently converted to each other. */ @@ -898,11 +896,11 @@ extern tree build_call_raise (int msg, Node_Id gnat_node, char kind); /* Similar to build_call_raise, with extra information about the column where the check failed. */ -extern tree build_call_raise_column (int msg, Node_Id gnat_node); +extern tree build_call_raise_column (int msg, Node_Id gnat_node, char kind); /* Similar to build_call_raise_column, for an index or range check exception , with extra information of the form "INDEX out of range FIRST..LAST". */ -extern tree build_call_raise_range (int msg, Node_Id gnat_node, +extern tree build_call_raise_range (int msg, Node_Id gnat_node, char kind, tree index, tree first, tree last); /* Return a CONSTRUCTOR of TYPE whose elements are V. This is not the @@ -1120,3 +1118,19 @@ return_type_with_variable_size_p (tree type) return false; } + +/* Return the unsigned version of TYPE_NODE, a scalar type. */ + +static inline tree +gnat_unsigned_type_for (tree type_node) +{ + return gnat_signed_or_unsigned_type_for (1, type_node); +} + +/* Return the signed version of TYPE_NODE, a scalar type. */ + +static inline tree +gnat_signed_type_for (tree type_node) +{ + return gnat_signed_or_unsigned_type_for (0, type_node); +} |