diff options
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r-- | gcc/ada/gcc-interface/Make-lang.in | 37 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/Makefile.in | 16 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 16 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/gigi.h | 30 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 12 |
5 files changed, 67 insertions, 44 deletions
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in index 6e873e2..969022e 100644 --- a/gcc/ada/gcc-interface/Make-lang.in +++ b/gcc/ada/gcc-interface/Make-lang.in @@ -272,6 +272,8 @@ GNAT_ADA_OBJS = \ ada/cstand.o \ ada/debug.o \ ada/debug_a.o \ + ada/einfo-entities.o \ + ada/einfo-utils.o \ ada/einfo.o \ ada/elists.o \ ada/err_vars.o \ @@ -424,6 +426,7 @@ GNAT_ADA_OBJS = \ ada/scng.o \ ada/scos.o \ ada/sdefault.o \ + ada/seinfo.o \ ada/sem.o \ ada/sem_aggr.o \ ada/sem_attr.o \ @@ -459,6 +462,8 @@ GNAT_ADA_OBJS = \ ada/sem_warn.o \ ada/set_targ.o \ ada/sinfo-cn.o \ + ada/sinfo-nodes.o \ + ada/sinfo-utils.o \ ada/sinfo.o \ ada/sinput-d.o \ ada/sinput-l.o \ @@ -478,7 +483,6 @@ GNAT_ADA_OBJS = \ ada/targparm.o \ ada/tbuild.o \ ada/treepr.o \ - ada/treeprs.o \ ada/ttypes.o \ ada/types.o \ ada/uintp.o \ @@ -526,6 +530,8 @@ GNATBIND_OBJS = \ ada/csets.o \ ada/cstreams.o \ ada/debug.o \ + ada/einfo-entities.o \ + ada/einfo-utils.o \ ada/einfo.o \ ada/elists.o \ ada/env.o \ @@ -618,7 +624,10 @@ GNATBIND_OBJS = \ ada/scng.o \ ada/sdefault.o \ ada/seh_init.o \ + ada/seinfo.o \ ada/sem_aux.o \ + ada/sinfo-nodes.o \ + ada/sinfo-utils.o \ ada/sinfo.o \ ada/sinput-c.o \ ada/sinput.o \ @@ -879,7 +888,7 @@ ada.mostlyclean: -$(RM) ada/*$(objext) ada/*.ali ada/b_gnat*.ads ada/b_gnat*.adb -$(RM) ada/*$(objext).gnatd.n -$(RM) ada/*$(coverageexts) - -$(RM) ada/sdefault.adb ada/stamp-sdefault ada/stamp-snames + -$(RM) ada/stamp-sdefault ada/stamp-snames ada/stamp-gen_il -$(RMDIR) ada/tools -$(RMDIR) ada/libgnat -$(RM) gnatbind$(exeext) gnat1$(exeext) @@ -907,7 +916,6 @@ ada.maintainer-clean: -$(RM) ada/einfo.h -$(RM) ada/nmake.adb -$(RM) ada/nmake.ads - -$(RM) ada/treeprs.ads -$(RM) ada/snames.ads ada/snames.adb ada/snames.h # Stage hooks: @@ -1033,11 +1041,6 @@ ada/b_gnatb.o : ada/b_gnatb.adb include $(srcdir)/ada/Make-generated.in -update-sources : ada/treeprs.ads ada/einfo.h ada/sinfo.h ada/nmake.adb \ - ada/nmake.ads - $(RM) $(addprefix $(srcdir)/ada/,$(notdir $^)) - $(CP) $^ $(srcdir)/ada - ada/sdefault.o : ada/libgnat/ada.ads ada/libgnat/a-except.ads ada/libgnat/a-unccon.ads \ ada/libgnat/a-uncdea.ads ada/alloc.ads ada/debug.ads ada/hostparm.ads ada/namet.ads \ ada/opt.ads ada/osint.ads ada/output.ads ada/sdefault.ads ada/sdefault.adb \ @@ -1099,13 +1102,23 @@ ada/mdll-fil.o : ada/mdll-fil.adb ada/mdll.ads ada/mdll-fil.ads ada/mdll-utl.o : ada/mdll-utl.adb ada/mdll.ads ada/mdll-utl.ads ada/sdefault.ads ada/types.ads $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(ADA_OUTPUT_OPTION) -ada_generated_files = ada/sinfo.h ada/einfo.h ada/nmake.adb ada/nmake.ads \ - ada/treeprs.ads ada/snames.ads ada/snames.adb ada/snames.h \ - ada/generated/gnatvsn.ads +# All generated files. Perhaps we should build all of these in the same +# subdirectory, and get rid of ada/bldtools. +ADA_GENERATED_FILES = ada/sinfo.h ada/einfo.h ada/nmake.adb ada/nmake.ads \ + ada/snames.ads ada/snames.adb ada/snames.h \ + ada/generated/gnatvsn.ads \ + ada/seinfo.ads \ + ada/seinfo_tables.ads ada/seinfo_tables.adb \ + ada/sinfo-nodes.ads ada/sinfo-nodes.adb \ + ada/einfo-entities.ads ada/einfo-entities.adb + +# Only used to manually trigger the creation of the generated files. +.PHONY: +ada_generated_files: $(ADA_GENERATED_FILES) # When building from scratch we don't have dependency files, the only thing # we need to ensure is that the generated files are created first. -$(GNAT1_OBJS) $(GNATBIND_OBJS): | $(ada_generated_files) +$(GNAT1_OBJS) $(GNATBIND_OBJS): | $(ADA_GENERATED_FILES) # Manually include the auto-generated dependencies for the Ada host objects. ADA_DEPFILES = $(foreach obj,$(GNAT1_ADA_OBJS) $(GNATBIND_OBJS),\ diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in index 836fcbe..333e203 100644 --- a/gcc/ada/gcc-interface/Makefile.in +++ b/gcc/ada/gcc-interface/Makefile.in @@ -104,7 +104,7 @@ TEXI2DVI = texi2dvi TEXI2PDF = texi2pdf GNATBIND_FLAGS = -static -x ADA_CFLAGS = -ADAFLAGS = -W -Wall -gnatpg -gnata +ADAFLAGS = -W -Wall -gnatpg -gnata -gnatU FORCE_DEBUG_ADAFLAGS = -g NO_INLINE_ADAFLAGS = -fno-inline NO_OMIT_ADAFLAGS = -fno-omit-frame-pointer @@ -332,6 +332,7 @@ GNATMAKE_OBJS = a-except.o ali.o ali-util.o aspects.o s-casuti.o alloc.o \ snames.o stand.o stringt.o styleg.o stylesw.o system.o validsw.o \ switch.o switch-m.o table.o targparm.o tempdir.o types.o uintp.o \ uname.o urealp.o usage.o widechar.o \ + seinfo.o einfo-entities.o einfo-utils.o sinfo-nodes.o sinfo-utils.o \ $(EXTRA_GNATMAKE_OBJS) # Make arch match the current multilib so that the RTS selection code @@ -383,15 +384,20 @@ TOOLS_FLAGS_TO_PASS= \ GCC_LINK=$(CXX) $(GCC_LINK_FLAGS) $(LDFLAGS) -# Build directory for the tools. Let's copy the target-dependent -# sources using the same mechanism as for gnatlib. The other sources are -# accessed using the vpath directive below +# Build directory for the tools. We first need to copy the generated files, +# then the target-dependent sources using the same mechanism as for gnatlib. +# The other sources are accessed using the vpath directive below + +GENERATED_FILES_FOR_TOOLS = \ + einfo-entities.ads einfo-entities.adb sdefault.adb seinfo.ads \ + sinfo-nodes.ads sinfo-nodes.adb snames.ads snames.adb ../stamp-tools: -$(RM) tools/* -$(RMDIR) tools -$(MKDIR) tools - -(cd tools; $(LN_S) ../sdefault.adb ../snames.ads ../snames.adb .) + -(cd tools; $(foreach FILE,$(GENERATED_FILES_FOR_TOOLS), \ + $(LN_S) ../$(FILE) $(FILE);)) -$(foreach PAIR,$(TOOLS_TARGET_PAIRS), \ $(RM) tools/$(word 1,$(subst <, ,$(PAIR)));\ $(LN_S) $(fsrcpfx)ada/$(word 2,$(subst <, ,$(PAIR))) \ diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 6e7abfc..b4c4653 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -434,7 +434,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) gcc_assert (!is_type || Known_Esize (gnat_entity) || Has_Size_Clause (gnat_entity) - || (!IN (kind, Numeric_Kind) + || (!Is_In_Numeric_Kind (kind) && !IN (kind, Enumeration_Kind) && (!IN (kind, Access_Kind) || kind == E_Access_Protected_Subprogram_Type @@ -443,7 +443,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) || type_annotate_only))); /* The RM size must be specified for all discrete and fixed-point types. */ - gcc_assert (!(IN (kind, Discrete_Or_Fixed_Point_Kind) + gcc_assert (!(Is_In_Discrete_Or_Fixed_Point_Kind (kind) && Unknown_RM_Size (gnat_entity))); /* If we get here, it means we have not yet done anything with this entity. @@ -4568,7 +4568,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) /* Similarly, if this is a record type or subtype at global level, call elaborate_expression_2 on any field position. Skip any fields that we haven't made trees for to avoid problems with class-wide types. */ - if (IN (kind, Record_Kind) && global_bindings_p ()) + if (Is_In_Record_Kind (kind) && global_bindings_p ()) for (gnat_temp = First_Entity (gnat_entity); Present (gnat_temp); gnat_temp = Next_Entity (gnat_temp)) if (Ekind (gnat_temp) == E_Component && present_gnu_tree (gnat_temp)) @@ -7675,7 +7675,7 @@ typedef struct vinfo will be the single field of GNU_RECORD_TYPE and the GCC nodes for the discriminants will be on GNU_FIELD_LIST. The other call to this function is a recursive call for the component list of a variant and, in this case, - GNU_FIELD_LIST is empty. + GNU_FIELD_LIST is empty. Note that GNAT_COMPONENT_LIST may be Empty. PACKED is 1 if this is for a packed record or -1 if this is for a record with Component_Alignment of Storage_Unit. @@ -7731,7 +7731,8 @@ components_to_record (Node_Id gnat_component_list, Entity_Id gnat_record_type, /* For each component referenced in a component declaration create a GCC field and add it to the list, skipping pragmas in the GNAT list. */ gnu_last = tree_last (gnu_field_list); - if (Present (Component_Items (gnat_component_list))) + if (Present (gnat_component_list) + && (Present (Component_Items (gnat_component_list)))) for (gnat_component_decl = First_Non_Pragma (Component_Items (gnat_component_list)); Present (gnat_component_decl); @@ -7788,7 +7789,10 @@ components_to_record (Node_Id gnat_component_list, Entity_Id gnat_record_type, } /* At the end of the component list there may be a variant part. */ - gnat_variant_part = Variant_Part (gnat_component_list); + if (Present (gnat_component_list)) + gnat_variant_part = Variant_Part (gnat_component_list); + else + gnat_variant_part = Empty; /* We create a QUAL_UNION_TYPE for the variant part since the variants are mutually exclusive and should go in the same memory. To do this we need diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index 2066f28..7b754da 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -233,24 +233,24 @@ extern "C" { structures and then generates code. */ extern void gigi (Node_Id gnat_root, int max_gnat_node, - int number_name, - struct Node *nodes_ptr, - struct Flags *Flags_Ptr, + int number_name, + Field_Offset *node_offsets_ptr, + slot *Slots, Node_Id *next_node_ptr, Node_Id *prev_node_ptr, struct Elist_Header *elists_ptr, - struct Elmt_Item *elmts_ptr, - struct String_Entry *strings_ptr, - Char_Code *strings_chars_ptr, - struct List_Header *list_headers_ptr, - Nat number_file, - struct File_Info_Type *file_info_ptr, - Entity_Id standard_boolean, - Entity_Id standard_integer, - Entity_Id standard_character, - Entity_Id standard_long_long_float, - Entity_Id standard_exception_type, - Int gigi_operating_mode); + struct Elmt_Item *elmts_ptr, + struct String_Entry *strings_ptr, + Char_Code *strings_chars_ptr, + struct List_Header *list_headers_ptr, + Nat number_file, + struct File_Info_Type *file_info_ptr, + Entity_Id standard_boolean, + Entity_Id standard_integer, + Entity_Id standard_character, + Entity_Id standard_long_long_float, + Entity_Id standard_exception_type, + Int gigi_operating_mode); #ifdef __cplusplus } diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index f0fead7..61a9d61 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -75,8 +75,8 @@ #define ALLOCA_THRESHOLD 1000 /* Pointers to front-end tables accessed through macros. */ -struct Node *Nodes_Ptr; -struct Flags *Flags_Ptr; +Field_Offset *Node_Offsets_Ptr; +slot *Slots_Ptr; Node_Id *Next_Node_Ptr; Node_Id *Prev_Node_Ptr; struct Elist_Header *Elists_Ptr; @@ -279,8 +279,8 @@ void gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED, - struct Node *nodes_ptr, - struct Flags *flags_ptr, + Field_Offset *node_offsets_ptr, + slot *slots_ptr, Node_Id *next_node_ptr, Node_Id *prev_node_ptr, struct Elist_Header *elists_ptr, @@ -305,8 +305,8 @@ gigi (Node_Id gnat_root, max_gnat_nodes = max_gnat_node; - Nodes_Ptr = nodes_ptr; - Flags_Ptr = flags_ptr; + Node_Offsets_Ptr = node_offsets_ptr; + Slots_Ptr = slots_ptr; Next_Node_Ptr = next_node_ptr; Prev_Node_Ptr = prev_node_ptr; Elists_Ptr = elists_ptr; |