aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/toplev.cc')
-rw-r--r--gcc/toplev.cc37
1 files changed, 23 insertions, 14 deletions
diff --git a/gcc/toplev.cc b/gcc/toplev.cc
index 00a8ccb..70dbb3e 100644
--- a/gcc/toplev.cc
+++ b/gcc/toplev.cc
@@ -81,7 +81,8 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-utils.h"
#include "gcse.h"
#include "omp-offload.h"
-#include "edit-context.h"
+#include "diagnostics/changes.h"
+#include "diagnostics/file-cache.h"
#include "tree-pass.h"
#include "dumpfile.h"
#include "ipa-fnsummary.h"
@@ -230,7 +231,8 @@ announce_function (tree decl)
identifier_to_locale (lang_hooks.decl_printable_name (decl, 2)));
fflush (stderr);
pp_needs_newline (global_dc->get_reference_printer ()) = true;
- diagnostic_set_last_function (global_dc, (diagnostic_info *) NULL);
+ diagnostic_set_last_function (global_dc,
+ (diagnostics::diagnostic_info *) nullptr);
}
}
@@ -1017,7 +1019,7 @@ open_auxiliary_file (const char *ext)
/* Alternative diagnostics callback for reentered ICE reporting. */
static void
-internal_error_reentered (diagnostic_context *, const char *, va_list *)
+internal_error_reentered (diagnostics::context *, const char *, va_list *)
{
/* Flush the dump file if emergency_dump_function itself caused an ICE. */
if (dump_file)
@@ -1027,7 +1029,7 @@ internal_error_reentered (diagnostic_context *, const char *, va_list *)
/* Auxiliary callback for the diagnostics code. */
static void
-internal_error_function (diagnostic_context *, const char *, va_list *)
+internal_error_function (diagnostics::context *, const char *, va_list *)
{
global_dc->set_internal_error_callback (internal_error_reentered);
warn_if_plugins ();
@@ -1068,13 +1070,14 @@ general_init (const char *argv0, bool init_signals, unique_argv original_argv)
global_dc->set_original_argv (std::move (original_argv));
- global_dc->m_source_printing.enabled
+ auto &source_printing_opts = global_dc->get_source_printing_options ();
+ source_printing_opts.enabled
= global_options_init.x_flag_diagnostics_show_caret;
- global_dc->m_source_printing.show_event_links_p
+ source_printing_opts.show_event_links_p
= global_options_init.x_flag_diagnostics_show_event_links;
- global_dc->m_source_printing.show_labels_p
+ source_printing_opts.show_labels_p
= global_options_init.x_flag_diagnostics_show_labels;
- global_dc->m_source_printing.show_line_numbers_p
+ source_printing_opts.show_line_numbers_p
= global_options_init.x_flag_diagnostics_show_line_numbers;
global_dc->set_show_cwe (global_options_init.x_flag_diagnostics_show_cwe);
global_dc->set_show_rules (global_options_init.x_flag_diagnostics_show_rules);
@@ -1085,7 +1088,7 @@ general_init (const char *argv0, bool init_signals, unique_argv original_argv)
(global_options_init.x_flag_diagnostics_show_path_depths);
global_dc->set_show_option_requested
(global_options_init.x_flag_diagnostics_show_option);
- global_dc->m_source_printing.min_margin_width
+ source_printing_opts.min_margin_width
= global_options_init.x_diagnostics_minimum_margin_width;
global_dc->m_show_column
= global_options_init.x_flag_show_column;
@@ -1285,7 +1288,7 @@ process_options ()
input_location = saved_location;
if (flag_diagnostics_generate_patch)
- global_dc->create_edit_context ();
+ global_dc->initialize_fixits_change_set ();
/* Avoid any informative notes in the second run of -fcompare-debug. */
if (flag_compare_debug)
@@ -1748,11 +1751,13 @@ process_options ()
if (warn_coverage_mismatch
&& option_unspecified_p (OPT_Wcoverage_mismatch))
diagnostic_classify_diagnostic (global_dc, OPT_Wcoverage_mismatch,
- DK_ERROR, UNKNOWN_LOCATION);
+ diagnostics::kind::error,
+ UNKNOWN_LOCATION);
if (warn_coverage_invalid_linenum
&& option_unspecified_p (OPT_Wcoverage_invalid_line_number))
diagnostic_classify_diagnostic (global_dc, OPT_Wcoverage_invalid_line_number,
- DK_ERROR, UNKNOWN_LOCATION);
+ diagnostics::kind::error,
+ UNKNOWN_LOCATION);
}
/* Save the current optimization options. */
@@ -1815,6 +1820,10 @@ backend_init_target (void)
static void
backend_init (void)
{
+#if CHECKING_P
+ verify_reg_names_in_constraints ();
+#endif
+
init_emit_once ();
init_rtlanal ();
@@ -2385,11 +2394,11 @@ toplev::main (int argc, char **argv)
emit some diagnostics here. */
invoke_plugin_callbacks (PLUGIN_FINISH, NULL);
- if (auto edit_context_ptr = global_dc->get_edit_context ())
+ if (auto change_set_ptr = global_dc->get_fixits_change_set ())
{
pretty_printer pp;
pp_show_color (&pp) = pp_show_color (global_dc->get_reference_printer ());
- edit_context_ptr->print_diff (&pp, true);
+ change_set_ptr->print_diff (&pp, true);
pp_flush (&pp);
}