aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2024-04-08 16:26:02 +0200
committerMarc Poulhiès <poulhies@adacore.com>2024-06-10 11:03:58 +0200
commit8d711859139753221d3eef7ba650579a9817677b (patch)
tree8b3d275aea23fdafee5efca46891296e99bf19c3 /gcc
parent731824d08107075d689aec92ea564e0a3ec6d90a (diff)
downloadgcc-8d711859139753221d3eef7ba650579a9817677b.zip
gcc-8d711859139753221d3eef7ba650579a9817677b.tar.gz
gcc-8d711859139753221d3eef7ba650579a9817677b.tar.bz2
ada: Fix handling of aspects CPU and Interrupt_Priority
When resolving aspect expression, aspects CPU and Interrupt_Priority should be handled like the aspect Priority; in particular, all these expressions can reference discriminants of the annotated task type. gcc/ada/ * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Make discriminants visible when analyzing aspect Interrupt_Priority. (Freeze_Entity_Checks): Likewise. (Resolve_Aspect_Expressions): Likewise for both aspects CPU and Interrupt_Priority.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_ch13.adb7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 4cf6fc9..c0a5b6c 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -11107,6 +11107,7 @@ package body Sem_Ch13 is
elsif A_Id in Aspect_CPU
| Aspect_Dynamic_Predicate
| Aspect_Ghost_Predicate
+ | Aspect_Interrupt_Priority
| Aspect_Predicate
| Aspect_Priority
| Aspect_Static_Predicate
@@ -13366,6 +13367,7 @@ package body Sem_Ch13 is
if Get_Aspect_Id (Ritem) in Aspect_CPU
| Aspect_Dynamic_Predicate
| Aspect_Ghost_Predicate
+ | Aspect_Interrupt_Priority
| Aspect_Predicate
| Aspect_Static_Predicate
| Aspect_Priority
@@ -15881,7 +15883,10 @@ package body Sem_Ch13 is
Set_Must_Not_Freeze (Expr);
Preanalyze_Spec_Expression (Expr, E);
- when Aspect_Priority =>
+ when Aspect_CPU
+ | Aspect_Interrupt_Priority
+ | Aspect_Priority
+ =>
Push_Type (E);
Preanalyze_Spec_Expression (Expr, Any_Integer);
Pop_Type (E);