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>
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;
/* 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 ();
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);
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);
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);
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);
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);
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
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 &);
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 ())
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)
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));
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. */
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);
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;
}
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,
#include "diagnostic-core.h"
#include "diagnostics/diagnostic-info.h"
-typedef diagnostics::diagnostic_info diagnostic_info;
-
#include "diagnostics/context.h"
/* Extension hooks for client. */
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;
inline bool
diagnostic_report_diagnostic (diagnostics::context *context,
- diagnostic_info *diagnostic)
+ diagnostics::diagnostic_info *diagnostic)
{
context->begin_group ();
bool warned = context->report_diagnostic (diagnostic);
}
#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
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
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);
}
/* 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 ();
}
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);
}
/* 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);
/* 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);
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;
/* 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;
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);
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),
*/
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 ();
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 ();
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;
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;
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;
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;
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);
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);
{
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);
(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 ());
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 ());
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);
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))
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
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);
{
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
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);
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);
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);
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);
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,
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);
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
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;
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 *)
{
}
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: "));
}
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 ();
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);
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. */
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. */
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);
}
}
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. */
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);
: 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 *,
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