+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.
-- --
-- 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 --
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;
-- --
-- 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- --
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
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;
then
if A_Id = Aspect_Import then
Set_Is_Imported (E);
+ Set_Has_Completion (E);
-- An imported entity cannot have an explicit
-- initialization.
-- 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)
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);
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:
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);
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;
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;
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;
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
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
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
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));
-- 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
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);
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);