[multiple changes]

2015-05-22  Eric Botcazou  <ebotcazou@adacore.com>

	* sem_ch8.adb (Analyze_Object_Renaming): Copy
	Has_Volatile_Full_Access from renamed to renaming entities.
	* sem_prag.adb (Process_Atomic_Independent_Shared_Volatile):
	Tidy up and remove redundant setting of Has_Volatile_Full_Access.

2015-05-22  Hristian Kirtchev  <kirtchev@adacore.com>

	* ghost.adb (Check_Ghost_Completion): Update references to SPARK
	RM 6.9 rules.
	(Check_Ghost_Policy): Update references to SPARK RM 6.9 rules.
	* sem_ch3.adb (Analyze_Object_Declaration): Update references
	to SPARK RM 6.9 rules.
	(Check_Completion): Ghost entities do not require a special form of
	completion.
	* sem_ch6.adb (Analyze_Generic_Subprogram_Body): Update references
	to SPARK RM 6.9 rules.
	(Analyze_Subprogram_Body_Helper): Update references to SPARK RM 6.9
	rules.
	* sem_ch7.adb (Analyze_Package_Body_Helper): Update references
	to SPARK RM 6.9 rules.
	(Requires_Completion_In_Body): Ghost entities do not require a special
	form of completion.

2015-05-22  Robert Dewar  <dewar@adacore.com>

	* a-csquin.ads: Use Ada 2012 notation.
	* sem_ch8.adb: Minor reformatting.

2015-05-22  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch13.adb (Analyze_Aspect_Specifications): Aspect Import
	acts as a completion.

From-SVN: r223534
This commit is contained in:
Arnaud Charlet 2015-05-22 12:20:00 +02:00
parent 30fc80cfa6
commit c2cfccb1cf
9 changed files with 70 additions and 58 deletions

View File

@ -1,3 +1,38 @@
2015-05-22 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch8.adb (Analyze_Object_Renaming): Copy
Has_Volatile_Full_Access from renamed to renaming entities.
* sem_prag.adb (Process_Atomic_Independent_Shared_Volatile):
Tidy up and remove redundant setting of Has_Volatile_Full_Access.
2015-05-22 Hristian Kirtchev <kirtchev@adacore.com>
* ghost.adb (Check_Ghost_Completion): Update references to SPARK
RM 6.9 rules.
(Check_Ghost_Policy): Update references to SPARK RM 6.9 rules.
* sem_ch3.adb (Analyze_Object_Declaration): Update references
to SPARK RM 6.9 rules.
(Check_Completion): Ghost entities do not require a special form of
completion.
* sem_ch6.adb (Analyze_Generic_Subprogram_Body): Update references
to SPARK RM 6.9 rules.
(Analyze_Subprogram_Body_Helper): Update references to SPARK RM 6.9
rules.
* sem_ch7.adb (Analyze_Package_Body_Helper): Update references
to SPARK RM 6.9 rules.
(Requires_Completion_In_Body): Ghost entities do not require a special
form of completion.
2015-05-22 Robert Dewar <dewar@adacore.com>
* a-csquin.ads: Use Ada 2012 notation.
* sem_ch8.adb: Minor reformatting.
2015-05-22 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specifications): Aspect Import
acts as a completion.
2015-05-22 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb: Minor reformatting.

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2011, Free Software Foundation, Inc. --
-- Copyright (C) 2011-2015, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@ -41,25 +41,13 @@ package Ada.Containers.Synchronized_Queue_Interfaces is
procedure Enqueue
(Container : in out Queue;
New_Item : Element_Type) is abstract;
-- ???
-- This is the official Ada 2012 syntax:
-- with Synchronization => By_Entry;
-- This is the temporary work-around:
pragma Implemented (Enqueue, By_Entry);
New_Item : Element_Type) is abstract
with Synchronization => By_Entry;
procedure Dequeue
(Container : in out Queue;
Element : out Element_Type) is abstract;
-- ???
-- This is the official Ada 2012 syntax:
-- with Synchronization => By_Entry;
-- This is the temporary work-around:
pragma Implemented (Dequeue, By_Entry);
Element : out Element_Type) is abstract
with Synchronization => By_Entry;
function Current_Use (Container : Queue) return Count_Type is abstract;

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2014-2015, Free Software Foundation, Inc. --
-- Copyright (C) 2014-2015, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@ -106,7 +106,7 @@ package body Ghost is
begin
-- The Ghost policy in effect at the point of declaration and at the
-- point of completion must match (SPARK RM 6.9(15)).
-- point of completion must match (SPARK RM 6.9(14)).
if Is_Checked_Ghost_Entity (Partial_View)
and then Policy = Name_Ignore
@ -411,7 +411,7 @@ package body Ghost is
else
Error_Msg_N
("ghost entity cannot appear in this context (SPARK RM 6.9(12))",
("ghost entity cannot appear in this context (SPARK RM 6.9(11))",
Ghost_Ref);
end if;
end Check_Ghost_Context;

View File

@ -3115,6 +3115,7 @@ package body Sem_Ch13 is
then
if A_Id = Aspect_Import then
Set_Is_Imported (E);
Set_Has_Completion (E);
-- An imported entity cannot have an explicit
-- initialization.

View File

@ -4055,7 +4055,7 @@ package body Sem_Ch3 is
-- The Ghost policy in effect at the point of declaration
-- and at the point of completion must match
-- (SPARK RM 6.9(15)).
-- (SPARK RM 6.9(14)).
if Present (Prev_Entity)
and then Is_Ghost_Entity (Prev_Entity)
@ -4237,7 +4237,7 @@ package body Sem_Ch3 is
Set_Is_Ghost_Entity (Id);
-- The Ghost policy in effect at the point of declaration and at the
-- point of completion must match (SPARK RM 6.9(16)).
-- point of completion must match (SPARK RM 6.9(14)).
if Present (Prev_Entity) and then Is_Ghost_Entity (Prev_Entity) then
Check_Ghost_Completion (Prev_Entity, Id);
@ -10937,12 +10937,6 @@ package body Sem_Ch3 is
if Is_Intrinsic_Subprogram (E) then
null;
-- A Ghost entity declared in a non-Ghost package does not force the
-- need for a body (SPARK RM 6.9(11)).
elsif not Is_Ghost_Entity (Pack_Id) and then Is_Ghost_Entity (E) then
null;
-- The following situation requires special handling: a child unit
-- that appears in the context clause of the body of its parent:
@ -19964,7 +19958,7 @@ package body Sem_Ch3 is
Set_Is_Ghost_Entity (Full_T);
-- The Ghost policy in effect at the point of declaration and at the
-- point of completion must match (SPARK RM 6.9(15)).
-- point of completion must match (SPARK RM 6.9(14)).
Check_Ghost_Completion (Priv_T, Full_T);

View File

@ -1267,7 +1267,7 @@ package body Sem_Ch6 is
Set_Is_Ghost_Entity (Body_Id);
-- The Ghost policy in effect at the point of declaration and at
-- the point of completion must match (SPARK RM 6.9(15)).
-- the point of completion must match (SPARK RM 6.9(14)).
Check_Ghost_Completion (Gen_Id, Body_Id);
end if;
@ -3265,7 +3265,7 @@ package body Sem_Ch6 is
Set_Is_Ghost_Entity (Body_Id);
-- The Ghost policy in effect at the point of declaration and
-- at the point of completion must match (SPARK RM 6.9(15)).
-- at the point of completion must match (SPARK RM 6.9(14)).
Check_Ghost_Completion (Spec_Id, Body_Id);
end if;

View File

@ -750,7 +750,7 @@ package body Sem_Ch7 is
Set_Is_Ghost_Entity (Body_Id);
-- The Ghost policy in effect at the point of declaration and at the
-- point of completion must match (SPARK RM 6.9(15)).
-- point of completion must match (SPARK RM 6.9(14)).
Check_Ghost_Completion (Spec_Id, Body_Id);
end if;
@ -2527,12 +2527,6 @@ package body Sem_Ch7 is
then
return False;
-- A Ghost entity declared in a non-Ghost package does not force the
-- need for a body (SPARK RM 6.9(11)).
elsif not Is_Ghost_Entity (Pack_Id) and then Is_Ghost_Entity (Id) then
return False;
-- Otherwise test to see if entity requires a completion. Note that
-- subprogram entities whose declaration does not come from source are
-- ignored here on the basis that we assume the expander will provide an

View File

@ -1344,11 +1344,13 @@ package body Sem_Ch8 is
Set_Is_Volatile (Id, Is_Volatile_Object (Nam));
-- Also copy settings of Is_Atomic and Is_Independent
-- Also copy settings of Atomic/Independent/Volatile_Full_Access
if Is_Entity_Name (Nam) then
Set_Is_Atomic (Id, Is_Atomic (Entity (Nam)));
Set_Is_Independent (Id, Is_Independent (Entity (Nam)));
Set_Is_Atomic (Id, Is_Atomic (Entity (Nam)));
Set_Is_Independent (Id, Is_Independent (Entity (Nam)));
Set_Has_Volatile_Full_Access (Id,
Has_Volatile_Full_Access (Entity (Nam)));
end if;
-- Treat as volatile if we just set the Volatile flag

View File

@ -5910,6 +5910,9 @@ package body Sem_Prag is
Check_First_Subtype (Arg1);
end if;
-- Attribute belongs on the base type. If the view of the type is
-- currently private, it also belongs on the underlying type.
if Prag_Id = Pragma_Atomic
or else
Prag_Id = Pragma_Shared
@ -5917,31 +5920,26 @@ package body Sem_Prag is
Prag_Id = Pragma_Volatile_Full_Access
then
Set_Atomic_Full (E);
Set_Atomic_Full (Underlying_Type (E));
Set_Atomic_Full (Base_Type (E));
Set_Atomic_Full (Underlying_Type (E));
end if;
-- Atomic/Shared/Volatile_Full_Access imply Independent
if Prag_Id /= Pragma_Volatile then
Set_Is_Independent (E);
Set_Is_Independent (Underlying_Type (E));
Set_Is_Independent (Base_Type (E));
Set_Is_Independent (Underlying_Type (E));
if Prag_Id = Pragma_Independent then
Record_Independence_Check (N, Base_Type (E));
end if;
end if;
-- Attribute belongs on the base type. If the view of the type is
-- currently private, it also belongs on the underlying type.
-- Atomic/Shared/Volatile_Full_Access imply Volatile
if Prag_Id /= Pragma_Independent then
if Prag_Id = Pragma_Volatile_Full_Access then
Set_Has_Volatile_Full_Access (Base_Type (E));
Set_Has_Volatile_Full_Access (Underlying_Type (E));
end if;
Set_Is_Volatile (E);
Set_Is_Volatile (Base_Type (E));
Set_Is_Volatile (Underlying_Type (E));
@ -5994,8 +5992,8 @@ package body Sem_Prag is
-- treated as atomic, thus incurring a potentially costly
-- synchronization operation for every access.
-- For Volatile_Full_Access we can do this for elementary
-- types too, since there is no issue of atomic sync.
-- For Volatile_Full_Access we can do this for elementary types
-- too, since there is no issue of atomic synchronization.
-- Of course it would be best if the back end could just adjust
-- the alignment etc for the specific object, but that's not
@ -6010,19 +6008,17 @@ package body Sem_Prag is
and then Sloc (Utyp) > No_Location
and then
Get_Source_File_Index (Sloc (E)) =
Get_Source_File_Index (Sloc (Underlying_Type (Etype (E))))
Get_Source_File_Index (Sloc (Utyp))
then
if Prag_Id = Pragma_Volatile_Full_Access then
Set_Has_Volatile_Full_Access
(Underlying_Type (Etype (E)));
Set_Has_Volatile_Full_Access (Utyp);
else
Set_Is_Atomic
(Underlying_Type (Etype (E)));
Set_Is_Atomic (Utyp);
end if;
end if;
end if;
-- Atomic/Shared imply both Independent and Volatile
-- Atomic/Shared/Volatile_Full_Access imply Independent
if Prag_Id /= Pragma_Volatile then
Set_Is_Independent (E);
@ -6032,6 +6028,8 @@ package body Sem_Prag is
end if;
end if;
-- Atomic/Shared/Volatile_Full_Access imply Volatile
if Prag_Id /= Pragma_Independent then
Set_Is_Volatile (E);
Set_Treat_As_Volatile (E);