No functional change intended.
gcc/ChangeLog:
* diagnostic.cc (diagnostic_context::set_option_hooks): Add
"lang_mask" param.
* diagnostic.h (diagnostic_context::option_enabled_p): Update for
move of m_lang_mask.
(diagnostic_context::set_option_hooks): Add "lang_mask" param.
(diagnostic_context::get_lang_mask): New.
(diagnostic_context::m_lang_mask): Move into m_option_callbacks,
thus making private.
* lto-wrapper.cc (main): Update for new lang_mask param of
set_option_hooks.
* toplev.cc (init_asm_output): Use get_lang_mask.
(general_init): Move initialization of global_dc's lang_mask to
new lang_mask param of set_option_hooks.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
set_option_hooks (diagnostic_option_enabled_cb option_enabled_cb,
void *option_state,
diagnostic_make_option_name_cb make_option_name_cb,
- diagnostic_make_option_url_cb make_option_url_cb)
+ diagnostic_make_option_url_cb make_option_url_cb,
+ unsigned lang_mask)
{
m_option_callbacks.m_option_enabled_cb = option_enabled_cb;
m_option_callbacks.m_option_state = option_state;
m_option_callbacks.m_make_option_name_cb = make_option_name_cb;
m_option_callbacks.m_make_option_url_cb = make_option_url_cb;
+ m_option_callbacks.m_lang_mask = lang_mask;
}
void
return true;
return m_option_callbacks.m_option_enabled_cb
(option_index,
- m_lang_mask,
+ m_option_callbacks.m_lang_mask,
m_option_callbacks.m_option_state);
}
set_option_hooks (diagnostic_option_enabled_cb option_enabled_cb,
void *option_state,
diagnostic_make_option_name_cb make_option_name_cb,
- diagnostic_make_option_url_cb make_option_url_cb);
+ diagnostic_make_option_url_cb make_option_url_cb,
+ unsigned lang_mask);
+
+ unsigned get_lang_mask () const
+ {
+ return m_option_callbacks.m_lang_mask;
+ }
private:
bool includes_seen_p (const line_map_ordinary *map);
is available. May be passed 0 as well as the index of a
particular option. */
diagnostic_make_option_url_cb m_make_option_url_cb;
+
+ /* A copy of lang_hooks.option_lang_mask (). */
+ unsigned m_lang_mask;
} m_option_callbacks;
/* An optional hook for adding URLs to quoted text strings in
int m_lock;
public:
- /* A copy of lang_hooks.option_lang_mask (). */
- unsigned m_lang_mask;
-
bool m_inhibit_notes_p;
diagnostic_source_printing_options m_source_printing;
global_dc->set_option_hooks (nullptr,
nullptr,
nullptr,
- get_option_url);
+ get_option_url,
+ 0);
if (atexit (lto_wrapper_cleanup) != 0)
fatal_error (input_location, "%<atexit%> failed");
"cannot open %qs for writing: %m", asm_file_name);
}
- if (!flag_syntax_only && !(global_dc->m_lang_mask & CL_LTODump))
+ if (!flag_syntax_only && !(global_dc->get_lang_mask () & CL_LTODump))
{
targetm.asm_out.file_start ();
/* Initialize the diagnostics reporting machinery, so option parsing
can give warnings and errors. */
diagnostic_initialize (global_dc, N_OPTS);
- global_dc->m_lang_mask = lang_hooks.option_lang_mask ();
/* Set a default printer. Language specific initializations will
override it later. */
tree_diagnostics_defaults (global_dc);
global_dc->set_option_hooks (option_enabled,
&global_options,
option_name,
- get_option_url);
+ get_option_url,
+ lang_hooks.option_lang_mask ());
global_dc->set_urlifier (make_gcc_urlifier ());
if (init_signals)