From c371d7bdbe69201b4c91179ff6f3e2237e0e7fbe Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 18 Jun 2024 10:59:56 -0400 Subject: diagnostics: eliminate diagnostic_context::m_print_path callback No functional change intended. gcc/ChangeLog: * diagnostic-format-json.cc (diagnostic_output_format_init_json): Replace clearing of diagnostic_context::m_print_path callback with setting the path format to DPF_NONE. * diagnostic-format-sarif.cc (diagnostic_output_format_init_sarif): Likewise. * diagnostic.cc (diagnostic_context::show_any_path): Replace call to diagnostic_context::m_print_path callback with a direct call to diagnostic_context::print_path. * diagnostic.h (diagnostic_context::print_path): New decl. (diagnostic_context::m_print_path): Delete callback. * tree-diagnostic-path.cc (default_tree_diagnostic_path_printer): Convert to... (diagnostic_context::print_path): ...this. * tree-diagnostic.cc (tree_diagnostics_defaults): Delete initialization of m_print_path. * tree-diagnostic.h (default_tree_diagnostic_path_printer): Delete decl. Signed-off-by: David Malcolm --- gcc/diagnostic-format-json.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/diagnostic-format-json.cc') diff --git a/gcc/diagnostic-format-json.cc b/gcc/diagnostic-format-json.cc index 2bdc2c1..ec03ac1 100644 --- a/gcc/diagnostic-format-json.cc +++ b/gcc/diagnostic-format-json.cc @@ -395,8 +395,8 @@ private: static void diagnostic_output_format_init_json (diagnostic_context *context) { - /* Override callbacks. */ - context->m_print_path = nullptr; /* handled in json_end_diagnostic. */ + /* Suppress normal textual path output. */ + context->set_path_format (DPF_NONE); /* The metadata is handled in JSON format, rather than as text. */ context->set_show_cwe (false); -- cgit v1.1