aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
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/gcc-interface
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/gcc-interface')
-rw-r--r--gcc/ada/gcc-interface/cuintp.c1
-rw-r--r--gcc/ada/gcc-interface/gigi.h2
-rw-r--r--gcc/ada/gcc-interface/targtyps.c1
-rw-r--r--gcc/ada/gcc-interface/trans.c4
4 files changed, 5 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/cuintp.c b/gcc/ada/gcc-interface/cuintp.c
index 6ac82d7..3488ae4 100644
--- a/gcc/ada/gcc-interface/cuintp.c
+++ b/gcc/ada/gcc-interface/cuintp.c
@@ -40,6 +40,7 @@
#include "types.h"
#include "uintp.h"
#include "ada-tree.h"
+#include "sinfo.h"
#include "gigi.h"
/* Universal integers are represented by the Uint type which is an index into
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index 49b85a4..692ef44 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -234,7 +234,7 @@ extern "C" {
extern void gigi (Node_Id gnat_root,
int max_gnat_node,
int number_name,
- Field_Offset *node_offsets_ptr,
+ Node_Header *node_offsets_ptr,
any_slot *slots_ptr,
Node_Id *next_node_ptr,
Node_Id *prev_node_ptr,
diff --git a/gcc/ada/gcc-interface/targtyps.c b/gcc/ada/gcc-interface/targtyps.c
index 704172d..6a3c0f2 100644
--- a/gcc/ada/gcc-interface/targtyps.c
+++ b/gcc/ada/gcc-interface/targtyps.c
@@ -35,6 +35,7 @@
#include "ada.h"
#include "types.h"
#include "ada-tree.h"
+#include "sinfo.h"
#include "gigi.h"
/* If we don't have a specific size for Ada's equivalent of `long', use that
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index d3c421d..158bfe3 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -75,7 +75,7 @@
#define ALLOCA_THRESHOLD 1000
/* Pointers to front-end tables accessed through macros. */
-Field_Offset *Node_Offsets_Ptr;
+Node_Header *Node_Offsets_Ptr;
any_slot *Slots_Ptr;
Node_Id *Next_Node_Ptr;
Node_Id *Prev_Node_Ptr;
@@ -279,7 +279,7 @@ void
gigi (Node_Id gnat_root,
int max_gnat_node,
int number_name ATTRIBUTE_UNUSED,
- Field_Offset *node_offsets_ptr,
+ Node_Header *node_offsets_ptr,
any_slot *slots_ptr,
Node_Id *next_node_ptr,
Node_Id *prev_node_ptr,