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

diagnostics: replace option_hooks with a diagnostic_option_manager class


Introduce a diagnostic_option_manager class to help isolate the
diagnostics subsystem from GCC's option handling.

No functional change intended.

gcc/ChangeLog:
	* diagnostic.cc (diagnostic_context::initialize): Replace
	m_options_callbacks with m_option_mgr.
	(diagnostic_context::set_option_hooks): Replace with...
	(diagnostic_context::set_option_manager): ...this.
	* diagnostic.h (diagnostic_option_enabled_cb): Delete.
	(diagnostic_make_option_name_cb): Delete.
	(diagnostic_make_option_url_cb): Delete.
	(class diagnostic_option_manager): New.
	(diagnostic_manager::option_enabled_p): Convert from using
	m_option_callbacks to m_option_mgr.
	(diagnostic_manager::make_option_name): Likewise.
	(diagnostic_manager::make_option_url): Likewise.
	(diagnostic_manager::set_option_hooks): Replace with...
	(diagnostic_manager::set_option_manager): ...this.
	(diagnostic_manager::get_lang_mask): Update for field changes.
	(diagnostic_manager::m_option_callbacks): Replace with...
	(diagnostic_manager::m_option_mgr): ...this and...
	(diagnostic_manager::m_lang_mask): ...this.
	* lto-wrapper.cc (class lto_diagnostic_option_manager): New.
	(main): Port from option hooks to diagnostic_option_manager.
	* opts-common.cc: Include "opts-diagnostic.h".
	(compiler_diagnostic_option_manager::option_enabled_p): New.
	* opts-diagnostic.h (option_name): Drop decl.
	(get_option_url): Drop decl.
	(class gcc_diagnostic_option_manager): New.
	(class compiler_diagnostic_option_manager): New.
	* opts.cc (option_name): Convert to...
	(compiler_diagnostic_option_manager::make_option_name): ...this.
	(get_option_url): Convert to...
	(gcc_diagnostic_option_manager::make_option_url): ...this.
	* toplev.cc (general_init): Port from option hooks to
	diagnostic_option_manager.

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