* [COMMITTED] ada: Add missing supportive code for recently added SPARK aspects
@ 2023-05-25 8:05 Marc Poulhiès
0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2023-05-25 8:05 UTC (permalink / raw)
To: gcc-patches; +Cc: Piotr Trojanek
From: Piotr Trojanek <trojanek@adacore.com>
Fix minor inconsistencies with the recently added SPARK aspects
Exceptional_Cases and Subprogram_Variant, whose implementation is based
on Contract_Cases.
gcc/ada/
* aspects.ads
(Implementation_Defined_Aspect): Recently added aspects are
implementation-defined, just like Contract_Cases.
* sem_prag.ads
(Aspect_Specifying_Pragma): Recently added aspects have corresponding
pragmas, just like Contract_Cases.
(Pragma_Significant_To_Subprograms): Recently added aspects are
significant to subprograms, just like Contract_Cases.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/aspects.ads | 2 ++
gcc/ada/sem_prag.ads | 46 ++++++++++++++++++++++++--------------------
2 files changed, 27 insertions(+), 21 deletions(-)
diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads
index 6670b64ca49..57719672222 100644
--- a/gcc/ada/aspects.ads
+++ b/gcc/ada/aspects.ads
@@ -270,6 +270,7 @@ package Aspects is
Aspect_Dimension_System => True,
Aspect_Effective_Reads => True,
Aspect_Effective_Writes => True,
+ Aspect_Exceptional_Cases => True,
Aspect_Extensions_Visible => True,
Aspect_Favor_Top_Level => True,
Aspect_Ghost => True,
@@ -292,6 +293,7 @@ package Aspects is
Aspect_Shared => True,
Aspect_Simple_Storage_Pool => True,
Aspect_Simple_Storage_Pool_Type => True,
+ Aspect_Subprogram_Variant => True,
Aspect_Suppress_Debug_Info => True,
Aspect_Suppress_Initialization => True,
Aspect_Thread_Local_Storage => True,
diff --git a/gcc/ada/sem_prag.ads b/gcc/ada/sem_prag.ads
index 993ff7a986b..cbeb815ee0e 100644
--- a/gcc/ada/sem_prag.ads
+++ b/gcc/ada/sem_prag.ads
@@ -59,6 +59,7 @@ package Sem_Prag is
Pragma_Effective_Reads => True,
Pragma_Effective_Writes => True,
Pragma_Elaborate_Body => True,
+ Pragma_Exceptional_Cases => True,
Pragma_Export => True,
Pragma_Extensions_Visible => True,
Pragma_Favor_Top_Level => True,
@@ -109,6 +110,7 @@ package Sem_Prag is
Pragma_Simple_Storage_Pool_Type => True,
Pragma_SPARK_Mode => True,
Pragma_Storage_Size => True,
+ Pragma_Subprogram_Variant => True,
Pragma_Suppress => True,
Pragma_Suppress_Debug_Info => True,
Pragma_Suppress_Initialization => True,
@@ -208,27 +210,29 @@ package Sem_Prag is
-- of subprogram bodies.
Pragma_Significant_To_Subprograms : constant array (Pragma_Id) of Boolean :=
- (Pragma_Contract_Cases => True,
- Pragma_Depends => True,
- Pragma_Ghost => True,
- Pragma_Global => True,
- Pragma_Inline => True,
- Pragma_Inline_Always => True,
- Pragma_Post => True,
- Pragma_Post_Class => True,
- Pragma_Postcondition => True,
- Pragma_Pre => True,
- Pragma_Pre_Class => True,
- Pragma_Precondition => True,
- Pragma_Pure => True,
- Pragma_Pure_Function => True,
- Pragma_Refined_Depends => True,
- Pragma_Refined_Global => True,
- Pragma_Refined_Post => True,
- Pragma_Refined_State => True,
- Pragma_Volatile => True,
- Pragma_Volatile_Function => True,
- others => False);
+ (Pragma_Contract_Cases => True,
+ Pragma_Depends => True,
+ Pragma_Exceptional_Cases => True,
+ Pragma_Ghost => True,
+ Pragma_Global => True,
+ Pragma_Inline => True,
+ Pragma_Inline_Always => True,
+ Pragma_Post => True,
+ Pragma_Post_Class => True,
+ Pragma_Postcondition => True,
+ Pragma_Pre => True,
+ Pragma_Pre_Class => True,
+ Pragma_Precondition => True,
+ Pragma_Pure => True,
+ Pragma_Pure_Function => True,
+ Pragma_Refined_Depends => True,
+ Pragma_Refined_Global => True,
+ Pragma_Refined_Post => True,
+ Pragma_Refined_State => True,
+ Pragma_Subprogram_Variant => True,
+ Pragma_Volatile => True,
+ Pragma_Volatile_Function => True,
+ others => False);
-----------------
-- Subprograms --
--
2.40.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-25 8:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-25 8:05 [COMMITTED] ada: Add missing supportive code for recently added SPARK aspects Marc Poulhiès
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).