par_sco.adb, [...]: Minor reformatting.
authorRobert Dewar <dewar@adacore.com>
Fri, 5 Jul 2013 09:47:41 +0000 (09:47 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 5 Jul 2013 09:47:41 +0000 (11:47 +0200)
2013-07-05  Robert Dewar  <dewar@adacore.com>

* par_sco.adb, sem_ch12.adb, par-ch5.adb: Minor reformatting.
* gnat_rm.texi: Document pragma Profile_Warnings.
* restrict.ads, sem_prag.adb: Minor reformatting.

From-SVN: r200695

gcc/ada/ChangeLog
gcc/ada/gnat_rm.texi
gcc/ada/par-ch5.adb
gcc/ada/par_sco.adb
gcc/ada/restrict.ads
gcc/ada/sem_ch12.adb
gcc/ada/sem_prag.adb

index bc4780dac0ea03d5197105aa1c9de290f8df93ff..ca13bc8f3ccb4ce5c3935fe5824bbfaf652cf3f4 100644 (file)
@@ -1,3 +1,9 @@
+2013-07-05  Robert Dewar  <dewar@adacore.com>
+
+       * par_sco.adb, sem_ch12.adb, par-ch5.adb: Minor reformatting.
+       * gnat_rm.texi: Document pragma Profile_Warnings.
+       * restrict.ads, sem_prag.adb: Minor reformatting.
+
 2013-07-05  Ed Schonberg  <schonberg@adacore.com>
 
        * sem_ch12.adb (Check_Formal_Package_Instance): Handle properly
index c70f6186e2e6f0247a9a8d084eb910a3783e95d0..52b036af1b45dc54270d4a90f1bb3440ea45c5fc 100644 (file)
@@ -203,9 +203,8 @@ Implementation Defined Pragmas
 * Pragma Precondition::
 * Pragma Preelaborable_Initialization::
 * Pragma Priority_Specific_Dispatching::
-* Pragma Profile (Ravenscar)::
-* Pragma Profile (Restricted)::
-* Pragma Profile (Rational)::
+* Pragma Profile::
+* Pragma Profile_Warnings::
 * Pragma Psect_Object::
 * Pragma Pure_Function::
 * Pragma Relative_Deadline::
@@ -1001,9 +1000,8 @@ consideration, the use of these pragmas should be minimized.
 * Pragma Precondition::
 * Pragma Preelaborable_Initialization::
 * Pragma Priority_Specific_Dispatching::
-* Pragma Profile (Ravenscar)::
-* Pragma Profile (Restricted)::
-* Pragma Profile (Rational)::
+* Pragma Profile::
+* Pragma Profile_Warnings::
 * Pragma Psect_Object::
 * Pragma Pure_Function::
 * Pragma Relative_Deadline::
@@ -5074,21 +5072,35 @@ inlining (-gnatN option set) are accepted and legality-checked
 by the compiler, but are ignored at run-time even if postcondition
 checking is enabled.
 
-@node Pragma Profile (Ravenscar)
-@unnumberedsec Pragma Profile (Ravenscar)
-@findex Ravenscar
+@node Pragma Profile
+@unnumberedsec Pragma Profile
+@findex Profile
 @noindent
 Syntax:
 
 @smallexample @c ada
-pragma Profile (Ravenscar | Restricted);
+pragma Profile (Ravenscar | Restricted | Rational);
 @end smallexample
 
 @noindent
 This pragma is standard in Ada 2005, but is available in all earlier
 versions of Ada as an implementation-defined pragma. This is a
-configuration pragma that establishes the following set of configuration
-pragmas:
+configuration pragma that establishes a set of configiuration pragmas
+that depend on the argument. @code{Ravenscar} is standard in Ada 2005.
+The other two possibilities (@code{Restricted} or @code{Rational})
+are implementation-defined. The set of configuration pragmas
+is defined in the following sections.
+
+@itemize
+
+@item Pragma Profile (Ravenscar)
+@findex Ravenscar
+@noindent
+
+The @code{Ravenscar} profile is standard in Ada 2005,
+but is available in all earlier
+versions of Ada as an implementation-defined pragma. This profile
+establishes the following set of configuration pragmas:
 
 @table @code
 @item Task_Dispatching_Policy (FIFO_Within_Priorities)
@@ -5172,20 +5184,11 @@ that pragma @code{Profile (Ravenscar)}, like the pragma
 automatically causes the use of a simplified,
 more efficient version of the tasking run-time system.
 
-@node Pragma Profile (Restricted)
-@unnumberedsec Pragma Profile (Restricted)
+@item Pragma Profile (Restricted)
 @findex Restricted Run Time
 @noindent
-Syntax:
-
-@smallexample @c ada
-pragma Profile (Restricted);
-@end smallexample
-
-@noindent
-This is an implementation-defined version of the standard pragma defined
-in Ada 2005. It is available in all versions of Ada. It is a
-configuration pragma that establishes the following set of restrictions:
+This profile corresponds to the GNAT restricted run time. It
+establishes the following set of restrictions:
 
 @itemize @bullet
 @item No_Abort_Statements
@@ -5210,28 +5213,39 @@ This set of restrictions causes the automatic selection of a simplified
 version of the run time that provides improved performance for the
 limited set of tasking functionality permitted by this set of restrictions.
 
-@node Pragma Profile (Rational)
-@unnumberedsec Pragma Profile (Rational)
+@item Pragma Profile (Rational)
 @findex Rational compatibility mode
-@noindent
-Syntax:
-
-@smallexample @c ada
-pragma Profile (Rational);
-@end smallexample
-
 @noindent
 The Rational profile is intended to facilitate porting legacy code that
 compiles with the Rational APEX compiler, even when the code includes non-
 conforming Ada constructs.  The profile enables the following three pragmas:
 
-
 @itemize @bullet
 @item pragma Implicit_Packing
 @item pragma Overriding_Renamings
 @item pragma Use_VADS_Size
 @end itemize
 
+@end itemize
+
+@node Pragma Profile_Warnings
+@unnumberedsec Pragma Profile_Warnings
+@findex Profile_Warnings
+@noindent
+Syntax:
+
+@smallexample @c ada
+pragma Profile_Warnings (Ravenscar | Restricted | Rational);
+@end smallexample
+
+@noindent
+This is an implementation-defined pragma that is similar in
+effect to @code{pragma Profile} except that instead of
+generating @code{Restrictions} pragmas, it generates
+@code{Restriction_Warnings} pragmas. The result is that
+violations of the profile generate warning messages instead
+of error messages.
+
 @noindent
 @node Pragma Psect_Object
 @unnumberedsec Pragma Psect_Object
@@ -20436,3 +20450,4 @@ this kind of implementation dependent addition.
 @contents
 
 @bye
+tablishes the following set of restrictions:
index ac56284d6aa17b02f87e68289fb82e05750d6a28..e9b0a2c8e95cdde3472ac68a092f4fda9f3a8fe1 100644 (file)
@@ -595,7 +595,8 @@ package body Ch5 is
                      --  For statement (labeled loop statement with FOR)
 
                      elsif Token = Tok_For then
-                        Append_To (Statement_List, P_For_Statement (Id_Node));
+                        Append_To (Statement_List,
+                          P_For_Statement (Id_Node));
 
                      --  Improper statement follows label. If we have an
                      --  expression token, then assume the colon was part
index 2b8824cdf0bc2a6b49bb0c2292094b19325c66c3..ce54f117e34ba4c60a0b4a500a508a875df311af 100644 (file)
@@ -2102,6 +2102,7 @@ package body Par_SCO is
             if Nkind (N) /= N_Implicit_Label_Declaration then
                Traverse_One (N);
             end if;
+
             Next (N);
          end loop;
 
index f54fb4b811ab7a746aacebba3f476c0b0c393ef1..181541acc8fe1f7af4b5c0aaf672bcceb1ff7912 100644 (file)
@@ -101,9 +101,9 @@ package Restrict is
      (No_Unchecked_Deallocation,   "a-uncdea"),
      (No_Unchecked_Deallocation,   "unchdeal"));
 
-   --  The following map has True for all GNAT pragmas. It is used to
-   --  implement pragma Restrictions (No_Implementation_Restrictions)
-   --  (which is why this restriction itself is excluded from the list).
+   --  The following map has True for all GNAT-defined Restrictions. It is used
+   --  to implement pragma Restrictions (No_Implementation_Restrictions) (which
+   --  is why this restriction itself is excluded from the list).
 
    Implementation_Restriction : array (All_Restrictions) of Boolean :=
      (Simple_Barriers                    => True,
index ed243ce9930c5bfcf7dd9f8c432bd1eb7a2d32cf..6749f2e436b312c727888cb34639d0bcc9d022b4 100644 (file)
@@ -5226,8 +5226,8 @@ package body Sem_Ch12 is
          --  Ditto for defaulted formal subprograms.
 
          elsif Is_Overloadable (E1)
-           and then Nkind (Unit_Declaration_Node (E2))
-             in N_Formal_Subprogram_Declaration
+           and then Nkind (Unit_Declaration_Node (E2)) in
+                      N_Formal_Subprogram_Declaration
          then
             goto Next_E;
 
index 6a545b4180bd32053446040f46948da9bec3e780..233f83fbbdafd53a0f5c56481c1951a8f9ac3994 100644 (file)
@@ -3746,7 +3746,6 @@ package body Sem_Prag is
       begin
          --  First check pragma arguments
 
-         GNAT_Pragma;
          Check_At_Least_N_Arguments (2);
          Check_At_Most_N_Arguments (4);
          Check_Arg_Order
@@ -5295,7 +5294,6 @@ package body Sem_Prag is
 
       procedure Process_Disable_Enable_Atomic_Sync (Nam : Name_Id) is
       begin
-         GNAT_Pragma;
          Check_No_Identifiers;
          Check_At_Most_N_Arguments (1);
 
@@ -9656,8 +9654,8 @@ package body Sem_Prag is
          --  pragma Check_Name (check_IDENTIFIER);
 
          when Pragma_Check_Name =>
-            Check_No_Identifiers;
             GNAT_Pragma;
+            Check_No_Identifiers;
             Check_Valid_Configuration_Pragma;
             Check_Arg_Count (1);
             Check_Arg_Is_Identifier (Arg1);
@@ -10667,6 +10665,7 @@ package body Sem_Prag is
          --  pragma Disable_Atomic_Synchronization [(Entity)];
 
          when Pragma_Disable_Atomic_Synchronization =>
+            GNAT_Pragma;
             Process_Disable_Enable_Atomic_Sync (Name_Suppress);
 
          -------------------
@@ -11098,6 +11097,7 @@ package body Sem_Prag is
          --  pragma Enable_Atomic_Synchronization [(Entity)];
 
          when Pragma_Enable_Atomic_Synchronization =>
+            GNAT_Pragma;
             Process_Disable_Enable_Atomic_Sync (Name_Unsuppress);
 
          ------------
@@ -11598,6 +11598,18 @@ package body Sem_Prag is
             end case;
          end External_Name_Casing;
 
+         ---------------
+         -- Fast_Math --
+         ---------------
+
+         --  pragma Fast_Math;
+
+         when Pragma_Fast_Math =>
+            GNAT_Pragma;
+            Check_No_Identifiers;
+            Check_Valid_Configuration_Pragma;
+            Fast_Math := True;
+
          --------------------------
          -- Favor_Top_Level --
          --------------------------
@@ -11629,18 +11641,6 @@ package body Sem_Prag is
             end if;
          end Favor_Top_Level;
 
-         ---------------
-         -- Fast_Math --
-         ---------------
-
-         --  pragma Fast_Math;
-
-         when Pragma_Fast_Math =>
-            GNAT_Pragma;
-            Check_No_Identifiers;
-            Check_Valid_Configuration_Pragma;
-            Fast_Math := True;
-
          ---------------------------
          -- Finalize_Storage_Only --
          ---------------------------
@@ -11965,6 +11965,7 @@ package body Sem_Prag is
             Ent : Entity_Id;
 
          begin
+            GNAT_Pragma;
             Check_No_Identifiers;
 
             --  Form with no arguments
@@ -14477,6 +14478,41 @@ package body Sem_Prag is
             Optimize_Alignment_Local := True;
          end Optimize_Alignment;
 
+         -------------
+         -- Ordered --
+         -------------
+
+         --  pragma Ordered (first_enumeration_subtype_LOCAL_NAME);
+
+         when Pragma_Ordered => Ordered : declare
+            Assoc   : constant Node_Id := Arg1;
+            Type_Id : Node_Id;
+            Typ     : Entity_Id;
+
+         begin
+            GNAT_Pragma;
+            Check_No_Identifiers;
+            Check_Arg_Count (1);
+            Check_Arg_Is_Local_Name (Arg1);
+
+            Type_Id := Get_Pragma_Arg (Assoc);
+            Find_Type (Type_Id);
+            Typ := Entity (Type_Id);
+
+            if Typ = Any_Type then
+               return;
+            else
+               Typ := Underlying_Type (Typ);
+            end if;
+
+            if not Is_Enumeration_Type (Typ) then
+               Error_Pragma ("pragma% must specify enumeration type");
+            end if;
+
+            Check_First_Subtype (Arg1);
+            Set_Has_Pragma_Ordered (Base_Type (Typ));
+         end Ordered;
+
          -------------------
          -- Overflow_Mode --
          -------------------
@@ -14557,43 +14593,16 @@ package body Sem_Prag is
             end if;
          end Overflow_Mode;
 
-         when Pragma_Overriding_Renamings =>
-            Overriding_Renamings := True;
-
-         -------------
-         -- Ordered --
-         -------------
-
-         --  pragma Ordered (first_enumeration_subtype_LOCAL_NAME);
+         --------------------------
+         -- Overriding Renamings --
+         --------------------------
 
-         when Pragma_Ordered => Ordered : declare
-            Assoc   : constant Node_Id := Arg1;
-            Type_Id : Node_Id;
-            Typ     : Entity_Id;
+         --  pragma Overriding_Renamings;
 
-         begin
+         when Pragma_Overriding_Renamings =>
             GNAT_Pragma;
-            Check_No_Identifiers;
-            Check_Arg_Count (1);
-            Check_Arg_Is_Local_Name (Arg1);
-
-            Type_Id := Get_Pragma_Arg (Assoc);
-            Find_Type (Type_Id);
-            Typ := Entity (Type_Id);
-
-            if Typ = Any_Type then
-               return;
-            else
-               Typ := Underlying_Type (Typ);
-            end if;
-
-            if not Is_Enumeration_Type (Typ) then
-               Error_Pragma ("pragma% must specify enumeration type");
-            end if;
-
-            Check_First_Subtype (Arg1);
-            Set_Has_Pragma_Ordered (Base_Type (Typ));
-         end Ordered;
+            Check_Arg_Count (0);
+            Overriding_Renamings := True;
 
          ----------
          -- Pack --
@@ -15458,6 +15467,8 @@ package body Sem_Prag is
             GNAT_Pragma;
             Check_Arg_Count (0);
 
+            --  This code does not agree with above (no effect) comment ???
+
             if In_Extended_Main_Source_Unit (N) then
                Propagate_Exceptions := True;
             end if;
@@ -16896,6 +16907,7 @@ package body Sem_Prag is
          --  MODE_TYPE ::= Nominal | Robustness
 
          when Pragma_Test_Case =>
+            GNAT_Pragma;
             Check_Test_Case;
 
          --------------------------