diff options
author | Bob Duff <duff@adacore.com> | 2021-10-06 09:03:53 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-10-20 10:17:04 +0000 |
commit | 36e38022125f2f336e5d281fb3e5e66191d21e73 (patch) | |
tree | 568b72492d067a5dca44147b9e452dbba8b8136f /gcc/ada/cstand.adb | |
parent | 749e01a5f310f2c4327f030d425aa6e23afbbbd5 (diff) | |
download | gcc-36e38022125f2f336e5d281fb3e5e66191d21e73.zip gcc-36e38022125f2f336e5d281fb3e5e66191d21e73.tar.gz gcc-36e38022125f2f336e5d281fb3e5e66191d21e73.tar.bz2 |
[Ada] tech debt: Clean up Uint fields, such as Esize
gcc/ada/
* atree.ads: Comment improvements. How is a "completely new
node" different from a "new node"? Document default values
corresponding to field types.
* exp_ch7.adb (Process_Tagged_Type_Declaration): Use
higher-level Scope_Depth instead of Scope_Depth_Value. Remove
confusing comment: not clear what a "true" library level package
is.
* uintp.adb (Image_Out): Print No_Uint in a more readable way.
* gen_il-gen.adb, gen_il-gen-gen_entities.adb,
gen_il-gen-gen_nodes.adb, gen_il-types.ads: Tighten up the
subtypes of fields whose type is Uint, where possible; use
more-constrained subtypes such as Unat.
* einfo-utils.adb, einfo-utils.ads, exp_attr.adb,
exp_ch3.adb, exp_intr.adb, exp_unst.adb, exp_util.adb,
freeze.adb, repinfo.adb, sem.adb, sem_ch12.adb, sem_ch13.adb,
sem_ch3.adb, sem_ch8.adb, sem_util.adb, sprint.adb, treepr.adb:
No longer use Uint_0 to indicate "unknown" or "not yet known"
for various fields whose type is Uint. Use No_Uint for that,
except in a small number of legacy cases that cause test
failures. Protect many queries of such fields with calls to
Known_... functions. Improve comments.
* exp_aggr.adb: Likewise.
(Is_OK_Aggregate): Check whether Csiz is present.
(Aggr_Assignment_OK_For_Backend): Ensure we do not access an
uninitialized size.
* exp_strm.adb (Build_Elementary_Input_Call,
Build_Elementary_Write_Call): Check whether P_Size is present.
* cstand.adb: Leave Component_Size of Any_Composite unknown.
Similar for RM_Size of Standard_Exception_Type. These should
not be used.
* einfo.ads: Comment improvements.
* exp_disp.ads: Minor.
* gen_il-internals.ads, gen_il-internals.adb: Minor.
* sinfo-utils.adb: Take advantage of full-coverage rules.
* types.h: Minor.
Diffstat (limited to 'gcc/ada/cstand.adb')
-rw-r--r-- | gcc/ada/cstand.adb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb index 41de2a5..3822d93 100644 --- a/gcc/ada/cstand.adb +++ b/gcc/ada/cstand.adb @@ -1233,10 +1233,11 @@ package body CStand is Mutate_Ekind (Any_Composite, E_Array_Type); Set_Scope (Any_Composite, Standard_Standard); Set_Etype (Any_Composite, Any_Composite); - Set_Component_Size (Any_Composite, Uint_0); Set_Component_Type (Any_Composite, Standard_Integer); Reinit_Size_Align (Any_Composite); + pragma Assert (not Known_Component_Size (Any_Composite)); + Any_Discrete := New_Standard_Entity ("a discrete type"); Mutate_Ekind (Any_Discrete, E_Signed_Integer_Type); Set_Scope (Any_Discrete, Standard_Standard); @@ -1508,10 +1509,11 @@ package body CStand is Set_Scope (Standard_Exception_Type, Standard_Standard); Set_Stored_Constraint (Standard_Exception_Type, No_Elist); - Set_RM_Size (Standard_Exception_Type, Uint_0); Set_Size_Known_At_Compile_Time (Standard_Exception_Type, True); + pragma Assert (not Known_RM_Size (Standard_Exception_Type)); + Make_Aliased_Component (Standard_Exception_Type, Standard_Boolean, "Not_Handled_By_Others"); Make_Aliased_Component (Standard_Exception_Type, Standard_Character, |