]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Add case for Program_Exit in Exit_Cases
authorClaire Dross <dross@adacore.com>
Fri, 17 Jan 2025 13:29:47 +0000 (14:29 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 6 Jun 2025 08:37:13 +0000 (10:37 +0200)
Extend the syntax for Exit_Cases to support exiting the program.

gcc/ada/ChangeLog:

* doc/gnat_rm/implementation_defined_pragmas.rst
(Pragma Exit_Cases): Update the documentation for Exit_Cases.
* sem_prag.adb
(Anlayze_Pragma): Accept Program_Exit as an exit kind.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.

gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
gcc/ada/gnat_rm.texi
gcc/ada/gnat_ugn.texi
gcc/ada/sem_prag.adb

index 685bdde48a5dc6a84feadb027f1273685b338795..cae8c168562b61d13092e272beb5552348085af9 100644 (file)
@@ -1940,7 +1940,8 @@ Syntax:
   EXIT_CASE      ::= GUARD => EXIT_KIND
   EXIT_KIND      ::= Normal_Return
                    | Exception_Raised
-                  | (Exception_Raised => exception_name)
+                   | (Exception_Raised => exception_name)
+                   | Program_Exit
   GUARD          ::= Boolean_expression
 
 For the semantics of this aspect, see the SPARK 2014 Reference Manual, section
index c67c198b8c4b3b7af01acacd9093864a32c6d0b1..4d984713e0200627f96564792cf149bf6a977d95 100644 (file)
@@ -3474,6 +3474,7 @@ EXIT_CASE      ::= GUARD => EXIT_KIND
 EXIT_KIND      ::= Normal_Return
                  | Exception_Raised
                  | (Exception_Raised => exception_name)
+                 | Program_Exit
 GUARD          ::= Boolean_expression
 @end example
 
index 5331a318c0d875d1f7a4307a535b3cb6df5a0c5f..ca1d7bcc1abf2925498bb0c80df47603b5eef884 100644 (file)
@@ -29833,8 +29833,8 @@ to permit their use in free software.
 
 @printindex ge
 
-@anchor{d2}@w{                              }
 @anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{                              }
+@anchor{d2}@w{                              }
 
 @c %**end of body
 @bye
index 9964f70ce201705958cf85c76b4e7ce30fd84ebf..706812313296362e4027c82d8425cbd4cbc5a647 100644 (file)
@@ -2642,14 +2642,16 @@ package body Sem_Prag is
             end if;
 
             --  Check the exit kind. It shall be either an exception or the
-            --  identifiers Normal_Return or Any_Exception.
+            --  identifiers Normal_Return, Exception_Raised, or Program_Exit.
 
             if Nkind (Exit_Kind) = N_Identifier then
                if Chars (Exit_Kind) not in Name_Normal_Return
                                          | Name_Exception_Raised
+                                         | Name_Program_Exit
                then
                   Error_Msg_N
-                    ("exit kind should be Normal_Return or Exception_Raised",
+                    ("exit kind should be Normal_Return, Exception_Raised, " &
+                       "or Program_Exit",
                      Exit_Kind);
                end if;
 
@@ -17438,6 +17440,7 @@ package body Sem_Prag is
          --
          --    EXIT_KIND ::=
          --      Normal_Return
+         --    | Program_Exit
          --    | Exception_Raised
          --    | (Exception_Raised => exception_name)
          --