aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.cc
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2023-10-02 12:16:55 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2023-10-02 12:16:55 -0400
commitc5c565eff6277ac176d6c5c94f55859d0eb28938 (patch)
treeaebf4d02a7be6e413e14fa16afbbfd5a9f00742c /gcc/toplev.cc
parentc64693fb885f21fafa01d67c5d85e11942770a7c (diff)
downloadgcc-c5c565eff6277ac176d6c5c94f55859d0eb28938.zip
gcc-c5c565eff6277ac176d6c5c94f55859d0eb28938.tar.gz
gcc-c5c565eff6277ac176d6c5c94f55859d0eb28938.tar.bz2
diagnostics: group together source printing fields of diagnostic_context
struct diagnostic_context has > 60 fields. Try to tame some of the complexity by grouping together the 8 source-printing fields into a struct, the "m_source_printing" field. No functional change intended. gcc/ada/ChangeLog: * gcc-interface/misc.cc (gnat_post_options): Update for renaming of diagnostic_context's show_caret to m_source_printing.enabled. gcc/analyzer/ChangeLog: * program-point.cc: Update for grouping of source printing fields within diagnostic_context. gcc/c-family/ChangeLog: * c-common.cc (maybe_add_include_fixit): Update for renaming of diagnostic_context's show_caret to m_source_printing.enabled. * c-opts.cc (c_common_init_options): Update for renaming of diagnostic_context's colorize_source_p to m_source_printing.colorize_source_p. gcc/ChangeLog: * diagnostic-show-locus.cc: Update for reorganization of source-printing fields of diagnostic_context. * diagnostic.cc (diagnostic_set_caret_max_width): Likewise. (diagnostic_initialize): Likewise. * diagnostic.h (diagnostic_context::show_caret): Move to... (diagnostic_context::m_source_printing::enabled): ...here. (diagnostic_context::caret_max_width): Move to... (diagnostic_context::m_source_printing::max_width): ...here. (diagnostic_context::caret_chars): Move to... (diagnostic_context::m_source_printing::caret_chars): ...here. (diagnostic_context::colorize_source_p): Move to... (diagnostic_context::m_source_printing::colorize_source_p): ...here. (diagnostic_context::show_labels_p): Move to... (diagnostic_context::m_source_printing::show_labels_p): ...here. (diagnostic_context::show_line_numbers_p): Move to... (diagnostic_context::m_source_printing::show_line_numbers_p): ...here. (diagnostic_context::min_margin_width): Move to... (diagnostic_context::m_source_printing::min_margin_width): ...here. (diagnostic_context::show_ruler_p): Move to... (diagnostic_context::m_source_printing::show_ruler_p): ...here. (diagnostic_same_line): Update for above changes. * opts.cc (common_handle_option): Update for reorganization of source-printing fields of diagnostic_context. * selftest-diagnostic.cc (test_diagnostic_context::test_diagnostic_context): Likewise. * toplev.cc (general_init): Likewise. * tree-diagnostic-path.cc (struct event_range): Likewise. gcc/fortran/ChangeLog: * error.cc (gfc_diagnostic_starter): Update for reorganization of source-printing fields of diagnostic_context. (gfc_diagnostics_init): Likewise. (gfc_diagnostics_finish): Likewise. gcc/testsuite/ChangeLog: * gcc.dg/plugin/diagnostic_plugin_show_trees.c: Update for reorganization of source-printing fields of diagnostic_context. * gcc.dg/plugin/diagnostic_plugin_test_inlining.c: Likewise. * gcc.dg/plugin/diagnostic_plugin_test_paths.c: Likewise. * gcc.dg/plugin/diagnostic_plugin_test_show_locus.c: Likewise. * gcc.dg/plugin/diagnostic_plugin_test_string_literals.c: Likewise. * gcc.dg/plugin/diagnostic_plugin_test_tree_expression_range.c: Likewise. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/toplev.cc')
-rw-r--r--gcc/toplev.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/toplev.cc b/gcc/toplev.cc
index db62e3e..626cc43 100644
--- a/gcc/toplev.cc
+++ b/gcc/toplev.cc
@@ -1023,11 +1023,11 @@ general_init (const char *argv0, bool init_signals)
override it later. */
tree_diagnostics_defaults (global_dc);
- global_dc->show_caret
+ global_dc->m_source_printing.enabled
= global_options_init.x_flag_diagnostics_show_caret;
- global_dc->show_labels_p
+ global_dc->m_source_printing.show_labels_p
= global_options_init.x_flag_diagnostics_show_labels;
- global_dc->show_line_numbers_p
+ global_dc->m_source_printing.show_line_numbers_p
= global_options_init.x_flag_diagnostics_show_line_numbers;
global_dc->show_cwe
= global_options_init.x_flag_diagnostics_show_cwe;
@@ -1039,7 +1039,7 @@ general_init (const char *argv0, bool init_signals)
= global_options_init.x_flag_diagnostics_show_path_depths;
global_dc->show_option_requested
= global_options_init.x_flag_diagnostics_show_option;
- global_dc->min_margin_width
+ global_dc->m_source_printing.min_margin_width
= global_options_init.x_diagnostics_minimum_margin_width;
global_dc->show_column
= global_options_init.x_flag_show_column;