[multiple changes]

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.

From-SVN: r216482
This commit is contained in:
Arnaud Charlet 2014-10-20 17:06:52 +02:00
parent c19273ff4a
commit dbb4cfef76
11 changed files with 151 additions and 40 deletions

View file

@ -1,3 +1,37 @@
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.

View file

@ -68,7 +68,7 @@ ALL_ADAFLAGS = \
$(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
@ -111,6 +111,7 @@ ADA_DEPS=case $@ in \
*)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;
@ -145,7 +146,7 @@ ifeq ($(build), $(host))
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"
@ -163,7 +164,7 @@ ifeq ($(build), $(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" \
GNATBIND="gnatbind" \
GNATLINK="gnatlink" \
@ -186,7 +187,7 @@ else
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)" \
@ -201,7 +202,7 @@ else
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)" \
@ -985,6 +986,24 @@ ada/a-tags.o : ada/a-tags.adb ada/a-tags.ads
$< $(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
@ -997,7 +1016,8 @@ ada/mdll-utl.o : ada/mdll-utl.adb ada/mdll.ads ada/mdll-utl.ads ada/sdefault.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.

View file

@ -523,6 +523,12 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks vxworks7,$(target_cpu) $(target_
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 \
@ -586,7 +592,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks vxworks7,$(target_cpu) $(target_
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
@ -871,6 +877,13 @@ endif
# 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 \
@ -921,7 +934,7 @@ ifeq ($(strip $(filter-out %86 wrs vxworks vxworks7,$(target_cpu) $(target_vendo
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
@ -956,6 +969,9 @@ ifeq ($(strip $(filter-out %86 wrs vxworks vxworks7,$(target_cpu) $(target_vendo
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
@ -1149,15 +1165,15 @@ ifeq ($(strip $(filter-out sparc% sun solaris%,$(target_cpu) $(target_vendor) $(
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)
@ -2326,6 +2342,16 @@ ifeq ($(strip $(filter-out darwin%,$(target_os))),)
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

View file

@ -53,6 +53,11 @@ function Prag (Pragma_Node : Node_Id; Semi : Source_Ptr) return Node_Id is
-- 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;
@ -107,6 +112,19 @@ function Prag (Pragma_Node : Node_Id; Semi : Source_Ptr) return Node_Id is
-- 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 --
----------
@ -413,8 +431,8 @@ begin
-- 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);
@ -425,16 +443,12 @@ begin
-- 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;
----------------
@ -448,8 +462,7 @@ begin
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 --

View file

@ -611,7 +611,12 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
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

View file

@ -849,10 +849,8 @@ package body Prj.Conf is
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;

View file

@ -93,4 +93,5 @@ package Prj.Proc is
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;

View file

@ -10664,6 +10664,9 @@ package body Sem_Ch13 is
-- 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;
@ -10700,6 +10703,12 @@ package body Sem_Ch13 is
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)

View file

@ -3846,9 +3846,7 @@ package body Sem_Ch3 is
-- 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);

View file

@ -16416,12 +16416,19 @@ package body Sem_Prag is
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);
-- 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