aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-02-24 16:52:45 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2014-02-24 16:52:45 +0100
commite19137bce2231c3494d161746c1485a241056ba3 (patch)
tree45da60a5e29914e3174fcd1b61eae9258a2cbe0e /gcc
parent1037b0f46276a61dc28319562c97180aaaaa9b80 (diff)
downloadgcc-e19137bce2231c3494d161746c1485a241056ba3.zip
gcc-e19137bce2231c3494d161746c1485a241056ba3.tar.gz
gcc-e19137bce2231c3494d161746c1485a241056ba3.tar.bz2
[multiple changes]
2014-02-24 Thomas Quinot <quinot@adacore.com> * par_sco.adb (Traverse_One): Refine categorization of statement SCOs. 2014-02-24 Robert Dewar <dewar@adacore.com> * aspects.ads, aspects.adb: Remove aspects Ada_2005 and Ada_2012, Pure_05, Pure_12 and Preelaborate_05. * gnat_rm.texi: Update accordingly. * sem_prag.adb: Document one argument form of Ada_05/Ada_2005 pragmas Document one argument form of Ada_12/Ada_2012 pragmas Recognize one argument form of these pragmas only in GNAT mode (-gnatg). From-SVN: r208072
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog15
-rw-r--r--gcc/ada/aspects.adb5
-rw-r--r--gcc/ada/aspects.ads22
-rw-r--r--gcc/ada/gnat_rm.texi40
-rw-r--r--gcc/ada/par_sco.adb23
-rw-r--r--gcc/ada/sem_prag.adb20
6 files changed, 78 insertions, 47 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index ffbdcdf..ce741ff 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,18 @@
+2014-02-24 Thomas Quinot <quinot@adacore.com>
+
+ * par_sco.adb (Traverse_One): Refine categorization of statement
+ SCOs.
+
+2014-02-24 Robert Dewar <dewar@adacore.com>
+
+ * aspects.ads, aspects.adb: Remove aspects Ada_2005 and Ada_2012,
+ Pure_05, Pure_12 and Preelaborate_05.
+ * gnat_rm.texi: Update accordingly.
+ * sem_prag.adb: Document one argument form of Ada_05/Ada_2005
+ pragmas Document one argument form of Ada_12/Ada_2012 pragmas
+ Recognize one argument form of these pragmas only in GNAT mode
+ (-gnatg).
+
2014-02-24 Ed Schonberg <schonberg@adacore.com>
* s-dimmks.ads: Replace symbol for temperature, previously the
diff --git a/gcc/ada/aspects.adb b/gcc/ada/aspects.adb
index 3e45c50..fd044fe 100644
--- a/gcc/ada/aspects.adb
+++ b/gcc/ada/aspects.adb
@@ -492,8 +492,6 @@ package body Aspects is
Canonical_Aspect : constant array (Aspect_Id) of Aspect_Id :=
(No_Aspect => No_Aspect,
Aspect_Abstract_State => Aspect_Abstract_State,
- Aspect_Ada_2005 => Aspect_Ada_2005,
- Aspect_Ada_2012 => Aspect_Ada_2005,
Aspect_Address => Aspect_Address,
Aspect_Alignment => Aspect_Alignment,
Aspect_All_Calls_Remote => Aspect_All_Calls_Remote,
@@ -557,12 +555,9 @@ package body Aspects is
Aspect_Precondition => Aspect_Pre,
Aspect_Predicate => Aspect_Predicate,
Aspect_Preelaborate => Aspect_Preelaborate,
- Aspect_Preelaborate_05 => Aspect_Preelaborate_05,
Aspect_Preelaborable_Initialization => Aspect_Preelaborable_Initialization,
Aspect_Priority => Aspect_Priority,
Aspect_Pure => Aspect_Pure,
- Aspect_Pure_05 => Aspect_Pure_05,
- Aspect_Pure_12 => Aspect_Pure_12,
Aspect_Pure_Function => Aspect_Pure_Function,
Aspect_Refined_Depends => Aspect_Refined_Depends,
Aspect_Refined_Global => Aspect_Refined_Global,
diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads
index d0b625e..a5e3bbc 100644
--- a/gcc/ada/aspects.ads
+++ b/gcc/ada/aspects.ads
@@ -146,10 +146,7 @@ package Aspects is
Aspect_Compiler_Unit, -- GNAT
Aspect_Elaborate_Body,
Aspect_Preelaborate,
- Aspect_Preelaborate_05, -- GNAT
Aspect_Pure,
- Aspect_Pure_05, -- GNAT
- Aspect_Pure_12, -- GNAT
Aspect_Remote_Call_Interface,
Aspect_Remote_Types,
Aspect_Shared_Passive,
@@ -162,8 +159,6 @@ package Aspects is
-- the aspect value is inherited from the parent, in which case, we do
-- not allow False if we inherit a True value from the parent.
- Aspect_Ada_2005, -- GNAT
- Aspect_Ada_2012, -- GNAT
Aspect_Async_Readers, -- GNAT
Aspect_Async_Writers, -- GNAT
Aspect_Asynchronous,
@@ -220,8 +215,6 @@ package Aspects is
Implementation_Defined_Aspect : constant array (Aspect_Id) of Boolean :=
(Aspect_Abstract_State => True,
- Aspect_Ada_2005 => True,
- Aspect_Ada_2012 => True,
Aspect_Async_Readers => True,
Aspect_Async_Writers => True,
Aspect_Compiler_Unit => True,
@@ -239,9 +232,6 @@ package Aspects is
Aspect_Object_Size => True,
Aspect_Persistent_BSS => True,
Aspect_Predicate => True,
- Aspect_Preelaborate_05 => True,
- Aspect_Pure_05 => True,
- Aspect_Pure_12 => True,
Aspect_Pure_Function => True,
Aspect_Remote_Access_Type => True,
Aspect_Scalar_Storage_Order => True,
@@ -282,7 +272,7 @@ package Aspects is
-- aspect is enabled. If it is False, the aspect is disabled.
subtype Boolean_Aspects is
- Aspect_Id range Aspect_Ada_2005 .. Aspect_Id'Last;
+ Aspect_Id range Aspect_Async_Readers .. Aspect_Id'Last;
subtype Pre_Post_Aspects is
Aspect_Id range Aspect_Post .. Aspect_Precondition;
@@ -377,8 +367,6 @@ package Aspects is
Aspect_Names : constant array (Aspect_Id) of Name_Id :=
(No_Aspect => No_Name,
Aspect_Abstract_State => Name_Abstract_State,
- Aspect_Ada_2005 => Name_Ada_2005,
- Aspect_Ada_2012 => Name_Ada_2012,
Aspect_Address => Name_Address,
Aspect_Alignment => Name_Alignment,
Aspect_All_Calls_Remote => Name_All_Calls_Remote,
@@ -443,11 +431,8 @@ package Aspects is
Aspect_Predicate => Name_Predicate,
Aspect_Preelaborable_Initialization => Name_Preelaborable_Initialization,
Aspect_Preelaborate => Name_Preelaborate,
- Aspect_Preelaborate_05 => Name_Preelaborate_05,
Aspect_Priority => Name_Priority,
Aspect_Pure => Name_Pure,
- Aspect_Pure_05 => Name_Pure_05,
- Aspect_Pure_12 => Name_Pure_12,
Aspect_Pure_Function => Name_Pure_Function,
Aspect_Read => Name_Read,
Aspect_Refined_Depends => Name_Refined_Depends,
@@ -646,11 +631,8 @@ package Aspects is
Aspect_Predicate => Always_Delay,
Aspect_Preelaborable_Initialization => Always_Delay,
Aspect_Preelaborate => Always_Delay,
- Aspect_Preelaborate_05 => Always_Delay,
Aspect_Priority => Always_Delay,
Aspect_Pure => Always_Delay,
- Aspect_Pure_05 => Always_Delay,
- Aspect_Pure_12 => Always_Delay,
Aspect_Pure_Function => Always_Delay,
Aspect_Read => Always_Delay,
Aspect_Refined_Depends => Always_Delay,
@@ -681,8 +663,6 @@ package Aspects is
Aspect_Write => Always_Delay,
Aspect_Abstract_State => Never_Delay,
- Aspect_Ada_2005 => Never_Delay,
- Aspect_Ada_2012 => Never_Delay,
Aspect_Convention => Never_Delay,
Aspect_Dimension => Never_Delay,
Aspect_Dimension_System => Never_Delay,
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index cdd2f4e..7e02d3b 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -279,8 +279,6 @@ Implementation Defined Pragmas
Implementation Defined Aspects
* Aspect Abstract_State::
-* Aspect Ada_2005::
-* Aspect Ada_2012::
* Aspect Compiler_Unit::
* Aspect Contract_Cases::
* Aspect Depends::
@@ -1188,6 +1186,7 @@ either Ada 83 or Ada 95 programs.
Syntax:
@smallexample @c ada
pragma Ada_05;
+pragma Ada_05 (local_NAME);
@end smallexample
@noindent
@@ -1197,6 +1196,17 @@ This pragma is useful when writing a reusable component that
itself uses Ada 2005 features, but which is intended to be usable from
either Ada 83 or Ada 95 programs.
+The one argument form (which is not a configuration pragma)
+is used for managing the transition from
+Ada 95 to Ada 2005 in the run-time library. If an entity is marked
+as Ada_2005 only, then referencing the entity in Ada_83 or Ada_95
+mode will generate a warning. In addition, in Ada_83 or Ada_95
+mode, a preference rule is established which does not choose
+such an entity unless it is unambiguously specified. This avoids
+extra subprograms marked this way from generating ambiguities in
+otherwise legal pre-Ada_2005 programs. The one argument form is
+intended for exclusive use in the GNAT run-time library.
+
@node Pragma Ada_2005
@unnumberedsec Pragma Ada_2005
@findex Ada_2005
@@ -1217,6 +1227,7 @@ same syntax and effect.
Syntax:
@smallexample @c ada
pragma Ada_12;
+pragma Ada_12 (local_NAME);
@end smallexample
@noindent
@@ -1228,6 +1239,17 @@ contexts. This pragma is useful when writing a reusable component that
itself uses Ada 2012 features, but which is intended to be usable from
Ada 83, Ada 95, or Ada 2005 programs.
+The one argument form, which is not a configuration pragma,
+is used for managing the transition from Ada
+2005 to Ada 2012 in the run-time library. If an entity is marked
+as Ada_201 only, then referencing the entity in any pre-Ada_2012
+mode will generate a warning. In addition, in any pre-Ada_2012
+mode, a preference rule is established which does not choose
+such an entity unless it is unambiguously specified. This avoids
+extra subprograms marked this way from generating ambiguities in
+otherwise legal pre-Ada_2012 programs. The one argument form is
+intended for exclusive use in the GNAT run-time library.
+
@node Pragma Ada_2012
@unnumberedsec Pragma Ada_2012
@findex Ada_2005
@@ -7640,8 +7662,6 @@ clause.
@menu
* Aspect Abstract_State::
-* Aspect Ada_2005::
-* Aspect Ada_2012::
* Aspect Compiler_Unit::
* Aspect Contract_Cases::
* Aspect Depends::
@@ -7686,18 +7706,6 @@ clause.
@noindent
This aspect is equivalent to pragma @code{Abstract_State}.
-@node Aspect Ada_2005
-@unnumberedsec Aspect Ada_2005
-@findex Ada_2005
-@noindent
-This aspect is equivalent to the one argument form of pragma @code{Ada_2005}.
-
-@node Aspect Ada_2012
-@unnumberedsec Aspect Ada_2012
-@findex Ada_2012
-@noindent
-This aspect is equivalent to the one argument form of pragma @code{Ada_2012}.
-
@node Aspect Compiler_Unit
@unnumberedsec Aspect Compiler_Unit
@findex Compiler_Unit
diff --git a/gcc/ada/par_sco.adb b/gcc/ada/par_sco.adb
index ce54f11..97b6f93 100644
--- a/gcc/ada/par_sco.adb
+++ b/gcc/ada/par_sco.adb
@@ -1544,12 +1544,17 @@ package body Par_SCO is
Set_Statement_Entry;
Traverse_Package_Body (N);
- -- Subprogram declaration
+ -- Subprogram declaration or subprogram body stub
when N_Subprogram_Declaration | N_Subprogram_Body_Stub =>
Process_Decisions_Defer
(Parameter_Specifications (Specification (N)), 'X');
+ -- Entry declaration
+
+ when N_Entry_Declaration =>
+ Process_Decisions_Defer (Parameter_Specifications (N), 'X');
+
-- Generic subprogram declaration
when N_Generic_Subprogram_Declaration =>
@@ -1600,7 +1605,7 @@ package body Par_SCO is
-- any decisions in the exit statement expression.
when N_Exit_Statement =>
- Extend_Statement_Sequence (N, ' ');
+ Extend_Statement_Sequence (N, 'E');
Process_Decisions_Defer (Condition (N), 'E');
Set_Statement_Entry;
@@ -2002,7 +2007,7 @@ package body Par_SCO is
-- want one entry in the SCOs, so we take the first, for which
-- Prev_Ids is False.
- when N_Object_Declaration =>
+ when N_Object_Declaration | N_Number_Declaration =>
if not Prev_Ids (N) then
Extend_Statement_Sequence (N, 'o');
@@ -2033,10 +2038,11 @@ package body Par_SCO is
-- no SCO should be generated for this node.
declare
+ NK : constant Node_Kind := Nkind (N);
Typ : Character;
begin
- case Nkind (N) is
+ case NK is
when N_Full_Type_Declaration |
N_Incomplete_Type_Declaration |
N_Private_Type_Declaration |
@@ -2060,8 +2066,15 @@ package body Par_SCO is
N_Protected_Body_Stub =>
Typ := ASCII.NUL;
- when others =>
+ when N_Procedure_Call_Statement =>
Typ := ' ';
+
+ when others =>
+ if NK in N_Statement_Other_Than_Procedure_Call then
+ Typ := ' ';
+ else
+ Typ := 'd';
+ end if;
end case;
if Typ /= ASCII.NUL then
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 94c8c8d..9479cb8 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -10673,6 +10673,16 @@ package body Sem_Prag is
-- Note: these pragmas also have some specific processing in Par.Prag
-- because we want to set the Ada 2005 version mode during parsing.
+ -- The one argument form is used for managing the transition from
+ -- Ada 95 to Ada 2005 in the run-time library. If an entity is marked
+ -- as Ada_2005 only, then referencing the entity in Ada_83 or Ada_95
+ -- mode will generate a warning. In addition, in Ada_83 or Ada_95
+ -- mode, a preference rule is established which does not choose
+ -- such an entity unless it is unambiguously specified. This avoids
+ -- extra subprograms marked this way from generating ambiguities in
+ -- otherwise legal pre-Ada_2005 programs. The one argument form is
+ -- intended for exclusive use in the GNAT run-time library.
+
when Pragma_Ada_05 | Pragma_Ada_2005 => declare
E_Id : Node_Id;
@@ -10722,6 +10732,16 @@ package body Sem_Prag is
-- Note: these pragmas also have some specific processing in Par.Prag
-- because we want to set the Ada 2012 version mode during parsing.
+ -- The one argument form is used for managing the transition from Ada
+ -- 2005 to Ada 2012 in the run-time library. If an entity is marked
+ -- as Ada_201 only, then referencing the entity in any pre-Ada_2012
+ -- mode will generate a warning. In addition, in any pre-Ada_2012
+ -- mode, a preference rule is established which does not choose
+ -- such an entity unless it is unambiguously specified. This avoids
+ -- extra subprograms marked this way from generating ambiguities in
+ -- otherwise legal pre-Ada_2012 programs. The one argument form is
+ -- intended for exclusive use in the GNAT run-time library.
+
when Pragma_Ada_12 | Pragma_Ada_2012 => declare
E_Id : Node_Id;