aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/einfo-utils.adb
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2021-07-29 11:15:46 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2021-09-23 13:06:14 +0000
commit99e30ba8c01f80a81891223069d47d8a611082c4 (patch)
tree2bfbbf0e257e54ccf041809b15680cfb8b58c83a /gcc/ada/einfo-utils.adb
parent7165704bfaae012cb28e5411619218da6fb8320d (diff)
downloadgcc-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/einfo-utils.adb')
-rw-r--r--gcc/ada/einfo-utils.adb4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb
index 4e5f434..23e93c9 100644
--- a/gcc/ada/einfo-utils.adb
+++ b/gcc/ada/einfo-utils.adb
@@ -364,7 +364,9 @@ package body Einfo.Utils is
function Known_Alignment (E : Entity_Id) return B is
begin
- return not Field_Is_Initial_Zero (E, F_Alignment);
+ -- For some reason, Empty is passed to this sometimes
+
+ return No (E) or else not Field_Is_Initial_Zero (E, F_Alignment);
end Known_Alignment;
procedure Reinit_Alignment (Id : E) is