diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2023-03-04 18:07:33 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-05-25 09:44:17 +0200 |
commit | 54d8dbebf1b1b7f2ff5dcaa50a7b17c116ddb60f (patch) | |
tree | 0cb36a813510f27f7fe40c444ba8f21a9449523c | |
parent | 2288b12cfe60f7bf65f382951449b070f9067da7 (diff) | |
download | gcc-54d8dbebf1b1b7f2ff5dcaa50a7b17c116ddb60f.zip gcc-54d8dbebf1b1b7f2ff5dcaa50a7b17c116ddb60f.tar.gz gcc-54d8dbebf1b1b7f2ff5dcaa50a7b17c116ddb60f.tar.bz2 |
ada: Fix comments for recently added SPARK aspects
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.
-rw-r--r-- | gcc/ada/contracts.adb | 2 | ||||
-rw-r--r-- | gcc/ada/contracts.ads | 4 | ||||
-rw-r--r-- | gcc/ada/sem_prag.adb | 18 | ||||
-rw-r--r-- | gcc/ada/sem_prag.ads | 2 | ||||
-rw-r--r-- | gcc/ada/sinfo.ads | 2 |
5 files changed, 19 insertions, 9 deletions
diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb index c85df0f..e2df8b9 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 a53565f..0625b9f 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 40636f2..d66e561 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 cbeb815..49c1d0b 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 e6a27e6..e4fd679 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 |