aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_util.ads
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-09-07 18:25:23 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-23 04:25:02 -0400
commitb120ca616fc820e352a19523dae34f5c53bfe859 (patch)
treea1c3cdf69ff403e07cabb282d2f6643041a3bdc9 /gcc/ada/sem_util.ads
parent84a5809c7214d103dd2e7f5c352fd99cb8320bb3 (diff)
downloadgcc-b120ca616fc820e352a19523dae34f5c53bfe859.zip
gcc-b120ca616fc820e352a19523dae34f5c53bfe859.tar.gz
gcc-b120ca616fc820e352a19523dae34f5c53bfe859.tar.bz2
[Ada] Implement new legality rules introduced in C.6(12) by AI12-0363
gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst (VFA): Remove uage restrictions in conjunction with Atomic and Aliased. * gnat_rm.texi: Regenerate. * aspects.ads (Aspect_Id): Add Aspect_Full_Access_Only. (Is_Representation_Aspect): Likewise. (Aspect_Names): Likewise. (Aspect_Delay): Likewise. * einfo.ads (Is_Atomic_Or_VFA): Rename into... (Is_Full_Access): ...this. (Is_Volatile_Full_Access): Document new usage for Full_Access_Only. * einfo.adb (Is_Atomic_Or_VFA): Rename into... (Is_Full_Access): ...this. * freeze.ads (Is_Atomic_VFA_Aggregate): Rename into... (Is_Full_Access_Aggregate): ...this. * freeze.adb (Is_Atomic_VFA_Aggregate): Rename into... (Is_Full_Access_Aggregate): ...this. Adjust to above renaming. (Freeze_Array_Type): Likewise. (Freeze_Entity): Likewise. * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Likewise. (Expand_Record_Aggregate): Likewise. * exp_ch4.adb (Expand_N_Op_Eq): Likewise. * exp_ch5.adb (Expand_Assign_Array): Likewise. * exp_ch8.adb (Evaluation_Required): Likewise. * layout.adb (Layout_Type): Likewise. (Set_Composite_Alignment): Likewise. * sem_aux.ads (Has_Rep_Item): Delete. * sem_aux.adb (Has_Rep_Item): Likewise. * sem_attr.adb (Resolve_Attribute) <Attribute_Access>: Implement new legality rules in C.6(12). * sem_ch12.adb (Instantiate_Object): Likewise. * sem_res.adb (Resolve_Actuals): Likewise. * sem_ch13.adb (Inherit_Delayed_Rep_Aspects): Deal with aspect Full_Access_Only. (Check_False_Aspect_For_Derived_Type): Likewise. (Make_Pragma_From_Boolean_Aspect): Test for the presence of Expr. Deal with aspect Full_Access_Only. (Analyze_Aspects_At_Freeze_Point): Likewise. (Analyze_One_Aspect): Do not set Delay_Required to true even for Always_Delay boolean aspects if they have no expression. Force Delay_Required to true for aspect Full_Access_Only in all cases. Reject aspect Full_Access_Only if not in Ada 2020 mode. (Check_Aspect_At_End_Of_Declarations): Deal with empty expression. (Check_Aspect_At_Freeze_Point): Likewise. (Rep_Item_Entity): Delete. (Inherit_Aspects_At_Freeze_Point): Align handling for Bit_Order with that for Scalar_Storage_Order. * sem_prag.adb (Check_Atomic_VFA): Delete. (Check_VFA_Conflicts): Likewise. (Check_Full_Access_Only): New procedure. (Process_Atomic_Independent_Shared_Volatile): Call to implement the new legality checks in C.6(8/2) and mark the entity last. (Analyze_Pragma) <Pragma_Atomic_Components>: Remove obsolete check. * sem_util.ads (Is_Atomic_Or_VFA_Object): Rename into... (Is_Full_Access_Object): ...this. (Is_Subcomponent_Of_Atomic_Object): Rename into... (Is_Subcomponent_Of_Full_Access_Object): ...this. * sem_util.adb (Inherit_Rep_Item_Chain): Use Present_In_Rep_Item. (Is_Atomic_Or_VFA_Object): Rename into... (Is_Full_Access_Object): ...this. (Is_Subcomponent_Of_Atomic_Object): Rename into... (Is_Subcomponent_Of_Full_Access_Object): ...this and adjust. * snames.ads-tmpl (Name_Full_Access_Only): New name of aspect. * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust for renaming. (promote_object_alignment): Likewise. (gnat_to_gnu_field): Likewise. Rename local variable and use specific qualifier in error message for Volatile_Full_Access. * gcc-interface/trans.c (lvalue_required_p): Likewise.
Diffstat (limited to 'gcc/ada/sem_util.ads')
-rw-r--r--gcc/ada/sem_util.ads12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index 2b49a44..f38d0f5 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -1670,10 +1670,6 @@ package Sem_Util is
-- Determine whether arbitrary node N denotes a reference to an atomic
-- object as per RM C.6(7) and the crucial remark in RM C.6(8).
- function Is_Atomic_Or_VFA_Object (N : Node_Id) return Boolean;
- -- Determine whether arbitrary node N denotes a reference to an object
- -- which is either atomic or Volatile_Full_Access.
-
function Is_Attribute_Loop_Entry (N : Node_Id) return Boolean;
-- Determine whether node N denotes attribute 'Loop_Entry
@@ -1909,6 +1905,10 @@ package Sem_Util is
-- Returns True iff the number U is a model number of the fixed-point type
-- T, i.e. if it is an exact multiple of Small.
+ function Is_Full_Access_Object (N : Node_Id) return Boolean;
+ -- Determine whether arbitrary node N denotes a reference to a full access
+ -- object as per Ada 2020 RM C.6(8.2).
+
function Is_Fully_Initialized_Type (Typ : Entity_Id) return Boolean;
-- Typ is a type entity. This function returns true if this type is fully
-- initialized, meaning that an object of the type is fully initialized.
@@ -2173,9 +2173,9 @@ package Sem_Util is
-- meaning that the name of the call denotes a static function
-- and all of the call's actual parameters are given by static expressions.
- function Is_Subcomponent_Of_Atomic_Object (N : Node_Id) return Boolean;
+ function Is_Subcomponent_Of_Full_Access_Object (N : Node_Id) return Boolean;
-- Determine whether arbitrary node N denotes a reference to a subcomponent
- -- of an atomic object as per RM C.6(7).
+ -- of a full access object as per RM C.6(7).
function Is_Subprogram_Contract_Annotation (Item : Node_Id) return Boolean;
-- Determine whether aspect specification or pragma Item is one of the