+2014-10-20 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch3.adb, prj-proc.adb, prj-proc.ads, prj-conf.adb: Minor
+ reformatting.
+
+2014-10-20 Robert Dewar <dewar@adacore.com>
+
+ * par-prag.adb (Add_List_Pragma_Entry): New procedure.
+ * par.adb (P_Pragma): Document requirement to handle multiple calls.
+
+2014-10-20 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb (Analyze_Pragma, case No_Elaboration_Code_All):
+ Fix error of bad inheritance of this pragma from with'ed unit.
+
+2014-10-20 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch13.adb (Inherit_Aspects_At_Freeze_Point): For a subtype,
+ inherit convention from parent type, because the subtype may
+ have been declared on a partial view, prior to the pragma on
+ the parent.
+
+2014-10-20 Olivier Hainque <hainque@adacore.com>
+ Tristan Gingold <gingold@adacore.com>
+
+ * gcc-interface/Makefile.in: Handle arm-darwin and VxWorks 7.
+ Misc clean ups.
+
+2014-10-20 Nicolas Roche <roche@adacore.com>
+
+ * gcc-interface/Make-lang.in: ensure that automatically generated
+ dependency are referencing generated gnatvsn rather than original
+ one.
+
2014-10-20 Gary Dismukes <dismukes@adacore.com>
* gnat_ugn.texi: Minor reformatting.
$(CFLAGS) $(ADA_CFLAGS) $(ADAFLAGS) $(CHECKING_ADAFLAGS) $(WARN_ADAFLAGS)
FORCE_DEBUG_ADAFLAGS = -g
ADA_CFLAGS =
-ADA_INCLUDES = -nostdinc -I- -I. -Iada -I$(srcdir)/ada -I$(srcdir)/ada/gcc-interface
+ADA_INCLUDES = -nostdinc -I- -I. -Iada/generated -Iada -I$(srcdir)/ada -I$(srcdir)/ada/gcc-interface
GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc
GNATLIBCFLAGS= -g -O2 $(TCFLAGS)
ADA_INCLUDE_DIR = $(libsubdir)/adainclude
*)a="`echo $@ | sed -e 's/.o$$/.ali/'`"; \
echo "$@: `cat $$a | \
sed -ne 's;^D \([a-z0-9_\.-]*\).*;ada/\1;gp' | \
+ sed -e 's;ada/gnatvsn.ads;ada/generated/gnatvsn.ads;g' | \
tr -d '\015' | tr '\n' ' '`" > $(dir $@)/$(DEPDIR)/$(patsubst %.o,%.Po,$(notdir $@));; \
esac;
CC="../../xgcc -B../../" \
CXX="$(CXX)" \
$(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
- ADA_INCLUDES="-I- -I../rts" \
+ ADA_INCLUDES="-I- -I../generated -I../rts" \
GNATMAKE="../../gnatmake" \
GNATLINK="../../gnatlink" \
GNATBIND="../../gnatbind"
CC="$(CC)" \
CXX="$(CXX)" \
$(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
- ADA_INCLUDES="-I$(RTS_DIR)/../adainclude -I$(RTS_DIR)" \
+ ADA_INCLUDES="-I../generated -I$(RTS_DIR)/../adainclude -I$(RTS_DIR)" \
GNATMAKE="gnatmake" \
GNATBIND="gnatbind" \
GNATLINK="gnatlink" \
CC="$(CC)" \
CXX="$(CXX)" \
$(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
- ADA_INCLUDES="-I../rts" \
+ ADA_INCLUDES="-I../generated -I../rts" \
GNATMAKE="$(GNATMAKE_FOR_HOST)" \
GNATBIND="$(GNATBIND_FOR_HOST)" \
GNATLINK="$(GNATLINK_FOR_HOST)" \
CC="$(CC)" \
CXX="$(CXX)" \
$(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
- ADA_INCLUDES="-I$(RTS_DIR)/../adainclude -I$(RTS_DIR)" \
+ ADA_INCLUDES="-I../generated -I$(RTS_DIR)/../adainclude -I$(RTS_DIR)" \
GNATMAKE="$(GNATMAKE_FOR_HOST)" \
GNATBIND="$(GNATBIND_FOR_HOST)" \
GNATLINK="$(GNATLINK_FOR_HOST)" \
$< $(OUTPUT_OPTION)
@$(ADA_DEPS)
+# Handling of gnatvsn version string
+
+# This ensure the build works even if there is no GNAT_DATE present in the
+# sources
+ada/GNAT_DATE:
+ touch ada/GNAT_DATE
+
+ada/generated/gnatvsn.ads: ada/gnatvsn.ads BASE-VER ada/GNAT_DATE
+ $(MKDIR) ada/generated
+ s=`cat $(srcdir)/BASE-VER | sed -e "s/\([0-9]*\)\.\([0-9]*\)\..*/-\1\2/g"`; \
+ d=`if test -f $(srcdir)/ada/GNAT_DATE; then \
+ cat $(srcdir)/ada/GNAT_DATE; else date +%Y%m%d; fi`; \
+ cat $< | sed -e "/Version/s/(\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\).*)/($$d$$s)/g" >$@
+
+ada/gnatvsn.o : ada/gnatvsn.adb ada/generated/gnatvsn.ads
+ $(CC) -c $(ALL_ADAFLAGS) -Iada/generated -I../ada/generated $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
+ @$(ADA_DEPS)
+
# Dependencies for windows specific tool (mdll)
ada/mdll.o : ada/mdll.adb ada/mdll.ads ada/mdll-fil.ads ada/mdll-utl.ads
$(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(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/treeprs.ads ada/snames.ads ada/snames.adb ada/snames.h \
+ ada/generated/gnatvsn.ads
# 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.
ARCH_STR=ppc
endif
+ ifeq ($(strip $(filter-out vxworks7%, $(target_os))),)
+ SVX=system-vxworks7
+ else
+ SVX=system-vxworks
+ endif
+
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<a-intnam-vxworks.ads \
a-numaux.ads<a-numaux-vxworks.ads \
s-vxwext.ads<s-vxwext-rtp.ads \
s-vxwext.adb<s-vxwext-rtp-smp.adb \
s-tpopsp.adb<s-tpopsp-vxworks-tls.adb \
- system.ads<system-vxworks-$(ARCH_STR)-rtp.ads
+ system.ads<$(SVX)-$(ARCH_STR)-rtp-smp.ads
EH_MECHANISM=-gcc
EXTRA_LIBGNAT_OBJS+=affinity.o sigtramp-vxworks.o
# x86 VxWorks
ifeq ($(strip $(filter-out %86 wrs vxworks vxworks7,$(target_cpu) $(target_vendor) $(target_os))),)
+
+ ifeq ($(strip $(filter-out vxworks7%, $(target_os))),)
+ SVX=system-vxworks7
+ else
+ SVX=system-vxworks
+ endif
+
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<a-intnam-vxworks.ads \
i-vxwork.ads<i-vxwork-x86.ads \
s-vxwext.ads<s-vxwext-rtp.ads \
s-vxwext.adb<s-vxwext-rtp-smp.adb \
s-tpopsp.adb<s-tpopsp-vxworks-tls.adb \
- system.ads<system-vxworks-x86-rtp.ads
+ system.ads<$(SVX)-x86-rtp-smp.ads
EXTRA_LIBGNAT_OBJS+=affinity.o
else
EXTRA_GNATRTL_TASKING_OBJS += s-vxwork.o s-vxwext.o
EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
+
+ GCC_SPEC_FILES+=vxworks-x86-link.spec
+ GCC_SPEC_FILES+=vxworks-smp-x86-link.spec
endif
# ARM VxWorks
s-tasinf.ads<s-tasinf-solaris.ads \
s-taspri.ads<s-taspri-solaris.ads \
s-tpopsp.adb<s-tpopsp-solaris.adb \
- g-soliop.ads<g-soliop-solaris.ads
+ g-soliop.ads<g-soliop-solaris.ads \
+ $(ATOMICS_TARGET_PAIRS) \
+ $(ATOMICS_BUILTINS_TARGET_PAIRS)
LIBGNAT_TARGET_PAIRS_32 = \
system.ads<system-solaris-sparc.ads
LIBGNAT_TARGET_PAIRS_64 = \
- system.ads<system-solaris-sparcv9.ads \
- $(ATOMICS_TARGET_PAIRS) \
- $(ATOMICS_BUILTINS_TARGET_PAIRS)
+ system.ads<system-solaris-sparcv9.ads
ifeq ($(strip $(filter-out sparc sun solaris%,$(target_cpu) $(target_vendor) $(target_os))),)
ifeq ($(strip $(MULTISUBDIR)),/sparcv9)
endif
endif
+ ifeq ($(strip $(filter-out arm,$(arch))),)
+ LIBGNAT_TARGET_PAIRS += \
+ s-intman.adb<s-intman-susv3.adb \
+ s-osprim.adb<s-osprim-darwin.adb \
+ $(ATOMICS_TARGET_PAIRS)
+
+ LIBGNAT_TARGET_PAIRS += \
+ system.ads<system-darwin-arm.ads
+ endif
+
TOOLS_TARGET_PAIRS = \
mlib-tgt-specific.adb<mlib-tgt-specific-darwin.adb \
indepsw.adb<indepsw-darwin.adb
-- Local Subprograms --
-----------------------
+ procedure Add_List_Pragma_Entry (PT : List_Pragma_Type; Loc : Source_Ptr);
+ -- Make a new entry in the List_Pragmas table if this entry is not already
+ -- in the table (it will always be the last one if there is a duplication
+ -- resulting from the use of Save/Restore_Scan_State).
+
function Arg1 return Node_Id;
function Arg2 return Node_Id;
function Arg3 return Node_Id;
-- Note that we don't need to do full error checking for badly formed cases
-- of restrictions, since these will be caught during semantic analysis.
+ ---------------------------
+ -- Add_List_Pragma_Entry --
+ ---------------------------
+
+ procedure Add_List_Pragma_Entry (PT : List_Pragma_Type; Loc : Source_Ptr) is
+ begin
+ if List_Pragmas.Last < List_Pragmas.First
+ or else (List_Pragmas.Table (List_Pragmas.Last)) /= ((PT, Loc))
+ then
+ List_Pragmas.Append ((PT, Loc));
+ end if;
+ end Add_List_Pragma_Entry;
+
----------
-- Arg1 --
----------
-- pragma List (Off | On)
- -- The processing for pragma List must be done at parse time,
- -- since a listing can be generated in parse only mode.
+ -- The processing for pragma List must be done at parse time, since a
+ -- listing can be generated in parse only mode.
when Pragma_List =>
Check_Arg_Count (1);
-- in the List (Off) case, the pragma will print even in a region
-- of code with listing turned off (this is required).
- List_Pragmas.Increment_Last;
- List_Pragmas.Table (List_Pragmas.Last) :=
- (Ptyp => List_On, Ploc => Sloc (Pragma_Node));
+ Add_List_Pragma_Entry (List_On, Sloc (Pragma_Node));
-- Now generate the list off entry for pragma List (Off)
if Chars (Expression (Arg1)) = Name_Off then
- List_Pragmas.Increment_Last;
- List_Pragmas.Table (List_Pragmas.Last) :=
- (Ptyp => List_Off, Ploc => Semi);
+ Add_List_Pragma_Entry (List_Off, Semi);
end if;
----------------
when Pragma_Page =>
Check_Arg_Count (0);
- List_Pragmas.Increment_Last;
- List_Pragmas.Table (List_Pragmas.Last) := (Page, Semi);
+ Add_List_Pragma_Entry (Page, Semi);
------------------
-- Restrictions --
function P_Pragma (Skipping : Boolean := False) return Node_Id;
-- Scan out a pragma. If Skipping is True, then the caller is skipping
-- the pragma in the context of illegal placement (this is used to avoid
- -- some junk cascaded messages).
+ -- some junk cascaded messages). Some pragmas must be dealt with during
+ -- the parsing phase (e.g. pragma Page, since we can generate a listing
+ -- in syntax only mode). It is possible that the parser uses the rescan
+ -- logic (using Save/Restore_Scan_State) with the effect of calling this
+ -- procedure more than once for the same pragma. All parse-time pragma
+ -- handling must be prepared to handle such multiple calls correctly.
function P_Identifier (C : Id_Check := None) return Node_Id;
-- Scans out an identifier. The parameter C determines the treatment
begin
Proj := Project;
-
while Proj /= No_Project loop
Id := Value_Of (Name_Runtime, Proj.Decl.Arrays, Shared);
-
while Id /= No_Array_Element loop
Element := Shared.Array_Elements.Table (Id);
Lang := Element.Index;
when List =>
case The_Default is
- when Read_Only_Value =>
+ when Read_Only_Value =>
null;
- when Empty_Value =>
+ when Empty_Value =>
The_Variable.Values := Nil_String;
- when Dot_Value =>
+ when Dot_Value =>
The_Variable.Values :=
Shared.Dot_String_List;
when Object_Dir_Value |
- Target_Value |
- Runtime_Value =>
+ Target_Value |
+ Runtime_Value =>
null;
end case;
end case;
procedure Set_Default_Runtime_For (Language : Name_Id; Value : String);
-- Set the default value for the runtime of Language. To be used for the
-- value of 'Runtime(<Language>) when Runtime (<language>) is not declared.
+
end Prj.Proc;
-- Component_Size, Machine_Radix, Object_Size, Pack, Predicates,
-- Preelaborable_Initialization, RM_Size and Small.
+ -- In addition, Convention must be propagated from base type to subtype,
+ -- because the subtype may have been declared on an incomplete view.
+
if Nkind (Parent (Typ)) = N_Private_Extension_Declaration then
return;
end if;
Set_Is_Volatile (Typ);
end if;
+ -- Convention
+
+ if Typ /= Base_Type (Typ) and then Is_Frozen (Base_Type (Typ)) then
+ Set_Convention (Typ, Convention (Base_Type (Typ)));
+ end if;
+
-- Default_Component_Value
if Is_Array_Type (Typ)
-- for discriminants and are thus not indefinite.
elsif Is_Unchecked_Union (T) then
- if Constant_Present (N)
- or else Nkind (E) = N_Function_Call
- then
+ if Constant_Present (N) or else Nkind (E) = N_Function_Call then
Set_Ekind (Id, E_Constant);
else
Set_Ekind (Id, E_Variable);
Rewrite (N,
Make_Object_Renaming_Declaration (Loc,
- Defining_Identifier => Id,
- Subtype_Mark => New_Occurrence_Of (T, Loc),
- Name => E));
+ Defining_Identifier => Id,
+ Subtype_Mark => New_Occurrence_Of (T, Loc),
+ Name => E));
Set_Renamed_Object (Id, E);
Freeze_Before (N, T);
Set_No_Elab_Code_All (Current_Sem_Unit);
- -- Set restriction No_Elaboration_Code, including adding it to the
- -- set of configuration restrictions so it will apply to all units
- -- in the extended main source.
+ -- Set restriction No_Elaboration_Code
Set_Restriction (No_Elaboration_Code, N);
- Add_To_Config_Boolean_Restrictions (No_Elaboration_Code);
+
+ -- If we are in the main unit or in an extended main source unit,
+ -- then we also add it to the configuration restrictions so that
+ -- it will apply to all units in the extended main source.
+
+ if Current_Sem_Unit = Main_Unit
+ or else In_Extended_Main_Source_Unit (N)
+ then
+ Add_To_Config_Boolean_Restrictions (No_Elaboration_Code);
+ end if;
-- If in main extended unit, activate transitive with test