]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix comments for recently added SPARK aspects
authorPiotr Trojanek <trojanek@adacore.com>
Sat, 4 Mar 2023 17:07:33 +0000 (18:07 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 25 May 2023 07:44:17 +0000 (09:44 +0200)
Implementation of contract Subprogram_Variant and Exceptional_Cases was
based on the existing code for Contract_Cases, i.e. on the existing
occurrences of Aspect_Contract_Cases, Name_Contract_Cases and
Pragma_Contract_Cases. However, occurrences of "Contract_Cases" itself
in the comments were not updated.

gcc/ada/

* contracts.adb
(Add_Pre_Post_Condition): Mention new aspects in the comment.
* contracts.ads
(Add_Contract_Item): Likewise.
(Analyze_Subprogram_Body_Stub_Contract): Likewise.
* sem_prag.adb
(Contract_Freeze_Error): Likewise.
(Ensure_Aggregate_Form): Likewise.
* sem_prag.ads
(Find_Related_Declaration_Or_Body): Likewise.
* sinfo.ads
(Is_Generic_Contract_Pragma): Likewise.

gcc/ada/contracts.adb
gcc/ada/contracts.ads
gcc/ada/sem_prag.adb
gcc/ada/sem_prag.ads
gcc/ada/sinfo.ads

index c85df0fccc8cc78ef58b5c30800ed81db5a83f67..e2df8b96a65262e81b8b129bf8884cb7bfe9ef97 100644 (file)
@@ -223,11 +223,13 @@ package body Contracts is
       --    Attach_Handler
       --    Contract_Cases
       --    Depends
+      --    Exceptional_Cases
       --    Extensions_Visible
       --    Global
       --    Interrupt_Handler
       --    Postcondition
       --    Precondition
+      --    Subprogram_Variant
       --    Test_Case
       --    Volatile_Function
 
index a53565fe003c753d0bca862ffcfe84397c529701..0625b9fc0295e5f0661fd35ad4ff76b8cd71c724 100644 (file)
@@ -45,6 +45,7 @@ package Contracts is
    --    Depends
    --    Effective_Reads
    --    Effective_Writes
+   --    Exceptional_Cases
    --    Extensions_Visible
    --    Global
    --    Initial_Condition
@@ -58,6 +59,7 @@ package Contracts is
    --    Refined_Global
    --    Refined_Post
    --    Refined_States
+   --    Subprogram_Variant
    --    Test_Case
    --    Volatile_Function
 
@@ -173,12 +175,14 @@ package Contracts is
    --
    --    Contract_Cases
    --    Depends
+   --    Exceptional_Cases
    --    Global
    --    Postcondition
    --    Precondition
    --    Refined_Depends
    --    Refined_Global
    --    Refined_Post
+   --    Subprogram_Variant
    --    Test_Case
 
    procedure Analyze_Task_Contract (Task_Id : Entity_Id);
index 40636f21fc75eb7e2fef32db5a7f42b077ee5488..d66e5612135b43ac4a7cc96ace6569b4133b85cf 100644 (file)
@@ -225,10 +225,10 @@ package body Sem_Prag is
    procedure Contract_Freeze_Error
      (Contract_Id : Entity_Id;
       Freeze_Id   : Entity_Id);
-   --  Subsidiary to the analysis of pragmas Contract_Cases, Part_Of, Post, and
-   --  Pre. Emit a freezing-related error message where Freeze_Id is the entity
-   --  of a body which caused contract freezing and Contract_Id denotes the
-   --  entity of the affected contstruct.
+   --  Subsidiary to the analysis of pragmas Contract_Cases, Exceptional_Cases,
+   --  Part_Of, Post, Pre and Subprogram_Variant. Emit a freezing-related error
+   --  message where Freeze_Id is the entity of a body which caused contract
+   --  freezing and Contract_Id denotes the entity of the affected contstruct.
 
    procedure Duplication_Error (Prag : Node_Id; Prev : Node_Id);
    --  Subsidiary to all Find_Related_xxx routines. Emit an error on pragma
@@ -4515,11 +4515,11 @@ package body Sem_Prag is
 
       procedure Ensure_Aggregate_Form (Arg : Node_Id);
       --  Subsidiary routine to the processing of pragmas Abstract_State,
-      --  Contract_Cases, Depends, Global, Initializes, Refined_Depends,
-      --  Refined_Global, Refined_State and Subprogram_Variant. Transform
-      --  argument Arg into an aggregate if not one already. N_Null is never
-      --  transformed. Arg may denote an aspect specification or a pragma
-      --  argument association.
+      --  Contract_Cases, Depends, Exceptional_Cases, Global, Initializes,
+      --  Refined_Depends, Refined_Global, Refined_State and
+      --  Subprogram_Variant. Transform argument Arg into an aggregate if not
+      --  one already. N_Null is never transformed. Arg may denote an aspect
+      --  specification or a pragma argument association.
 
       procedure Error_Pragma (Msg : String);
       pragma No_Return (Error_Pragma);
index cbeb815ee0e1c66210fec6417da00b40eab2f0ab..49c1d0b48920bdf11639e239c85b07b87773b116 100644 (file)
@@ -447,6 +447,7 @@ package Sem_Prag is
    --  Subsidiary to the analysis of pragmas
    --    Contract_Cases
    --    Depends
+   --    Exceptional_Cases
    --    Extensions_Visible
    --    Global
    --    Initializes
@@ -463,6 +464,7 @@ package Sem_Prag is
    --    Refined_Global
    --    Refined_Post
    --    Refined_State
+   --    Subprogram_Variant
    --    Test_Case
    --    Volatile_Function
    --  as well as attributes 'Old and 'Result. Find the declaration of the
index e6a27e62cc1860d069d930fb340a77f2fbcc9a64..e4fd6794f4b6059ad4a51fc4379b6afb5bee25fd 100644 (file)
@@ -1712,6 +1712,7 @@ package Sinfo is
    --      Abstract_State
    --      Contract_Cases
    --      Depends
+   --      Exceptional_Cases
    --      Extensions_Visible
    --      Global
    --      Initial_Condition
@@ -1726,6 +1727,7 @@ package Sinfo is
    --      Refined_Global
    --      Refined_Post
    --      Refined_State
+   --      Subprogram_Variant
    --      Test_Case
 
    --  Is_Homogeneous_Aggregate