[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 1 Aug 2014 13:26:17 +0000 (15:26 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 1 Aug 2014 13:26:17 +0000 (15:26 +0200)
2014-08-01  Ed Schonberg  <schonberg@adacore.com>

* sem_ch5.adb (Analyze_Loop_Parameter_Specification): a)
An attribute_reference to Loop_Entry denotes an iterator
specification: its prefix is an object, as is the case for 'Old.
b) If the domain of iteration is an expression whose type has
the Iterable aspect defined, this is an iterator specification.

2014-08-01  Robert Dewar  <dewar@adacore.com>

* gnatcmd.adb: Minor reformatting.

2014-08-01  Robert Dewar  <dewar@adacore.com>

* atree.ads (Info_Messages): New counter.
* err_vars.ads: Minor comment update.
* errout.adb (Delete_Warning_And_Continuations): Deal
with new Info_Messages counter.
(Error_Msg_Internal): ditto.
(Delete_Warning): ditto.
(Initialize): ditto.
(Write_Error_Summary): ditto.
(Output_Messages): ditto.
(To_Be_Removed): ditto.
* erroutc.adb (Delete_Msg): Deal with Info_Messages counter.
(Compilation_Errors): ditto.
* errutil.adb (Error_Msg): Deal with Info_Messages counter.
(Finalize): ditto.
(Initialize): ditto.
* sem_prag.adb (Analyze_Pragma): Minor comment addition.
* gnat_ugn.texi: Document that -gnatwe does not affect info
messages.

From-SVN: r213457

gcc/ada/ChangeLog
gcc/ada/atree.ads
gcc/ada/err_vars.ads
gcc/ada/errout.adb
gcc/ada/erroutc.adb
gcc/ada/errutil.adb
gcc/ada/gnat_ugn.texi
gcc/ada/gnatcmd.adb
gcc/ada/sem_ch5.adb
gcc/ada/sem_prag.adb

index de5593239c676f2eca978c254f82ab8318ef73f3..aa4d49c48b97f881df05973d5e7f55351ab5e7f9 100644 (file)
@@ -1,3 +1,36 @@
+2014-08-01  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch5.adb (Analyze_Loop_Parameter_Specification): a)
+       An attribute_reference to Loop_Entry denotes an iterator
+       specification: its prefix is an object, as is the case for 'Old.
+       b) If the domain of iteration is an expression whose type has
+       the Iterable aspect defined, this is an iterator specification.
+
+2014-08-01  Robert Dewar  <dewar@adacore.com>
+
+       * gnatcmd.adb: Minor reformatting.
+
+2014-08-01  Robert Dewar  <dewar@adacore.com>
+
+       * atree.ads (Info_Messages): New counter.
+       * err_vars.ads: Minor comment update.
+       * errout.adb (Delete_Warning_And_Continuations): Deal
+       with new Info_Messages counter.
+       (Error_Msg_Internal): ditto.
+       (Delete_Warning): ditto.
+       (Initialize): ditto.
+       (Write_Error_Summary): ditto.
+       (Output_Messages): ditto.
+       (To_Be_Removed): ditto.
+       * erroutc.adb (Delete_Msg): Deal with Info_Messages counter.
+       (Compilation_Errors): ditto.
+       * errutil.adb (Error_Msg): Deal with Info_Messages counter.
+       (Finalize): ditto.
+       (Initialize): ditto.
+       * sem_prag.adb (Analyze_Pragma): Minor comment addition.
+       * gnat_ugn.texi: Document that -gnatwe does not affect info
+       messages.
+
 2014-08-01  Robert Dewar  <dewar@adacore.com>
 
        * debug.adb: Document debug switch -gnatd.Z.
index 38491d2b8ea235d1f57febe3a239d8f7cdae328e..37b276e9cdbf8d38ec0516466107f37de2638897 100644 (file)
@@ -313,7 +313,12 @@ package Atree is
 
    Warnings_Detected : Nat := 0;
    --  Number of warnings detected. Initialized to zero at the start of
-   --  compilation. Initialized for -gnatVa use, see comment above.
+   --  compilation. Initialized for -gnatVa use, see comment above. This
+   --  count includes the count of style and info messages.
+
+   Info_Messages : Nat := 0;
+   --  Number of info messages generated. Info messages are neved treated as
+   --  errors (whether from use of the pragma, or the compiler switch -gnatwe).
 
    Warnings_Treated_As_Errors : Nat := 0;
    --  Number of warnings changed into errors as a result of matching a pattern
index 48e382df0c09b87fb861fcfd8eea4b8efe832056..48df37e636251ed9cea6408e4ec807665d654411 100644 (file)
@@ -39,10 +39,10 @@ package Err_Vars is
    --  from invalid values in such cases.
 
    --  Note on error counts (Serious_Errors_Detected, Total_Errors_Detected,
-   --  Warnings_Detected). These counts might more logically appear in this
-   --  unit, but we place them in atree.ads, because of licensing issues. We
-   --  need to be able to access these counts from units that have the more
-   --  general licensing conditions.
+   --  Warnings_Detected, Info_Messages). These counts might more logically
+   --  appear in this unit, but we place them instead in atree.ads, because of
+   --  licensing issues. We need to be able to access these counts from units
+   --  that have the more general licensing conditions.
 
    ----------------------------------
    -- Error Message Mode Variables --
index cae81b152bf743ea7e5db3bc9f3332cd59e58884..55b02eeaab9b25061f25b35c6300e1223c26a660 100644 (file)
@@ -261,8 +261,12 @@ package body Errout is
                M.Deleted := True;
                Warnings_Detected := Warnings_Detected - 1;
 
+               if M.Info then
+                  Info_Messages := Info_Messages - 1;
+               end if;
+
                if M.Warn_Err then
-                  Warnings_Treated_As_Errors := Warnings_Treated_As_Errors + 1;
+                  Warnings_Treated_As_Errors := Warnings_Treated_As_Errors - 1;
                end if;
             end if;
 
@@ -1132,6 +1136,10 @@ package body Errout is
       if Errors.Table (Cur_Msg).Warn or else Errors.Table (Cur_Msg).Style then
          Warnings_Detected := Warnings_Detected + 1;
 
+         if Errors.Table (Cur_Msg).Info then
+            Info_Messages := Info_Messages + 1;
+         end if;
+
       else
          Total_Errors_Detected := Total_Errors_Detected + 1;
 
@@ -1340,8 +1348,12 @@ package body Errout is
             Errors.Table (E).Deleted := True;
             Warnings_Detected := Warnings_Detected - 1;
 
+            if Errors.Table (E).Info then
+               Info_Messages := Info_Messages - 1;
+            end if;
+
             if Errors.Table (E).Warn_Err then
-               Warnings_Treated_As_Errors := Warnings_Treated_As_Errors + 1;
+               Warnings_Treated_As_Errors := Warnings_Treated_As_Errors - 1;
             end if;
          end if;
       end Delete_Warning;
@@ -1566,6 +1578,7 @@ package body Errout is
       Total_Errors_Detected := 0;
       Warnings_Treated_As_Errors := 0;
       Warnings_Detected := 0;
+      Info_Messages := 0;
       Warnings_As_Errors_Count := 0;
       Cur_Msg := No_Error_Msg;
       List_Pragmas.Init;
@@ -1656,8 +1669,7 @@ package body Errout is
       begin
          --  Extra blank line if error messages or source listing were output
 
-         if Total_Errors_Detected + Warnings_Detected > 0
-           or else Full_List
+         if Total_Errors_Detected + Warnings_Detected > 0 or else Full_List
          then
             Write_Eol;
          end if;
@@ -1666,8 +1678,8 @@ package body Errout is
          --  This normally goes to Standard_Output. The exception is when brief
          --  mode is not set, verbose mode (or full list mode) is set, and
          --  there are errors. In this case we send the message to standard
-         --  error to make sure that *something* appears on standard error in
-         --  an error situation.
+         --  error to make sure that *something* appears on standard error
+         --  in an error situation.
 
          if Total_Errors_Detected + Warnings_Detected /= 0
            and then not Brief_Output
@@ -1702,12 +1714,12 @@ package body Errout is
             Write_Str (" errors");
          end if;
 
-         if Warnings_Detected /= 0 then
+         if Warnings_Detected - Info_Messages /= 0 then
             Write_Str (", ");
             Write_Int (Warnings_Detected);
             Write_Str (" warning");
 
-            if Warnings_Detected /= 1 then
+            if Warnings_Detected - Info_Messages /= 1 then
                Write_Char ('s');
             end if;
 
@@ -1727,6 +1739,16 @@ package body Errout is
             end if;
          end if;
 
+         if Info_Messages /= 0 then
+            Write_Str (", ");
+            Write_Int (Info_Messages);
+            Write_Str (" info message");
+
+            if Info_Messages > 1 then
+               Write_Char ('s');
+            end if;
+         end if;
+
          Write_Eol;
          Set_Standard_Output;
       end Write_Error_Summary;
@@ -2027,8 +2049,9 @@ package body Errout is
       Write_Max_Errors;
 
       if Warning_Mode = Treat_As_Error then
-         Total_Errors_Detected := Total_Errors_Detected + Warnings_Detected;
-         Warnings_Detected := 0;
+         Total_Errors_Detected :=
+           Total_Errors_Detected + Warnings_Detected - Info_Messages;
+         Warnings_Detected := Info_Messages;
       end if;
    end Output_Messages;
 
@@ -2200,6 +2223,11 @@ package body Errout is
                and then not Errors.Table (E).Uncond
             then
                Warnings_Detected := Warnings_Detected - 1;
+
+               if Errors.Table (E).Info then
+                  Info_Messages := Info_Messages - 1;
+               end if;
+
                return True;
 
             --  No removal required
index 4e5070a74f29acd644ea6c929e12e229927513d9..c347364c1b9b77ba753b27b0b6901ff881877a18 100644 (file)
@@ -143,7 +143,7 @@ package body Erroutc is
 
                if Errors.Table (D).Warn_Err then
                   Warnings_Treated_As_Errors :=
-                    Warnings_Treated_As_Errors + 1;
+                    Warnings_Treated_As_Errors - 1;
                end if;
 
             else
@@ -233,7 +233,7 @@ package body Erroutc is
    function Compilation_Errors return Boolean is
    begin
       return Total_Errors_Detected /= 0
-        or else (Warnings_Detected /= 0
+        or else (Warnings_Detected - Info_Messages /= 0
                   and then Warning_Mode = Treat_As_Error)
         or else Warnings_Treated_As_Errors /= 0;
    end Compilation_Errors;
index 0c47f2183c49c34b2b9597b68893a9c7f5a33f5d..7eb85a4193aa40c05673eb83ef61c05b09a54a9e 100644 (file)
@@ -309,6 +309,10 @@ package body Errutil is
       then
          Warnings_Detected := Warnings_Detected + 1;
 
+         if Errors.Table (Cur_Msg).Info then
+            Info_Messages := Info_Messages + 1;
+         end if;
+
       else
          Total_Errors_Detected := Total_Errors_Detected + 1;
 
@@ -536,19 +540,19 @@ package body Errutil is
             Write_Str (" errors");
          end if;
 
-         if Warnings_Detected /= 0 then
+         if Warnings_Detected - Info_Messages  /= 0 then
             Write_Str (", ");
-            Write_Int (Warnings_Detected);
+            Write_Int (Warnings_Detected - Info_Messages);
             Write_Str (" warning");
 
-            if Warnings_Detected /= 1 then
+            if Warnings_Detected - Info_Messages /= 1 then
                Write_Char ('s');
             end if;
 
             if Warning_Mode = Treat_As_Error then
                Write_Str (" (treated as error");
 
-               if Warnings_Detected /= 1 then
+               if Warnings_Detected - Info_Messages /= 1 then
                   Write_Char ('s');
                end if;
 
@@ -575,8 +579,9 @@ package body Errutil is
       end if;
 
       if Warning_Mode = Treat_As_Error then
-         Total_Errors_Detected := Total_Errors_Detected + Warnings_Detected;
-         Warnings_Detected := 0;
+         Total_Errors_Detected :=
+           Total_Errors_Detected + Warnings_Detected - Info_Messages;
+         Warnings_Detected := Info_Messages;
       end if;
 
       --  Prevent displaying the same messages again in the future
@@ -596,6 +601,7 @@ package body Errutil is
       Serious_Errors_Detected := 0;
       Total_Errors_Detected := 0;
       Warnings_Detected := 0;
+      Info_Messages := 0;
       Cur_Msg := No_Error_Msg;
 
       --  Initialize warnings table, if all warnings are suppressed, supply
index a63aa76d6ba08632ab46913d9b83758cd74d59e6..fb844521ec24b93d0783af261fdc171bbdfce997 100644 (file)
@@ -4995,6 +4995,8 @@ treated as errors.
 The warning string still appears, but the warning messages are counted
 as errors, and prevent the generation of an object file. Note that this
 is the only -gnatw switch that affects the handling of style check messages.
+Note also that this switch has no effect on info (information) messages, which
+are not treated as errors if this switch is present.
 
 @item -gnatw.e
 @emph{Activate every optional warning}
index 8c60f8094345406ae45f3d4394c61ba0df128582..2e5bade8e36ea98eae1ec936f99e96ec00043beb 100644 (file)
@@ -47,7 +47,6 @@ with Snames;   use Snames;
 with Stringt;
 with Switch;   use Switch;
 with Table;
-with Targparm; use Targparm;
 with Tempdir;
 with Types;    use Types;
 
@@ -58,6 +57,9 @@ with Ada.Text_IO;             use Ada.Text_IO;
 with GNAT.OS_Lib; use GNAT.OS_Lib;
 
 procedure GNATCmd is
+
+   AAMP_On_Target : Boolean := False;
+
    Normal_Exit : exception;
    --  Raise this exception for normal program termination
 
@@ -1183,7 +1185,7 @@ procedure GNATCmd is
          --  No usage for Sync
 
          if C /= Sync then
-            if Targparm.AAMP_On_Target then
+            if AAMP_On_Target then
                Put ("gnaampcmd ");
             else
                Put ("gnat ");
@@ -1584,12 +1586,11 @@ begin
    Rules_Switches.Init;
    Rules_Switches.Set_Last (0);
 
-   --  Set AAMP_On_Target from the command name, for testing in
-   --  Osint.Program_Name to handle the mapping of GNAAMP tool names. We don't
-   --  extract it from system.ads, has there may be no default runtime.
+   --  Set AAMP_On_Target from command name, for testing in Osint.Program_Name
+   --  to handle the mapping of GNAAMP tool names. We don't extract it from
+   --  system.ads, as there may be no default runtime.
 
-   Find_Program_Name;
-   AAMP_On_Target := Name_Buffer (1 .. Name_Len) = "gnaampcmd";
+   AAMP_On_Target := To_Lower (Command_Name) = "gnaampcmd";
 
    --  Put the command line in environment variable GNAT_DRIVER_COMMAND_LINE,
    --  so that the spawned tool may know the way the GNAT driver was invoked.
index ffdf8814e52ddd8203d7cd60f8e5d99554df46b6..18a66229cd53d7290883f001b5196d9022c4af03 100644 (file)
@@ -2523,8 +2523,10 @@ package body Sem_Ch5 is
            or else (Is_Entity_Name (DS_Copy)
                      and then not Is_Type (Entity (DS_Copy)))
            or else (Nkind (DS_Copy) = N_Attribute_Reference
-                     and then Attribute_Name (DS_Copy) = Name_Old)
+                     and then Nam_In (Attribute_Name (DS_Copy),
+                                      Name_Old, Name_Loop_Entry))
            or else Nkind (DS_Copy) = N_Unchecked_Type_Conversion
+           or else Has_Aspect (Etype (DS_Copy), Aspect_Iterable)
          then
             --  This is an iterator specification. Rewrite it as such and
             --  analyze it to capture function calls that may require
index 3aef37217afea2abfc46988608cd24572994f7f9..adcad24435ca89bad70e47ccca08c11a5e7685a2 100644 (file)
@@ -20715,6 +20715,8 @@ package body Sem_Prag is
          -- Warning_As_Error --
          ----------------------
 
+         --  pragma Warning_As_Error (static_string_EXPRESSION);
+
          when Pragma_Warning_As_Error =>
             GNAT_Pragma;
             Check_Arg_Count (1);