diff options
author | David Malcolm <dmalcolm@redhat.com> | 2023-12-06 12:35:08 -0500 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2023-12-06 12:35:08 -0500 |
commit | 8fc4e6c397e1ce64bec6f9fed148950821cc79e7 (patch) | |
tree | 35aad37e7fcdbf9a213dbc6f2b3ca8389c9ac20d /gcc/testsuite | |
parent | e7d6c277fa28c0b9b621d23c471e0388d2912644 (diff) | |
download | gcc-8fc4e6c397e1ce64bec6f9fed148950821cc79e7.zip gcc-8fc4e6c397e1ce64bec6f9fed148950821cc79e7.tar.gz gcc-8fc4e6c397e1ce64bec6f9fed148950821cc79e7.tar.bz2 |
diagnostics: use const and references for diagnostic_info
No functional change intended.
gcc/c-family/ChangeLog:
* c-opts.cc (c_diagnostic_finalizer): Make "diagnostic" param
const.
gcc/cp/ChangeLog:
* cp-tree.h (cxx_print_error_function): Make diagnostic_info param
const.
* error.cc (cxx_print_error_function): Likewise.
(cp_diagnostic_starter): Likewise.
(cp_print_error_function): Likewise.
gcc/ChangeLog:
* diagnostic-format-json.cc (on_begin_diagnostic): Convert param
to const reference.
(on_end_diagnostic): Likewise.
(json_output_format::on_end_diagnostic): Likewise.
* diagnostic-format-sarif.cc
(sarif_invocation::add_notification_for_ice): Likewise.
(sarif_result::on_nested_diagnostic): Likewise.
(sarif_ice_notification::sarif_ice_notification): Likewise.
(sarif_builder::end_diagnostic): Likewise.
(sarif_builder::make_result_object): Likewise.
(make_reporting_descriptor_object_for_warning): Likewise.
(sarif_builder::make_locations_arr): Likewise.
(sarif_output_format::on_begin_diagnostic): Likewise.
(sarif_output_format::on_end_diagnostic): Likewise.
* diagnostic.cc (default_diagnostic_starter): Make diagnostic_info
param const.
(default_diagnostic_finalizer): Likewise.
(diagnostic_context::report_diagnostic): Pass diagnostic by
reference to on_{begin,end}_diagnostic.
(diagnostic_text_output_format::on_begin_diagnostic): Convert
param to const reference.
(diagnostic_text_output_format::on_end_diagnostic): Likewise.
* diagnostic.h (diagnostic_starter_fn): Make diagnostic_info param
const.
(diagnostic_finalizer_fn): Likeewise.
(diagnostic_output_format::on_begin_diagnostic): Convert param to
const reference.
(diagnostic_output_format::on_end_diagnostic): Likewise.
(diagnostic_text_output_format::on_begin_diagnostic): Likewise.
(diagnostic_text_output_format::on_end_diagnostic): Likewise.
(default_diagnostic_starter): Make diagnostic_info param const.
(default_diagnostic_finalizer): Likewise.
* langhooks-def.h (lhd_print_error_function): Make diagnostic_info
param const.
* langhooks.cc (lhd_print_error_function): Likewise.
* langhooks.h (lang_hooks::print_error_function): Likewise.
* tree-diagnostic.cc (diagnostic_report_current_function):
Likewise.
(default_tree_diagnostic_starter): Likewise.
(virt_loc_aware_diagnostic_finalizer): Likewise.
* tree-diagnostic.h (diagnostic_report_current_function):
Likewise.
(virt_loc_aware_diagnostic_finalizer): Likewise.
gcc/fortran/ChangeLog:
* error.cc (gfc_diagnostic_starter): Make diagnostic_info param
const.
(gfc_diagnostic_finalizer): Likewise.
gcc/jit/ChangeLog:
* dummy-frontend.cc (jit_begin_diagnostic): Make diagnostic_info
param const.
(jit_end_diagnostic): Likewise. Pass to add_diagnostic by
reference.
* jit-playback.cc (jit::playback::context::add_diagnostic):
Convert diagnostic_info to const reference.
* jit-playback.h (jit::playback::context::add_diagnostic):
Likewise.
gcc/testsuite/ChangeLog:
* g++.dg/plugin/show_template_tree_color_plugin.c
(noop_starter_fn): Make diagnostic_info param const.
* gcc.dg/plugin/diagnostic_group_plugin.c
(test_diagnostic_starter): Likewise.
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
(custom_diagnostic_finalizer): Likewise.
* gcc.dg/plugin/location_overflow_plugin.c
(verify_unpacked_ranges): Likewise.
(verify_no_columns): Likewise.
libcc1/ChangeLog:
* context.cc (plugin_print_error_function): Make diagnostic_info
param const.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/testsuite')
4 files changed, 5 insertions, 5 deletions
diff --git a/gcc/testsuite/g++.dg/plugin/show_template_tree_color_plugin.c b/gcc/testsuite/g++.dg/plugin/show_template_tree_color_plugin.c index af568bf..e1af2cf 100644 --- a/gcc/testsuite/g++.dg/plugin/show_template_tree_color_plugin.c +++ b/gcc/testsuite/g++.dg/plugin/show_template_tree_color_plugin.c @@ -21,7 +21,7 @@ int plugin_is_GPL_compatible; void -noop_starter_fn (diagnostic_context *, diagnostic_info *) +noop_starter_fn (diagnostic_context *, const diagnostic_info *) { } diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic_group_plugin.c b/gcc/testsuite/gcc.dg/plugin/diagnostic_group_plugin.c index ce0b322..e9d4b72 100644 --- a/gcc/testsuite/gcc.dg/plugin/diagnostic_group_plugin.c +++ b/gcc/testsuite/gcc.dg/plugin/diagnostic_group_plugin.c @@ -165,7 +165,7 @@ pass_test_groups::execute (function *fun) void test_diagnostic_starter (diagnostic_context *context, - diagnostic_info *diagnostic) + const diagnostic_info *diagnostic) { pp_set_prefix (context->printer, xstrdup ("PREFIX: ")); } diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_show_locus.c b/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_show_locus.c index 6cc661b..3bd8cab 100644 --- a/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_show_locus.c +++ b/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_show_locus.c @@ -129,7 +129,7 @@ static bool force_show_locus_color = false; static void custom_diagnostic_finalizer (diagnostic_context *context, - diagnostic_info *diagnostic, + const diagnostic_info *diagnostic, diagnostic_t) { bool old_show_color = pp_show_color (context->printer); diff --git a/gcc/testsuite/gcc.dg/plugin/location_overflow_plugin.c b/gcc/testsuite/gcc.dg/plugin/location_overflow_plugin.c index 09bac50d..d0a6b07 100644 --- a/gcc/testsuite/gcc.dg/plugin/location_overflow_plugin.c +++ b/gcc/testsuite/gcc.dg/plugin/location_overflow_plugin.c @@ -42,7 +42,7 @@ static diagnostic_finalizer_fn original_finalizer = NULL; static void verify_unpacked_ranges (diagnostic_context *context, - diagnostic_info *diagnostic, + const diagnostic_info *diagnostic, diagnostic_t orig_diag_kind) { /* Verify that the locations are ad-hoc, not packed. */ @@ -56,7 +56,7 @@ verify_unpacked_ranges (diagnostic_context *context, static void verify_no_columns (diagnostic_context *context, - diagnostic_info *diagnostic, + const diagnostic_info *diagnostic, diagnostic_t orig_diag_kind) { /* Verify that the locations have no columns. */ |