Skip to content
Snippets Groups Projects
Commit 92c5265d authored by David Malcolm's avatar David Malcolm
Browse files

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: default avatarDavid Malcolm <dmalcolm@redhat.com>
parent ac707d30
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment