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:
David Malcolm <dmalcolm@redhat.com>
Showing
- gcc/diagnostic.cc 7 additions, 16 deletionsgcc/diagnostic.cc
- gcc/diagnostic.h 41 additions, 53 deletionsgcc/diagnostic.h
- gcc/lto-wrapper.cc 19 additions, 5 deletionsgcc/lto-wrapper.cc
- gcc/opts-common.cc 7 additions, 0 deletionsgcc/opts-common.cc
- gcc/opts-diagnostic.h 38 additions, 6 deletionsgcc/opts-diagnostic.h
- gcc/opts.cc 9 additions, 9 deletionsgcc/opts.cc
- gcc/toplev.cc 5 additions, 5 deletionsgcc/toplev.cc
Loading
Please register or sign in to comment