-
- Downloads
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>
Showing
- gcc/Makefile.in 1 addition, 0 deletionsgcc/Makefile.in
- gcc/diagnostic-format-json.cc 1 addition, 0 deletionsgcc/diagnostic-format-json.cc
- gcc/diagnostic-format-sarif.cc 1 addition, 0 deletionsgcc/diagnostic-format-sarif.cc
- gcc/diagnostic-format-text.cc 209 additions, 0 deletionsgcc/diagnostic-format-text.cc
- gcc/diagnostic-format-text.h 56 additions, 0 deletionsgcc/diagnostic-format-text.h
- gcc/diagnostic-format.h 83 additions, 0 deletionsgcc/diagnostic-format.h
- gcc/diagnostic-global-context.cc 1 addition, 0 deletionsgcc/diagnostic-global-context.cc
- gcc/diagnostic.cc 2 additions, 174 deletionsgcc/diagnostic.cc
- gcc/diagnostic.h 2 additions, 83 deletionsgcc/diagnostic.h
- gcc/gcc.cc 1 addition, 0 deletionsgcc/gcc.cc
- gcc/opts.cc 1 addition, 0 deletionsgcc/opts.cc
- gcc/testsuite/gcc.dg/plugin/diagnostic_group_plugin.c 1 addition, 0 deletionsgcc/testsuite/gcc.dg/plugin/diagnostic_group_plugin.c
Loading
Please register or sign in to comment