diagnostics: make diagnostic_context::m_urlifier private
No functional change intended. gcc/ChangeLog: * diagnostic.cc (diagnostic_context::set_urlifier): New. * diagnostic.h (diagnostic_context::set_urlifier): New decl. (diagnostic_context::m_urlifier): Make private. * gcc.cc (driver::global_initializations): Use set_urlifier rather than directly setting field. * toplev.cc (general_init): Likewise. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
This commit is contained in:
parent
579bb65cdd
commit
a526cc6ff3
4 changed files with 13 additions and 2 deletions
|
@ -373,6 +373,14 @@ diagnostic_context::set_client_data_hooks (diagnostic_client_data_hooks *hooks)
|
|||
m_client_data_hooks = hooks;
|
||||
}
|
||||
|
||||
void
|
||||
diagnostic_context::set_urlifier (urlifier *urlifier)
|
||||
{
|
||||
/* Ideally we'd use a std::unique_ptr here. */
|
||||
delete m_urlifier;
|
||||
m_urlifier = urlifier;
|
||||
}
|
||||
|
||||
void
|
||||
diagnostic_context::create_edit_context ()
|
||||
{
|
||||
|
|
|
@ -297,6 +297,7 @@ public:
|
|||
void set_output_format (diagnostic_output_format *output_format);
|
||||
void set_text_art_charset (enum diagnostic_text_art_charset charset);
|
||||
void set_client_data_hooks (diagnostic_client_data_hooks *hooks);
|
||||
void set_urlifier (urlifier *);
|
||||
void create_edit_context ();
|
||||
void set_warning_as_error_requested (bool val)
|
||||
{
|
||||
|
@ -518,10 +519,12 @@ public:
|
|||
particular option. */
|
||||
char *(*m_get_option_url) (diagnostic_context *, int);
|
||||
|
||||
private:
|
||||
/* An optional hook for adding URLs to quoted text strings in
|
||||
diagnostics. Only used for the main diagnostic message. */
|
||||
urlifier *m_urlifier;
|
||||
|
||||
public:
|
||||
void (*m_print_path) (diagnostic_context *, const diagnostic_path *);
|
||||
json::value *(*m_make_json_for_path) (diagnostic_context *,
|
||||
const diagnostic_path *);
|
||||
|
|
|
@ -8292,7 +8292,7 @@ driver::global_initializations ()
|
|||
diagnostic_initialize (global_dc, 0);
|
||||
diagnostic_color_init (global_dc);
|
||||
diagnostic_urls_init (global_dc);
|
||||
global_dc->m_urlifier = make_gcc_urlifier ();
|
||||
global_dc->set_urlifier (make_gcc_urlifier ());
|
||||
|
||||
#ifdef GCC_DRIVER_HOST_INITIALIZATION
|
||||
/* Perform host dependent initialization when needed. */
|
||||
|
|
|
@ -1049,7 +1049,7 @@ general_init (const char *argv0, bool init_signals)
|
|||
global_dc->m_option_state = &global_options;
|
||||
global_dc->m_option_name = option_name;
|
||||
global_dc->m_get_option_url = get_option_url;
|
||||
global_dc->m_urlifier = make_gcc_urlifier ();
|
||||
global_dc->set_urlifier (make_gcc_urlifier ());
|
||||
|
||||
if (init_signals)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue