]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 24 Feb 2014 15:52:45 +0000 (16:52 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 24 Feb 2014 15:52:45 +0000 (16:52 +0100)
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

gcc/ada/ChangeLog
gcc/ada/aspects.adb
gcc/ada/aspects.ads
gcc/ada/gnat_rm.texi
gcc/ada/par_sco.adb
gcc/ada/sem_prag.adb

index ffbdcdf7d965b08365b36cb59d3ec7250002336a..ce741ff584f8eaea4e847c221833a66052c2dc3e 100644 (file)
@@ -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
index 3e45c508e76d33c5ef1f19d4fcfdf24edffd849e..fd044fef07f22be476ac074910a0c9137b009f7e 100644 (file)
@@ -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,
index d0b625edc435206fdb4a3021b985824f4779b5a6..a5e3bbc06b4edaf64e065d12cb463e75cc621494 100644 (file)
@@ -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,
index cdd2f4e215e1cf50454b8ac7e6523ced6f3a5ec3..7e02d3bd2997f8d5682e3cf9e8591dc4547a3bc1 100644 (file)
@@ -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
index ce54f117e34ba4c60a0b4a500a508a875df311af..97b6f93e4c5afd4783fec15f8d619f56906ab186 100644 (file)
@@ -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
index 94c8c8d4a977526d62b4d887772a8065771142a9..9479cb8883a2b0ea6bef851e2af846481397a3f8 100644 (file)
@@ -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;