]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
types.ads, [...]: Minor reformatting.
authorRobert Dewar <dewar@adacore.com>
Fri, 4 Jan 2013 09:28:49 +0000 (09:28 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 4 Jan 2013 09:28:49 +0000 (10:28 +0100)
2013-01-04  Robert Dewar  <dewar@adacore.com>

* types.ads, prj-conf.adb, par-tchk.adb: Minor reformatting.

2013-01-04  Robert Dewar  <dewar@adacore.com>

* par-ch6.adb (P_Subprogram): Better handling of missing IS
after expression function.
* par-util.adb (No_Constraint): Improve handling to avoid bad warnings.

2013-01-04  Robert Dewar  <dewar@adacore.com>

* exp_util.ads, exp_util.adb (Insert_Actions): In expression with
actions case, new actions are appended to the sequence rather than
prepended.

2013-01-04  Robert Dewar  <dewar@adacore.com>

* gnat_ugn.texi: Document -gnatw.d/w.D (does no apply in VMS mode).
* usage.adb: Add lines for -gnatw.d/w.D switches.
* warnsw.adb: Minor fixes (some missing cases of setting
Warning_Doc_Switch). Reject -gnatw.d and -gnatw.D in VMS mode.

From-SVN: r194895

gcc/ada/ChangeLog
gcc/ada/exp_util.adb
gcc/ada/exp_util.ads
gcc/ada/gnat_ugn.texi
gcc/ada/par-ch6.adb
gcc/ada/par-tchk.adb
gcc/ada/par-util.adb
gcc/ada/prj-conf.adb
gcc/ada/types.ads
gcc/ada/usage.adb
gcc/ada/warnsw.adb

index 42768377489e018ed63dc536d941cf988235e0ef..1a8e0daefc8248246dc0b0cc1aaa28b8e33f449f 100644 (file)
@@ -1,3 +1,26 @@
+2013-01-04  Robert Dewar  <dewar@adacore.com>
+
+       * types.ads, prj-conf.adb, par-tchk.adb: Minor reformatting.
+
+2013-01-04  Robert Dewar  <dewar@adacore.com>
+
+       * par-ch6.adb (P_Subprogram): Better handling of missing IS
+       after expression function.
+       * par-util.adb (No_Constraint): Improve handling to avoid bad warnings.
+
+2013-01-04  Robert Dewar  <dewar@adacore.com>
+
+       * exp_util.ads, exp_util.adb (Insert_Actions): In expression with
+       actions case, new actions are appended to the sequence rather than
+       prepended.
+
+2013-01-04  Robert Dewar  <dewar@adacore.com>
+
+       * gnat_ugn.texi: Document -gnatw.d/w.D (does no apply in VMS mode).
+       * usage.adb: Add lines for -gnatw.d/w.D switches.
+       * warnsw.adb: Minor fixes (some missing cases of setting
+       Warning_Doc_Switch). Reject -gnatw.d and -gnatw.D in VMS mode.
+
 2013-01-04  Robert Dewar  <dewar@adacore.com>
 
        * exp_util.adb (Remove_Side_Effects): Make sure scope suppress
index 883effee6c1595b6392e953d3ee2d4b547d118f8..2ca174eed909c0b24afb29a7d57e1afc9c254220 100644 (file)
@@ -3138,7 +3138,7 @@ package body Exp_Util is
         and then not Is_Frozen (Current_Scope)
       then
          if No (Scope_Stack.Table
-           (Scope_Stack.Last).Pending_Freeze_Actions)
+                  (Scope_Stack.Last).Pending_Freeze_Actions)
          then
             Scope_Stack.Table (Scope_Stack.Last).Pending_Freeze_Actions :=
               Ins_Actions;
@@ -3306,13 +3306,13 @@ package body Exp_Util is
                return;
 
             --  Case of appearing within an Expressions_With_Actions node. We
-            --  prepend the actions to the list of actions already there, if
+            --  append the actions to the list of actions already there, if
             --  the node has not been analyzed yet. Otherwise find insertion
             --  location further up the tree.
 
             when N_Expression_With_Actions =>
                if not Analyzed (P) then
-                  Prepend_List (Ins_Actions, Actions (P));
+                  Append_List (Ins_Actions, Actions (P));
                   return;
                end if;
 
index d87a5a4664011a2473fe0b625e13e071a911e0e1..339fd4396a13ff58b9a290777505398ae7fe0b0d 100644 (file)
@@ -75,6 +75,9 @@ package Exp_Util is
    --    expansion of the N_If_Expression node rewrites the node so that the
    --    actions can be positioned normally.
 
+   --    For actions coming from expansion of the expression in an expression
+   --    with actions node, the action is appended to the list of actions.
+
    --  Basically what we do is to climb up to the tree looking for the
    --  proper insertion point, as described by one of the above cases,
    --  and then insert the appropriate action or actions.
index b372f454650d898b92cd7c34506de34c2e3bc598..76e90a6c7f2842b6271b0d80c7fa51491fb095ad 100644 (file)
@@ -5214,6 +5214,9 @@ individually controlled.  The warnings that are not turned on by this
 switch are
 @option{-gnatwd} (implicit dereferencing),
 @option{-gnatwh} (hiding),
+@ifclear VMS
+@option{-gnatw.d} (tag warnings with -gnatw switch)
+@end ifclear
 @option{-gnatw.h} (holes (gaps) in record layouts)
 @option{-gnatw.i} (overlapping actuals),
 @option{-gnatw.k} (redefinition of names in standard),
@@ -5362,6 +5365,24 @@ this warning option.
 This switch suppresses warnings for implicit dereferences in
 indexed components, slices, and selected components.
 
+@ifclear vms
+@item -gnatw.d
+@emph{Activate tagging of warning messages.}
+@cindex @option{-gnatw.d} (@command{gcc})
+If this switch is set, then warning messages are tagged, either with
+the string ``@option{-gnatw?}'' showing which switch controls the warning,
+or with ``[enabled by default]'' if the warning is not under control of a
+specific @option{-gnatw?} switch. This mode is off by default, and is not
+affected by the use of @code{-gnatwa}.
+
+@item -gnatw.D
+@emph{Deactivate tagging of warning messages.}
+@cindex @option{-gnatw.d} (@command{gcc})
+If this switch is set, then warning messages return to the default
+mode in which warnings are not tagged as described above for
+@code{-gnatw.d}.
+@end ifclear
+
 @item -gnatwe
 @emph{Treat warnings and style checks as errors.}
 @cindex @option{-gnatwe} (@command{gcc})
index 6ad3467a5d2883cfcdbaf33415c283553b124f19..74736ceb4aec163db4fa66961d44eadf3367b75f 100644 (file)
@@ -592,15 +592,26 @@ package body Ch6 is
          elsif Aspect_Specifications_Present then
             goto Subprogram_Declaration;
 
-         --  Here we have a missing IS or missing semicolon, we always guess
-         --  a missing semicolon, since we are pretty good at fixing up a
-         --  semicolon which should really be an IS
+         --  Here we have a missing IS or missing semicolon
 
          else
-            Error_Msg_AP -- CODEFIX
-              ("|missing "";""");
-            SIS_Missing_Semicolon_Message := Get_Msg_Id;
-            goto Subprogram_Declaration;
+            --  If the next token is a left paren at the start of a line, then
+            --  this is almost certainly the start of the expression for an
+            --  expression function, so in this case guess a missing IS.
+
+            if Token = Tok_Left_Paren and then Token_Is_At_Start_Of_Line then
+               Error_Msg_AP -- CODEFIX
+                 ("missing IS");
+
+            --  In all other cases, we guess a missing semicolon, since we are
+            --  good at fixing up a semicolon which should really be an IS.
+
+            else
+               Error_Msg_AP -- CODEFIX
+                 ("|missing "";""");
+               SIS_Missing_Semicolon_Message := Get_Msg_Id;
+               goto Subprogram_Declaration;
+            end if;
          end if;
       end if;
 
index 6efb1e96697173266b1bc2fb184fb7dc0c69b0ec..eefd7b4302ef53d0c517e2b3d8535941564f6292 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2010, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2012, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -452,10 +452,10 @@ package body Tchk is
          Scan;
          return;
 
-      --  An interesting little kludge here. If the previous token is a
-      --  semicolon, then there is no way that we can legitimately need another
-      --  semicolon. This could only arise in an error situation where an error
-      --  has already been signalled. By simply ignoring the request for a
+      --  An interesting little kludge. If the previous token is a semicolon,
+      --  then there is no way that we can legitimately need another semicolon.
+      --  This could only arise in an error situation where an error has
+      --  already been signalled. By simply ignoring the request for a
       --  semicolon in this case, we avoid some spurious missing semicolon
       --  messages.
 
@@ -474,9 +474,7 @@ package body Tchk is
       --  Deal with pragma. If pragma is not at start of line, it is considered
       --  misplaced otherwise we treat it as a normal missing semicolon case.
 
-      elsif Token = Tok_Pragma
-        and then not Token_Is_At_Start_Of_Line
-      then
+      elsif Token = Tok_Pragma and then not Token_Is_At_Start_Of_Line then
          P_Pragmas_Misplaced;
 
          if Token = Tok_Semicolon then
index fa592a7ea5058661d37c612ec4088a9fd38123a4..e18801f024fc572ec46df5ff09190400d538d969 100644 (file)
@@ -635,6 +635,15 @@ package body Util is
 
    procedure No_Constraint is
    begin
+      --  If next token is at start of line, don't object, it seems relatively
+      --  unlikely that a constraint would be on its own starting a line.
+
+      if Token_Is_At_Start_Of_Line then
+         return;
+      end if;
+
+      --  Otherwise if we have a token that could start a constraint, object
+
       if Token in Token_Class_Consk then
          Error_Msg_SC ("constraint not allowed here");
          Discard_Junk_Node (P_Constraint_Opt);
index 2a00c098621daeace0f4b9f25317fabe292c08ec..d64c78b3bfca818aad28320d7f9bc8875159223f 100644 (file)
@@ -688,9 +688,9 @@ package body Prj.Conf is
                   if Switch.Value /= No_Name then
                      Get_Name_String (Switch.Value);
 
-                     if Conf_File_Name'Length = 0 and then
-                        Name_Len > 9 and then
-                        Name_Buffer (1 .. 9) = "--config="
+                     if Conf_File_Name'Length = 0
+                       and then Name_Len > 9
+                       and then Name_Buffer (1 .. 9) = "--config="
                      then
                         Conf_File_Name :=
                           new String'(Name_Buffer (10 .. Name_Len));
@@ -1357,7 +1357,7 @@ package body Prj.Conf is
       end if;
 
       if Config_File_Path = null then
-         if (not Allow_Automatic_Generation)
+         if not Allow_Automatic_Generation
            and then Conf_File_Name'Length > 0
          then
             Raise_Invalid_Config
index d983c2915a48f7a99b9f2e5fa88546525822901b..a63e10c97e897df65c28541f63871bd17ec50845 100644 (file)
@@ -257,13 +257,13 @@ package Types is
    --  possible values for each of the above types is disjoint so that this
    --  distinction is possible.
 
-   type Union_Id is new Int;
-   --  The type in the tree for a union of possible ID values
-
    --  Note: it is also helpful for debugging purposes to make these ranges
    --  distinct. If a bug leads to misidentification of a value, then it will
    --  typically result in an out of range value and a Constraint_Error.
 
+   type Union_Id is new Int;
+   --  The type in the tree for a union of possible ID values
+
    List_Low_Bound : constant := -100_000_000;
    --  The List_Id values are subscripts into an array of list headers which
    --  has List_Low_Bound as its lower bound. This value is chosen so that all
index 436a8865f2232527901cd285cf6d423438670b8a..f4cceb46d23033ca8ac7889cacedaf3309ef14a6 100644 (file)
@@ -474,6 +474,16 @@ begin
    Write_Line ("        .C*  turn off warnings for unrepped components");
    Write_Line ("        d    turn on warnings for implicit dereference");
    Write_Line ("        D*   turn off warnings for implicit dereference");
+
+   --  Switches -gnatw.d/w.D not available on VMS
+
+   if not OpenVMS_On_Target then
+      Write_Line
+        ("        .d   turn on tagging of warnings with -gnatw switch");
+      Write_Line
+        ("        .D*  turn off tagging of warnings with -gnatw switch");
+   end if;
+
    Write_Line ("        e    treat all warnings (but not info) as errors");
    Write_Line ("        .e   turn on every optional info/warning " &
                                                   "(no exceptions)");
index a8d31e452318c6ef4d55955c752134c798f3810b..9f8512f18dee422e011895930d3828c4534c2a79 100644 (file)
@@ -53,10 +53,18 @@ package body Warnsw is
             Warn_On_Unrepped_Components         := False;
 
          when 'd' =>
-            Warning_Doc_Switch                     := True;
+            if Open_VMS_On_Target then
+               return False;
+            end if;
+
+            Warning_Doc_Switch                  := True;
 
          when 'D' =>
-            Warning_Doc_Switch                     := False;
+            if Open_VMS_On_Target then
+               return False;
+            end if;
+
+            Warning_Doc_Switch                  := False;
 
          when 'e' =>
             Address_Clause_Overlay_Warnings     := True;
@@ -68,6 +76,7 @@ package body Warnsw is
             Implementation_Unit_Warnings        := True;
             Ineffective_Inline_Warnings         := True;
             List_Inherited_Aspects              := True;
+            Warning_Doc_Switch                  := True;
             Warn_On_Ada_2005_Compatibility      := True;
             Warn_On_Ada_2012_Compatibility      := True;
             Warn_On_All_Unread_Out_Parameters   := True;
@@ -217,6 +226,7 @@ package body Warnsw is
       Implementation_Unit_Warnings        := False;
       Ineffective_Inline_Warnings         := True;
       List_Inherited_Aspects              := False;
+      Warning_Doc_Switch                  := False;
       Warn_On_Ada_2005_Compatibility      := True;
       Warn_On_Ada_2012_Compatibility      := True;
       Warn_On_All_Unread_Out_Parameters   := False;
@@ -296,6 +306,7 @@ package body Warnsw is
             Implementation_Unit_Warnings        := False;
             Ineffective_Inline_Warnings         := False;
             List_Inherited_Aspects              := False;
+            Warning_Doc_Switch                  := False;
             Warn_On_Ada_2005_Compatibility      := False;
             Warn_On_Ada_2012_Compatibility      := False;
             Warn_On_All_Unread_Out_Parameters   := False;