]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Add missing supportive code for recently added SPARK aspects
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 3 Mar 2023 16:45:20 +0000 (17:45 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 25 May 2023 07:44:17 +0000 (09:44 +0200)
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.

gcc/ada/aspects.ads
gcc/ada/sem_prag.ads

index 6670b64ca495e242d3a08402370e996ebd612288..57719672222b00256e9e3bff0cf103c16234b2a8 100644 (file)
@@ -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,
index 993ff7a986b695d1f6419a1f2223fc47f1c90f53..cbeb815ee0e1c66210fec6417da00b40eab2f0ab 100644 (file)
@@ -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 --