]> git.ipfire.org Git - thirdparty/gcc.git/commit
diagnostics: eliminate diagnostic_context::m_make_json_for_path
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 18 Jun 2024 14:59:55 +0000 (10:59 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Tue, 18 Jun 2024 14:59:55 +0000 (10:59 -0400)
commitd3878c85f331c7a378245b636d5d230735b87347
tree22686fb7a8760d2886a8a85eae4485533ecc3448
parent164ac58fabc6430eed45dda7500dfba64be2bd87
diagnostics: eliminate diagnostic_context::m_make_json_for_path

Now that the path-handling code for json_output_format no longer
needs "tree", and thus can be in OBJS-libcommon we can move it
from tree-diagnostic-path.cc to diagnostic-format-json.cc where it
should have been all along.

No functional change intended.

gcc/ChangeLog:
* diagnostic-format-json.cc: Include "diagnostic-path.h" and
"logical-location.h".
(make_json_for_path): Move tree-diagnostic-path.cc's
default_tree_make_json_for_path here, renaming it and making it
static.
(json_output_format::on_end_diagnostic): Replace call of
m_context's m_make_json_for_path callback with a direct call to
make_json_for_path.
* diagnostic.h (diagnostic_context::m_make_json_for_path): Drop
field.
* tree-diagnostic-path.cc: Drop include of "json.h".
(default_tree_make_json_for_path): Rename to make_json_for_path
and move to diagnostic-format-json.cc.
* tree-diagnostic.cc (tree_diagnostics_defaults): Drop
initialization of m_make_json_for_path.
* tree-diagnostic.h (default_tree_make_json_for): Delete decl.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/diagnostic-format-json.cc
gcc/diagnostic.h
gcc/tree-diagnostic-path.cc
gcc/tree-diagnostic.cc
gcc/tree-diagnostic.h