aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2024-05-24 14:14:03 -0700
committerMarc Poulhiès <poulhies@adacore.com>2024-06-20 10:50:57 +0200
commit36bd57330f9b8f06206c909af53cd8b3ca6f6bed (patch)
treec08652c0fd338691d3c172c53e56fd1aaf15c40d
parentecb84b0aa4eac2050eedd7f9a66dd7393d5d31c2 (diff)
downloadgcc-36bd57330f9b8f06206c909af53cd8b3ca6f6bed.zip
gcc-36bd57330f9b8f06206c909af53cd8b3ca6f6bed.tar.gz
gcc-36bd57330f9b8f06206c909af53cd8b3ca6f6bed.tar.bz2
ada: Replace "All" argument to Extensions_Allowed pragma with "All_Extensions"
The argument to pragma Extensions_Allowed to enable all extensions is no longer "All", but instead "All_Extensions". gcc/ada/ * doc/gnat_rm/gnat_language_extensions.rst: Update documentation. * doc/gnat_rm/implementation_defined_pragmas.rst: Update documentation. * errout.adb (Error_Msg_GNAT_Extension): Update error message text. * par-prag.adb: Update pragma parsing. This includes changing the the name of the Check_Arg_Is_On_Or_Off formal parameter All_OK_Too to All_Extensions_OK_Too. * sem_prag.adb (Analyze_Pragma): In analyzing an Extensions_Allowed pragma, replace uses of Name_All with Name_All_Extensions; update a comment to reflect this. * snames.ads-tmpl: Add Name_All_Extensions declaration. * gnat_rm.texi: Regenerate.
-rw-r--r--gcc/ada/doc/gnat_rm/gnat_language_extensions.rst5
-rw-r--r--gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst10
-rw-r--r--gcc/ada/errout.adb10
-rw-r--r--gcc/ada/gnat_rm.texi15
-rw-r--r--gcc/ada/par-prag.adb19
-rw-r--r--gcc/ada/sem_prag.adb6
-rw-r--r--gcc/ada/snames.ads-tmpl1
7 files changed, 36 insertions, 30 deletions
diff --git a/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst b/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst
index f71e8f6..d06ac4c 100644
--- a/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst
+++ b/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst
@@ -37,8 +37,9 @@ file, or in a ``.adc`` file corresponding to your project.
.. attention:: You can activate the extended set of extensions by using either
the ``-gnatX0`` command line flag, or the pragma ``Extensions_Allowed`` with
- ``All`` as an argument. However, it is not recommended you use this subset
- for serious projects, and is only means as a playground/technology preview.
+ ``All_Extensions`` as an argument. However, it is not recommended you use
+ this subset for serious projects; it is only meant as a technology preview
+ for use in playground experiments.
.. _Curated_Language_Extensions:
diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
index 6c08eae..f31a1b9 100644
--- a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
+++ b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
@@ -2208,19 +2208,19 @@ Syntax:
.. code-block:: ada
- pragma Extensions_Allowed (On | Off | All);
+ pragma Extensions_Allowed (On | Off | All_Extensions);
-This configuration pragma enables (via the "On" or "All" argument) or disables
-(via the "Off" argument) the implementation extension mode; the pragma takes
-precedence over the ``-gnatX`` and ``-gnatX0`` command switches.
+This configuration pragma enables (via the "On" or "All_Extensions" argument)
+or disables (via the "Off" argument) the implementation extension mode; the
+pragma takes precedence over the ``-gnatX`` and ``-gnatX0`` command switches.
If an argument of ``"On"`` is specified, the latest version of the Ada language
is implemented (currently Ada 2022) and, in addition, a curated set of GNAT
specific extensions are recognized. (See the list here
:ref:`here<Curated_Language_Extensions>`)
-An argument of ``"All"`` has the same effect except that some extra
+An argument of ``"All_Extensions"`` has the same effect except that some extra
experimental extensions are enabled (See the list here
:ref:`here<Experimental_Language_Extensions>`)
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index c4eab2d..1d82386 100644
--- a/gcc/ada/errout.adb
+++ b/gcc/ada/errout.adb
@@ -902,21 +902,23 @@ package body Errout is
if Is_Core_Extension then
Error_Msg
("\unit must be compiled with -gnatX '[or -gnatX0'] " &
- "or use pragma Extensions_Allowed (On) '[or All']", Loc);
+ "or use pragma Extensions_Allowed (On) '[or All_Extensions']",
+ Loc);
else
Error_Msg
("\unit must be compiled with -gnatX0 " &
- "or use pragma Extensions_Allowed (All)", Loc);
+ "or use pragma Extensions_Allowed (All_Extensions)", Loc);
end if;
else
Error_Msg_Sloc := Sloc (Ada_Version_Pragma);
Error_Msg ("\incompatible with Ada version set#", Loc);
if Is_Core_Extension then
Error_Msg
- ("\must use pragma Extensions_Allowed (On) '[or All']", Loc);
+ ("\must use pragma Extensions_Allowed (On)" &
+ " '[or All_Extensions']", Loc);
else
Error_Msg
- ("\must use pragma Extensions_Allowed (All)", Loc);
+ ("\must use pragma Extensions_Allowed (All_Extensions)", Loc);
end if;
end if;
end Error_Msg_GNAT_Extension;
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index c578502..b80d77e 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -3688,19 +3688,19 @@ GNAT User’s Guide.
Syntax:
@example
-pragma Extensions_Allowed (On | Off | All);
+pragma Extensions_Allowed (On | Off | All_Extensions);
@end example
-This configuration pragma enables (via the “On” or “All” argument) or disables
-(via the “Off” argument) the implementation extension mode; the pragma takes
-precedence over the @code{-gnatX} and @code{-gnatX0} command switches.
+This configuration pragma enables (via the “On” or “All_Extensions” argument)
+or disables (via the “Off” argument) the implementation extension mode; the
+pragma takes precedence over the @code{-gnatX} and @code{-gnatX0} command switches.
If an argument of @code{"On"} is specified, the latest version of the Ada language
is implemented (currently Ada 2022) and, in addition, a curated set of GNAT
specific extensions are recognized. (See the list here
@ref{69,,here})
-An argument of @code{"All"} has the same effect except that some extra
+An argument of @code{"All_Extensions"} has the same effect except that some extra
experimental extensions are enabled (See the list here
@ref{6a,,here})
@@ -28817,8 +28817,9 @@ activate the curated subset of extensions.
@quotation Attention
You can activate the extended set of extensions by using either
the @code{-gnatX0} command line flag, or the pragma @code{Extensions_Allowed} with
-@code{All} as an argument. However, it is not recommended you use this subset
-for serious projects, and is only means as a playground/technology preview.
+@code{All_Extensions} as an argument. However, it is not recommended you use
+this subset for serious projects; it is only meant as a technology preview
+for use in playground experiments.
@end quotation
@end cartouche
diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb
index 88a0439..9e77bf1 100644
--- a/gcc/ada/par-prag.adb
+++ b/gcc/ada/par-prag.adb
@@ -74,11 +74,11 @@ function Prag (Pragma_Node : Node_Id; Semi : Source_Ptr) return Node_Id is
-- is a string literal. If not give error and raise Error_Resync.
procedure Check_Arg_Is_On_Or_Off
- (Arg : Node_Id; All_OK_Too : Boolean := False);
+ (Arg : Node_Id; All_Extensions_OK_Too : Boolean := False);
-- Check the expression of the specified argument to make sure that it
-- is an identifier which is either ON or OFF, and if not, then issue
- -- an error message and raise Error_Resync. If All_OK_Too is True,
- -- then an ALL identifer is also acceptable.
+ -- an error message and raise Error_Resync. If All_Extensions_OK_Too is
+ -- True, then an ALL_EXTENSIONS identifer is also acceptable.
procedure Check_No_Identifier (Arg : Node_Id);
-- Checks that the given argument does not have an identifier. If
@@ -170,21 +170,22 @@ function Prag (Pragma_Node : Node_Id; Semi : Source_Ptr) return Node_Id is
----------------------------
procedure Check_Arg_Is_On_Or_Off
- (Arg : Node_Id; All_OK_Too : Boolean := False)
+ (Arg : Node_Id; All_Extensions_OK_Too : Boolean := False)
is
Argx : constant Node_Id := Expression (Arg);
Error : Boolean := Nkind (Expression (Arg)) /= N_Identifier;
begin
if not Error then
Error := Chars (Argx) not in Name_On | Name_Off
- and then not (All_OK_Too and Chars (Argx) = Name_All);
+ and then not (All_Extensions_OK_Too
+ and then Chars (Argx) = Name_All_Extensions);
end if;
if Error then
Error_Msg_Name_2 := Name_On;
Error_Msg_Name_3 := Name_Off;
- if All_OK_Too then
- Error_Msg_Name_4 := Name_All;
+ if All_Extensions_OK_Too then
+ Error_Msg_Name_4 := Name_All_Extensions;
Error_Msg_N ("argument for pragma% must be% or% or%", Argx);
else
Error_Msg_N ("argument for pragma% must be% or%", Argx);
@@ -433,11 +434,11 @@ begin
when Pragma_Extensions_Allowed =>
Check_Arg_Count (1);
Check_No_Identifier (Arg1);
- Check_Arg_Is_On_Or_Off (Arg1, All_OK_Too => True);
+ Check_Arg_Is_On_Or_Off (Arg1, All_Extensions_OK_Too => True);
if Chars (Expression (Arg1)) = Name_On then
Ada_Version := Ada_With_Core_Extensions;
- elsif Chars (Expression (Arg1)) = Name_All then
+ elsif Chars (Expression (Arg1)) = Name_All_Extensions then
Ada_Version := Ada_With_All_Extensions;
else
Ada_Version := Ada_Version_Explicit;
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 6091b5e..784c9a4 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -17422,17 +17422,17 @@ package body Sem_Prag is
-- Extensions_Allowed --
------------------------
- -- pragma Extensions_Allowed (ON | OFF | ALL);
+ -- pragma Extensions_Allowed (ON | OFF | ALL_EXTENSIONS);
when Pragma_Extensions_Allowed =>
GNAT_Pragma;
Check_Arg_Count (1);
Check_No_Identifiers;
- Check_Arg_Is_One_Of (Arg1, Name_On, Name_Off, Name_All);
+ Check_Arg_Is_One_Of (Arg1, Name_On, Name_Off, Name_All_Extensions);
if Chars (Get_Pragma_Arg (Arg1)) = Name_On then
Ada_Version := Ada_With_Core_Extensions;
- elsif Chars (Get_Pragma_Arg (Arg1)) = Name_All then
+ elsif Chars (Get_Pragma_Arg (Arg1)) = Name_All_Extensions then
Ada_Version := Ada_With_All_Extensions;
else
Ada_Version := Ada_Version_Explicit;
diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl
index 6027864..c624d04 100644
--- a/gcc/ada/snames.ads-tmpl
+++ b/gcc/ada/snames.ads-tmpl
@@ -783,6 +783,7 @@ package Snames is
Name_Address_Type : constant Name_Id := N + $;
Name_Aggregate : constant Name_Id := N + $;
+ Name_All_Extensions : constant Name_Id := N + $;
Name_Allow : constant Name_Id := N + $;
Name_Amount : constant Name_Id := N + $;
Name_As_Is : constant Name_Id := N + $;