Eliminate report_diagnostic macro
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 5 May 2017 21:01:05 +0000 (21:01 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Fri, 5 May 2017 21:01:05 +0000 (21:01 +0000)
This patch eliminates the report_diagnostic macro, manually
expanding it in all sites in the code.

No functional change intended.

gcc/c-family/ChangeLog:
* c-common.c (c_cpp_error): Replace report_diagnostic
with diagnostic_report_diagnostic.

gcc/c/ChangeLog:
* c-decl.c (warn_defaults_to): Replace report_diagnostic
with diagnostic_report_diagnostic.
* c-errors.c (pedwarn_c99): Likewise.
(pedwarn_c90): Likewise.

gcc/cp/ChangeLog:
* error.c (pedwarn_cxx98): Replace report_diagnostic
with diagnostic_report_diagnostic.

gcc/ChangeLog:
* diagnostic.c (diagnostic_impl): Replace report_diagnostic
with diagnostic_report_diagnostic.
(diagnostic_n_impl_richloc): Likewise.
* diagnostic.h (report_diagnostic): Delete macro.
* rtl-error.c (diagnostic_for_asm): Replace report_diagnostic
with diagnostic_report_diagnostic.
* substring-locations.c (format_warning_va): Likewise.

gcc/fortran/ChangeLog:
* cpp.c (cb_cpp_error): Replace report_diagnostic
with diagnostic_report_diagnostic.
* error.c (gfc_warning): Likewise.
(gfc_warning_now_at): Likewise.
(gfc_warning_now): Likewise.
(gfc_warning_internal): Likewise.
(gfc_error_now): Likewise.
(gfc_fatal_error): Likewise.
(gfc_error_opt): Likewise.
(gfc_internal_error): Likewise.

From-SVN: r247663

15 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/c/c-errors.c
gcc/cp/ChangeLog
gcc/cp/error.c
gcc/diagnostic.c
gcc/diagnostic.h
gcc/fortran/ChangeLog
gcc/fortran/cpp.c
gcc/fortran/error.c
gcc/rtl-error.c
gcc/substring-locations.c

index 079fb47012f54b9a138c0b47e882c09ea9b660d9..72c8c9e707f23463f3045a5c966992b4fa34e26f 100644 (file)
@@ -1,3 +1,13 @@
+2017-05-05  David Malcolm  <dmalcolm@redhat.com>
+
+       * diagnostic.c (diagnostic_impl): Replace report_diagnostic
+       with diagnostic_report_diagnostic.
+       (diagnostic_n_impl_richloc): Likewise.
+       * diagnostic.h (report_diagnostic): Delete macro.
+       * rtl-error.c (diagnostic_for_asm): Replace report_diagnostic
+       with diagnostic_report_diagnostic.
+       * substring-locations.c (format_warning_va): Likewise.
+
 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
 
        * diagnostic.c (diagnostic_report_diagnostic): Eliminate
index 63d41979de7034c09879aeb783321d574c53f890..a1bb25c7aa0dab99f545519cef48980fe546f33d 100644 (file)
@@ -1,3 +1,8 @@
+2017-05-05  David Malcolm  <dmalcolm@redhat.com>
+
+       * c-common.c (c_cpp_error): Replace report_diagnostic
+       with diagnostic_report_diagnostic.
+
 2017-05-04  Martin Sebor  <msebor@redhat.com>
 
        PR translation/80280
index 088492294cac1a7292f1ca0bd71eb2fb0c19e460..f46b2547644fadef437874c8dbf06806a46014e8 100644 (file)
@@ -6109,7 +6109,7 @@ c_cpp_error (cpp_reader *pfile ATTRIBUTE_UNUSED, int level, int reason,
                                  richloc, dlevel);
   diagnostic_override_option_index (&diagnostic,
                                     c_option_controlling_cpp_error (reason));
-  ret = report_diagnostic (&diagnostic);
+  ret = diagnostic_report_diagnostic (global_dc, &diagnostic);
   if (level == CPP_DL_WARNING_SYSHDR)
     global_dc->dc_warn_system_headers = save_warn_system_headers;
   return ret;
index 3c26eac90508a5fdb6133001848eb95b31cdfe12..45f375fdfa5c93d9b9ff24deb0eb6fba790757fa 100644 (file)
@@ -1,3 +1,10 @@
+2017-05-05  David Malcolm  <dmalcolm@redhat.com>
+
+       * c-decl.c (warn_defaults_to): Replace report_diagnostic
+       with diagnostic_report_diagnostic.
+       * c-errors.c (pedwarn_c99): Likewise.
+       (pedwarn_c90): Likewise.
+
 2017-05-01  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>
 
         PR c++/80038
index 64a11079a0e3c1c9694c0bc67b2648011f3cf105..b779d37aaaed7fc369632a7c11a599997a2b11af 100644 (file)
@@ -5486,7 +5486,7 @@ warn_defaults_to (location_t location, int opt, const char *gmsgid, ...)
   diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc,
                        flag_isoc99 ? DK_PEDWARN : DK_WARNING);
   diagnostic.option_index = opt;
-  report_diagnostic (&diagnostic);
+  diagnostic_report_diagnostic (global_dc, &diagnostic);
   va_end (ap);
 }
 
index 2c9267c186536aef2ad0227aedd9184e9175eb16..aa9ce4205dd2c3a644cda39a52eb507ff2f8c728 100644 (file)
@@ -48,7 +48,7 @@ pedwarn_c99 (location_t location, int opt, const char *gmsgid, ...)
                           (pedantic && !flag_isoc11)
                           ? DK_PEDWARN : DK_WARNING);
       diagnostic.option_index = OPT_Wc99_c11_compat;
-      warned = report_diagnostic (&diagnostic);
+      warned = diagnostic_report_diagnostic (global_dc, &diagnostic);
     }
   /* -Wno-c99-c11-compat suppresses even the pedwarns.  */
   else if (warn_c99_c11_compat == 0)
@@ -58,7 +58,7 @@ pedwarn_c99 (location_t location, int opt, const char *gmsgid, ...)
     {
       diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc, DK_PEDWARN);
       diagnostic.option_index = opt;
-      warned = report_diagnostic (&diagnostic);
+      warned = diagnostic_report_diagnostic (global_dc, &diagnostic);
     }
   va_end (ap);
   return warned;
@@ -92,7 +92,7 @@ pedwarn_c90 (location_t location, int opt, const char *gmsgid, ...)
                               (pedantic && !flag_isoc99)
                               ? DK_PEDWARN : DK_WARNING);
          diagnostic.option_index = opt;
-         report_diagnostic (&diagnostic);
+         diagnostic_report_diagnostic (global_dc, &diagnostic);
          warned = true;
          goto out;
        }
@@ -105,7 +105,7 @@ pedwarn_c90 (location_t location, int opt, const char *gmsgid, ...)
                           (pedantic && !flag_isoc99)
                           ? DK_PEDWARN : DK_WARNING);
       diagnostic.option_index = OPT_Wc90_c99_compat;
-      report_diagnostic (&diagnostic);
+      diagnostic_report_diagnostic (global_dc, &diagnostic);
     }
   /* -Wno-c90-c99-compat suppresses the pedwarns.  */
   else if (warn_c90_c99_compat == 0)
@@ -115,7 +115,7 @@ pedwarn_c90 (location_t location, int opt, const char *gmsgid, ...)
     {
       diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc, DK_PEDWARN);
       diagnostic.option_index = opt;
-      report_diagnostic (&diagnostic);
+      diagnostic_report_diagnostic (global_dc, &diagnostic);
       warned = true;
     }
 out:
index f81b6863d0322e45a32b7a00831377aaf4d752bc..8389282d7860388f4b6e3d0f67486693407b327a 100644 (file)
@@ -1,3 +1,8 @@
+2017-05-05  David Malcolm  <dmalcolm@redhat.com>
+
+       * error.c (pedwarn_cxx98): Replace report_diagnostic
+       with diagnostic_report_diagnostic.
+
 2017-05-05  Nathan Sidwell  <nathan@acm.org>
 
        * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
index a83ecb2e0f2694ba7364863a54ae011ee5c3c69e..0912d2d66b94e756a6723cf4f2ac363b897b633b 100644 (file)
@@ -3755,7 +3755,7 @@ pedwarn_cxx98 (location_t location, int opt, const char *gmsgid, ...)
   diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc,
                       (cxx_dialect == cxx98) ? DK_PEDWARN : DK_WARNING);
   diagnostic.option_index = opt;
-  ret = report_diagnostic (&diagnostic);
+  ret = diagnostic_report_diagnostic (global_dc, &diagnostic);
   va_end (ap);
   return ret;
 }
index f1b6b1ef16a34eb7daa54dc1f9fef7d5aaab8900..815bdb01169b8413e69f4fbb351c6054cb7d7a66 100644 (file)
@@ -1076,7 +1076,7 @@ diagnostic_impl (rich_location *richloc, int opt,
       if (kind == DK_WARNING || kind == DK_PEDWARN)
        diagnostic.option_index = opt;
     }
-  return report_diagnostic (&diagnostic);
+  return diagnostic_report_diagnostic (global_dc, &diagnostic);
 }
 
 /* Same as diagonostic_n_impl taking rich_location instead of location_t.  */
@@ -1092,7 +1092,7 @@ diagnostic_n_impl_richloc (rich_location *richloc, int opt, int n,
                                   ap, richloc, kind);
   if (kind == DK_WARNING)
     diagnostic.option_index = opt;
-  return report_diagnostic (&diagnostic);
+  return diagnostic_report_diagnostic (global_dc, &diagnostic);
 } 
 
 /* Implement inform_n, warning_n, and error_n, as documented and
index 91a964276650ed86e6a08c24dc30cdc9225fa2f2..846a158eeb5c7d0059566ce918bf2c36b903a185 100644 (file)
@@ -278,8 +278,6 @@ extern diagnostic_context *global_dc;
   (!(DC)->dc_inhibit_warnings                                          \
    && !(in_system_header_at (LOC) && !(DC)->dc_warn_system_headers))
 
-#define report_diagnostic(D) diagnostic_report_diagnostic (global_dc, D)
-
 /* Override the option index to be used for reporting a
    diagnostic.  */
 #define diagnostic_override_option_index(DI, OPTIDX) \
index 1cc78c94b037427fda77a77e8a4ea2bf620d74d1..27fcf6efec529c53a9de0aa3e3fb394ce39c054d 100644 (file)
@@ -1,3 +1,16 @@
+2017-05-05  David Malcolm  <dmalcolm@redhat.com>
+
+       * cpp.c (cb_cpp_error): Replace report_diagnostic
+       with diagnostic_report_diagnostic.
+       * error.c (gfc_warning): Likewise.
+       (gfc_warning_now_at): Likewise.
+       (gfc_warning_now): Likewise.
+       (gfc_warning_internal): Likewise.
+       (gfc_error_now): Likewise.
+       (gfc_fatal_error): Likewise.
+       (gfc_error_opt): Likewise.
+       (gfc_internal_error): Likewise.
+
 2017-05-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/37131
index 6ac37ad8563384d6a0828a513697e0ec9acccfd9..4d1b56a00450d576370246242173e0feea38774a 100644 (file)
@@ -1062,7 +1062,7 @@ cb_cpp_error (cpp_reader *pfile ATTRIBUTE_UNUSED, int level, int reason,
                                  richloc, dlevel);
   if (reason == CPP_W_WARNING_DIRECTIVE)
     diagnostic_override_option_index (&diagnostic, OPT_Wcpp);
-  ret = report_diagnostic (&diagnostic);
+  ret = diagnostic_report_diagnostic (global_dc, &diagnostic);
   if (level == CPP_DL_WARNING_SYSHDR)
     global_dc->dc_warn_system_headers = save_warn_system_headers;
   return ret;
index 0312499f324ecbbc68c3d5945a43010d6264c01b..eeb7a785c3d51aa332c3b421efafce662d471f04 100644 (file)
@@ -789,7 +789,7 @@ gfc_warning (int opt, const char *gmsgid, va_list ap)
   diagnostic_set_info (&diagnostic, gmsgid, &argp, &rich_loc,
                       DK_WARNING);
   diagnostic.option_index = opt;
-  bool ret = report_diagnostic (&diagnostic);
+  bool ret = diagnostic_report_diagnostic (global_dc, &diagnostic);
 
   if (buffered_p)
     {
@@ -1138,7 +1138,7 @@ gfc_warning_now_at (location_t loc, int opt, const char *gmsgid, ...)
   va_start (argp, gmsgid);
   diagnostic_set_info (&diagnostic, gmsgid, &argp, &rich_loc, DK_WARNING);
   diagnostic.option_index = opt;
-  ret = report_diagnostic (&diagnostic);
+  ret = diagnostic_report_diagnostic (global_dc, &diagnostic);
   va_end (argp);
   return ret;
 }
@@ -1157,7 +1157,7 @@ gfc_warning_now (int opt, const char *gmsgid, ...)
   diagnostic_set_info (&diagnostic, gmsgid, &argp, &rich_loc,
                       DK_WARNING);
   diagnostic.option_index = opt;
-  ret = report_diagnostic (&diagnostic);
+  ret = diagnostic_report_diagnostic (global_dc, &diagnostic);
   va_end (argp);
   return ret;
 }
@@ -1176,7 +1176,7 @@ gfc_warning_internal (int opt, const char *gmsgid, ...)
   diagnostic_set_info (&diagnostic, gmsgid, &argp, &rich_loc,
                       DK_WARNING);
   diagnostic.option_index = opt;
-  ret = report_diagnostic (&diagnostic);
+  ret = diagnostic_report_diagnostic (global_dc, &diagnostic);
   va_end (argp);
   return ret;
 }
@@ -1194,7 +1194,7 @@ gfc_error_now (const char *gmsgid, ...)
 
   va_start (argp, gmsgid);
   diagnostic_set_info (&diagnostic, gmsgid, &argp, &rich_loc, DK_ERROR);
-  report_diagnostic (&diagnostic);
+  diagnostic_report_diagnostic (global_dc, &diagnostic);
   va_end (argp);
 }
 
@@ -1210,7 +1210,7 @@ gfc_fatal_error (const char *gmsgid, ...)
 
   va_start (argp, gmsgid);
   diagnostic_set_info (&diagnostic, gmsgid, &argp, &rich_loc, DK_FATAL);
-  report_diagnostic (&diagnostic);
+  diagnostic_report_diagnostic (global_dc, &diagnostic);
   va_end (argp);
 
   gcc_unreachable ();
@@ -1295,7 +1295,7 @@ gfc_error_opt (int opt, const char *gmsgid, va_list ap)
     }
 
   diagnostic_set_info (&diagnostic, gmsgid, &argp, &richloc, DK_ERROR);
-  report_diagnostic (&diagnostic);
+  diagnostic_report_diagnostic (global_dc, &diagnostic);
 
   if (buffered_p)
     {
@@ -1345,7 +1345,7 @@ gfc_internal_error (const char *gmsgid, ...)
 
   va_start (argp, gmsgid);
   diagnostic_set_info (&diagnostic, gmsgid, &argp, &rich_loc, DK_ICE);
-  report_diagnostic (&diagnostic);
+  diagnostic_report_diagnostic (global_dc, &diagnostic);
   va_end (argp);
 
   gcc_unreachable ();
index c8a11916dc76d6e2b8b56aee9d089303ed00f416..e04bd7eea4ed3456da6cee3f0d8998e57ed467ab 100644 (file)
@@ -71,7 +71,7 @@ diagnostic_for_asm (const rtx_insn *insn, const char *msg, va_list *args_ptr,
 
   diagnostic_set_info (&diagnostic, msg, args_ptr,
                       &richloc, kind);
-  report_diagnostic (&diagnostic);
+  diagnostic_report_diagnostic (global_dc, &diagnostic);
 }
 
 void
index e2d8dd7ea88634f759b96667149c1cec99ab6969..433023d9845295189d2a78ef2dfe5ea588ca58f0 100644 (file)
@@ -150,7 +150,7 @@ format_warning_va (const substring_loc &fmt_loc,
   diagnostic_info diagnostic;
   diagnostic_set_info (&diagnostic, gmsgid, ap, &richloc, DK_WARNING);
   diagnostic.option_index = opt;
-  bool warned = report_diagnostic (&diagnostic);
+  bool warned = diagnostic_report_diagnostic (global_dc, &diagnostic);
 
   if (!err && fmt_substring_loc && !substring_within_range)
     /* Case 2.  */