toplev.c (rest_of_type_compilation): Return early in case of errors.
authorHans-Peter Nilsson <hp@bitrange.com>
Wed, 30 Oct 2002 00:19:59 +0000 (00:19 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Wed, 30 Oct 2002 00:19:59 +0000 (00:19 +0000)
* toplev.c (rest_of_type_compilation): Return early in case of
errors.
(check_global_declarations): Don't call debug_hooks->global_decl
in case of errors.

From-SVN: r58645

gcc/ChangeLog
gcc/toplev.c

index 6250ccd56dcee239e9cb38fddf458926ce2e1d97..73713f022e1354df57776e443a0c9fe03f1ed767 100644 (file)
@@ -1,3 +1,10 @@
+2002-10-29  Hans-Peter Nilsson  <hp@bitrange.com>
+
+       * toplev.c (rest_of_type_compilation): Return early in case of
+       errors.
+       (check_global_declarations): Don't call debug_hooks->global_decl
+       in case of errors.
+
 2002-10-28  Andreas Bauer  <baueran@in.tum.de>
 
        * doc/c-tree.texi (Tree overview): Fix typos.
index 447ef032ee48c9cafd7a061600a66813e7c21658..2f3d127441d69ff68eb4d1b19cbeb6b274dcf3f8 100644 (file)
@@ -2050,9 +2050,14 @@ check_global_declarations (vec, len)
          && (*lang_hooks.decls.warn_unused_global) (decl))
        warning_with_decl (decl, "`%s' defined but not used");
 
-      timevar_push (TV_SYMOUT);
-      (*debug_hooks->global_decl) (decl);
-      timevar_pop (TV_SYMOUT);
+      /* Avoid confusing the debug information machinery when there are
+        errors.  */
+      if (errorcount == 0 && sorrycount == 0)
+       {
+         timevar_push (TV_SYMOUT);
+         (*debug_hooks->global_decl) (decl);
+         timevar_pop (TV_SYMOUT);
+       }
     }
 }
 
@@ -2341,6 +2346,11 @@ rest_of_type_compilation (type, toplev)
      int toplev ATTRIBUTE_UNUSED;
 #endif
 {
+  /* Avoid confusing the debug information machinery when there are
+     errors.  */
+  if (errorcount != 0 || sorrycount != 0)
+    return;
+
   timevar_push (TV_SYMOUT);
 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
   if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)