aboutsummaryrefslogtreecommitdiff
path: root/gcc/analyzer
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/analyzer
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/analyzer')
-rw-r--r--gcc/analyzer/program-point.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/analyzer/program-point.cc b/gcc/analyzer/program-point.cc
index d7db2f5..914d49f 100644
--- a/gcc/analyzer/program-point.cc
+++ b/gcc/analyzer/program-point.cc
@@ -256,8 +256,8 @@ public:
debug_diagnostic_context ()
{
diagnostic_initialize (this, 0);
- show_line_numbers_p = true;
- show_caret = true;
+ m_source_printing.show_line_numbers_p = true;
+ m_source_printing.enabled = true;
}
~debug_diagnostic_context ()
{