aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/fe.h
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2021-07-02 11:41:28 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2021-09-21 15:24:57 +0000
commitb23cdc01588b60f52a8c70c8f4465a068b49d317 (patch)
tree6e4640413b49f9c2a3ede3201136938fca7f5db7 /gcc/ada/fe.h
parente9068967876383bf0d9280b4f455fd50e7faf152 (diff)
downloadgcc-b23cdc01588b60f52a8c70c8f4465a068b49d317.zip
gcc-b23cdc01588b60f52a8c70c8f4465a068b49d317.tar.gz
gcc-b23cdc01588b60f52a8c70c8f4465a068b49d317.tar.bz2
[Ada] Clean up uses of Esize and RM_Size
gcc/ada/ * einfo-utils.adb: Add support (currently disabled) for using "initial zero" instead of "Uint_0" to represent "unknown". Call Known_ functions, instead of evilly duplicating their code inline. * fe.h (No_Uint_To_0): New function to convert No_Uint to Uint_0, in order to preserve existing behavior. (Copy_Esize, Copy_RM_Size): New imports from Einfo.Utils. * cstand.adb: Set size fields of Standard_Debug_Renaming_Type and Standard_Exception_Type. * checks.adb, exp_attr.adb, exp_ch3.adb, exp_ch5.adb, exp_ch6.adb, exp_pakd.adb, exp_util.adb, freeze.adb, itypes.adb, layout.adb, repinfo.adb, sem_attr.adb, sem_ch12.adb, sem_ch13.adb, sem_ch13.ads, sem_ch3.adb, sem_ch7.adb, sem_util.adb: Protect calls with Known_..., use Copy_... Remove assumption that Uint_0 represents "unknown". * types.ads (Nonzero_Int): New subtype. * gcc-interface/decl.c, gcc-interface/trans.c: Protect calls with Known_... and use Copy_... as appropriate, to avoid blowing up in unknown cases. Similarly, call No_Uint_To_0 to preserve existing behavior.
Diffstat (limited to 'gcc/ada/fe.h')
-rw-r--r--gcc/ada/fe.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ada/fe.h b/gcc/ada/fe.h
index d956327..488e811 100644
--- a/gcc/ada/fe.h
+++ b/gcc/ada/fe.h
@@ -69,6 +69,15 @@ extern Boolean Debug_Flag_NN;
/* einfo: */
+/* Valid_Uint is used to preserve the old behavior of Esize and
+ friends, where Uint_0 was the default. All calls to this
+ are questionable. */
+INLINE Valid_Uint
+No_Uint_To_0 (Uint X)
+{
+ return X == No_Uint ? Uint_0 : X;
+}
+
#define Set_Alignment einfo__entities__set_alignment
#define Set_Component_Bit_Offset einfo__entities__set_component_bit_offset
#define Set_Component_Size einfo__entities__set_component_size
@@ -618,6 +627,12 @@ B Known_RM_Size (Entity_Id E);
#define Copy_Alignment einfo__utils__copy_alignment
B Copy_Alignment(Entity_Id To, Entity_Id From);
+#define Copy_Esize einfo__utils__copy_esize
+B Copy_Esize(Entity_Id To, Entity_Id From);
+
+#define Copy_RM_Size einfo__utils__copy_rm_size
+B Copy_RM_Size(Entity_Id To, Entity_Id From);
+
#define Is_Discrete_Or_Fixed_Point_Type einfo__utils__is_discrete_or_fixed_point_type
B Is_Discrete_Or_Fixed_Point_Type (E Id);