]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
diagnostics: eliminate ::diagnostic_info typedef
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 25 Jul 2025 19:13:45 +0000 (15:13 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 25 Jul 2025 19:13:45 +0000 (15:13 -0400)
No functional change intended.

gcc/c-family/ChangeLog:
* c-common.cc: Update usage of "diagnostic_info" to explicitly
refer to "diagnostics::diagnostic_info".
* c-opts.cc: Likewise.

gcc/c/ChangeLog:
* c-errors.cc: Update usage of "diagnostic_info" to explicitly
refer to "diagnostics::diagnostic_info".

gcc/cp/ChangeLog:
* constexpr.cc: Update usage of "diagnostic_info" to explicitly
refer to "diagnostics::diagnostic_info".
* cp-tree.h: Likewise.
* error.cc: Likewise.
* module.cc: Likewise.

gcc/d/ChangeLog:
* d-diagnostic.cc: Likewise.

gcc/ChangeLog:
* diagnostic.h: Eliminate "diagnostic_info" typedef.
* diagnostics/context.cc: Update usage of "diagnostic_info" to
explicitly refer to "diagnostics::diagnostic_info".
* langhooks.cc: Likewise.
* libgdiagnostics.cc: Likewise.
* rtl-error.cc: Likewise.
* substring-locations.cc: Likewise.
* toplev.cc: Likewise.
* tree-diagnostic.cc: Likewise.
* tree-diagnostic.h: Likewise.

gcc/fortran/ChangeLog:
* cpp.cc: Update usage of "diagnostic_info" to explicitly refer to
"diagnostics::diagnostic_info".
* error.cc: Likewise.

gcc/jit/ChangeLog:
* dummy-frontend.cc: Update usage of "diagnostic_info" to
explicitly refer to "diagnostics::diagnostic_info".

gcc/m2/ChangeLog:
* gm2-gcc/m2linemap.cc: Update usage of "diagnostic_info" to
explicitly refer to "diagnostics::diagnostic_info".
* gm2-gcc/rtegraph.cc: Likewise.

gcc/rust/ChangeLog:
* resolve/rust-ice-finalizer.cc: Update usage of "diagnostic_info"
to explicitly refer to "diagnostics::diagnostic_info".
* resolve/rust-ice-finalizer.h: Likewise.

gcc/testsuite/ChangeLog:
* g++.dg/plugin/show_template_tree_color_plugin.cc: Update usage
of "diagnostic_info" to explicitly refer to
"diagnostics::diagnostic_info".
* gcc.dg/plugin/diagnostic_group_plugin.cc: Likewise.
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.cc: Likewise.
* gcc.dg/plugin/location_overflow_plugin.cc: Likewise.

libcc1/ChangeLog:
* context.cc: Update usage of "diagnostic_info" to explicitly
refer to "diagnostics::diagnostic_info".

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
29 files changed:
gcc/c-family/c-common.cc
gcc/c-family/c-opts.cc
gcc/c/c-errors.cc
gcc/cp/constexpr.cc
gcc/cp/cp-tree.h
gcc/cp/error.cc
gcc/cp/module.cc
gcc/d/d-diagnostic.cc
gcc/diagnostic.h
gcc/diagnostics/context.cc
gcc/fortran/cpp.cc
gcc/fortran/error.cc
gcc/jit/dummy-frontend.cc
gcc/langhooks.cc
gcc/libgdiagnostics.cc
gcc/m2/gm2-gcc/m2linemap.cc
gcc/m2/gm2-gcc/rtegraph.cc
gcc/rtl-error.cc
gcc/rust/resolve/rust-ice-finalizer.cc
gcc/rust/resolve/rust-ice-finalizer.h
gcc/substring-locations.cc
gcc/testsuite/g++.dg/plugin/show_template_tree_color_plugin.cc
gcc/testsuite/gcc.dg/plugin/diagnostic_group_plugin.cc
gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_show_locus.cc
gcc/testsuite/gcc.dg/plugin/location_overflow_plugin.cc
gcc/toplev.cc
gcc/tree-diagnostic.cc
gcc/tree-diagnostic.h
libcc1/context.cc

index 17c2aed6939e7892383d58df8aff2f5e6b55934f..07059dc1f9201fe012c70ffa267ed9544a2437f8 100644 (file)
@@ -7068,7 +7068,7 @@ c_cpp_diagnostic (cpp_reader *pfile ATTRIBUTE_UNUSED,
                  rich_location *richloc,
                  const char *msg, va_list *ap)
 {
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   enum diagnostics::kind dlevel;
   bool save_warn_system_headers = global_dc->m_warn_system_headers;
   bool ret;
index d256ea60444581a28411cdc4e4924cb5088a6632..2ce05e5c7ce67f1837e7cc417f7fe82f8ac1d0a4 100644 (file)
@@ -170,7 +170,7 @@ c_common_option_lang_mask (void)
 /* Diagnostic finalizer for C/C++/Objective-C/Objective-C++.  */
 static void
 c_diagnostic_text_finalizer (diagnostics::text_sink &text_output,
-                            const diagnostic_info *diagnostic,
+                            const diagnostics::diagnostic_info *diagnostic,
                             enum diagnostics::kind)
 {
   pretty_printer *const pp = text_output.get_printer ();
index 39ec1304766d1e8deee20be9ecbf9ad935948dea..e2c74fe818910a1a609d81ca719f2669c400b664 100644 (file)
@@ -36,7 +36,7 @@ pedwarn_c23 (location_t location,
             diagnostics::option_id option_id,
             const char *gmsgid, ...)
 {
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   va_list ap;
   bool warned = false;
   rich_location richloc (line_table, location);
@@ -82,7 +82,7 @@ pedwarn_c11 (location_t location,
             diagnostics::option_id option_id,
             const char *gmsgid, ...)
 {
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   va_list ap;
   bool warned = false;
   rich_location richloc (line_table, location);
@@ -129,7 +129,7 @@ pedwarn_c99 (location_t location,
             diagnostics::option_id option_id,
             const char *gmsgid, ...)
 {
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   va_list ap;
   bool warned = false;
   rich_location richloc (line_table, location);
@@ -173,7 +173,7 @@ pedwarn_c90 (location_t location,
             diagnostics::option_id option_id,
             const char *gmsgid, ...)
 {
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   va_list ap;
   bool warned = false;
   rich_location richloc (line_table, location);
index 202d64b21431f67db8837da8804e407d62f3085b..f92beb17906edd2f39b7b0a32e66489996adc631 100644 (file)
@@ -153,7 +153,7 @@ static bool
 constexpr_error (location_t location, bool constexpr_fundef_p,
                 const char *gmsgid, ...)
 {
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   va_list ap;
   rich_location richloc (line_table, location);
   va_start (ap, gmsgid);
index e3bfed0ef567d319fe1660cb664e186164cc1a88..c8391d60cdac26129edb8f762415ee36a948f2d3 100644 (file)
@@ -8465,7 +8465,7 @@ extern void cxx_print_type                        (FILE *, tree, int);
 extern void cxx_print_identifier               (FILE *, tree, int);
 extern void cxx_print_error_function           (diagnostics::text_sink &,
                                                 const char *,
-                                                const diagnostic_info *);
+                                                const diagnostics::diagnostic_info *);
 
 /* in typeck.cc */
 /* Says how we should behave when comparing two arrays one of which
index 814aa07bc4b0171d02191cb45aff3d6492936ffd..c427163d28347c69b60b15d3050482976f28f9a0 100644 (file)
@@ -104,9 +104,9 @@ static void print_instantiation_partial_context (diagnostics::text_sink &,
                                                 location_t);
 static void maybe_print_constraint_context (diagnostics::text_sink &);
 static void cp_diagnostic_text_starter (diagnostics::text_sink &,
-                                       const diagnostic_info *);
+                                       const diagnostics::diagnostic_info *);
 static void cp_print_error_function (diagnostics::text_sink &,
-                                    const diagnostic_info *);
+                                    const diagnostics::diagnostic_info *);
 
 static bool cp_printer (pretty_printer *, text_info *, const char *,
                        int, bool, bool, bool, bool *, pp_token_list &);
@@ -251,7 +251,7 @@ erroneous_templates_t *erroneous_templates;
 
 static void
 cp_adjust_diagnostic_info (diagnostics::context *context,
-                          diagnostic_info *diagnostic)
+                          diagnostics::diagnostic_info *diagnostic)
 {
   if (diagnostic->m_kind == diagnostics::kind::error)
     if (tree tmpl = get_current_template ())
@@ -3763,7 +3763,7 @@ eh_spec_to_string (tree p, int /*v*/)
 void
 cxx_print_error_function (diagnostics::text_sink &text_output,
                          const char *file,
-                         const diagnostic_info *diagnostic)
+                         const diagnostics::diagnostic_info *diagnostic)
 {
   char *prefix;
   if (file)
@@ -3778,7 +3778,7 @@ cxx_print_error_function (diagnostics::text_sink &text_output,
 
 static void
 cp_diagnostic_text_starter (diagnostics::text_sink &text_output,
-                           const diagnostic_info *diagnostic)
+                           const diagnostics::diagnostic_info *diagnostic)
 {
   pp_set_prefix (text_output.get_printer (),
                 text_output.build_indent_prefix (true));
@@ -3795,7 +3795,7 @@ cp_diagnostic_text_starter (diagnostics::text_sink &text_output,
    a diagnostic message.  Called from cp_diagnostic_starter.  */
 static void
 cp_print_error_function (diagnostics::text_sink &text_output,
-                        const diagnostic_info *diagnostic)
+                        const diagnostics::diagnostic_info *diagnostic)
 {
   /* If we are in an instantiation context, current_function_decl is likely
      to be wrong, so just rely on print_instantiation_full_context.  */
@@ -4932,7 +4932,7 @@ pedwarn_cxx98 (location_t location,
               diagnostics::option_id option_id,
               const char *gmsgid, ...)
 {
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   va_list ap;
   bool ret;
   rich_location richloc (line_table, location);
index 42a1979ac510684989c178afd2ad3e2686d3972e..0a689bb32233325624045aabf84a5798c8373885 100644 (file)
@@ -4822,7 +4822,8 @@ noisy_p ()
     return false;
 
   pp_needs_newline (global_dc->get_reference_printer ()) = true;
-  diagnostic_set_last_function (global_dc, (diagnostic_info *) NULL);
+  diagnostic_set_last_function (global_dc,
+                               (diagnostics::diagnostic_info *) nullptr);
 
   return true;
 }
index 44749344ce4868e079eda9c344c6c81da422cc81..e666ddf48b79f3b1b13c4051c507ea019dcedc84 100644 (file)
@@ -193,7 +193,7 @@ d_diagnostic_report_diagnostic (const SourceLoc &loc, int opt,
   if (loc.filename.length != 0 || !verbatim)
     {
       rich_location rich_loc (line_table, make_location_t (loc));
-      diagnostic_info diagnostic;
+      diagnostics::diagnostic_info diagnostic;
       char *xformat = expand_d_format (format);
 
       diagnostic_set_info_translated (&diagnostic, xformat, &argp,
index 5d9751469e0b72073d44ce149ba35200a54215bb..d22d77b1988236c3d5fdecd8282e443985d22867 100644 (file)
@@ -26,8 +26,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "diagnostic-core.h"
 
 #include "diagnostics/diagnostic-info.h"
-typedef diagnostics::diagnostic_info diagnostic_info;
-
 #include "diagnostics/context.h"
 
 /* Extension hooks for client.  */
@@ -58,7 +56,7 @@ extern diagnostics::context *global_dc;
    diagnostic.  */
 
 inline void
-diagnostic_set_option_id (diagnostic_info *info,
+diagnostic_set_option_id (diagnostics::diagnostic_info *info,
                          diagnostics::option_id opt_id)
 {
   info->m_option_id = opt_id;
@@ -174,7 +172,7 @@ diagnostic_pop_diagnostics (diagnostics::context *context,
 
 inline bool
 diagnostic_report_diagnostic (diagnostics::context *context,
-                             diagnostic_info *diagnostic)
+                             diagnostics::diagnostic_info *diagnostic)
 {
   context->begin_group ();
   bool warned = context->report_diagnostic (diagnostic);
@@ -183,10 +181,14 @@ diagnostic_report_diagnostic (diagnostics::context *context,
 }
 
 #ifdef ATTRIBUTE_GCC_DIAG
-extern void diagnostic_set_info (diagnostic_info *, const char *, va_list *,
-                                rich_location *, enum diagnostics::kind) ATTRIBUTE_GCC_DIAG(2,0);
-extern void diagnostic_set_info_translated (diagnostic_info *, const char *,
-                                           va_list *, rich_location *,
+extern void diagnostic_set_info (diagnostics::diagnostic_info *,
+                                const char *, va_list *,
+                                rich_location *,
+                                enum diagnostics::kind)
+  ATTRIBUTE_GCC_DIAG(2,0);
+extern void diagnostic_set_info_translated (diagnostics::diagnostic_info *,
+                                           const char *, va_list *,
+                                           rich_location *,
                                            enum diagnostics::kind)
      ATTRIBUTE_GCC_DIAG(2,0);
 #endif
@@ -194,13 +196,13 @@ extern void diagnostic_set_info_translated (diagnostic_info *, const char *,
 namespace diagnostics {
 
 void default_text_starter (diagnostics::text_sink &,
-                          const diagnostic_info *);
+                          const diagnostics::diagnostic_info *);
 template <typename Sink>
 void default_start_span_fn (const diagnostics::location_print_policy &,
                            Sink &sink,
                            expanded_location);
 void default_text_finalizer (diagnostics::text_sink &,
-                            const diagnostic_info *,
+                            const diagnostics::diagnostic_info *,
                             enum diagnostics::kind);
 } // namespace diagnostics
 
@@ -212,7 +214,8 @@ int get_terminal_width (void);
    specifies which location. By default, expand the first one.  */
 
 inline location_t
-diagnostic_location (const diagnostic_info * diagnostic, int which = 0)
+diagnostic_location (const diagnostics::diagnostic_info *diagnostic,
+                    int which = 0)
 {
   return diagnostic->m_message.get_location (which);
 }
@@ -220,7 +223,7 @@ diagnostic_location (const diagnostic_info * diagnostic, int which = 0)
 /* Return the number of locations to be printed in DIAGNOSTIC.  */
 
 inline unsigned int
-diagnostic_num_locations (const diagnostic_info * diagnostic)
+diagnostic_num_locations (const diagnostics::diagnostic_info *diagnostic)
 {
   return diagnostic->m_message.m_richloc->get_num_locations ();
 }
@@ -230,7 +233,8 @@ diagnostic_num_locations (const diagnostic_info * diagnostic)
    expand the first one.  */
 
 inline expanded_location
-diagnostic_expand_location (const diagnostic_info * diagnostic, int which = 0)
+diagnostic_expand_location (const diagnostics::diagnostic_info *diagnostic,
+                           int which = 0)
 {
   return diagnostic->m_richloc->get_expanded_location (which);
 }
index 64bb315bd1fab5ed6e5a78bcaa5a8453916ec918..842baedc89e92a2cab2aabd3076ba239060e4736 100644 (file)
@@ -580,8 +580,9 @@ context::initialize_fixits_change_set ()
 /* Initialize DIAGNOSTIC, where the message MSG has already been
    translated.  */
 void
-diagnostic_set_info_translated (diagnostic_info *diagnostic, const char *msg,
-                               va_list *args, rich_location *richloc,
+diagnostic_set_info_translated (diagnostics::diagnostic_info *diagnostic,
+                               const char *msg, va_list *args,
+                               rich_location *richloc,
                                enum diagnostics::kind kind)
 {
   gcc_assert (richloc);
@@ -598,8 +599,9 @@ diagnostic_set_info_translated (diagnostic_info *diagnostic, const char *msg,
 /* Initialize DIAGNOSTIC, where the message GMSGID has not yet been
    translated.  */
 void
-diagnostic_set_info (diagnostic_info *diagnostic, const char *gmsgid,
-                    va_list *args, rich_location *richloc,
+diagnostic_set_info (diagnostics::diagnostic_info *diagnostic,
+                    const char *gmsgid, va_list *args,
+                    rich_location *richloc,
                     enum diagnostics::kind kind)
 {
   gcc_assert (richloc);
index 01113589fe7b423d0060979d24740fabb235455e..15ecc7dd5fa3dbb1e5e4d9e323a218ba7a42aa41 100644 (file)
@@ -1088,7 +1088,7 @@ cb_cpp_diagnostic (cpp_reader *pfile ATTRIBUTE_UNUSED,
                   rich_location *richloc,
                   const char *msg, va_list *ap)
 {
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   enum diagnostics::kind dlevel;
   bool save_warn_system_headers = global_dc->m_warn_system_headers;
   bool ret;
index 8d913aa89ef6495911861c9a6f66133806a9defe..564513da64c5569008935cb133335aac1d620dc3 100644 (file)
@@ -237,13 +237,13 @@ gfc_clear_diagnostic_buffer (diagnostics::buffer *this_buffer)
 /* The currently-printing diagnostic, for use by gfc_format_decoder,
    for colorizing %C and %L.  */
 
-static diagnostic_info *curr_diagnostic;
+static diagnostics::diagnostic_info *curr_diagnostic;
 
 /* A helper function to call diagnostic_report_diagnostic, while setting
    curr_diagnostic for the duration of the call.  */
 
 static bool
-gfc_report_diagnostic (diagnostic_info *diagnostic)
+gfc_report_diagnostic (diagnostics::diagnostic_info *diagnostic)
 {
   gcc_assert (diagnostic != NULL);
   curr_diagnostic = diagnostic;
@@ -261,7 +261,7 @@ gfc_warning (int opt, const char *gmsgid, va_list ap)
   va_list argp;
   va_copy (argp, ap);
 
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   rich_location rich_loc (line_table, UNKNOWN_LOCATION);
   diagnostics::buffer *old_buffer = global_dc->get_diagnostic_buffer ();
   gcc_assert (!old_buffer);
@@ -461,7 +461,7 @@ gfc_format_decoder (pretty_printer *pp, text_info *text, const char *spec,
    caller is responsible for freeing the memory.  */
 static char *
 gfc_diagnostic_build_kind_prefix (diagnostics::context *context,
-                                 const diagnostic_info *diagnostic)
+                                 const diagnostics::diagnostic_info *diagnostic)
 {
   static const char *const diagnostic_kind_text[] = {
 #define DEFINE_DIAGNOSTIC_KIND(K, T, C) (T),
@@ -550,7 +550,7 @@ gfc_diagnostic_build_locus_prefix (const diagnostics::location_print_policy &loc
 */
 static void
 gfc_diagnostic_text_starter (diagnostics::text_sink &text_output,
-                            const diagnostic_info *diagnostic)
+                            const diagnostics::diagnostic_info *diagnostic)
 {
   diagnostics::context *const context = &text_output.get_context ();
   pretty_printer *const pp = text_output.get_printer ();
@@ -636,7 +636,7 @@ gfc_diagnostic_start_span (const diagnostics::location_print_policy &loc_policy,
 
 static void
 gfc_diagnostic_text_finalizer (diagnostics::text_sink &text_output,
-                              const diagnostic_info *diagnostic ATTRIBUTE_UNUSED,
+                              const diagnostics::diagnostic_info *,
                               enum diagnostics::kind orig_diag_kind ATTRIBUTE_UNUSED)
 {
   pretty_printer *const pp = text_output.get_printer ();
@@ -651,7 +651,7 @@ bool
 gfc_warning_now_at (location_t loc, int opt, const char *gmsgid, ...)
 {
   va_list argp;
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   rich_location rich_loc (line_table, loc);
   bool ret;
 
@@ -670,7 +670,7 @@ bool
 gfc_warning_now (int opt, const char *gmsgid, ...)
 {
   va_list argp;
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   rich_location rich_loc (line_table, UNKNOWN_LOCATION);
   bool ret;
 
@@ -689,7 +689,7 @@ bool
 gfc_warning_internal (int opt, const char *gmsgid, ...)
 {
   va_list argp;
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   rich_location rich_loc (line_table, UNKNOWN_LOCATION);
   bool ret;
 
@@ -708,7 +708,7 @@ void
 gfc_error_now (const char *gmsgid, ...)
 {
   va_list argp;
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   rich_location rich_loc (line_table, UNKNOWN_LOCATION);
 
   error_buffer->flag = true;
@@ -727,7 +727,7 @@ void
 gfc_fatal_error (const char *gmsgid, ...)
 {
   va_list argp;
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   rich_location rich_loc (line_table, UNKNOWN_LOCATION);
 
   va_start (argp, gmsgid);
@@ -780,7 +780,7 @@ gfc_error_opt (int opt, const char *gmsgid, va_list ap)
       return;
     }
 
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   rich_location richloc (line_table, UNKNOWN_LOCATION);
   diagnostics::buffer *old_buffer = global_dc->get_diagnostic_buffer ();
   gcc_assert (!old_buffer);
@@ -828,7 +828,7 @@ gfc_internal_error (const char *gmsgid, ...)
 {
   int e, w;
   va_list argp;
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   rich_location rich_loc (line_table, UNKNOWN_LOCATION);
 
   gfc_get_errors (&w, &e);
index 5b56b730452308fb857df37f56088b71d1de5c06..3ffca92903f0a24a8d95c9a5602a86e3c42f8eac 100644 (file)
@@ -1015,7 +1015,7 @@ public:
             (void *)&m_playback_ctxt);
   }
 
-  void on_report_diagnostic (const diagnostic_info &info,
+  void on_report_diagnostic (const diagnostics::diagnostic_info &info,
                             enum diagnostics::kind orig_diag_kind) final override
   {
     JIT_LOG_SCOPE (gcc::jit::active_playback_ctxt->get_logger ());
@@ -1042,7 +1042,7 @@ private:
 
 static void
 jit_begin_diagnostic (diagnostics::text_sink &,
-                     const diagnostic_info */*diagnostic*/)
+                     const diagnostics::diagnostic_info */*diagnostic*/)
 {
   gcc_assert (gcc::jit::active_playback_ctxt);
   JIT_LOG_SCOPE (gcc::jit::active_playback_ctxt->get_logger ());
@@ -1055,7 +1055,7 @@ jit_begin_diagnostic (diagnostics::text_sink &,
 
 static void
 jit_end_diagnostic (diagnostics::text_sink &,
-                   const diagnostic_info *,
+                   const diagnostics::diagnostic_info *,
                    enum diagnostics::kind)
 {
   gcc_assert (gcc::jit::active_playback_ctxt);
index 56c2c733c0c1e44b0f936a57cfc5daa2b0d5edf7..20d27a6d7fd017fb9cd71fe03d15deada52eec7d 100644 (file)
@@ -371,7 +371,7 @@ lhd_handle_option (size_t code ATTRIBUTE_UNUSED,
 void
 lhd_print_error_function (diagnostics::text_sink &text_output,
                          const char *file,
-                         const diagnostic_info *diagnostic)
+                         const diagnostics::diagnostic_info *diagnostic)
 {
   diagnostics::context *const context = &text_output.get_context ();
   if (diagnostic_last_function_changed (context, diagnostic))
index bc7ca8a195bd6b110b904aa60e7c00fa3a424924..04fcc689ace1416c2da4a062a2358fee984f03ad 100644 (file)
@@ -243,7 +243,7 @@ public:
 
   static void
   text_starter (diagnostics::text_sink &text_output,
-               const diagnostic_info *diagnostic);
+               const diagnostics::diagnostic_info *diagnostic);
 
 private:
   diagnostics::text_sink *m_inner_sink; // borrowed from dc
@@ -1446,7 +1446,7 @@ diagnostic_text_sink::set_colorize (enum diagnostic_colorize colorize)
 
 void
 diagnostic_text_sink::text_starter (diagnostics::text_sink &text_output,
-                                   const diagnostic_info *info)
+                                   const diagnostics::diagnostic_info *info)
 {
   gcc_assert (info->m_x_data);
   const diagnostic &diag = *static_cast<const diagnostic *> (info->m_x_data);
@@ -1614,7 +1614,7 @@ diagnostic_manager::emit_va (diagnostic &diag, const char *msgid, va_list *args)
   {
     m_dc.begin_group ();
 
-    diagnostic_info info;
+    diagnostics::diagnostic_info info;
 GCC_DIAGNOSTIC_PUSH_IGNORED(-Wsuggest-attribute=format)
     diagnostic_set_info (&info, msgid, args, diag.get_rich_location (),
                         diagnostics_kind_from_diagnostic_level
index 0f0bd6541f1dd4277d3059b69cc82ae0e694061c..89a10807a6f20b8ead4e6da61253db7101d85426 100644 (file)
@@ -188,7 +188,7 @@ m2linemap_ErrorAt (location_t location, char *message)
 static void
 m2linemap_ErrorAtf_1 (location_t location, const char *message, ...)
 {
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   va_list ap;
   rich_location richloc (line_table, location);
 
@@ -210,7 +210,7 @@ m2linemap_ErrorAtf (location_t location, const char *message)
 static void
 m2linemap_WarningAtf_1 (location_t location, const char *message, ...)
 {
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   va_list ap;
   rich_location richloc (line_table, location);
 
@@ -232,7 +232,7 @@ m2linemap_WarningAtf (location_t location, const char *message)
 static void
 m2linemap_NoteAtf_1 (location_t location, const char *message, ...)
 {
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   va_list ap;
   rich_location richloc (line_table, location);
 
index 00df71d57f6d72d6f85df57c249f4f9053606879..f7b306534385dfa16c5edaf6c36a57cedcf36db2 100644 (file)
@@ -286,7 +286,7 @@ static void
 rte_error_at (location_t location, diagnostics::kind kind,
              const char *message, ...)
 {
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   va_list ap;
   rich_location richloc (line_table, location);
 
index 04a449ccf31803567f5c2898608ef5226ce53bee..7391a2f5fdace95719a45a2ad499ab360cb1acfa 100644 (file)
@@ -66,7 +66,7 @@ static void
 diagnostic_for_asm (const rtx_insn *insn, const char *msg, va_list *args_ptr,
                    enum diagnostics::kind kind)
 {
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   rich_location richloc (line_table, location_for_asm (insn));
 
   diagnostic_set_info (&diagnostic, msg, args_ptr,
index 2a0cd3bbd3cacf426365723af7fbeca49644c06a..79a06c3b862b9a70b7f06123e3d8d90b7b2253bc 100644 (file)
@@ -23,7 +23,7 @@ namespace Resolver {
 
 void ATTRIBUTE_NORETURN
 funny_ice_text_finalizer (diagnostics::text_sink &text_output,
-                         const diagnostic_info *diagnostic,
+                         const diagnostics::diagnostic_info *diagnostic,
                          enum diagnostics::kind diag_kind)
 {
   gcc_assert (diag_kind == diagnostics::kind::ice_nobt);
index f36e5582e5c1297d6c57a7170a7ad307a8427c0a..512017639e655a7ca5a384f98d1cf82e410c4c80 100644 (file)
@@ -56,7 +56,7 @@ namespace Resolver {
 
 void ATTRIBUTE_NORETURN
 funny_ice_text_finalizer (diagnostics::text_sink &text_output,
-                         const diagnostic_info *diagnostic,
+                         const diagnostics::diagnostic_info *diagnostic,
                          enum diagnostics::kind diag_kind);
 
 } // namespace Resolver
index 9bbc76bec8c1c340a92c3d6060dc9e0e2da7ccaa..2f920ca46926784aece94b91f47159d22bbbd4b5 100644 (file)
@@ -203,7 +203,7 @@ format_string_diagnostic_t::emit_warning_n_va (diagnostics::option_id option_id,
   if (!err && m_corrected_substring && substring_within_range)
     richloc.add_fixit_replace (fmt_substring_range, m_corrected_substring);
 
-  diagnostic_info diagnostic;
+  diagnostics::diagnostic_info diagnostic;
   if (singular_gmsgid != plural_gmsgid)
     {
       unsigned long gtn;
index 289af332acfe850fd68590d1eb7206c115fd9665..5d185ff769d21fbdda3b023610eb6e0e6e992a6c 100644 (file)
@@ -21,7 +21,8 @@
 int plugin_is_GPL_compatible;
 
 void
-noop_text_starter_fn (diagnostics::text_sink &, const diagnostic_info *)
+noop_text_starter_fn (diagnostics::text_sink &,
+                     const diagnostics::diagnostic_info *)
 {
 }
 
index 8d44c03986ccfb23a9a08166bf6de236f9029eb3..48f832579add83e909f2f6600ad57ba5bf36e3e7 100644 (file)
@@ -166,7 +166,7 @@ pass_test_groups::execute (function *fun)
 
 void
 test_diagnostic_text_starter (diagnostics::text_sink &text_output,
-                             const diagnostic_info *diagnostic)
+                             const diagnostics::diagnostic_info *diagnostic)
 {
   pp_set_prefix (text_output.get_printer (), xstrdup ("PREFIX: "));
 }
index c867d463a64e62efcc449a7ef52f3fcda13d9238..e1fc56cde64334daef96d04c851aa6fe47c3d4be 100644 (file)
@@ -132,7 +132,7 @@ static bool force_show_locus_color = false;
 
 static void
 custom_diagnostic_text_finalizer (diagnostics::text_sink &text_output,
-                                 const diagnostic_info *diagnostic,
+                                 const diagnostics::diagnostic_info *diag,
                                  enum diagnostics::kind)
 {
   pretty_printer *const pp = text_output.get_printer ();
@@ -144,7 +144,7 @@ custom_diagnostic_text_finalizer (diagnostics::text_sink &text_output,
   pp_newline (pp);
   diagnostic_show_locus (&text_output.get_context (),
                         text_output.get_source_printing_options (),
-                        diagnostic->m_richloc, diagnostic->m_kind, pp);
+                        diag->m_richloc, diag->m_kind, pp);
   pp_show_color (pp) = old_show_color;
   pp_set_prefix (pp, saved_prefix);
   pp_flush (pp);
index bd8019a701f49d1552d84df41beeb356c3d06d87..00ad8704477a44e826599313cb4a32cdbc9d8e1d 100644 (file)
@@ -43,7 +43,7 @@ static diagnostics::text_finalizer_fn original_text_finalizer = NULL;
 
 static void
 verify_unpacked_ranges  (diagnostics::text_sink &text_output,
-                        const diagnostic_info *diagnostic,
+                        const diagnostics::diagnostic_info *diagnostic,
                         enum diagnostics::kind orig_diag_kind)
 {
   /* Verify that the locations are ad-hoc, not packed. */
@@ -57,7 +57,7 @@ verify_unpacked_ranges  (diagnostics::text_sink &text_output,
 
 static void
 verify_no_columns  (diagnostics::text_sink &text_output,
-                   const diagnostic_info *diagnostic,
+                   const diagnostics::diagnostic_info *diagnostic,
                    enum diagnostics::kind orig_diag_kind)
 {
   /* Verify that the locations have no columns. */
index 8d02f62412bba997e37df967f221241407edb89f..75f807bd6a0032cd5843445b32341fff1bed41c0 100644 (file)
@@ -231,7 +231,8 @@ announce_function (tree decl)
                 identifier_to_locale (lang_hooks.decl_printable_name (decl, 2)));
       fflush (stderr);
       pp_needs_newline (global_dc->get_reference_printer ()) = true;
-      diagnostic_set_last_function (global_dc, (diagnostic_info *) NULL);
+      diagnostic_set_last_function (global_dc,
+                                   (diagnostics::diagnostic_info *) nullptr);
     }
 }
 
index 4e43842732d4eff206d5d38799f01b4b9067ce3a..3761fc099e6094f384d5bc2f7cdbbb4cba7c6cfb 100644 (file)
@@ -36,20 +36,20 @@ along with GCC; see the file COPYING3.  If not see
    that caused an error.  */
 void
 diagnostic_report_current_function (diagnostics::text_sink &text_output,
-                                   const diagnostic_info *diagnostic)
+                                   const diagnostics::diagnostic_info *diag)
 {
-  location_t loc = diagnostic_location (diagnostic);
+  location_t loc = diagnostic_location (diag);
   text_output.report_current_module (loc);
-  lang_hooks.print_error_function (text_output, LOCATION_FILE (loc), diagnostic);
+  lang_hooks.print_error_function (text_output, LOCATION_FILE (loc), diag);
 }
 
 static void
 default_tree_diagnostic_text_starter (diagnostics::text_sink &text_output,
-                                     const diagnostic_info *diagnostic)
+                                     const diagnostics::diagnostic_info *diag)
 {
   pretty_printer *const pp = text_output.get_printer ();
-  diagnostic_report_current_function (text_output, diagnostic);
-  pp_set_prefix (pp, text_output.build_prefix (*diagnostic));
+  diagnostic_report_current_function (text_output, diag);
+  pp_set_prefix (pp, text_output.build_prefix (*diag));
 }
 
 /* Default tree printer.   Handles declarations only.  */
@@ -111,7 +111,7 @@ default_tree_printer (pretty_printer *pp, text_info *text, const char *spec,
 
 static void
 set_inlining_locations (diagnostics::context *,
-                       diagnostic_info *diagnostic)
+                       diagnostics::diagnostic_info *diagnostic)
 {
   location_t loc = diagnostic_location (diagnostic);
   tree block = LOCATION_BLOCK (loc);
index ffb0c2bab4f4f1898a0430b388460ade29cd1250..9315d35c6bd368e922efaa7afb20a1fec4013d4d 100644 (file)
@@ -49,7 +49,7 @@ along with GCC; see the file COPYING3.  If not see
        : current_function_decl)
 
 void diagnostic_report_current_function (diagnostics::context *,
-                                        const diagnostic_info *);
+                                        const diagnostics::diagnostic_info *);
 
 void tree_diagnostics_defaults (diagnostics::context *);
 bool default_tree_printer (pretty_printer *, text_info *, const char *,
index 6cfe254f9b058ab48e2e1d5f151687479a4c2e61..38343a7c29ebbf08fba63f6145b5ffa5307e20c7 100644 (file)
@@ -65,7 +65,7 @@ cc1_plugin::plugin_context *cc1_plugin::current_context;
 static void
 plugin_print_error_function (diagnostics::text_sink &text_output,
                             const char *file,
-                            const diagnostic_info *diagnostic)
+                            const diagnostics::diagnostic_info *diagnostic)
 {
   if (current_function_decl != NULL_TREE
       && DECL_NAME (current_function_decl) != NULL_TREE