diff options
author | Bob Duff <duff@adacore.com> | 2021-07-02 11:41:28 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-09-21 15:24:57 +0000 |
commit | b23cdc01588b60f52a8c70c8f4465a068b49d317 (patch) | |
tree | 6e4640413b49f9c2a3ede3201136938fca7f5db7 /gcc/ada/sem_ch13.ads | |
parent | e9068967876383bf0d9280b4f455fd50e7faf152 (diff) | |
download | gcc-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/sem_ch13.ads')
-rw-r--r-- | gcc/ada/sem_ch13.ads | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch13.ads b/gcc/ada/sem_ch13.ads index 3b21484..0d3b041 100644 --- a/gcc/ada/sem_ch13.ads +++ b/gcc/ada/sem_ch13.ads @@ -81,9 +81,11 @@ package Sem_Ch13 is -- the setting of the RM_Size field is not affected. This routine also -- initializes the alignment field to zero. + Unknown_Minimum_Size : constant Nonzero_Int := -1; + function Minimum_Size (T : Entity_Id; - Biased : Boolean := False) return Nat; + Biased : Boolean := False) return Int; -- Given an elementary type, determines the minimum number of bits required -- to represent all values of the type. This function may not be called -- with any other types. If the flag Biased is set True, then the minimum @@ -96,7 +98,7 @@ package Sem_Ch13 is -- the type is already biased, then Minimum_Size returns the biased size, -- regardless of the setting of Biased. Also, fixed-point types are never -- biased in the current implementation. If the size is not known at - -- compile time, this function returns 0. + -- compile time, this function returns Unknown_Minimum_Size. procedure Check_Constant_Address_Clause (Expr : Node_Id; U_Ent : Entity_Id); -- Expr is an expression for an address clause. This procedure checks |