diff options
author | Bob Duff <duff@adacore.com> | 2021-07-29 11:15:46 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-09-23 13:06:14 +0000 |
commit | 99e30ba8c01f80a81891223069d47d8a611082c4 (patch) | |
tree | 2bfbbf0e257e54ccf041809b15680cfb8b58c83a /gcc/ada/types.ads | |
parent | 7165704bfaae012cb28e5411619218da6fb8320d (diff) | |
download | gcc-99e30ba8c01f80a81891223069d47d8a611082c4.zip gcc-99e30ba8c01f80a81891223069d47d8a611082c4.tar.gz gcc-99e30ba8c01f80a81891223069d47d8a611082c4.tar.bz2 |
[Ada] Cleanup and efficiency improvements
gcc/ada/
* gen_il-gen.adb: Generate getters and setters with much of the
code inlined. Generate code for storing a few fields in the node
header, to avoid the extra level of indirection for those
fields. We generate the header type, so we don't have to
duplicate hand-written Ada and C code to depend on the number of
header fields. Declare constants for slot size. Use short names
because these are used all over. Remove
Put_Low_Level_Accessor_Instantiations, Put_Low_Level_C_Getter,
which are no longer needed. Rename
Put_High_Level_C_Getter-->Put_C_Getter.
* atree.ads, atree.adb: Take into account the header slots.
Take into account the single Node_Or_Entity_Field type. Remove
"pragma Assertion_Policy (Ignore);", because the routines in
this package are no longer efficiency critical.
* atree.h: Remove low-level getters, which are no longer used by
sinfo.h and einfo.h.
* einfo-utils.adb: Avoid crash in Known_Alignment.
* live.adb, sem_eval.adb: Remove code that prevents Node_Id from
having a predicate. We don't actually add a predicate to
Node_Id, but we want to be able to for temporary debugging.
* sinfo-utils.adb: Remove code that prevents Node_Id from having
a predicate. Take into account the single Node_Or_Entity_Field
type.
* sinfo-utils.ads: Minor.
* table.ads (Table_Type): Make the components aliased, because
low-level setters in Atree need to take 'Access.
* treepr.adb: Take into account the single Node_Or_Entity_Field
type. Make some code more robust, so we can print out
half-baked nodes.
* types.ads: Move types here for visibility purposes.
* gcc-interface/gigi.h, gcc-interface/trans.c: Take into account
the Node_Header change in the GNAT front end.
* gcc-interface/cuintp.c, gcc-interface/targtyps.c: Add because
gigi.h now refers to type Node_Header, which is in sinfo.h.
Diffstat (limited to 'gcc/ada/types.ads')
-rw-r--r-- | gcc/ada/types.ads | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ada/types.ads b/gcc/ada/types.ads index 2caaf50..07b0960 100644 --- a/gcc/ada/types.ads +++ b/gcc/ada/types.ads @@ -991,6 +991,8 @@ package Types is -- Offset of a node field, in units of the size of the field, which is -- always a power of 2. + subtype Node_Offset is Field_Offset'Base range 1 .. Field_Offset'Base'Last; + subtype Slot_Count is Field_Offset; -- Count of number of slots. Same type as Field_Offset to avoid -- proliferation of type conversions. @@ -1005,4 +1007,8 @@ package Types is type Offset_Array is array (Offset_Array_Index range <>) of Opt_Field_Offset; + Slot_Size : constant := 32; + type Slot is mod 2**Slot_Size; + for Slot'Size use Slot_Size; + end Types; |