]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 6 Nov 2012 11:28:27 +0000 (12:28 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 6 Nov 2012 11:28:27 +0000 (12:28 +0100)
2012-11-06  Tristan Gingold  <gingold@adacore.com>

* sem_ch9.adb (Analyze_Protected_Type_Declaration): Fix thinko
in previous commit.

2012-11-06  Jose Ruiz  <ruiz@adacore.com>

* ali.adb (Scan_ALI): Fix parsing mechanism for -fstack-check.

2012-11-06  Thomas Quinot  <quinot@adacore.com>

* atree.adb, atree.ads, einfo.adb, errout.adb, errout.ads, erroutc.adb,
erroutc.ads, errutil.adb, errutil.ads, err_vars.ads, expander.adb,
exp_ch13.adb, exp_ch2.adb, exp_ch6.adb, exp_dist.adb, fe.h,
fmap.adb, fmap.ads, gprep.adb, makeutl.adb, osint.adb, osint.ads,
par_sco.adb, prepcomp.adb, prj-part.adb, prj-proc.adb, scng.adb,
sdefault.ads, sem_ch10.adb, sem_ch13.adb, sem_ch2.adb, sem_ch3.adb,
sem_ch4.adb, sem_ch5.adb, sem_dim.adb, sem_elab.adb, sem_eval.adb,
sem_intr.adb, sem_prag.adb, sem_type.adb, sem_warn.adb, stylesw.adb,
stylesw.ads, targparm.adb, targparm.ads (Cascaded_Error): Rename to
more descriptive name 'Check_Error_Detected'. Add calls to
Check_Error_Detected at places where semantic analysis is abandoned
assuming a previously detected error.

From-SVN: r193235

43 files changed:
gcc/ada/ChangeLog
gcc/ada/ali.adb
gcc/ada/atree.adb
gcc/ada/atree.ads
gcc/ada/einfo.adb
gcc/ada/err_vars.ads
gcc/ada/errout.adb
gcc/ada/errout.ads
gcc/ada/erroutc.adb
gcc/ada/erroutc.ads
gcc/ada/errutil.adb
gcc/ada/errutil.ads
gcc/ada/exp_ch13.adb
gcc/ada/exp_ch2.adb
gcc/ada/exp_ch6.adb
gcc/ada/exp_dist.adb
gcc/ada/expander.adb
gcc/ada/fe.h
gcc/ada/fmap.adb
gcc/ada/fmap.ads
gcc/ada/gprep.adb
gcc/ada/makeutl.adb
gcc/ada/par_sco.adb
gcc/ada/prepcomp.adb
gcc/ada/prj-part.adb
gcc/ada/prj-proc.adb
gcc/ada/scng.adb
gcc/ada/sdefault.ads
gcc/ada/sem_ch10.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch2.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_ch4.adb
gcc/ada/sem_ch5.adb
gcc/ada/sem_ch9.adb
gcc/ada/sem_dim.adb
gcc/ada/sem_elab.adb
gcc/ada/sem_eval.adb
gcc/ada/sem_intr.adb
gcc/ada/sem_prag.adb
gcc/ada/sem_type.adb
gcc/ada/sem_warn.adb
gcc/ada/stylesw.adb

index aec3b4f9904f4c01ec6d9ab9971a17090764ec7c..379a4a156bffcbfc714f490b0c5afd6c6f64be2a 100644 (file)
@@ -1,3 +1,27 @@
+2012-11-06  Tristan Gingold  <gingold@adacore.com>
+
+       * sem_ch9.adb (Analyze_Protected_Type_Declaration): Fix thinko
+       in previous commit.
+
+2012-11-06  Jose Ruiz  <ruiz@adacore.com>
+
+       * ali.adb (Scan_ALI): Fix parsing mechanism for -fstack-check.
+
+2012-11-06  Thomas Quinot  <quinot@adacore.com>
+
+       * atree.adb, atree.ads, einfo.adb, errout.adb, errout.ads, erroutc.adb,
+       erroutc.ads, errutil.adb, errutil.ads, err_vars.ads, expander.adb,
+       exp_ch13.adb, exp_ch2.adb, exp_ch6.adb, exp_dist.adb, fe.h,
+       fmap.adb, fmap.ads, gprep.adb, makeutl.adb, osint.adb, osint.ads,
+       par_sco.adb, prepcomp.adb, prj-part.adb, prj-proc.adb, scng.adb,
+       sdefault.ads, sem_ch10.adb, sem_ch13.adb, sem_ch2.adb, sem_ch3.adb,
+       sem_ch4.adb, sem_ch5.adb, sem_dim.adb, sem_elab.adb, sem_eval.adb,
+       sem_intr.adb, sem_prag.adb, sem_type.adb, sem_warn.adb, stylesw.adb,
+       stylesw.ads, targparm.adb, targparm.ads (Cascaded_Error): Rename to
+       more descriptive name 'Check_Error_Detected'. Add calls to
+       Check_Error_Detected at places where semantic analysis is abandoned
+       assuming a previously detected error.
+
 2012-11-06  Robert Dewar  <dewar@adacore.com>
 
        * exp_ch4.adb: Minor comment change.
index a85fa4bec2fa322919602691900965108d1456a0..0386c05fe5a2aa6e747e7cfe8f7591b8e6c1ede9 100644 (file)
@@ -970,9 +970,16 @@ package body ALI is
                Add_Char_To_Name_Buffer (Getc);
             end loop;
 
-            --  If -fstack-check, record that it occurred
-
-            if Name_Buffer (1 .. Name_Len) = "-fstack-check" then
+            --  If -fstack-check, record that it occurred. Note that an
+            --  additional string parameter can be specified, in the form of
+            --  -fstack-check={no|generic|specific}. "no" means no checking,
+            --  "generic" means force the use of old-style checking, and
+            --  "specific" means use the best checking method.
+
+            if Name_Len >= 13
+              and then Name_Buffer (1 .. 13) = "-fstack-check"
+              and then Name_Buffer (1 .. Name_Len) /= "-fstack-check=no"
+            then
                Stack_Check_Switch_Set := True;
             end if;
 
index dce76e9db4141e044ca2c367f5353559579fa030..70dd3801e5cdef99ec4ff7d4cf477a4f0764a527 100644 (file)
@@ -560,6 +560,20 @@ package body Atree is
           (Nodes.Table (E + 2).Field12'Unrestricted_Access)).Convention := Val;
    end Basic_Set_Convention;
 
+   --------------------------
+   -- Check_Error_Detected --
+   --------------------------
+
+   procedure Check_Error_Detected is
+   begin
+      --  An anomaly has been detected which is assumed to be a consequence of
+      --  a previous error. Raise an exception if no error found previously.
+
+      if Total_Errors_Detected = 0 then
+         raise Program_Error;
+      end if;
+   end Check_Error_Detected;
+
    -----------------
    -- Change_Node --
    -----------------
index 305ef9f3978ee3e02aa92207ffff774ef8feed6b..0829d4da454acfff9bcb4d30a4de88e76172824c 100644 (file)
@@ -276,6 +276,36 @@ package Atree is
    Current_Error_Node : Node_Id;
    --  Node to place error messages
 
+   ------------------
+   -- Error Counts --
+   ------------------
+
+   --  The following variables denote the count of errors of various kinds
+   --  detected in the tree.
+
+   Serious_Errors_Detected : Nat := 0;
+   --  This is a count of errors that are serious enough to stop expansion,
+   --  and hence to prevent generation of an object file even if the
+   --  switch -gnatQ is set. Initialized to zero at the start of compilation.
+   --  Initialized for -gnatVa use, see comment above.
+
+   Total_Errors_Detected : Nat := 0;
+   --  Number of errors detected so far. Includes count of serious errors and
+   --  non-serious errors, so this value is always greater than or equal to the
+   --  Serious_Errors_Detected value. Initialized to zero at the start of
+   --  compilation. Initialized for -gnatVa use, see comment above.
+
+   Warnings_Detected : Nat := 0;
+   --  Number of warnings detected. Initialized to zero at the start of
+   --  compilation. Initialized for -gnatVa use, see comment above.
+
+   procedure Check_Error_Detected;
+   --  When an anomaly is found in the tree, many semantic routines silently
+   --  bail out, assuming that the anomaly was caused by a previously detected
+   --  error. This routine should be called in these cases, and will raise an
+   --  exception if no error has been detected. This ensure that the anomaly
+   --  is never allowed to go unnoticed.
+
    -------------------------------
    -- Default Setting of Fields --
    -------------------------------
index 7e3073ef3845ef59f2337fc12291541ed7e030bf..212849791fb836abc5aa4e7d78a3720d8cdefa52 100644 (file)
@@ -33,7 +33,6 @@ pragma Style_Checks (All_Checks);
 --  Turn off subprogram ordering, not used for this unit
 
 with Atree;  use Atree;
-with Errout; use Errout;
 with Namet;  use Namet;
 with Nlists; use Nlists;
 with Output; use Output;
@@ -6981,7 +6980,7 @@ package body Einfo is
             --  previous errors.
 
             elsif No (Etyp) then
-               Cascaded_Error;
+               Check_Error_Detected;
                return T;
 
             elsif Is_Private_Type (T) and then Etyp = Full_View (T) then
index e17e1fe95731bd8db52a6466fbf9712eaf8304e6..58355cc5ff293c6b291fc6c43850d01398fdbf0b 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2011, 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- --
@@ -38,26 +38,6 @@ package Err_Vars is
    --  been initialized, so we initialize some variables to avoid exceptions
    --  from invalid values in such cases.
 
-   ------------------
-   -- Error Counts --
-   ------------------
-
-   Serious_Errors_Detected : Nat := 0;
-   --  This is a count of errors that are serious enough to stop expansion,
-   --  and hence to prevent generation of an object file even if the
-   --  switch -gnatQ is set. Initialized to zero at the start of compilation.
-   --  Initialized for -gnatVa use, see comment above.
-
-   Total_Errors_Detected : Nat := 0;
-   --  Number of errors detected so far. Includes count of serious errors and
-   --  non-serious errors, so this value is always greater than or equal to the
-   --  Serious_Errors_Detected value. Initialized to zero at the start of
-   --  compilation. Initialized for -gnatVa use, see comment above.
-
-   Warnings_Detected : Nat := 0;
-   --  Number of warnings detected. Initialized to zero at the start of
-   --  compilation. Initialized for -gnatVa use, see comment above.
-
    ----------------------------------
    -- Error Message Mode Variables --
    ----------------------------------
index 48bbc983b197f7b89e4d8216d5ddc284c931eee9..6f450200ef952e19e9b844e6f8230f45ce1e88df 100644 (file)
 -- Public License  distributed with GNAT; see file COPYING3.  If not, go to --
 -- http://www.gnu.org/licenses for a complete copy of the license.          --
 --                                                                          --
--- As a special exception under Section 7 of GPL version 3, you are granted --
--- additional permissions described in the GCC Runtime Library Exception,   --
--- version 3.1, as published by the Free Software Foundation.               --
---                                                                          --
 -- GNAT was originally developed  by the GNAT team at  New York University. --
 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
 --                                                                          --
@@ -202,20 +198,6 @@ package body Errout is
    --  spec for precise definition of the conversion that is performed by this
    --  routine in OpenVMS mode.
 
-   --------------------
-   -- Cascaded_Error --
-   --------------------
-
-   procedure Cascaded_Error is
-   begin
-      --  An anomaly has been detected which is assumed to be a consequence of
-      --  a previous error. Raise an exception if no error found previously.
-
-      if Total_Errors_Detected = 0 then
-         raise Program_Error;
-      end if;
-   end Cascaded_Error;
-
    -----------------------
    -- Change_Error_Text --
    -----------------------
index 7da6493e453bd47c84e1c54e042159cf50e1b79c..2c6ab7d4ddd6e16ef10368d1c513acebe9bea855 100644 (file)
@@ -39,19 +39,6 @@ with System;
 
 package Errout is
 
-   Serious_Errors_Detected : Nat renames Err_Vars.Serious_Errors_Detected;
-   --  This is a count of errors that are serious enough to stop expansion,
-   --  and hence to prevent generation of an object file even if the switch
-   --  -gnatQ is set.
-
-   Total_Errors_Detected : Nat renames Err_Vars.Total_Errors_Detected;
-   --  Number of errors detected so far. Includes count of serious errors and
-   --  non-serious errors, so this value is always greater than or equal to
-   --  the Serious_Errors_Detected value.
-
-   Warnings_Detected : Nat renames Err_Vars.Warnings_Detected;
-   --  Number of warnings detected
-
    Configurable_Run_Time_Violations : Nat := 0;
    --  Count of configurable run time violations so far. This is used to
    --  suppress certain cascaded error messages when we know that we may not
@@ -727,13 +714,6 @@ package Errout is
    --  This routine can only be called during semantic analysis. It may not
    --  be called during parsing.
 
-   procedure Cascaded_Error;
-   --  When an anomaly is detected, many semantic routines silently bail out,
-   --  assuming that the anomaly was caused by a previously detected error.
-   --  This routine should be called in these cases, and will raise an
-   --  exception if no serious error has been detected. This ensure that the
-   --  anomaly is never allowed to go unnoticed.
-
    procedure Change_Error_Text (Error_Id : Error_Msg_Id; New_Msg : String);
    --  The error message text of the message identified by Id is replaced by
    --  the given text. This text may contain insertion characters in the
index f58a49a8a5a1bd4f8df13e495f137d1296b350f9..56a4e3547fb5805a18b65f1dd326ce3f4180d33a 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2011, 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- --
@@ -29,6 +29,7 @@
 --  environment, and that in particular, no disallowed table expansion is
 --  allowed to occur.
 
+with Atree;    use Atree;
 with Casing;   use Casing;
 with Debug;    use Debug;
 with Err_Vars; use Err_Vars;
index 6c077b0f2e301a6ee3dcbe11271c4572ac505810..fc5cfa9fc216a8dd29151d6402cfbca45998db20 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2011, 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- --
index cf6e9ef2b3d6a801aef41ccccbfccfaf8f61af77..d6fa960a7a48c8dc39e4d51ecba3fcb46495438f 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1991-2011, Free Software Foundation, Inc.         --
+--          Copyright (C) 1991-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- --
@@ -23,6 +23,7 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
+with Atree;    use Atree;
 with Err_Vars; use Err_Vars;
 with Erroutc;  use Erroutc;
 with Namet;    use Namet;
index 91ac4f1083b7f7ceb04e026926087b8a017b451b..fa6ad53b19d5d5747ef627d46b8ab3ed013dc612 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2002-2009, Free Software Foundation, Inc.         --
+--          Copyright (C) 2002-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- --
@@ -26,9 +26,7 @@
 --  This package contains routines to output error messages and the
 --  corresponding instantiation of Styleg, suitable to instantiate Scng.
 
---  It is not dependent on the GNAT tree packages (Atree, Sinfo, ...)
-
---  It uses the same global variables as Errout, located in package
+--  It uses the same global variables as Errout, located in packages Atree and
 --  Err_Vars. Like Errout, it also uses the common variables and routines
 --  in package Erroutc.
 
index 26eaec28b4e6ea3b5038ff5746ddb360c5a4ae2b..141e144ab5bec220d45f7e258250a452490e32b2 100644 (file)
@@ -379,6 +379,7 @@ package body Exp_Ch13 is
       --  This is an error protection against previous errors
 
       if No (E_Scope) then
+         Check_Error_Detected;
          return;
       end if;
 
index 64e561cde52f822ed08fd898e0af19230f6ccc5a..b93f832441ca367cd837616c17cf46894d993009 100644 (file)
@@ -28,7 +28,6 @@ with Checks;   use Checks;
 with Debug;    use Debug;
 with Einfo;    use Einfo;
 with Elists;   use Elists;
-with Errout;   use Errout;
 with Exp_Smem; use Exp_Smem;
 with Exp_Tss;  use Exp_Tss;
 with Exp_Util; use Exp_Util;
@@ -341,7 +340,8 @@ package body Exp_Ch2 is
    begin
       --  Defend against errors
 
-      if No (E) and then Total_Errors_Detected /= 0 then
+      if No (E) then
+         Check_Error_Detected;
          return;
       end if;
 
index 8d9ef9b38dd5360bcb04d18d2d7f382efe97fb4e..c3cf8c8e70b9f6f8694cc71ded6f61cf94fbdc2d 100644 (file)
@@ -6227,6 +6227,7 @@ package body Exp_Ch6 is
       if Present (Expression (N))
         and then Nkind (Expression (N)) = N_Empty
       then
+         Check_Error_Detected;
          return;
       end if;
 
index cf8243e9ca7d79ca8ea1997cb054319ef738b76b..c2396c1e568218fb327b12e37107e9ea6ed48e64 100644 (file)
@@ -26,7 +26,6 @@
 with Atree;    use Atree;
 with Einfo;    use Einfo;
 with Elists;   use Elists;
-with Errout;   use Errout;
 with Exp_Atag; use Exp_Atag;
 with Exp_Disp; use Exp_Disp;
 with Exp_Strm; use Exp_Strm;
index af367d9512d816f321c1c5f83cca027165f8661a..83a692067cf2ce9bd1702865d41c5e2468984959 100644 (file)
@@ -25,7 +25,6 @@
 
 with Atree;    use Atree;
 with Debug_A;  use Debug_A;
-with Errout;   use Errout;
 with Exp_Aggr; use Exp_Aggr;
 with Exp_Alfa; use Exp_Alfa;
 with Exp_Attr; use Exp_Attr;
index f8d399c965cfbe84d3180061017fbd2d5927f308..fe52233202bc7c11e3c0181dff90f29e682f8665 100644 (file)
@@ -80,6 +80,10 @@ extern Boolean Is_Entity_Name                (Node_Id);
 #define Get_Attribute_Definition_Clause einfo__get_attribute_definition_clause
 extern Node_Id Get_Attribute_Definition_Clause (Entity_Id, char);
 
+/* atree: */
+
+#define Serious_Errors_Detected atree__serious_errors_detected
+
 /* errout: */
 
 #define Error_Msg_N               errout__error_msg_n
@@ -95,7 +99,6 @@ extern void Set_Identifier_Casing (Char *, const Char *);
 #define Error_Msg_Node_2        err_vars__error_msg_node_2
 #define Error_Msg_Uint_1        err_vars__error_msg_uint_1
 #define Error_Msg_Uint_2        err_vars__error_msg_uint_2
-#define Serious_Errors_Detected err_vars__serious_errors_detected
 
 extern Entity_Id Error_Msg_Node_2;
 extern Uint      Error_Msg_Uint_1;
index 171f7a18e7d1eb5e1eadf1b7ffbbf59ec2b76ba8..f5432096e28f92508f95071facd21d924259226a 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2001-2010, Free Software Foundation, Inc.         --
+--          Copyright (C) 2001-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- --
index f1d54db47338edeb5336ff70656b13fc1d2eca59..19aa0693ef505dc31669d21d70b575d11396b0cc 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2001-2009, Free Software Foundation, Inc.         --
+--          Copyright (C) 2001-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- --
index 0fad22bf7a738c8dac8dc492135c8023408bf2d2..8eb1465bff47e3a88a7be139ee81d6c97214adca 100644 (file)
@@ -23,8 +23,8 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
+with Atree;    use Atree;
 with Csets;
-with Err_Vars; use Err_Vars;
 with Errutil;
 with Namet;    use Namet;
 with Opt;
@@ -524,13 +524,13 @@ package body GPrep is
 
          --  In verbose mode, if there is no error, report it
 
-         if Opt.Verbose_Mode and then Err_Vars.Total_Errors_Detected = 0 then
+         if Opt.Verbose_Mode and then Total_Errors_Detected = 0 then
             Errutil.Finalize (Source_Type => "input");
          end if;
 
          --  If we had some errors, delete the output file, and report them
 
-         if Err_Vars.Total_Errors_Detected > 0 then
+         if Total_Errors_Detected > 0 then
             if Outfile /= Standard_Output then
                Delete (Text_Outfile);
             end if;
index a2ea435269dec8f3499e1424f41c9dc23db3948b..b2a6d53bb48865d0a7c30a78c3c5041259aba33a 100644 (file)
@@ -24,6 +24,7 @@
 ------------------------------------------------------------------------------
 
 with ALI;      use ALI;
+with Atree;    use Atree;
 with Debug;
 with Err_Vars; use Err_Vars;
 with Errutil;
index cec2afefdb263f03425ccdc4fa96d839b9efa1ec..2fdd6c5e8e9203adac8579391557bea3d8dd10fb 100644 (file)
@@ -969,7 +969,7 @@ package body Par_SCO is
       --  The test here for zero is to deal with possible previous errors
 
       if Index = 0 then
-         Cascaded_Error;
+         Check_Error_Detected;
 
       else
          declare
index dd64bcb714b2329aa13752d3d2d359f29f9b0da9..2cc1c5e684f6a7c2c52dd1013f006fec2e4acfca 100644 (file)
@@ -23,6 +23,7 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
+with Atree;    use Atree;
 with Errout;   use Errout;
 with Lib.Writ; use Lib.Writ;
 with Opt;      use Opt;
index f1166afbb7301de5913a31e5a5664760fe42f130..5d09dbe6010bb820681c3c954fa780eda9b84b64 100644 (file)
@@ -23,6 +23,7 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
+with Atree;    use Atree;
 with Err_Vars; use Err_Vars;
 with Opt;      use Opt;
 with Osint;    use Osint;
@@ -690,7 +691,7 @@ package body Prj.Part is
       --  If there were any kind of error during the parsing, serious
       --  or not, then the parsing fails.
 
-      if Err_Vars.Total_Errors_Detected > 0 then
+      if Total_Errors_Detected > 0 then
          Project := Empty_Node;
       end if;
 
index cb9d533c7657ca3e64f0f65a1abe179f904d013d..dc745fe5ca6e55864e062d802339a320c12bfe10 100644 (file)
@@ -23,6 +23,7 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
+with Atree;    use Atree;
 with Err_Vars; use Err_Vars;
 with Opt;      use Opt;
 with Osint;    use Osint;
@@ -2908,7 +2909,7 @@ package body Prj.Proc is
 
             Process_Imported_Projects (Imported, Limited_With => True);
 
-            if Err_Vars.Total_Errors_Detected = 0 then
+            if Total_Errors_Detected = 0 then
                Process_Aggregated_Projects;
             end if;
 
@@ -2938,7 +2939,7 @@ package body Prj.Proc is
                   end loop;
                end if;
 
-               if Err_Vars.Total_Errors_Detected = 0 then
+               if Total_Errors_Detected = 0 then
 
                   --  For an aggregate library we add the aggregated projects
                   --  as imported ones. This is necessary to give visibility
index ce644bc095292f4dd725fca6b8265c3410da154d..e27c91d14f2356bbc5d34067de5611692e104149 100644 (file)
@@ -23,8 +23,8 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
+with Atree;    use Atree;
 with Csets;    use Csets;
-with Err_Vars; use Err_Vars;
 with Hostparm; use Hostparm;
 with Namet;    use Namet;
 with Opt;      use Opt;
index 21745fbb674e768d21424e76ddfef44d62a1e0d5..492e7b74da99e813346bfbefdb56bdaa68449cce 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2009, 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- --
index 0a90eb2e80ad148a1cef1d647f6847abf7baca1e..2f203dc2e836ae77b382d55cb78f8e766480c64d 100644 (file)
@@ -725,6 +725,7 @@ package body Sem_Ch10 is
          --  ignore the entire analysis effort
 
          if No (Lib_Unit) then
+            Check_Error_Detected;
             return;
 
          else
@@ -2677,7 +2678,7 @@ package body Sem_Ch10 is
             --  Abandon processing in case of previous errors
 
             if No (Par_Name) then
-               pragma Assert (Serious_Errors_Detected /= 0);
+               Check_Error_Detected;
                return;
             end if;
          end loop;
@@ -5105,7 +5106,7 @@ package body Sem_Ch10 is
             --  Abandon processing in case of previous errors
 
             if No (Scope (Uname)) then
-               pragma Assert (Serious_Errors_Detected /= 0);
+               Check_Error_Detected;
                return;
             end if;
 
index 51edb644c1dccbfe838bfe3424f0fbdd4d84e249..cdddfa86e76362474adfb90d3b95abccef2e6cb9 100644 (file)
@@ -7292,9 +7292,8 @@ package body Sem_Ch13 is
          --  clause in question, then there was some previous error for which
          --  we already gave a message, so just return with Comp Empty.
 
-         if No (Comp)
-           or else Component_Clause (Comp) /= CC
-         then
+         if No (Comp) or else Component_Clause (Comp) /= CC then
+            Check_Error_Detected;
             Comp := Empty;
 
          --  Normal case where we have a component clause
@@ -7897,15 +7896,22 @@ package body Sem_Ch13 is
          end if;
       end if;
 
-      --  Dismiss cases for generic types or types with previous errors
+      --  Dismiss generic types
 
-      if No (UT)
-        or else UT = Any_Type
-        or else Is_Generic_Type (UT)
-        or else Is_Generic_Type (Root_Type (UT))
+      if Is_Generic_Type (T)
+           or else
+         Is_Generic_Type (UT)
+           or else
+         Is_Generic_Type (Root_Type (UT))
       then
          return;
 
+      --  Guard against previous errors
+
+      elsif No (UT) or else UT = Any_Type then
+         Check_Error_Detected;
+         return;
+
       --  Check case of bit packed array
 
       elsif Is_Array_Type (UT)
index efa965eb94148c823e8ab86cc6b49bec35b0a781..f20a518d4d2b43d7ef6e319927897d2ee54ab2fd 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2011, 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- --
@@ -24,7 +24,6 @@
 ------------------------------------------------------------------------------
 
 with Atree;    use Atree;
-with Errout;   use Errout;
 with Namet;    use Namet;
 with Opt;      use Opt;
 with Restrict; use Restrict;
index a3b7f3ee2b94f702a7dd06cc91e52e361eb5dce0..e6f76e29f1cb72c216f905e11086e323a2e1e190 100644 (file)
@@ -12078,6 +12078,7 @@ package body Sem_Ch3 is
       --  Defend against previous errors
 
       if No (Scalar_Range (Derived_Type)) then
+         Check_Error_Detected;
          return;
       end if;
 
index 9d63e886aaf2c1a241cf4a268377cb82ee55ad9a..10fd3863af2b14a1003766972827333655c8cb34 100644 (file)
@@ -1921,6 +1921,7 @@ package body Sem_Ch4 is
       --  Defend against error of missing expressions from previous error
 
       if No (Then_Expr) then
+         Check_Error_Detected;
          return;
       end if;
 
@@ -3917,8 +3918,7 @@ package body Sem_Ch4 is
          --  subsequent semantic checks might examine the original node.
 
          Set_Entity (Sel, Comp);
-         Rewrite (Selector_Name (N),
-           New_Occurrence_Of (Comp, Sloc (N)));
+         Rewrite (Selector_Name (N), New_Occurrence_Of (Comp, Sloc (N)));
          Set_Original_Discriminant (Selector_Name (N), Comp);
          Set_Etype (N, Etype (Comp));
          Check_Implicit_Dereference (N, Etype (Comp));
@@ -3930,9 +3930,9 @@ package body Sem_Ch4 is
 
       elsif Is_Record_Type (Prefix_Type) then
 
-         --  Find component with given name
-         --  In an instance, if the node is known as a prefixed call, do
-         --  not examine components whose visibility may be accidental.
+         --  Find component with given name. In an instance, if the node is
+         --  known as a prefixed call, do not examine components whose
+         --  visibility may be accidental.
 
          while Present (Comp) and then not Is_Prefixed_Call (N) loop
             if Chars (Comp) = Chars (Sel)
index b062be948a18221d769f6d6f87c6a1657868c676..bf1eceb4c2f5131edc9cd822f8301f1990c88495 100644 (file)
@@ -898,6 +898,7 @@ package body Sem_Ch5 is
       --  up, and we just return immediately (defence against previous errors).
 
       if No (HSS) then
+         Check_Error_Detected;
          return;
       end if;
 
@@ -942,11 +943,8 @@ package body Sem_Ch5 is
             --  identifier and continue, otherwise raise an exception.
 
             if No (Ent) then
-               if Total_Errors_Detected /= 0 then
-                  Set_Identifier (N, Empty);
-               else
-                  raise Program_Error;
-               end if;
+               Check_Error_Detected;
+               Set_Identifier (N, Empty);
 
             else
                Set_Ekind (Ent, E_Block);
@@ -1398,6 +1396,7 @@ package body Sem_Ch5 is
       --  Ignore previous error
 
       if Label_Ent = Any_Id then
+         Check_Error_Detected;
          return;
 
       --  We just have a label as the target of a goto
index 8f6e4d7eaf4f65ce32ff3a6a12667f8fe0b5b2c7..9b38f0072fbbe84d0811c284f29c38bf5a9b7b81 100644 (file)
@@ -2094,7 +2094,9 @@ package body Sem_Ch9 is
 
                --  Pragma case
 
-               elsif Pragma_Name (Prio_Item) = Name_Priority then
+               elsif Nkind (Prio_Item) = N_Pragma
+                 and then Pragma_Name (Prio_Item) = Name_Priority
+               then
                   Error_Msg_N ("?pragma Interrupt_Priority is preferred "
                                & "in presence of handlers", Prio_Item);
                end if;
index 9b9de0a102baac06412a0440d532a5d71f1bfd9b..0e46efae9497bb76ab7ac2c82d3ad73c41c6b99b 100644 (file)
@@ -1634,7 +1634,7 @@ package body Sem_Dim is
             --  the call was aborted due to a previous error.
 
             if No (Actual) then
-               Cascaded_Error;
+               Check_Error_Detected;
                return;
             end if;
 
index 34aa69169d1de9cf908a775557d748015bfd9061..6d88c966e1f7fd252a5bae34a1d3f6c0b1f184df 100644 (file)
@@ -828,6 +828,7 @@ package body Sem_Elab is
                --  If no alias, there is a previous error
 
                if No (Ent) then
+                  Check_Error_Detected;
                   return;
                end if;
             end loop;
index 343485436c55294c19f94315173758068e522312..cf2a922f120efd5078b5ca33fc042a535876ce24 100644 (file)
@@ -1294,10 +1294,13 @@ package body Sem_Eval is
 
    begin
       --  Never known at compile time if bad type or raises constraint error
-      --  or empty (latter case occurs only as a result of a previous error)
+      --  or empty (latter case occurs only as a result of a previous error).
 
-      if No (Op)
-        or else Op = Error
+      if No (Op) then
+         Check_Error_Detected;
+         return False;
+
+      elsif Op = Error
         or else Etype (Op) = Any_Type
         or else Raises_Constraint_Error (Op)
       then
index f650be9c5790088334ee83b57a9ed3259331766e..93eb492473542398a481f41700ccffcfc9231fac 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2011, 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- --
@@ -271,7 +271,9 @@ package body Sem_Intr is
          --  Return if previous error in declaration, otherwise get T2 type
 
          if No (Next_Formal (First_Formal (E))) then
+            Check_Error_Detected;
             return;
+
          else
             T2 := Etype (Next_Formal (First_Formal (E)));
          end if;
index 4ca5285d7ef3e447210ac32f5e59975ccc606f06..ed9af8f11bf28cc0fd10008abf5627ffc82c7630 100644 (file)
@@ -5059,7 +5059,7 @@ package body Sem_Prag is
 
                   --  If previous error, avoid cascaded errors
 
-                  Cascaded_Error;
+                  Check_Error_Detected;
                   Applies   := True;
                   Effective := True;
 
index 0c46536e9613dadbe17f91014bdae76f6026a010..41d9a62a9d50b15d2d4f2f1aea3c0a1ab43e4236 100644 (file)
@@ -906,9 +906,10 @@ package body Sem_Type is
             --  covers an object T2 that implements a direct derivation of T1.
             --  Note: test for presence of E is defense against previous error.
 
-            if Present (E)
-              and then Present (Interfaces (E))
-            then
+            if No (E) then
+               Check_Error_Detected;
+
+            elsif Present (Interfaces (E)) then
                Elmt := First_Elmt (Interfaces (E));
                while Present (Elmt) loop
                   if Is_Ancestor (Etype (T1), Node (Elmt)) then
index 34bc4582cd87c3d6fc93749bc8077b38bfd4abc4..53ad6312daad41bce2ce26ee580200b5288ffcf6 100644 (file)
@@ -619,6 +619,7 @@ package body Sem_Warn is
          if No (Entity (Ident))
            or else Ekind (Entity (Ident)) /= E_Loop
          then
+            Check_Error_Detected;
             return;
          end if;
 
@@ -3317,7 +3318,7 @@ package body Sem_Warn is
                       or else
                     Denotes_Same_Prefix (Act1, Act2))
                then
-                  --  Exclude generic types and guard against previous errors.
+                  --  Exclude generic types and guard against previous errors
 
                   if Error_Posted (N)
                     or else No (Etype (Act1))
index cce2b8ff74593a8fb1190a3461464216475fb13b..886043bd8c398a4a8b17eb5ba2d03204f7800dc2 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2011, 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- --