#include "config.h"#include "system.h"#include "tree.h"#include "tm_p.h"#include "flags.h"#include "input.h"#include "toplev.h"#include "intl.h"#include "diagnostic.h"#include "langhooks.h"#include "langhooks-def.h"#include "diagnostic.def"

Go to the source code of this file.
| #define is_starting_newline | ( | BUFFER | ) | (output_text_length (BUFFER) == 0) |
| #define line_wrap_cutoff | ( | BUFFER | ) | (BUFFER)->state.maximum_length |
| #define output_text_length | ( | BUFFER | ) | (BUFFER)->line_length |
Definition at line 55 of file diagnostic.c.
Referenced by init_output_buffer(), output_add_character(), output_add_newline(), output_add_space(), output_append_r(), output_clear_message_text(), and output_space_left().
| #define prefix_was_emitted_for | ( | BUFFER | ) | (BUFFER)->state.emitted_prefix_p |
Definition at line 58 of file diagnostic.c.
Referenced by output_clear_data(), output_emit_prefix(), and output_set_prefix().
Definition at line 1063 of file diagnostic.c.
Referenced by cgraph_expand_function(), genrtl_start_function(), output_func_start_profiler(), start_function(), start_java_method(), and start_preparsed_function().
| static void default_diagnostic_finalizer | ( | diagnostic_context * | context, | |
| diagnostic | ||||
| ) | [static] |
Definition at line 1456 of file diagnostic.c.
References output_destroy_prefix().
Referenced by diagnostic_initialize().
| static void default_diagnostic_starter | ( | diagnostic_context * | context, | |
| diagnostic_info * | diagnostic | |||
| ) | [static] |
Definition at line 1447 of file diagnostic.c.
References diagnostic_build_prefix(), diagnostic_report_current_function(), and output_set_prefix().
Referenced by diagnostic_initialize().
| char* diagnostic_build_prefix | ( | diagnostic_info * | diagnostic | ) |
Definition at line 860 of file diagnostic.c.
Referenced by cp_diagnostic_starter(), default_diagnostic_starter(), and diagnostic_for_decl().
| bool diagnostic_count_diagnostic | ( | diagnostic_context * | context, | |
| diagnostic_t | kind | |||
| ) |
Definition at line 914 of file diagnostic.c.
References abort, diagnostic_kind_count, diagnostic_report_warnings_p, progname, and warnings_are_errors.
Referenced by diagnostic_for_decl(), and diagnostic_report_diagnostic().
| void diagnostic_flush_buffer | ( | diagnostic_context * | context | ) |
Definition at line 905 of file diagnostic.c.
References fflush(), output_buffer_attached_stream, and output_buffer_to_stream().
| static void diagnostic_for_decl | ( | diagnostic_info * | diagnostic, | |
| tree | decl | |||
| ) | [static] |
Definition at line 885 of file diagnostic.c.
References diagnostic_context::buffer, diagnostic_build_prefix(), diagnostic_count_diagnostic(), diagnostic_report_current_function(), error_recursion(), format_with_decl(), global_dc, diagnostic_context::lock, output_destroy_prefix(), output_flush(), and output_set_prefix().
Referenced by VPARAMS().
| void diagnostic_initialize | ( | diagnostic_context * | context | ) |
| void diagnostic_report_current_function | ( | diagnostic_context * | context | ) |
Definition at line 1119 of file diagnostic.c.
Referenced by default_diagnostic_starter(), and diagnostic_for_decl().
| void diagnostic_report_current_module | ( | diagnostic_context * | context | ) |
Definition at line 1420 of file diagnostic.c.
Referenced by cp_diagnostic_starter(), and diagnostic_report_current_function().
| void diagnostic_report_diagnostic | ( | diagnostic_context * | context, | |
| diagnostic_info * | diagnostic | |||
| ) |
Definition at line 1318 of file diagnostic.c.
| void diagnostic_set_info | ( | diagnostic_info * | diagnostic, | |
| const char * | msgid, | |||
| va_list * | args, | |||
| const char * | file, | |||
| int | line, | |||
| diagnostic_t | kind | |||
| ) |
Definition at line 837 of file diagnostic.c.
References text_specifies_location().
Referenced by cp_error_at(), cp_pedwarn_at(), cp_warning_at(), diagnostic_for_asm(), error(), fatal_error(), inform(), internal_error(), pedwarn(), pedwarn_c90(), pedwarn_c99(), sorry(), VPARAMS(), warning(), and warning0().
| static void error_recursion | ( | diagnostic_context * | context | ) | [static] |
Definition at line 1342 of file diagnostic.c.
References bug_report_url, exit(), FATAL_EXIT_CODE, fnotice(), and output_flush().
Referenced by diagnostic_for_decl(), and diagnostic_report_diagnostic().
| void fancy_abort | ( | char * | file, | |
| int | line, | |||
| const char * | function | |||
| ) | const |
| char* file_name_as_prefix | ( | char * | f | ) | const |
Definition at line 676 of file diagnostic.c.
References build_message_string().
Referenced by cp_print_error_function(), and lhd_print_error_function().
| static void format_with_decl | ( | output_buffer * | buffer, | |
| text_info * | text, | |||
| tree | decl | |||
| ) | [static] |
Definition at line 699 of file diagnostic.c.
References _, abort, DECL_NAME, text_info::format_spec, ISALPHA, maybe_wrap_text(), n, output_add_string(), output_format(), and p.
Referenced by diagnostic_for_decl().
| void init_output_buffer | ( | output_buffer * | buffer, | |
| const char * | prefix, | |||
| int | maximum_length | |||
| ) |
Definition at line 202 of file diagnostic.c.
References diagnostic_prefixing_rule, global_dc, memset, obstack_init, output_buffer_attached_stream, output_clear_data(), output_line_cutoff, output_prefixing_rule, output_set_prefix(), and output_text_length.
Referenced by init_error().
| void lhd_print_error_function | ( | diagnostic_context * | context, | |
| const char * | file | |||
| ) |
| static void maybe_wrap_text | ( | output_buffer * | buffer, | |
| const char * | start, | |||
| const char * | end | |||
| ) | [static] |
Definition at line 468 of file diagnostic.c.
References output_append(), output_is_line_wrapping, and wrap_text().
Referenced by format_with_decl(), and output_add_string().
| void output_add_character | ( | output_buffer * | buffer, | |
| int | c | |||
| ) |
Definition at line 289 of file diagnostic.c.
References obstack_1grow, output_add_newline(), output_is_line_wrapping, output_space_left(), and output_text_length.
Referenced by dump_char(), dump_expr(), dump_function_name(), dump_type_prefix(), output_format(), output_indent(), and print_non_consecutive_character().
| void output_add_identifier | ( | output_buffer * | buffer, | |
| tree | id | |||
| ) |
Definition at line 492 of file diagnostic.c.
References IDENTIFIER_LENGTH, IDENTIFIER_POINTER, and output_append().
| void output_add_newline | ( | output_buffer * | buffer | ) |
Definition at line 280 of file diagnostic.c.
References obstack_1grow, and output_text_length.
Referenced by cp_print_error_function(), diagnostic_report_current_module(), lhd_print_error_function(), output_add_character(), output_add_space(), and wrap_text().
| void output_add_space | ( | output_buffer * | buffer | ) |
Definition at line 301 of file diagnostic.c.
References obstack_1grow, output_add_newline(), output_is_line_wrapping, output_space_left(), and output_text_length.
Referenced by dump_aggr_type(), dump_binary_op(), dump_function_decl(), dump_qualifiers(), dump_simple_decl(), dump_template_decl(), dump_template_parameter(), dump_type_prefix(), print_non_consecutive_character(), and wrap_text().
| void output_add_string | ( | output_buffer * | buffer, | |
| const char * | str | |||
| ) |
Definition at line 483 of file diagnostic.c.
References maybe_wrap_text(), and strlen().
Referenced by c_tree_printer(), cp_print_error_function(), cp_printer(), dump_char(), dump_decl(), dump_exception_spec(), dump_expr(), dump_function_decl(), dump_function_name(), dump_parameters(), dump_template_bindings(), dump_template_decl(), dump_template_parameter(), dump_type(), format_with_decl(), lhd_print_error_function(), output_format(), and print_integer().
| void output_append | ( | output_buffer * | buffer, | |
| const char * | start, | |||
| const char * | end | |||
| ) |
Definition at line 404 of file diagnostic.c.
References is_starting_newline, output_append_r(), output_emit_prefix(), and output_is_line_wrapping.
Referenced by maybe_wrap_text(), output_add_identifier(), output_format(), and wrap_text().
| static void output_append_r | ( | output_buffer * | buffer, | |
| const char * | start, | |||
| int | length | |||
| ) | [static] |
Definition at line 390 of file diagnostic.c.
References obstack_grow, and output_text_length.
Referenced by output_append(), and output_emit_prefix().
| static void output_buffer_to_stream | ( | output_buffer * | buffer | ) | [static] |
Definition at line 504 of file diagnostic.c.
References fputs(), output_buffer_attached_stream, output_clear_message_text(), and output_finalize_message().
Referenced by diagnostic_flush_buffer(), lhd_print_error_function(), and output_flush().
| void output_clear | ( | output_buffer * | buffer | ) |
Definition at line 219 of file diagnostic.c.
References output_clear_data(), and output_clear_message_text().
| static void output_clear_data | ( | output_buffer * | buffer | ) | [static] |
Definition at line 192 of file diagnostic.c.
References output_indentation, and prefix_was_emitted_for.
Referenced by init_output_buffer(), output_clear(), and output_flush().
| void output_clear_message_text | ( | output_buffer * | buffer | ) |
Definition at line 183 of file diagnostic.c.
References obstack_base, obstack_free, and output_text_length.
Referenced by output_buffer_to_stream(), and output_clear().
| void output_decimal | ( | output_buffer * | buffer, | |
| int | i | |||
| ) |
Definition at line 316 of file diagnostic.c.
References output_formatted_scalar.
Referenced by output_format().
| void output_destroy_prefix | ( | output_buffer * | buffer | ) |
Definition at line 171 of file diagnostic.c.
Referenced by cp_diagnostic_finalizer(), cp_print_error_function(), default_diagnostic_finalizer(), and diagnostic_for_decl().
| static void output_do_verbatim | ( | output_buffer * | buffer, | |
| text_info * | text | |||
| ) | [static] |
Definition at line 760 of file diagnostic.c.
References DIAGNOSTICS_SHOW_PREFIX_NEVER, output_format(), output_line_cutoff, and output_prefixing_rule.
Referenced by VPARAMS().
| void output_emit_prefix | ( | output_buffer * | buffer | ) |
Definition at line 247 of file diagnostic.c.
References DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE, DIAGNOSTICS_SHOW_PREFIX_NEVER, DIAGNOSTICS_SHOW_PREFIX_ONCE, NULL, output_append_r(), output_indent(), output_indentation, output_prefixing_rule, prefix_was_emitted_for, and strlen().
Referenced by output_append().
| const char* output_finalize_message | ( | output_buffer * | buffer | ) |
Definition at line 229 of file diagnostic.c.
References obstack_1grow, and output_message_text.
Referenced by args_to_string(), context_as_string(), cv_to_string(), decl_as_string(), decl_to_string(), expr_as_string(), expr_to_string(), fndecl_to_string(), lang_decl_name(), output_buffer_to_stream(), type_as_string(), and type_to_string().
| static void output_flush | ( | output_buffer * | buffer | ) | [static] |
Definition at line 748 of file diagnostic.c.
References fflush(), fputc(), output_buffer_attached_stream, output_buffer_to_stream(), and output_clear_data().
Referenced by diagnostic_for_decl(), diagnostic_report_diagnostic(), error_recursion(), and VPARAMS().
| static void output_format | ( | output_buffer * | buffer, | |
| text_info * | text | |||
| ) | [static] |
Definition at line 526 of file diagnostic.c.
References abort, text_info::args_ptr, text_info::format_spec, n, output_add_character(), output_add_string(), output_append(), output_decimal(), output_hexadecimal(), output_long_decimal(), output_long_hexadecimal(), output_long_octal(), output_long_unsigned_decimal(), output_octal(), output_pointer(), output_unsigned_decimal(), p, s, va_arg, and wrap_text().
Referenced by diagnostic_report_diagnostic(), format_with_decl(), get_insn_template(), output_do_verbatim(), and VPARAMS().
| static void output_hexadecimal | ( | output_buffer * | buffer, | |
| unsigned int | i | |||
| ) | [static] |
Definition at line 364 of file diagnostic.c.
References output_formatted_scalar.
Referenced by output_format().
| static void output_indent | ( | output_buffer * | buffer | ) | [static] |
Definition at line 421 of file diagnostic.c.
References i, n, output_add_character(), and output_indentation.
Referenced by output_emit_prefix().
| const char* output_last_position | ( | output_buffer * | buffer | ) | const |
Definition at line 159 of file diagnostic.c.
References NULL, obstack_base, obstack_next_free, and p.
Referenced by print_non_consecutive_character().
| static void output_long_decimal | ( | output_buffer * | buffer, | |
| long int | i | |||
| ) | [static] |
Definition at line 324 of file diagnostic.c.
References output_formatted_scalar.
Referenced by output_format().
| static void output_long_hexadecimal | ( | output_buffer * | buffer, | |
| unsigned long int | i | |||
| ) | [static] |
Definition at line 372 of file diagnostic.c.
References output_formatted_scalar.
Referenced by output_format().
| static void output_long_octal | ( | output_buffer * | buffer, | |
| unsigned long int | i | |||
| ) | [static] |
Definition at line 356 of file diagnostic.c.
References output_formatted_scalar.
Referenced by output_format().
| static void output_long_unsigned_decimal | ( | output_buffer * | buffer, | |
| long unsigned int | i | |||
| ) | [static] |
Definition at line 340 of file diagnostic.c.
References output_formatted_scalar.
Referenced by output_format().
| static void output_octal | ( | output_buffer * | buffer, | |
| unsigned int | i | |||
| ) | [static] |
Definition at line 348 of file diagnostic.c.
References output_formatted_scalar.
Referenced by output_format().
| static void output_pointer | ( | output_buffer * | buffer, | |
| void * | p | |||
| ) | [static] |
Definition at line 380 of file diagnostic.c.
References HOST_PTR_PRINTF, and output_formatted_scalar.
Referenced by output_format().
| void output_set_maximum_length | ( | output_buffer * | buffer, | |
| int | length | |||
| ) |
Definition at line 136 of file diagnostic.c.
References output_line_cutoff.
Referenced by decode_f_option().
| void output_set_prefix | ( | output_buffer * | buffer, | |
| const char * | prefix | |||
| ) |
Definition at line 146 of file diagnostic.c.
References output_indentation, and prefix_was_emitted_for.
Referenced by cp_diagnostic_starter(), cp_print_error_function(), cxx_print_error_function(), default_diagnostic_starter(), diagnostic_for_decl(), init_output_buffer(), and lhd_print_error_function().
| int output_space_left | ( | output_buffer * | buffer | ) | const |
Definition at line 239 of file diagnostic.c.
References line_wrap_cutoff, and output_text_length.
Referenced by output_add_character(), output_add_space(), and wrap_text().
| static void output_unsigned_decimal | ( | output_buffer * | buffer, | |
| unsigned int | i | |||
| ) | [static] |
Definition at line 332 of file diagnostic.c.
References output_formatted_scalar.
Referenced by output_format().
| static char* vbuild_message_string PARAMS | ( | (const char *, va_list) | ) | [static] |
Definition at line 67 of file diagnostic.c.
References DIAGNOSTICS_SHOW_PREFIX_NEVER, DIAGNOSTICS_SHOW_PREFIX_ONCE, line_wrap_cutoff, output_is_line_wrapping, output_line_cutoff, output_prefixing_rule, and strlen().
| static void output_do_verbatim PARAMS | ( | (output_buffer *, text_info *) | ) | [static] |
| static void output_flush PARAMS | ( | (output_buffer *) | ) | [static] |
| static bool text_specifies_location | ( | text_info * | text, | |
| location_t * | locus | |||
| ) | [static] |
| const char* trim_filename | ( | char * | name | ) | const |
Definition at line 1368 of file diagnostic.c.
References DIR_SEPARATOR, DIR_SEPARATOR_2, p, and q.
Referenced by emit_insn_modes_h(), fancy_abort(), new_adjust(), new_mode(), and w32_error().
| static char* vbuild_message_string | ( | char * | msg, | |
| va_list | ap | |||
| ) | const [static] |
Definition at line 647 of file diagnostic.c.
References str, and vasprintf().
Referenced by VPARAMS().
Definition at line 1025 of file diagnostic.c.
References _, diagnostic_set_info(), pedantic_error_kind, report_diagnostic, VA_CLOSE, VA_FIXEDARG, and VA_OPEN.
Definition at line 1001 of file diagnostic.c.
References _, DECL_IN_SYSTEM_HEADER, DECL_SOURCE_FILE, DECL_SOURCE_LINE, diagnostic_for_decl(), diagnostic_set_info(), pedantic_error_kind, VA_CLOSE, VA_FIXEDARG, and VA_OPEN.
Definition at line 970 of file diagnostic.c.
References _, text_info::args_ptr, diagnostic_context::buffer, errno, exit(), FATAL_EXIT_CODE, text_info::format_spec, global_dc, output_flush(), output_format(), progname, VA_CLOSE, VA_FIXEDARG, VA_OPEN, and xstrerror().
Definition at line 956 of file diagnostic.c.
References _, VA_CLOSE, VA_FIXEDARG, VA_OPEN, and vfprintf().
| void output_verbatim VPARAMS | ( | (output_buffer *buffer, const char *msgid,...) | ) |
Definition at line 779 of file diagnostic.c.
References text_info::args_ptr, text_info::format_spec, output_do_verbatim(), VA_CLOSE, VA_FIXEDARG, and VA_OPEN.
| void output_printf VPARAMS | ( | (struct output_buffer *buffer, const char *msgid,...) | ) |
Definition at line 684 of file diagnostic.c.
References _, text_info::args_ptr, text_info::format_spec, output_format(), VA_CLOSE, VA_FIXEDARG, and VA_OPEN.
| static char* build_message_string VPARAMS | ( | (const char *msg,...) | ) | [static] |
Definition at line 660 of file diagnostic.c.
References str, VA_CLOSE, VA_FIXEDARG, VA_OPEN, and vbuild_message_string().
Definition at line 1478 of file diagnostic.c.
Referenced by build_call(), build_class_member_access_expr(), build_component_ref(), build_external_ref(), do_identifier(), finish_class_member_access_expr(), finish_id_expression(), and grokdeclarator().
| static void wrap_text | ( | output_buffer * | buffer, | |
| const char * | start, | |||
| const char * | end | |||
| ) | [static] |
Definition at line 433 of file diagnostic.c.
References output_add_newline(), output_add_space(), output_append(), output_is_line_wrapping, output_space_left(), and p.
Referenced by maybe_wrap_text(), and output_format().
1.5.6