[COMMITTED] ada: Fix comments for recently added SPARK aspects

Message ID 20230525080551.1956531-1-poulhies@adacore.com
State Accepted
Headers
Series [COMMITTED] ada: Fix comments for recently added SPARK aspects |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Marc Poulhiès May 25, 2023, 8:05 a.m. UTC
  From: Piotr Trojanek <trojanek@adacore.com>

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.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/contracts.adb |  2 ++
 gcc/ada/contracts.ads |  4 ++++
 gcc/ada/sem_prag.adb  | 18 +++++++++---------
 gcc/ada/sem_prag.ads  |  2 ++
 gcc/ada/sinfo.ads     |  2 ++
 5 files changed, 19 insertions(+), 9 deletions(-)
  

Patch

diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb
index c85df0fccc8..e2df8b96a65 100644
--- a/gcc/ada/contracts.adb
+++ b/gcc/ada/contracts.adb
@@ -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
 
diff --git a/gcc/ada/contracts.ads b/gcc/ada/contracts.ads
index a53565fe003..0625b9fc029 100644
--- a/gcc/ada/contracts.ads
+++ b/gcc/ada/contracts.ads
@@ -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);
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 40636f21fc7..d66e5612135 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -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);
diff --git a/gcc/ada/sem_prag.ads b/gcc/ada/sem_prag.ads
index cbeb815ee0e..49c1d0b4892 100644
--- a/gcc/ada/sem_prag.ads
+++ b/gcc/ada/sem_prag.ads
@@ -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
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index e6a27e62cc1..e4fd6794f4b 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -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