aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostic-format-json.cc
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2024-06-18 10:59:56 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2024-06-18 10:59:56 -0400
commitc371d7bdbe69201b4c91179ff6f3e2237e0e7fbe (patch)
tree42ace3bbf32dcdd7edc252758b060a83f42517db /gcc/diagnostic-format-json.cc
parentbdcfe7f7f50ec64b45581a175d1eca41c74a3dfe (diff)
downloadgcc-c371d7bdbe69201b4c91179ff6f3e2237e0e7fbe.zip
gcc-c371d7bdbe69201b4c91179ff6f3e2237e0e7fbe.tar.gz
gcc-c371d7bdbe69201b4c91179ff6f3e2237e0e7fbe.tar.bz2
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 <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/diagnostic-format-json.cc')
-rw-r--r--gcc/diagnostic-format-json.cc4
1 files changed, 2 insertions, 2 deletions
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);