diff options
author | David Malcolm <dmalcolm@redhat.com> | 2024-08-26 12:24:22 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2024-08-26 12:24:22 -0400 |
commit | 92c5265d22afaac146b2a7ecbc3dac9fc3382877 (patch) | |
tree | 982a41367a39f5ac3aa099c9745ae383bb4bc785 /gcc/diagnostic-format-json.cc | |
parent | ac707d30ce449f30c6018829d443956fdd653f4c (diff) | |
download | gcc-92c5265d22afaac146b2a7ecbc3dac9fc3382877.zip gcc-92c5265d22afaac146b2a7ecbc3dac9fc3382877.tar.gz gcc-92c5265d22afaac146b2a7ecbc3dac9fc3382877.tar.bz2 |
diagnostics: move output formats from diagnostic.{c,h} to their own files
In particular, move the classic text output code to a
diagnostic-text.cc (analogous to -json.cc and -sarif.cc).
No functional change intended.
gcc/ChangeLog:
* Makefile.in (OBJS-libcommon): Add diagnostic-format-text.o.
* diagnostic-format-json.cc: Include "diagnostic-format.h".
* diagnostic-format-sarif.cc: Likewise.
* diagnostic-format-text.cc: New file, using material from
diagnostics.cc.
* diagnostic-global-context.cc: Include
"diagnostic-format.h".
* diagnostic-format-text.h: New file, using material from
diagnostics.h.
* diagnostic-format.h: New file, using material from
diagnostics.h.
* diagnostic.cc: Include "diagnostic-format.h" and
"diagnostic-format-text.h".
(diagnostic_text_output_format::~diagnostic_text_output_format):
Move to diagnostic-format-text.cc.
(diagnostic_text_output_format::on_report_diagnostic): Likewise.
(diagnostic_text_output_format::on_diagram): Likewise.
(diagnostic_text_output_format::print_any_cwe): Likewise.
(diagnostic_text_output_format::print_any_rules): Likewise.
(diagnostic_text_output_format::print_option_information):
Likewise.
* diagnostic.h (class diagnostic_output_format): Move to
diagnostic-format.h.
(class diagnostic_text_output_format): Move to
diagnostic-format-text.h.
(diagnostic_output_format_init): Move to
diagnostic-format.h.
(diagnostic_output_format_init_json_stderr): Likewise.
(diagnostic_output_format_init_json_file): Likewise.
(diagnostic_output_format_init_sarif_stderr): Likewise.
(diagnostic_output_format_init_sarif_file): Likewise.
(diagnostic_output_format_init_sarif_stream): Likewise.
* gcc.cc: Include "diagnostic-format.h".
* opts.cc: Include "diagnostic-format.h".
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/diagnostic_group_plugin.c: Include
"diagnostic-format-text.h".
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/diagnostic-format-json.cc')
-rw-r--r-- | gcc/diagnostic-format-json.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/diagnostic-format-json.cc b/gcc/diagnostic-format-json.cc index f2e9d0d..c94f5f7 100644 --- a/gcc/diagnostic-format-json.cc +++ b/gcc/diagnostic-format-json.cc @@ -27,6 +27,7 @@ along with GCC; see the file COPYING3. If not see #include "selftest-diagnostic.h" #include "diagnostic-metadata.h" #include "diagnostic-path.h" +#include "diagnostic-format.h" #include "json.h" #include "selftest.h" #include "logical-location.h" |