aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch13.ads
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2024-05-09 20:18:57 +0200
committerMarc Poulhiès <poulhies@adacore.com>2024-06-14 09:34:17 +0200
commit464f0cb46a17cd4b941f0b3182323a883c59dcf3 (patch)
tree8cb1441a2fc9cc6ed39e0eadea96c4e57a8974a0 /gcc/ada/sem_ch13.ads
parentd3fe0ffdd22bcabcbf03ee936d89ab971fbc74c4 (diff)
downloadgcc-464f0cb46a17cd4b941f0b3182323a883c59dcf3.zip
gcc-464f0cb46a17cd4b941f0b3182323a883c59dcf3.tar.gz
gcc-464f0cb46a17cd4b941f0b3182323a883c59dcf3.tar.bz2
ada: Couple of small cleanups in semantic analysis of aspects
The first cleanup is to expose a consistent interface from Sem_Ch13 for the analysis of aspects at various points of the program. The second cleanup is to fix the awkward implementation of the analysis of the specification for the aspects Stable_Properties, Designated_Storage_Model, Storage_Model_Type and Aggregate, which are always delayed, and the incorrect placement of that of the aspect Local_Restrictions, which is never delayed. gcc/ada/ * freeze.adb (Freeze_All): Call Check_Aspects_At_End_Of_Declarations to perform the visibility check for aspects. * sem_ch13.ads (Check_Aspects_At_End_Of_Declarations): Declare. (Check_Aspect_At_Freeze_Point): Move to... (Check_Aspect_At_End_Of_Declarations): Move to... * sem_ch13.adb (Check_Aspect_At_Freeze_Point): ...here. (Check_Aspect_At_End_Of_Declarations): ...here. (Analyze_Aspect_Specifications): Remove peculiar processing for Stable_Properties, Designated_Storage_Model, Storage_Model_Type and Aggregate. Move that of Local_Restrictions around. Reset Aitem at the beginning of the loop for each aspect. (Check_Aspects_At_End_Of_Declarations): New procedure.
Diffstat (limited to 'gcc/ada/sem_ch13.ads')
-rw-r--r--gcc/ada/sem_ch13.ads14
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/ada/sem_ch13.ads b/gcc/ada/sem_ch13.ads
index 3c48a49..2bdca95 100644
--- a/gcc/ada/sem_ch13.ads
+++ b/gcc/ada/sem_ch13.ads
@@ -312,18 +312,16 @@ package Sem_Ch13 is
-- Quite an awkward approach, but this is an awkard requirement
procedure Analyze_Aspects_At_Freeze_Point (E : Entity_Id);
- -- Analyze all the delayed aspects for entity E at freezing point. This
+ -- Analyzes all the delayed aspects for entity E at freezing point. This
-- includes dealing with inheriting delayed aspects from the parent type
- -- in the case where a derived type is frozen.
+ -- in the case where a derived type is frozen. Callers should check that
+ -- Has_Delayed_Aspects (E) is True before calling this routine.
- procedure Check_Aspect_At_Freeze_Point (ASN : Node_Id);
- -- Performs the processing described above at the freeze point, ASN is the
- -- N_Aspect_Specification node for the aspect.
-
- procedure Check_Aspect_At_End_Of_Declarations (ASN : Node_Id);
+ procedure Check_Aspects_At_End_Of_Declarations (E : Entity_Id);
-- Performs the processing described above at the freeze all point, and
-- issues appropriate error messages if the visibility has indeed changed.
- -- Again, ASN is the N_Aspect_Specification node for the aspect.
+ -- Callers should check that Has_Delayed_Aspects (E) is True before calling
+ -- this routine.
procedure Inherit_Aspects_At_Freeze_Point (Typ : Entity_Id);
-- Given an entity Typ that denotes a derived type or a subtype, this