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

diagnostics: make option-handling callbacks private


No functional change intended.

gcc/c-family/ChangeLog:
	* c-warn.cc (conversion_warning): Update call to
	global_dc->m_option_enabled to use option_enabled_p.

gcc/cp/ChangeLog:
	* decl.cc (finish_function): Update call to
	global_dc->m_option_enabled to use option_enabled_p.

gcc/ChangeLog:
	* diagnostic-format-json.cc
	(json_output_format::on_end_diagnostic): Update calls to m_context
	callbacks to use member functions; tighten up scopes.
	* diagnostic-format-sarif.cc (sarif_builder::make_result_object):
	Likewise.
	(sarif_builder::make_reporting_descriptor_object_for_warning):
	Likewise.
	* diagnostic.cc (diagnostic_context::initialize): Update for
	callbacks being moved into m_option_callbacks and being renamed.
	(diagnostic_context::set_option_hooks): New.
	(diagnostic_option_classifier::classify_diagnostic): Update call
	to global_dc->m_option_enabled to use option_enabled_p.
	(diagnostic_context::print_option_information): Update calls to
	m_context callbacks to use member functions; tighten up scopes.
	(diagnostic_context::diagnostic_enabled): Likewise.
	* diagnostic.h (diagnostic_option_enabled_cb): New typedef.
	(diagnostic_make_option_name_cb): New typedef.
	(diagnostic_make_option_url_cb): New typedef.
	(diagnostic_context::option_enabled_p): New.
	(diagnostic_context::make_option_name): New.
	(diagnostic_context::make_option_url): New.
	(diagnostic_context::set_option_hooks): New decl.
	(diagnostic_context::m_option_enabled): Rename to
	m_option_enabled_cb and move within m_option_callbacks, using
	typedef.
	(diagnostic_context::m_option_state): Move within
	m_option_callbacks.
	(diagnostic_context::m_option_name): Rename to
	m_make_option_name_cb and move within m_option_callbacks, using
	typedef.
	(diagnostic_context::m_get_option_url): Likewise, renaming to
	m_make_option_url_cb.
	* lto-wrapper.cc (print_lto_docs_link): Update call to m_context
	callback to use member function.
	(main): Use diagnostic_context::set_option_hooks.
	* opts-diagnostic.h (option_name): Make context param const.
	(get_option_url): Likewise.
	* opts.cc (option_name): Likewise.
	(get_option_url): Likewise.
	* toplev.cc (general_init): Use
	diagnostic_context::set_option_hooks.

Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
parent 07e568d7
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