+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
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,
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,
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,
-- 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,
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,
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,
-- 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;
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,
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,
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,
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,
Implementation Defined Aspects
* Aspect Abstract_State::
-* Aspect Ada_2005::
-* Aspect Ada_2012::
* Aspect Compiler_Unit::
* Aspect Contract_Cases::
* Aspect Depends::
Syntax:
@smallexample @c ada
pragma Ada_05;
+pragma Ada_05 (local_NAME);
@end smallexample
@noindent
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
Syntax:
@smallexample @c ada
pragma Ada_12;
+pragma Ada_12 (local_NAME);
@end smallexample
@noindent
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
@menu
* Aspect Abstract_State::
-* Aspect Ada_2005::
-* Aspect Ada_2012::
* Aspect Compiler_Unit::
* Aspect Contract_Cases::
* Aspect Depends::
@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
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 =>
-- 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;
-- 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');
-- 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 |
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
-- 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;
-- 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;