diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2020-05-14 12:11:52 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-07-08 10:55:53 -0400 |
commit | 6b52c24dd1870aff68879bd68a67fdb14f7e5cba (patch) | |
tree | 9c5518e23b797d89938e7a9110130ed6103e2309 | |
parent | cf6bd6a3ef104abb96095c5d78bffed1a95896f5 (diff) | |
download | gcc-6b52c24dd1870aff68879bd68a67fdb14f7e5cba.zip gcc-6b52c24dd1870aff68879bd68a67fdb14f7e5cba.tar.gz gcc-6b52c24dd1870aff68879bd68a67fdb14f7e5cba.tar.bz2 |
[Ada] Analyze aspects once generic subprograms are recognized
gcc/ada/
* sem_ch12.adb (Analyze_Generic_Subprogram_Declaration): Call
Analyze_Aspect_Specifications after setting Ekind of the
analyzed entity.
* sem_ch13.adb (Analyze_Aspect_Yield): Remove minimal decoration
of generic subprograms.
-rw-r--r-- | gcc/ada/sem_ch12.adb | 14 | ||||
-rw-r--r-- | gcc/ada/sem_ch13.adb | 16 |
2 files changed, 7 insertions, 23 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 11b6ce2..c04a20a 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -3860,13 +3860,6 @@ package body Sem_Ch12 is Enter_Name (Id); Set_Scope_Depth_Value (Id, Scope_Depth (Current_Scope) + 1); - -- Analyze the aspects of the generic copy to ensure that all generated - -- pragmas (if any) perform their semantic effects. - - if Has_Aspects (N) then - Analyze_Aspect_Specifications (N, Id); - end if; - Push_Scope (Id); Enter_Generic_Scope (Id); Set_Inner_Instances (Id, New_Elmt_List); @@ -3880,6 +3873,13 @@ package body Sem_Ch12 is Set_Ekind (Id, E_Generic_Procedure); end if; + -- Analyze the aspects of the generic copy to ensure that all generated + -- pragmas (if any) perform their semantic effects. + + if Has_Aspects (N) then + Analyze_Aspect_Specifications (N, Id); + end if; + -- Set SPARK_Mode from context Set_SPARK_Pragma (Id, SPARK_Mode_Pragma); diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 2131bb3..88d3124 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -2563,22 +2563,6 @@ package body Sem_Ch13 is end if; if Expr_Value then - - -- Adding minimum decoration to generic subprograms to set - -- the Yield attribute (since at this stage it may not be - -- set; see Analyze_Generic_Subprogram_Declaration). - - if Nkind (N) in N_Generic_Subprogram_Declaration - and then Ekind (E) = E_Void - then - if Nkind (Specification (N)) = N_Function_Specification - then - Set_Ekind (E, E_Function); - else - Set_Ekind (E, E_Procedure); - end if; - end if; - Set_Has_Yield_Aspect (E); end if; |