GCC Middle and Back End API Reference
|
Go to the source code of this file.
Data Structures | |
struct | diagnostic_info |
struct | diagnostic_classification_change_t |
struct | diagnostic_context |
Typedefs | |
typedef struct diagnostic_info | diagnostic_info |
typedef struct diagnostic_classification_change_t | diagnostic_classification_change_t |
typedef void(* | diagnostic_starter_fn )(diagnostic_context *, diagnostic_info *) |
typedef diagnostic_starter_fn | diagnostic_finalizer_fn |
Variables | |
diagnostic_context * | global_dc |
Each time a diagnostic's classification is changed with a pragma, we record the change and the location of the change in an array of these structs.
typedef struct diagnostic_info diagnostic_info |
A diagnostic is described by the MESSAGE to send, the FILE and LINE of its context and its KIND (ice, error, warning, note, ...) See complete list in diagnostic.def.
typedef void(* diagnostic_starter_fn)(diagnostic_context *, diagnostic_info *) |
Forward declarations.
void default_diagnostic_finalizer | ( | diagnostic_context * | , |
diagnostic_info * | |||
) |
Referenced by diagnostic_initialize(), and tree_diagnostics_defaults().
void default_diagnostic_starter | ( | diagnostic_context * | , |
diagnostic_info * | |||
) |
References diagnostic_build_prefix(), diagnostic_report_current_module(), diagnostic_info::location, pp_set_prefix(), and diagnostic_context::printer.
Referenced by diagnostic_initialize().
void void void diagnostic_append_note | ( | diagnostic_context * | , |
location_t | , | ||
const char * | , | ||
... | |||
) |
void void void char* diagnostic_build_prefix | ( | diagnostic_context * | context, |
const diagnostic_info * | diagnostic | ||
) |
Return a malloc'd string describing a location. The caller is responsible for freeing the memory.
References build_message_string(), colorize_start(), colorize_stop(), DK_LAST_DIAGNOSTIC_KIND, expand_location_to_spelling_point(), diagnostic_info::kind, diagnostic_info::location, diagnostic_info::override_column, diagnostic_context::printer, progname, and diagnostic_context::show_column.
Referenced by default_diagnostic_starter(), default_tree_diagnostic_starter(), and diagnostic_append_note().
diagnostic_t diagnostic_classify_diagnostic | ( | diagnostic_context * | context, |
int | option_index, | ||
diagnostic_t | new_kind, | ||
location_t | where | ||
) |
Force diagnostics controlled by OPTIDX to be kind KIND.
Interface to specify diagnostic kind overrides. Returns the previous setting, or DK_UNSPECIFIED if the parameters are out of range. If OPTION_INDEX is zero, the new setting is for all the diagnostics.
References diagnostic_context::classification_history, diagnostic_context::classify_diagnostic, DK_LAST_DIAGNOSTIC_KIND, diagnostic_classification_change_t::kind, diagnostic_classification_change_t::location, diagnostic_context::n_classification_history, diagnostic_context::n_opts, and diagnostic_classification_change_t::option.
Referenced by control_warning_option(), process_options(), and set_option().
void diagnostic_finish | ( | diagnostic_context * | ) |
|
inlinestatic |
References diagnostic_context::inhibit_notes_p.
Referenced by process_options().
void diagnostic_initialize | ( | diagnostic_context * | , |
int | |||
) |
Diagnostic related functions.
void diagnostic_pop_diagnostics | ( | diagnostic_context * | , |
location_t | |||
) |
void diagnostic_push_diagnostics | ( | diagnostic_context * | , |
location_t | |||
) |
void diagnostic_report_current_module | ( | diagnostic_context * | , |
location_t | |||
) |
bool diagnostic_report_diagnostic | ( | diagnostic_context * | context, |
diagnostic_info * | diagnostic | ||
) |
Report a diagnostic message (an error or a warning) as specified by DC. This function is *the* subroutine in terms of which front-ends should implement their specific diagnostic handling modules. The 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 diagnostic_context::abort_on_error, text_info::args_ptr, diagnostic_context::classification_history, diagnostic_context::classify_diagnostic, diagnostic_action_after_output(), diagnostic_show_locus(), DK_POP, error_recursion(), expand_location(), fnotice(), text_info::format_spec, free(), diagnostic_context::inhibit_notes_p, diagnostic_context::internal_error, diagnostic_info::kind, diagnostic_classification_change_t::kind, line_table, diagnostic_info::location, diagnostic_classification_change_t::location, diagnostic_context::lock, text_info::locus, diagnostic_info::message, diagnostic_context::n_classification_history, diagnostic_classification_change_t::option, option(), diagnostic_context::option_enabled, diagnostic_info::option_index, diagnostic_context::option_name, diagnostic_context::option_state, pp_destroy_prefix(), pp_format(), pp_newline_and_flush(), pp_output_formatted_text(), diagnostic_context::printer, diagnostic_context::show_option_requested, diagnostic_context::some_warnings_are_errors, diagnostic_context::warning_as_error_requested, diagnostic_info::x_data, and text_info::x_data.
void diagnostic_set_caret_max_width | ( | diagnostic_context * | context, |
int | value | ||
) |
void diagnostic_set_info | ( | diagnostic_info * | , |
const char * | , | ||
va_list * | , | ||
location_t | , | ||
diagnostic_t | |||
) |
void void diagnostic_set_info_translated | ( | diagnostic_info * | , |
const char * | , | ||
va_list * | , | ||
location_t | , | ||
diagnostic_t | |||
) |
void diagnostic_show_locus | ( | diagnostic_context * | context, |
const diagnostic_info * | diagnostic | ||
) |
Print the physical source line corresponding to the location of this diagnostics, and a caret indicating the precise column.
References adjust_line(), buffer, diagnostic_context::caret_max_width, colorize_start(), colorize_stop(), expand_location_to_spelling_point(), diagnostic_context::last_location, len, diagnostic_info::location, location_get_source_line(), pp_character(), pp_get_prefix(), pp_newline(), pp_set_prefix(), pp_string(), diagnostic_context::printer, diagnostic_context::show_caret, snprintf(), and strlen().
Referenced by diagnostic_append_note(), and diagnostic_report_diagnostic().
char* file_name_as_prefix | ( | diagnostic_context * | , |
const char * | |||
) |
Pure text formatting support functions.
diagnostic_context* global_dc |
This diagnostic_context is used by front-ends that directly output diagnostic messages without going through `error', `warning', and similar functions.
Referenced by announce_function(), do_self_spec(), driver_handle_option(), emit_diagnostic(), free_lang_data(), general_init(), init_options_once(), lang_handle_option(), main(), permerror(), print_usage(), process_command(), process_options(), target_handle_option(), toplev_main(), and verbatim().