|
GCC Middle and Back End API Reference
|
#include <context.h>

Data Structures | |
| struct | urlifier_stack_node |
Public Types | |
| typedef void(*) | set_locations_callback_t(const context &, diagnostic_info *) |
Data Fields | |
| bool | m_show_column |
| bool | m_pedantic_errors |
| bool | m_permissive |
| bool | m_inhibit_warnings |
| bool | m_warn_system_headers |
| void * | m_client_aux_data |
| location_t | m_last_location |
Private Member Functions | |
| void | error_recursion () ATTRIBUTE_NORETURN |
| bool | diagnostic_enabled (diagnostic_info *diagnostic) |
| void | get_any_inlining_info (diagnostic_info *diagnostic) |
| void | check_max_errors (bool flush) |
| void | action_after_output (enum kind diag_kind) |
| void | inhibit_notes_in_group (bool inhibit=true) |
| bool | notes_inhibited_in_group () const |
Friends | |
| class | source_print_policy |
| class | text_sink |
| class | buffer |
| text_starter_fn & | text_starter (context *dc) |
| start_span_fn< to_text > & | start_span (context *dc) |
| text_finalizer_fn & | text_finalizer (context *dc) |
This class encapsulates the state of the diagnostics subsystem as a whole (either directly, or via owned objects of other classes, to avoid global variables). It has responsibility for: - being a central place for clients to report diagnostics - reporting those diagnostics to zero or more output sinks (e.g. text vs SARIF) - providing a "dump" member function for a debug dump of the state of the diagnostics subsystem - direct vs buffered diagnostics (see class diagnostics::buffer) - tracking the original argv of the program (for SARIF output) - crash-handling It delegates responsibility to various other classes: - the various output sinks (instances of diagnostics::sink subclasses) - formatting of messages (class pretty_printer) - an optional urlifier to inject URLs into formatted messages - counting the number of diagnostics reported of each kind (class diagnostics::counters) - calling out to a option_id_manager to determine if a particular warning is enabled or disabled - tracking pragmas that enable/disable warnings in a range of source code - a cache for use when quoting the user's source code (class file_cache) - a text_art::theme - a diagnostics::changes::change_set for generating patches from fix-it hints - diagnostics::client_data_hooks for metadata. Try to avoid adding new responsibilities to this class itself, to avoid the "blob" anti-pattern.
| typedef void(*) diagnostics::context::set_locations_callback_t(const context &, diagnostic_info *) |
|
private |
Take any action which is expected to happen after the diagnostic is written out. This function does not always return.
References bt_callback(), bt_err_callback(), FATAL_EXIT_CODE, finish(), fnotice(), gcc_unreachable, ICE_EXIT_CODE, m_abort_on_error, m_fatal_errors, m_original_argv, m_report_bug, and real_abort().
Referenced by error_recursion(), flush_diagnostic_buffer(), and report_diagnostic().
| void diagnostics::context::add_sink | ( | std::unique_ptr< sink > | sink_ | ) |
References DIAGNOSTICS_LOG_SCOPE_PRINTF0, diagnostics::logging::logger::get_indent(), diagnostics::logging::logger::get_stream(), m_logger, and m_sinks.
Referenced by diagnostic_manager_add_sink_from_spec(), diagnostic_text_sink::diagnostic_text_sink(), handle_OPT_fdiagnostics_add_output_(), diagnostics::maybe_open_sarif_sink_for_socket(), and sarif_sink::sarif_sink().
| void diagnostics::context::begin_group | ( | ) |
class diagnostics::context.
References m_diagnostic_groups.
Referenced by auto_diagnostic_group::auto_diagnostic_group(), diagnostic_report_diagnostic(), emit_diagnostic_with_group(), emit_diagnostic_with_group_va(), diagnostic_manager::emit_va(), and diagnostics::output_spec::dc_spec_context::report_error_va().
| char * diagnostics::context::build_indent_prefix | ( | ) | const |
|
private |
Check if we've met the maximum error limit, and if so fatally exit with a message. FLUSH indicates whether a diagnostics::context::finish call is needed.
References diagnostic_count(), FATAL_EXIT_CODE, finish(), fnotice(), and m_max_errors.
Referenced by flush_diagnostic_buffer(), and report_diagnostic().
|
inline |
References classify_diagnostic(), diagnostics::option_classifier::classify_diagnostic(), diagnostics::logging::log_function_params::log_param_kind(), diagnostics::logging::log_function_params::log_param_location_t(), diagnostics::logging::log_function_params::log_param_option_id(), m_logger, and m_option_classifier.
Referenced by classify_diagnostic(), create_loc_map(), and diagnostic_classify_diagnostic().
| void diagnostics::context::clear_diagnostic_buffer | ( | buffer & | buffer_ | ) |
Clear BUFFER_ without flushing it.
References buffer, diagnostics::counters::clear(), diagnostics::buffer::m_diagnostic_counters, m_last_location, diagnostics::buffer::m_per_sink_buffers, and UNKNOWN_LOCATION.
|
inline |
References pretty_printer::clone(), and m_reference_printer.
Referenced by attr_access::array_as_string(), diagnostics::html_sink::update_printer(), and diagnostics::sarif_sink::update_printer().
| void diagnostics::context::color_init | ( | int | value | ) |
Maybe initialize the color support. We require clients to do this explicitly, since most clients don't want color. When called without a VALUE, it initializes with DIAGNOSTICS_COLOR_DEFAULT.
References colorize_init(), DIAGNOSTICS_COLOR_AUTO, m_reference_printer, m_sinks, and pp_show_color().
Referenced by diagnostic_color_init().
|
inline |
References diagnostics::counters::m_count_for_kind, and m_diagnostic_counters.
Referenced by check_max_errors(), execution_failed_p(), and report_diagnostic().
|
inline |
References diagnostics::counters::get_count(), and m_diagnostic_counters.
|
private |
Returns whether a DIAGNOSTIC should be printed, and adjusts diagnostic->kind as appropriate for #pragma GCC diagnostic and -Werror=foo.
References diagnostics::any, get_any_inlining_info(), m_opt_permissive, m_option_classifier, option_enabled_p(), and option_unspecified_p().
Referenced by report_diagnostic(), and warning_enabled_at().
| bool diagnostics::context::diagnostic_impl | ( | rich_location * | richloc, |
| const metadata * | metadata, | ||
| option_id | opt_id, | ||
| const char * | gmsgid, | ||
| va_list * | ap, | ||
| enum kind | kind ) |
Implement emit_diagnostic, inform, warning, warning_at, pedwarn, permerror, error, error_at, error_at, sorry, fatal_error, internal_error, and internal_error_no_backtrace, as documented and defined below.
References ap, diagnostic_set_info(), diagnostics::logging::logger::log_bool_return(), diagnostics::logging::log_function_params::log_param_kind(), diagnostics::logging::log_function_params::log_param_option_id(), diagnostics::logging::log_function_params::log_param_string(), diagnostics::option_id::m_idx, m_logger, diagnostic::m_metadata, m_opt_permissive, m_permissive, and report_diagnostic().
Referenced by emit_diagnostic(), emit_diagnostic(), emit_diagnostic_valist(), emit_diagnostic_valist_meta(), emit_diagnostic_with_group_va(), emit_json_diagnostic(), error(), error_at(), error_at(), error_meta(), fatal_error(), inform(), inform(), internal_error(), internal_error_no_backtrace(), pedwarn(), pedwarn(), permerror(), permerror(), permerror_opt(), permerror_opt(), sorry(), sorry_at(), warning(), warning_at(), warning_at(), and warning_meta().
| bool diagnostics::context::diagnostic_n_impl | ( | rich_location * | richloc, |
| const metadata * | metadata, | ||
| option_id | opt_id, | ||
| unsigned HOST_WIDE_INT | n, | ||
| const char * | singular_gmsgid, | ||
| const char * | plural_gmsgid, | ||
| va_list * | ap, | ||
| enum kind | kind ) |
Implement inform_n, warning_n, and error_n, as documented and defined below.
References ap, diagnostic_set_info_translated(), diagnostics::logging::logger::log_bool_return(), diagnostics::logging::log_function_params::log_param_kind(), diagnostics::logging::log_function_params::log_param_option_id(), diagnostics::logging::log_function_params::log_params_n_gmsgids(), m_logger, diagnostic::m_metadata, ngettext, report_diagnostic(), and ULONG_MAX.
Referenced by error_n(), inform_n(), warning_n(), and warning_n().
|
inline |
References DEBUG_FUNCTION, and dump().
Referenced by dump().
| void diagnostics::context::dump | ( | FILE * | outfile, |
| int | indent ) const |
Dump state of this diagnostics::context to OUT, for debugging.
References diagnostics::buffer::dump(), diagnostics::client_data_hooks::dump(), diagnostics::counters::dump(), diagnostics::file_cache::dump(), pretty_printer::dump(), diagnostics::dumping::emit_heading(), diagnostics::dumping::emit_indent(), diagnostics::dumping::emit_none(), i, m_client_data_hooks, m_diagnostic_buffer, m_diagnostic_counters, m_file_cache, m_reference_printer, and m_sinks.
Referenced by finish().
| bool diagnostics::context::emit_diagnostic_with_group | ( | enum kind kind | , |
| rich_location & | richloc, | ||
| const metadata * | metadata, | ||
| option_id | opt_id, | ||
| const char * | gmsgid, | ||
| ... ) |
Emit a diagnostic within a diagnostic group on this context.
References ap, begin_group(), emit_diagnostic_with_group_va(), and end_group().
Referenced by diagnostics::open_html_output_file(), and diagnostics::output_file::try_to_open().
| bool diagnostics::context::emit_diagnostic_with_group_va | ( | enum kind kind | , |
| rich_location & | richloc, | ||
| const metadata * | metadata, | ||
| option_id | opt_id, | ||
| const char * | gmsgid, | ||
| va_list * | ap ) |
As above, but taking a va_list *.
References ap, begin_group(), diagnostic_impl(), and end_group().
Referenced by emit_diagnostic_with_group().
| void diagnostics::context::emit_diagram | ( | const diagram & | diag | ) |
Emit DIAGRAM to this context, respecting the output format.
References m_diagrams, and m_sinks.
|
inline |
References m_lock.
Referenced by emitting_diagnostic_p().
| void diagnostics::context::end_group | ( | ) |
References DIAGNOSTICS_LOG_SCOPE_PRINTF0, get_logger(), inhibit_notes_in_group(), m_diagnostic_groups, and m_sinks.
Referenced by diagnostic_report_diagnostic(), emit_diagnostic_with_group(), emit_diagnostic_with_group_va(), diagnostic_manager::emit_va(), finish(), and auto_diagnostic_group::~auto_diagnostic_group().
|
private |
Inform the user that an error occurred while trying to report some other error. This indicates catastrophic internal inconsistencies, so give up now. But do try to flush out the previous error. This mustn't use internal_error, that will cause infinite recursion.
References action_after_output(), fnotice(), m_lock, m_reference_printer, pp_newline_and_flush(), and real_abort().
Referenced by report_diagnostic().
| bool diagnostics::context::execution_failed_p | ( | ) | const |
Return true if sufficiently severe diagnostics have been seen that we ought to exit with a non-zero exit code.
References diagnostic_count().
Referenced by toplev::main(), and diagnostics::sarif_invocation::prepare_to_flush().
| void diagnostics::context::finish | ( | ) |
Do any cleaning up required after the last diagnostic is emitted.
References dump(), end_group(), diagnostics::option_classifier::fini(), diagnostics::logging::logger::get_indent(), diagnostics::logging::logger::get_stream(), diagnostics::logging::logger::inc_depth(), diagnostics::logging::logger::log_printf(), m_client_data_hooks, m_diagnostic_groups, m_diagrams, m_file_cache, m_fixits_change_set, m_logger, m_option_classifier, m_option_id_mgr, m_original_argv, m_reference_printer, m_sinks, m_urlifier_stack, pop_urlifier(), and set_diagnostic_buffer().
Referenced by action_after_output(), check_max_errors(), and diagnostic_finish().
| void diagnostics::context::flush_diagnostic_buffer | ( | buffer & | buffer_ | ) |
Flush the diagnostics in BUFFER_ to this context, clearing BUFFER_.
References action_after_output(), buffer, check_max_errors(), diagnostics::buffer::diagnostic_count(), diagnostics::buffer::m_diagnostic_counters, m_diagnostic_counters, diagnostics::buffer::m_per_sink_buffers, and diagnostics::counters::move_to().
|
private |
Update the inlining info in this context for a DIAGNOSTIC.
References diagnostic_location(), in_system_header_at(), and m_set_locations_cb.
Referenced by diagnostic_enabled().
|
inline |
References diagnostics::option_classifier::m_classification_history, and m_option_classifier.
Referenced by create_loc_map().
|
inline |
References m_client_data_hooks.
Referenced by emit_json_diagnostic(), diagnostics::sarif_builder::get_logical_location_manager(), diagnostics::sarif_builder::get_or_create_artifact(), diagnostics::sarif_builder::make_driver_tool_component_object(), diagnostics::html_builder::make_element_for_diagnostic(), diagnostics::sarif_builder::make_locations_arr(), diagnostics::sarif_builder::make_tool_object(), and diagnostics::sarif_invocation::prepare_to_flush().
|
inline |
References m_column_options.
Referenced by common_handle_option(), and report_diagnostic().
|
inline |
References m_column_options.
|
inline |
References buffer, and m_diagnostic_buffer.
References m_diagnostic_groups.
Referenced by diagnostics::sarif_result::on_nested_diagnostic(), and diagnostics::html_builder::on_report_diagnostic().
|
inline |
References m_diagrams.
Referenced by text_art::dump_to_file(), diagnostics::sink::get_diagram_theme(), and diagnostics::use_unicode_p().
|
inline |
References m_escape_format.
Referenced by diagnostics::sarif_builder::make_location_object().
|
inline |
References gcc_assert, and m_file_cache.
Referenced by gcc_rich_location::add_fixit_insert_formatted(), asm_show_source(), diagnostics::sarif_builder::get_sarif_column(), diagnostics::sarif_builder::get_source_lines(), toplev::main(), diagnostics::html_builder::make_element_for_patch(), diagnostics::sarif_builder::make_message_describing_fix_it_hint(), diagnostics::sarif_builder::maybe_make_artifact_content_object(), report_diagnostic(), and diagnostic_file::set_buffered_content().
|
inline |
References m_fixits_change_set.
Referenced by toplev::main().
|
inline |
References m_lang_mask.
Referenced by init_asm_output().
|
inline |
References m_logger.
Referenced by emit_diagnostic(), emit_diagnostic(), emit_diagnostic_valist(), emit_diagnostic_valist_meta(), emit_json_diagnostic(), end_group(), error(), error_at(), error_at(), error_meta(), error_n(), fatal_error(), diagnostics::html_builder::flush_to_file(), diagnostics::sarif_builder::flush_to_file(), diagnostics::sarif_builder::flush_to_object(), diagnostics::sink::get_logger(), handle_OPT_fdiagnostics_add_output_(), handle_OPT_fdiagnostics_set_output_(), inform(), inform(), inform_n(), internal_error(), internal_error_no_backtrace(), pedwarn(), pedwarn(), permerror(), permerror(), permerror_opt(), permerror_opt(), report_diagnostic(), diagnostics::sarif_socket_sink::send_rpc_notification(), sorry(), sorry_at(), verbatim(), warning(), warning_at(), warning_at(), warning_meta(), warning_n(), and warning_n().
| const logical_locations::manager * diagnostics::context::get_logical_location_manager | ( | ) | const |
|
inline |
|
inline |
References m_original_argv.
|
inline |
References m_path_format.
|
inline |
References m_reference_printer.
Referenced by announce_function(), common_handle_option(), escaped_string::escape(), fancy_abort(), init_options_once(), initialize(), toplev::main(), lazy_diagnostic_context_path::make_inner_path(), diagnostics::print_path_as_html(), set_caret_max_width(), diagnostic_text_sink::set_colorize(), and tree_dump_pretty_printer::tree_dump_pretty_printer().
| sink & diagnostics::context::get_sink | ( | size_t | idx | ) | const |
References gcc_assert, and m_sinks.
|
inline |
|
inline |
References m_source_printing.
| const urlifier * diagnostics::context::get_urlifier | ( | ) | const |
References m_urlifier_stack.
Referenced by diagnostics::html_builder::make_element_for_diagnostic(), and diagnostics::sarif_builder::on_report_diagnostic().
|
inline |
References m_inhibit_notes_p.
Referenced by process_options().
State whether we should inhibit notes in the current diagnostic_group and its future children if any.
References gcc_assert, and m_diagnostic_groups.
Referenced by end_group(), pop_nesting_level(), and report_diagnostic().
| void diagnostics::context::initialize | ( | int | n_opts | ) |
Initialize the diagnostic message outputting machinery.
References auto_vec< T, N >::auto_vec(), diagnostics::source_printing_options::caret_chars, diagnostics::counters::clear(), diagnostics::source_printing_options::colorize_source_p, diagnostics::default_start_span_fn(), diagnostics::default_text_finalizer(), diagnostics::default_text_starter(), DIAGNOSTICS_COLUMN_UNIT_DISPLAY, DIAGNOSTICS_ESCAPE_FORMAT_UNICODE, DIAGNOSTICS_TEXT_ART_CHARSET_ASCII, DIAGNOSTICS_TEXT_ART_CHARSET_EMOJI, DPF_NONE, diagnostics::source_printing_options::enabled, EXTRA_DIAGNOSTIC_OUTPUT_fixits_v1, EXTRA_DIAGNOSTIC_OUTPUT_fixits_v2, EXTRA_DIAGNOSTIC_OUTPUT_none, diagnostics::file_cache::file_cache(), fopen, get_reference_printer(), i, diagnostics::option_classifier::init(), diagnostics::logging::logger::log_printf(), m_abort_on_error, m_adjust_diagnostic_info, m_client_aux_data, m_client_data_hooks, m_column_options, diagnostics::column_options::m_column_origin, diagnostics::column_options::m_column_unit, m_diagnostic_buffer, m_diagnostic_counters, m_diagnostic_groups, m_diagrams, m_escape_format, m_extra_output_kind, m_fatal_errors, m_file_cache, m_fixits_change_set, m_inhibit_notes_p, m_inhibit_warnings, m_internal_error, m_last_location, m_lock, m_logger, m_max_errors, m_n_opts, m_opt_permissive, m_option_classifier, m_option_id_mgr, m_original_argv, m_path_format, m_pedantic_errors, m_permissive, m_reference_printer, m_report_bug, m_set_locations_cb, m_show_column, m_show_cwe, m_show_option_requested, m_show_path_depths, m_show_rules, m_sinks, m_source_printing, diagnostics::column_options::m_tabstop, m_text_callbacks, m_urlifier_stack, m_warn_system_headers, m_warning_as_error_requested, diagnostics::source_printing_options::min_margin_width, pp_line_cutoff(), set_caret_max_width(), set_text_art_charset(), diagnostics::source_printing_options::show_event_links_p, diagnostics::source_printing_options::show_labels_p, diagnostics::source_printing_options::show_line_numbers_p, diagnostics::source_printing_options::show_ruler_p, text_sink, and UNKNOWN_LOCATION.
Referenced by diagnostic_initialize().
| void diagnostics::context::initialize_fixits_change_set | ( | ) |
References gcc_assert, m_file_cache, and m_fixits_change_set.
Referenced by process_options().
| void diagnostics::context::initialize_input_context | ( | diagnostic_input_charset_callback | ccb, |
| bool | should_skip_bom ) |
Create the file_cache, if not already created, and tell it how to translate files on input.
References diagnostics::file_cache::initialize_input_context(), and m_file_cache.
Referenced by diagnostic_initialize_input_context().
| void diagnostics::context::maybe_show_locus | ( | const rich_location & | richloc, |
| const source_printing_options & | opts, | ||
| enum kind | diagnostic_kind, | ||
| pretty_printer & | pp, | ||
| source_effect_info * | effects ) |
As per diagnostics::source_print_policy::print, but don't print anything if source printing is disabled, or if the location hasn't changed.
References BUILTINS_LOCATION, diagnostics::source_printing_options::enabled, m_last_location, diagnostics::source_print_policy::print(), and source_print_policy.
Referenced by diagnostic_show_locus().
| void diagnostics::context::maybe_show_locus_as_html | ( | const rich_location & | richloc, |
| const source_printing_options & | opts, | ||
| enum kind | diagnostic_kind, | ||
| xml::printer & | xp, | ||
| source_effect_info * | effects, | ||
| html_label_writer * | label_writer ) |
As above, but print in HTML form to XP. If non-null, use LABEL_WRITER when writing labelled ranges.
References BUILTINS_LOCATION, diagnostics::source_printing_options::enabled, m_last_location, diagnostics::source_print_policy::print_as_html(), and source_print_policy.
Referenced by diagnostic_show_locus_as_html(), and diagnostics::html_builder::make_element_for_diagnostic().
|
private |
Return whether notes must be inhibited in the current diagnostic_group.
References m_diagnostic_groups.
Referenced by report_diagnostic().
References m_option_id_mgr, and diagnostics::option_id_manager::option_enabled_p().
Referenced by diagnostics::option_classifier::classify_diagnostic(), and diagnostic_enabled().
References m_option_classifier, and diagnostics::option_classifier::option_unspecified_p().
Referenced by diagnostic_enabled(), and option_unspecified_p().
|
inline |
References m_option_classifier, and diagnostics::option_classifier::pch_restore().
|
inline |
References m_option_classifier, and diagnostics::option_classifier::pch_save().
|
inline |
| void diagnostics::context::pop_nesting_level | ( | ) |
References inhibit_notes_in_group(), and m_diagnostic_groups.
Referenced by auto_diagnostic_nesting_level::~auto_diagnostic_nesting_level().
| void diagnostics::context::pop_urlifier | ( | ) |
References gcc_assert, and m_urlifier_stack.
Referenced by finish(), and auto_override_urlifier::~auto_override_urlifier().
| void diagnostics::context::push_borrowed_urlifier | ( | const urlifier & | loan | ) |
References gcc_assert, and m_urlifier_stack.
Referenced by auto_override_urlifier::auto_override_urlifier().
|
inline |
| void diagnostics::context::push_nesting_level | ( | ) |
References m_diagnostic_groups.
Referenced by auto_diagnostic_nesting_level::auto_diagnostic_nesting_level().
| void diagnostics::context::push_owned_urlifier | ( | std::unique_ptr< urlifier > | ptr | ) |
References gcc_assert, and m_urlifier_stack.
Referenced by general_init(), and driver::global_initializations().
| void diagnostics::context::refresh_output_sinks | ( | ) |
Give all output sinks a chance to rebuild their pretty_printer.
References m_sinks.
Referenced by init_options_once(), and set_pretty_printer().
| void diagnostics::context::remove_all_output_sinks | ( | ) |
References m_sinks.
Referenced by set_sink().
| bool diagnostics::context::report_diagnostic | ( | diagnostic_info * | diagnostic | ) |
Report a diagnostic message (an error or a warning) as specified by this diagnostics::context. front-end independent format specifiers are exactly those described in the documentation of output_format. Return true if a diagnostic was printed, false otherwise.
References action_after_output(), check_max_errors(), diagnostic_count(), diagnostic_enabled(), diagnostic_location(), DIAGNOSTICS_COLUMN_UNIT_BYTE, DIAGNOSTICS_COLUMN_UNIT_DISPLAY, DIAGNOSTICS_LOG_SCOPE_PRINTF0, error_recursion(), expand_location(), EXTRA_DIAGNOSTIC_OUTPUT_fixits_v1, EXTRA_DIAGNOSTIC_OUTPUT_fixits_v2, fnotice(), gcc_assert, get_column_options(), get_file_cache(), get_logger(), ICE_EXIT_CODE, inhibit_notes_in_group(), m_abort_on_error, m_adjust_diagnostic_info, diagnostics::counters::m_count_for_kind, m_diagnostic_buffer, m_diagnostic_counters, m_diagnostic_groups, m_extra_output_kind, m_fixits_change_set, m_inhibit_notes_p, m_inhibit_warnings, m_internal_error, m_lock, m_logger, m_pedantic_errors, m_reference_printer, m_sinks, m_warn_system_headers, m_warning_as_error_requested, notes_inhibited_in_group(), pp_flush(), pp_format(), pp_newline_and_flush(), diagnostics::print_parseable_fixits(), and va_copy.
Referenced by diagnostic_impl(), diagnostic_n_impl(), and diagnostic_report_diagnostic().
| void diagnostics::context::report_global_digraph | ( | const lazily_created< digraphs::digraph > & | ldg | ) |
References m_sinks.
Referenced by diagnostic_manager::take_global_graph().
| void diagnostics::context::report_verbatim | ( | text_info & | text | ) |
References m_sinks, and va_copy.
Referenced by verbatim().
|
inline |
References m_abort_on_error.
Referenced by setup_core_dumping().
|
inline |
References m_adjust_diagnostic_info.
| void diagnostics::context::set_caret_max_width | ( | int | value | ) |
Set caret_max_width to value.
References get_reference_printer(), get_terminal_width(), INT_MAX, m_source_printing, diagnostics::source_printing_options::max_width, and pp_buffer().
Referenced by common_handle_option(), and initialize().
| std::unique_ptr< client_data_hooks > diagnostics::context::set_client_data_hooks | ( | std::unique_ptr< client_data_hooks > | hooks | ) |
References m_client_data_hooks.
Referenced by emit_json_diagnostic(), and tree_diagnostics_defaults().
| void diagnostics::context::set_diagnostic_buffer | ( | buffer * | buffer_ | ) |
Methods fns of diagnostics::context relating to buffering.
If BUFFER_ is non-null, use BUFFER as the active diagnostics::buffer on this context. BUFFER is borrowed. If BUFFER_ is null, stop any buffering on this context until the next call to this function.
References buffer, diagnostics::buffer::ensure_per_sink_buffers(), gcc_assert, m_diagnostic_buffer, m_diagnostic_groups, diagnostics::buffer::m_per_sink_buffers, and m_sinks.
Referenced by finish().
|
inline |
References m_escape_format.
Referenced by common_handle_option(), and diagnostics::sarif_builder::make_location_object().
|
inline |
References m_extra_output_kind.
Referenced by common_handle_option().
|
inline |
References m_fatal_errors.
Referenced by common_handle_option().
| void diagnostics::context::set_format_decoder | ( | printer_fn | format_decoder | ) |
Set FORMAT_DECODER on the reference printer and on the pretty_printer of all output sinks.
References m_reference_printer, m_sinks, and pp_format_decoder().
Referenced by tree_diagnostics_defaults().
|
inline |
References m_internal_error.
Referenced by general_init(), and internal_error_function().
| void diagnostics::context::set_main_input_filename | ( | const char * | filename | ) |
References m_sinks.
Referenced by diagnostic_manager_set_analysis_target().
|
inline |
References m_max_errors.
Referenced by common_handle_option().
| void diagnostics::context::set_nesting_level | ( | int | new_level | ) |
References m_diagnostic_groups.
Referenced by diagnostic_manager::emit_va().
| void diagnostics::context::set_option_id_manager | ( | std::unique_ptr< option_id_manager > | option_id_mgr, |
| unsigned | lang_mask ) |
References m_lang_mask, and m_option_id_mgr.
Referenced by general_init(), and main().
| void diagnostics::context::set_original_argv | ( | unique_argv | original_argv | ) |
References m_original_argv, and unique_argv::release().
Referenced by general_init().
|
inline |
References m_path_format.
Referenced by common_handle_option(), and general_init().
|
inline |
References m_opt_permissive.
| void diagnostics::context::set_prefixing_rule | ( | diagnostic_prefixing_rule_t | rule | ) |
References m_reference_printer, m_sinks, and pp_prefixing_rule().
Referenced by common_handle_option().
| void diagnostics::context::set_pretty_printer | ( | std::unique_ptr< pretty_printer > | pp | ) |
Set PP as the reference printer for this context. Refresh all output sinks.
References m_reference_printer, and refresh_output_sinks().
|
inline |
References m_report_bug.
Referenced by common_handle_option().
|
inline |
References m_set_locations_cb.
Referenced by tree_diagnostics_defaults().
|
inline |
References m_show_cwe.
Referenced by common_handle_option(), and general_init().
| void diagnostics::context::set_show_highlight_colors | ( | bool | val | ) |
References m_reference_printer, m_sinks, and pp_show_highlight_colors().
Referenced by common_handle_option(), driver_handle_option(), general_init(), init_options_once(), and run_gcc().
| void diagnostics::context::set_show_nesting | ( | bool | val | ) |
References m_sinks.
Referenced by common_handle_option(), and general_init().
| void diagnostics::context::set_show_nesting_levels | ( | bool | val | ) |
References m_sinks.
Referenced by common_handle_option(), and general_init().
| void diagnostics::context::set_show_nesting_locations | ( | bool | val | ) |
References m_sinks.
Referenced by common_handle_option(), and general_init().
|
inline |
References m_show_option_requested.
Referenced by common_handle_option(), and general_init().
|
inline |
References m_show_path_depths.
Referenced by common_handle_option(), and general_init().
|
inline |
References m_show_rules.
Referenced by common_handle_option(), and general_init().
| void diagnostics::context::set_sink | ( | std::unique_ptr< sink > | sink_ | ) |
| void diagnostics::context::set_text_art_charset | ( | enum diagnostic_text_art_charset | charset | ) |
Initialize this context's m_diagrams based on CHARSET. Specifically, make a text_art::theme object for m_diagrams.m_theme, (or nullptr for "no diagrams").
References DIAGNOSTICS_TEXT_ART_CHARSET_ASCII, DIAGNOSTICS_TEXT_ART_CHARSET_EMOJI, DIAGNOSTICS_TEXT_ART_CHARSET_NONE, DIAGNOSTICS_TEXT_ART_CHARSET_UNICODE, gcc_unreachable, and m_diagrams.
Referenced by common_handle_option(), driver_handle_option(), and initialize().
|
inline |
References m_warning_as_error_requested.
Referenced by common_handle_option().
|
inline |
References m_show_path_depths.
Referenced by diagnostics::print_path_as_html().
| bool diagnostics::context::supports_fnotice_on_stderr_p | ( | ) | const |
| void diagnostics::context::urls_init | ( | int | value | ) |
Initialize URL support within this context based on VALUE, handling "auto".
References determine_url_format(), DIAGNOSTICS_URL_AUTO, pretty_printer::get_url_format(), m_reference_printer, m_sinks, and pretty_printer::set_url_format().
Referenced by diagnostic_urls_init().
|
inline |
References m_warning_as_error_requested.
Referenced by compiler_diagnostic_option_id_manager::get_option_name().
Returns whether warning OPT_ID is enabled at LOC.
References diagnostic_enabled(), diagnostic_report_warnings_p, and line_table.
Referenced by warning_enabled_at().
|
friend |
References buffer.
Referenced by buffer, clear_diagnostic_buffer(), flush_diagnostic_buffer(), get_diagnostic_buffer(), and set_diagnostic_buffer().
|
friend |
References source_print_policy.
Referenced by maybe_show_locus(), maybe_show_locus_as_html(), and source_print_policy.
|
friend |
Client supplied function called between disjoint spans of source code, so that the context can print something to indicate that a new span of source code has begun.
References m_text_callbacks, and start_span.
Referenced by start_span.
|
friend |
Client supplied function called after a diagnostic message is displayed (for text-based diagnostic output).
References m_text_callbacks, and text_finalizer.
Referenced by text_finalizer.
|
friend |
References text_sink.
Referenced by initialize(), and text_sink.
|
friend |
Client supplied function to announce a diagnostic (for text-based diagnostic output).
References m_text_callbacks, and text_starter.
Referenced by text_starter.
|
private |
Referenced by action_after_output(), initialize(), report_diagnostic(), and set_abort_on_error().
|
private |
Referenced by initialize(), report_diagnostic(), and set_adjust_diagnostic_info_callback().
| void* diagnostics::context::m_client_aux_data |
Referenced by initialize().
|
private |
Referenced by dump(), finish(), get_client_data_hooks(), get_logical_location_manager(), initialize(), and set_client_data_hooks().
|
private |
Referenced by get_column_options(), get_column_options(), and initialize().
|
private |
Referenced by dump(), get_diagnostic_buffer(), initialize(), report_diagnostic(), and set_diagnostic_buffer().
|
private |
Referenced by diagnostic_count(), diagnostic_count(), dump(), flush_diagnostic_buffer(), initialize(), and report_diagnostic().
| struct { ... } diagnostics::context::m_diagnostic_groups |
| struct { ... } diagnostics::context::m_diagrams |
Referenced by emit_diagram(), finish(), get_diagram_theme(), initialize(), and set_text_art_charset().
|
private |
Referenced by get_escape_format(), initialize(), and set_escape_format().
|
private |
Referenced by initialize(), report_diagnostic(), and set_extra_output_kind().
|
private |
Referenced by action_after_output(), initialize(), and set_fatal_errors().
|
private |
Referenced by dump(), finish(), get_file_cache(), initialize(), initialize_fixits_change_set(), and initialize_input_context().
|
private |
Referenced by finish(), get_fixits_change_set(), initialize(), initialize_fixits_change_set(), and report_diagnostic().
|
private |
Referenced by diagnostics::text_sink::append_note(), inhibit_notes(), initialize(), and report_diagnostic().
| bool diagnostics::context::m_inhibit_warnings |
Referenced by common_handle_option(), initialize(), and report_diagnostic().
|
private |
Referenced by initialize(), report_diagnostic(), and set_internal_error_callback().
|
private |
Referenced by get_lang_mask(), and set_option_id_manager().
| location_t diagnostics::context::m_last_location |
|
private |
Referenced by emitting_diagnostic_p(), error_recursion(), initialize(), and report_diagnostic().
|
private |
|
private |
Referenced by check_max_errors(), initialize(), and set_max_errors().
|
private |
Referenced by initialize().
|
private |
Referenced by diagnostic_enabled(), diagnostic_impl(), initialize(), and set_permissive_option().
|
private |
|
private |
Referenced by finish(), get_option_name(), get_option_url(), initialize(), option_enabled_p(), and set_option_id_manager().
|
private |
Referenced by action_after_output(), finish(), get_original_argv(), initialize(), and set_original_argv().
|
private |
Referenced by get_path_format(), initialize(), and set_path_format().
| bool diagnostics::context::m_pedantic_errors |
Referenced by common_handle_option(), initialize(), and report_diagnostic().
| bool diagnostics::context::m_permissive |
Referenced by diagnostic_impl(), and initialize().
|
private |
|
private |
Referenced by action_after_output(), initialize(), and set_report_bug().
|
private |
Referenced by get_any_inlining_info(), initialize(), and set_set_locations_callback().
| bool diagnostics::context::m_show_column |
|
private |
Referenced by initialize(), and set_show_cwe().
|
private |
Referenced by initialize(), and set_show_option_requested().
|
private |
Referenced by initialize(), set_show_path_depths(), and show_path_depths_p().
|
private |
Referenced by initialize(), and set_show_rules().
Referenced by add_sink(), color_init(), dump(), emit_diagram(), end_group(), diagnostics::buffer::ensure_per_sink_buffers(), finish(), get_sink(), initialize(), diagnostics::buffer::move_to(), refresh_output_sinks(), remove_all_output_sinks(), report_diagnostic(), report_global_digraph(), report_verbatim(), set_diagnostic_buffer(), set_format_decoder(), set_main_input_filename(), set_prefixing_rule(), set_show_highlight_colors(), set_show_nesting(), set_show_nesting_levels(), set_show_nesting_locations(), set_sink(), supports_fnotice_on_stderr_p(), and urls_init().
|
private |
Referenced by get_source_printing_options(), get_source_printing_options(), initialize(), and set_caret_max_width().
| struct { ... } diagnostics::context::m_text_callbacks |
Referenced by initialize(), start_span, text_finalizer, and text_starter.
|
private |
Referenced by finish(), get_urlifier(), initialize(), pop_urlifier(), push_borrowed_urlifier(), and push_owned_urlifier().
| bool diagnostics::context::m_warn_system_headers |
Referenced by common_handle_option(), initialize(), and report_diagnostic().
|
private |
Referenced by initialize(), report_diagnostic(), set_warning_as_error_requested(), and warning_as_error_requested_p().