+2015-05-22 Eric Botcazou <ebotcazou@adacore.com>
+
+ * einfo.ads (Has_Volatile_Full_Access): Rename into...
+ (Is_Volatile_Full_Access): ...this.
+ (Set_Has_Volatile_Full_Access): Rename into...
+ (Set_Is_Volatile_Full_Access): ...this.
+ * einfo.adb (Has_Volatile_Full_Access): Rename into...
+ (Is_Volatile_Full_Access): ...this.
+ (Set_Has_Volatile_Full_Access): Rename into...
+ (Set_Is_Volatile_Full_Access): ...this.
+ (Is_Atomic_Or_VFA): Adjust to above renaming.
+ * errout.adb (Special_Msg_Delete): Likewise.
+ * exp_pakd.adb (Install_PAT): Likewise.
+ * freeze.adb (Freeze_Array_Type): Likewise.
+ * sem_ch8.adb (Analyze_Object_Renaming): Likewise.
+ * sem_ch13.adb (Inherit_Delayed_Rep_Aspects): Likewise.
+ (Inherit_Aspects_At_Freeze_Point): Likewise.
+ * sem_prag.adb (Set_Atomic_VFA): Likewise.
+ (Process_Atomic_Independent_Shared_Volatile): Likewise.
+ * sem_util.adb (Is_Atomic_Or_VFA_Object): Likewise.
+
2015-05-22 Robert Dewar <dewar@adacore.com>
* exp_ch5.adb, layout.adb, einfo.adb, einfo.ads, sem_prag.adb,
-- Has_Nested_Subprogram Flag282
-- Is_Uplevel_Referenced_Entity Flag283
-- Is_Unimplemented Flag284
- -- Has_Volatile_Full_Access Flag285
+ -- Is_Volatile_Full_Access Flag285
-- Needs_Typedef Flag286
-- (unused) Flag253
return Flag87 (Implementation_Base_Type (Id));
end Has_Volatile_Components;
- function Has_Volatile_Full_Access (Id : E) return B is
- begin
- return Flag285 (Id);
- end Has_Volatile_Full_Access;
-
function Has_Xref_Entry (Id : E) return B is
begin
return Flag182 (Id);
end if;
end Is_Volatile;
+ function Is_Volatile_Full_Access (Id : E) return B is
+ begin
+ return Flag285 (Id);
+ end Is_Volatile_Full_Access;
+
function Itype_Printed (Id : E) return B is
begin
pragma Assert (Is_Itype (Id));
Set_Flag87 (Id, V);
end Set_Has_Volatile_Components;
- procedure Set_Has_Volatile_Full_Access (Id : E; V : B := True) is
- begin
- Set_Flag285 (Id, V);
- end Set_Has_Volatile_Full_Access;
-
procedure Set_Has_Xref_Entry (Id : E; V : B := True) is
begin
Set_Flag182 (Id, V);
Set_Flag16 (Id, V);
end Set_Is_Volatile;
+ procedure Set_Is_Volatile_Full_Access (Id : E; V : B := True) is
+ begin
+ Set_Flag285 (Id, V);
+ end Set_Is_Volatile_Full_Access;
+
procedure Set_Itype_Printed (Id : E; V : B := True) is
begin
pragma Assert (Is_Itype (Id));
function Is_Atomic_Or_VFA (Id : E) return B is
begin
- return Is_Atomic (Id) or else Has_Volatile_Full_Access (Id);
+ return Is_Atomic (Id) or else Is_Volatile_Full_Access (Id);
end Is_Atomic_Or_VFA;
------------------
W ("Has_Uplevel_Reference", Flag215 (Id));
W ("Has_Visible_Refinement", Flag263 (Id));
W ("Has_Volatile_Components", Flag87 (Id));
- W ("Has_Volatile_Full_Access", Flag285 (Id));
W ("Has_Xref_Entry", Flag182 (Id));
W ("In_Package_Body", Flag48 (Id));
W ("In_Private_Part", Flag45 (Id));
W ("Is_Visible_Formal", Flag206 (Id));
W ("Is_Visible_Lib_Unit", Flag116 (Id));
W ("Is_Volatile", Flag16 (Id));
+ W ("Is_Volatile_Full_Access", Flag285 (Id));
W ("Itype_Printed", Flag202 (Id));
W ("Kill_Elaboration_Checks", Flag32 (Id));
W ("Kill_Range_Checks", Flag33 (Id));
-- type the pragma will be chained to the rep item chain of the first
-- subtype in the usual manner.
--- Has_Volatile_Full_Access (Flag285)
--- Defined in all type entities, and also in constants, components and
--- variables. Set if a pragma Volatile_Full_Access applies to the entity.
--- In the case of private and incomplete types, this flag is set in
--- both the partial view and the full view.
-
-- Has_Xref_Entry (Flag182)
-- Defined in all entities. Set if an entity has an entry in the Xref
-- information generated in ali files. This is true for all source
-- optimizations on volatile objects should test Treat_As_Volatile
-- rather than testing this flag.
+-- Is_Volatile_Full_Access (Flag285)
+-- Defined in all type entities, and also in constants, components and
+-- variables. Set if a pragma Volatile_Full_Access applies to the entity.
+-- In the case of private and incomplete types, this flag is set in
+-- both the partial view and the full view.
+
-- Is_Wrapper_Package (synthesized)
-- Defined in package entities. Indicates that the package has been
-- created as a wrapper for a subprogram instantiation.
-- Has_Task (Flag30) (base type only)
-- Has_Unchecked_Union (Flag123) (base type only)
-- Has_Volatile_Components (Flag87) (base type only)
- -- Has_Volatile_Full_Access (Flag285)
-- In_Use (Flag8)
-- Is_Abstract_Type (Flag146)
-- Is_Asynchronous (Flag81)
-- Is_RACW_Stub_Type (Flag244)
-- Is_Unsigned_Type (Flag144)
-- Is_Volatile (Flag16)
+ -- Is_Volatile_Full_Access (Flag285)
-- Itype_Printed (Flag202) (itypes only)
-- Known_To_Have_Preelab_Init (Flag207)
-- May_Inherit_Delayed_Rep_Aspects (Flag262)
-- Related_Type (Node27)
-- Has_Biased_Representation (Flag139)
-- Has_Per_Object_Constraint (Flag154)
- -- Has_Volatile_Full_Access (Flag285)
-- Is_Atomic (Flag85)
-- Is_Independent (Flag268)
-- Is_Return_Object (Flag209)
-- Is_Tag (Flag78)
-- Is_Volatile (Flag16)
+ -- Is_Volatile_Full_Access (Flag285)
-- Treat_As_Volatile (Flag41)
-- Is_Atomic_Or_VFA (synth)
-- Next_Component (synth)
-- Has_Size_Clause (Flag29)
-- Has_Thunks (Flag228) (constants only)
-- Has_Volatile_Components (Flag87)
- -- Has_Volatile_Full_Access (Flag285)
-- Is_Atomic (Flag85)
-- Is_Eliminated (Flag124)
-- Is_Independent (Flag268)
-- Is_True_Constant (Flag163)
-- Is_Uplevel_Referenced_Entity (Flag283)
-- Is_Volatile (Flag16)
+ -- Is_Volatile_Full_Access (Flag285)
-- Optimize_Alignment_Space (Flag241) (constants only)
-- Optimize_Alignment_Time (Flag242) (constants only)
-- Stores_Attribute_Old_Prefix (Flag270) (constants only)
-- Has_Initial_Value (Flag219)
-- Has_Size_Clause (Flag29)
-- Has_Volatile_Components (Flag87)
- -- Has_Volatile_Full_Access (Flag285)
-- Is_Atomic (Flag85)
-- Is_Eliminated (Flag124)
-- Is_Independent (Flag268)
-- Is_True_Constant (Flag163)
-- Is_Uplevel_Referenced_Entity (Flag283)
-- Is_Volatile (Flag16)
+ -- Is_Volatile_Full_Access (Flag285)
-- OK_To_Rename (Flag247)
-- Optimize_Alignment_Space (Flag241)
-- Optimize_Alignment_Time (Flag242)
function Has_Uplevel_Reference (Id : E) return B;
function Has_Visible_Refinement (Id : E) return B;
function Has_Volatile_Components (Id : E) return B;
- function Has_Volatile_Full_Access (Id : E) return B;
function Has_Xref_Entry (Id : E) return B;
function Hiding_Loop_Variable (Id : E) return E;
function Homonym (Id : E) return E;
function Is_Visible_Formal (Id : E) return B;
function Is_Visible_Lib_Unit (Id : E) return B;
function Is_Volatile (Id : E) return B;
+ function Is_Volatile_Full_Access (Id : E) return B;
function Itype_Printed (Id : E) return B;
function Kill_Elaboration_Checks (Id : E) return B;
function Kill_Range_Checks (Id : E) return B;
procedure Set_Has_Uplevel_Reference (Id : E; V : B := True);
procedure Set_Has_Visible_Refinement (Id : E; V : B := True);
procedure Set_Has_Volatile_Components (Id : E; V : B := True);
- procedure Set_Has_Volatile_Full_Access (Id : E; V : B := True);
procedure Set_Has_Xref_Entry (Id : E; V : B := True);
procedure Set_Hiding_Loop_Variable (Id : E; V : E);
procedure Set_Homonym (Id : E; V : E);
procedure Set_Is_Visible_Formal (Id : E; V : B := True);
procedure Set_Is_Visible_Lib_Unit (Id : E; V : B := True);
procedure Set_Is_Volatile (Id : E; V : B := True);
+ procedure Set_Is_Volatile_Full_Access (Id : E; V : B := True);
procedure Set_Itype_Printed (Id : E; V : B := True);
procedure Set_Kill_Elaboration_Checks (Id : E; V : B := True);
procedure Set_Kill_Range_Checks (Id : E; V : B := True);
pragma Inline (Has_Uplevel_Reference);
pragma Inline (Has_Visible_Refinement);
pragma Inline (Has_Volatile_Components);
- pragma Inline (Has_Volatile_Full_Access);
pragma Inline (Has_Xref_Entry);
pragma Inline (Hiding_Loop_Variable);
pragma Inline (Homonym);
pragma Inline (Is_Valued_Procedure);
pragma Inline (Is_Visible_Formal);
pragma Inline (Is_Visible_Lib_Unit);
+ pragma Inline (Is_Volatile_Full_Access);
pragma Inline (Itype_Printed);
pragma Inline (Kill_Elaboration_Checks);
pragma Inline (Kill_Range_Checks);
pragma Inline (Set_Has_Unknown_Discriminants);
pragma Inline (Set_Has_Visible_Refinement);
pragma Inline (Set_Has_Volatile_Components);
- pragma Inline (Set_Has_Volatile_Full_Access);
pragma Inline (Set_Has_Xref_Entry);
pragma Inline (Set_Hiding_Loop_Variable);
pragma Inline (Set_Homonym);
pragma Inline (Set_Is_Visible_Formal);
pragma Inline (Set_Is_Visible_Lib_Unit);
pragma Inline (Set_Is_Volatile);
+ pragma Inline (Set_Is_Volatile_Full_Access);
pragma Inline (Set_Itype_Printed);
pragma Inline (Set_Kill_Elaboration_Checks);
pragma Inline (Set_Kill_Range_Checks);
elsif Msg = "volatile full access to & cannot be guaranteed" then
if Is_Type (E)
- and then Has_Volatile_Full_Access (E)
+ and then Is_Volatile_Full_Access (E)
and then No (Get_Rep_Pragma (E, Name_Volatile_Full_Access))
then
return True;
-- Propagate representation aspects
- Set_Is_Atomic (PAT, Is_Atomic (Typ));
- Set_Is_Independent (PAT, Is_Independent (Typ));
- Set_Has_Volatile_Full_Access (PAT, Has_Volatile_Full_Access (Typ));
- Set_Is_Volatile (PAT, Is_Volatile (Typ));
- Set_Treat_As_Volatile (PAT, Treat_As_Volatile (Typ));
+ Set_Is_Atomic (PAT, Is_Atomic (Typ));
+ Set_Is_Independent (PAT, Is_Independent (Typ));
+ Set_Is_Volatile (PAT, Is_Volatile (Typ));
+ Set_Is_Volatile_Full_Access (PAT, Is_Volatile_Full_Access (Typ));
+ Set_Treat_As_Volatile (PAT, Treat_As_Volatile (Typ));
-- For a non-bit-packed array, propagate reverse storage order
-- flag from original base type to packed array base type.
then
Complain_CS ("atomic");
- elsif Has_Volatile_Full_Access (Ctyp) then
+ elsif Is_Volatile_Full_Access (Ctyp) then
Complain_CS ("volatile full access");
end if;
end Alias_Atomic_Check;
-- Volatile_Full_Access
when Aspect_Volatile_Full_Access =>
- if Has_Volatile_Full_Access (P) then
- Set_Has_Volatile_Full_Access (E);
+ if Is_Volatile_Full_Access (P) then
+ Set_Is_Volatile_Full_Access (E);
end if;
-- Volatile_Components
end if;
when Aspect_Volatile_Full_Access =>
- if not Has_Volatile_Full_Access (Par) then
+ if not Is_Volatile_Full_Access (Par) then
return;
end if;
(Get_Rep_Item (Typ, Name_Atomic, Name_Shared))
then
Set_Is_Atomic (Typ);
- Set_Treat_As_Volatile (Typ);
Set_Is_Volatile (Typ);
+ Set_Treat_As_Volatile (Typ);
end if;
-- Convention
and then Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item
(Get_Rep_Item (Typ, Name_Volatile))
then
- Set_Treat_As_Volatile (Typ);
Set_Is_Volatile (Typ);
+ Set_Treat_As_Volatile (Typ);
end if;
-- Volatile_Full_Access
and then Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item
(Get_Rep_Item (Typ, Name_Volatile_Full_Access))
then
- Set_Has_Volatile_Full_Access (Typ);
- Set_Treat_As_Volatile (Typ);
+ Set_Is_Volatile_Full_Access (Typ);
Set_Is_Volatile (Typ);
+ Set_Treat_As_Volatile (Typ);
end if;
-- Inheritance for derived types only
P : constant Node_Id := Prefix (Nam);
begin
if Is_Entity_Name (P) then
- if Has_Volatile_Full_Access (Entity (P))
+ if Is_Volatile_Full_Access (Entity (P))
or else
- Has_Volatile_Full_Access (Etype (P))
+ Is_Volatile_Full_Access (Etype (P))
then
Error_Msg_N
("cannot rename component of Volatile_Full_Access "
-- 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_Has_Volatile_Full_Access (Id,
- Has_Volatile_Full_Access (Entity (Nam)));
+ Set_Is_Atomic (Id, Is_Atomic (Entity (Nam)));
+ Set_Is_Independent (Id, Is_Independent (Entity (Nam)));
+ Set_Is_Volatile_Full_Access (Id,
+ Is_Volatile_Full_Access (Entity (Nam)));
end if;
-- Treat as volatile if we just set the Volatile flag
Utyp : Entity_Id;
procedure Set_Atomic_VFA (E : Entity_Id);
- -- Set given type as Is_Atomic or Has_Volatile_Full_Access. Also, if
+ -- Set given type as Is_Atomic or Is_Volatile_Full_Access. Also, if
-- no explicit alignment was given, set alignment to unknown, since
-- back end knows what the alignment requirements are for atomic and
-- full access arrays. Note: this is necessary for derived types.
procedure Set_Atomic_VFA (E : Entity_Id) is
begin
if Prag_Id = Pragma_Volatile_Full_Access then
- Set_Has_Volatile_Full_Access (E);
+ Set_Is_Volatile_Full_Access (E);
else
Set_Is_Atomic (E);
end if;
-- Check Atomic and VFA used together
if (Is_Atomic (E) and then Prag_Id = Pragma_Volatile_Full_Access)
- or else (Has_Volatile_Full_Access (E)
+ or else (Is_Volatile_Full_Access (E)
and then (Prag_Id = Pragma_Atomic
or else
Prag_Id = Pragma_Shared))
Prag_Id = Pragma_Volatile_Full_Access
then
if Prag_Id = Pragma_Volatile_Full_Access then
- Set_Has_Volatile_Full_Access (E);
+ Set_Is_Volatile_Full_Access (E);
else
Set_Is_Atomic (E);
end if;
Get_Source_File_Index (Sloc (Utyp))
then
if Prag_Id = Pragma_Volatile_Full_Access then
- Set_Has_Volatile_Full_Access (Utyp);
+ Set_Is_Volatile_Full_Access (Utyp);
else
Set_Is_Atomic (Utyp);
end if;
return Is_Atomic_Object (N)
or else (Is_Object_Reference (N)
and then Is_Entity_Name (N)
- and then (Has_Volatile_Full_Access (Entity (N))
+ and then (Is_Volatile_Full_Access (Entity (N))
or else
- Has_Volatile_Full_Access (Etype (Entity (N)))));
+ Is_Volatile_Full_Access (Etype (Entity (N)))));
end Is_Atomic_Or_VFA_Object;
-------------------------