[gcc r16-1238] ada: Add case for Program_Exit in Exit_Cases
Marc Poulhies
dkm@gcc.gnu.org
Fri Jun 6 08:42:38 GMT 2025
https://gcc.gnu.org/g:028dd931876d2bf7d9d38e3ca93f018d0b51ce6d
commit r16-1238-g028dd931876d2bf7d9d38e3ca93f018d0b51ce6d
Author: Claire Dross <dross@adacore.com>
Date: Fri Jan 17 14:29:47 2025 +0100
ada: Add case for Program_Exit in Exit_Cases
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.
Diff:
---
gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst | 3 ++-
gcc/ada/gnat_rm.texi | 1 +
gcc/ada/gnat_ugn.texi | 2 +-
gcc/ada/sem_prag.adb | 7 +++++--
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
index 685bdde48a5d..cae8c168562b 100644
--- a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
+++ b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
@@ -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
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index c67c198b8c4b..4d984713e020 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -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
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 5331a318c0d8..ca1d7bcc1abf 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -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
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 9964f70ce201..706812313296 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -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)
--
More information about the Gcc-cvs
mailing list