[Ada] tech debt: Clean up Uint fields, such as Esize
commit36e38022125f2f336e5d281fb3e5e66191d21e73
authorBob Duff <duff@adacore.com>
Wed, 6 Oct 2021 13:03:53 +0000 (6 09:03 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 20 Oct 2021 10:17:04 +0000 (20 10:17 +0000)
tree568b72492d067a5dca44147b9e452dbba8b8136f
parent749e01a5f310f2c4327f030d425aa6e23afbbbd5
[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.
33 files changed:
gcc/ada/atree.ads
gcc/ada/cstand.adb
gcc/ada/einfo-utils.adb
gcc/ada/einfo-utils.ads
gcc/ada/einfo.ads
gcc/ada/exp_aggr.adb
gcc/ada/exp_attr.adb
gcc/ada/exp_ch3.adb
gcc/ada/exp_ch7.adb
gcc/ada/exp_disp.ads
gcc/ada/exp_intr.adb
gcc/ada/exp_strm.adb
gcc/ada/exp_unst.adb
gcc/ada/exp_util.adb
gcc/ada/freeze.adb
gcc/ada/gen_il-gen-gen_entities.adb
gcc/ada/gen_il-gen-gen_nodes.adb
gcc/ada/gen_il-gen.adb
gcc/ada/gen_il-internals.adb
gcc/ada/gen_il-internals.ads
gcc/ada/gen_il-types.ads
gcc/ada/repinfo.adb
gcc/ada/sem.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_ch8.adb
gcc/ada/sem_util.adb
gcc/ada/sinfo-utils.adb
gcc/ada/sprint.adb
gcc/ada/treepr.adb
gcc/ada/types.h
gcc/ada/uintp.adb