GCC Middle and Back End API Reference
|
Functions | |
static void | pp_set_real_maximum_length () |
static void | pp_clear_state () |
void | pp_write_text_to_stream () |
void | pp_write_text_as_dot_label_to_stream () |
static void | pp_wrap_text () |
static void | pp_maybe_wrap_text () |
static void | pp_append_r () |
void | pp_indent () |
void | pp_format () |
void | pp_output_formatted_text () |
void | pp_format_verbatim () |
void | pp_flush () |
void | pp_set_line_maximum_length () |
void | pp_clear_output_area () |
void | pp_set_prefix () |
void | pp_destroy_prefix () |
void | pp_emit_prefix () |
void | pp_append_text () |
const char * | pp_formatted_text () |
const char * | pp_last_position_in_text () |
int | pp_remaining_character_count_for_line () |
void | pp_printf () |
void | pp_verbatim () |
void | pp_newline () |
void | pp_character () |
void | pp_string () |
void | pp_maybe_space () |
void | pp_newline_and_flush () |
void | pp_newline_and_indent () |
void | pp_separate_with () |
static int | decode_utf8_char () |
const char * | identifier_to_locale () |
Variables | |
void *(* | identifier_to_locale_alloc )(size_t) = xmalloc |
void(* | identifier_to_locale_free )(void *) = free |
|
static |
The string starting at P has LEN (at least 1) bytes left; if they start with a valid UTF-8 sequence, return the length of that sequence and set *VALUE to the value of that sequence, and otherwise return 0 and set *VALUE to (unsigned int) -1.
References abort().
Referenced by identifier_to_locale().
const char* identifier_to_locale | ( | ) |
Given IDENT, an identifier in the internal encoding, return a version of IDENT suitable for diagnostics in the locale character set: either IDENT itself, or a string, allocated using identifier_to_locale_alloc, converted to the locale character set and using escape sequences if not representable in the locale character set or containing control characters or invalid byte sequences. Existing backslashes in IDENT are not doubled, so the result may not uniquely specify the contents of an arbitrary byte sequence identifier.
References decode_utf8_char(), errno, identifier_to_locale_alloc, identifier_to_locale_free, locale_encoding, locale_utf8, and strlen().
Referenced by announce_function(), default_tree_printer(), expand_expr_real_1(), lhd_print_error_function(), pp_tree_identifier(), resolve_operand_name_1(), and verify_cgraph_node().
|
inlinestatic |
Append to the output area of PRETTY-PRINTER a string specified by its STARTing character and LENGTH.
References obstack.
Referenced by pp_append_text(), and pp_emit_prefix().
void pp_append_text | ( | ) |
Append a string delimited by START and END to the output area of PRETTY-PRINTER. No line wrapping is done. However, if beginning a new line then emit PRETTY-PRINTER's prefix and skip any leading whitespace if appropriate. The caller must ensure that it is safe to do so.
References pp_append_r(), and pp_emit_prefix().
Referenced by pp_format(), pp_maybe_wrap_text(), pp_tree_identifier(), and pp_wrap_text().
void pp_character | ( | ) |
Have PRETTY-PRINTER add a CHARACTER.
References obstack, pp_newline(), and pp_remaining_character_count_for_line().
Referenced by diagnostic_show_locus(), dump_binary_rhs(), dump_generic_node(), dump_gimple_fmt(), dump_omp_clause(), dump_ternary_rhs(), pp_format(), pp_separate_with(), and pretty_print_string().
void pp_clear_output_area | ( | ) |
Clear PRETTY-PRINTER output area text info.
References obstack.
Referenced by mf_varname_tree(), pp_write_text_as_dot_label_to_stream(), and pp_write_text_to_stream().
|
inlinestatic |
Clear PRETTY-PRINTER's output state.
References pretty_printer::emitted_prefix.
Referenced by pp_flush(), and pp_format().
void pp_destroy_prefix | ( | ) |
Free PRETTY-PRINTER's prefix, a previously malloc()'d string.
References free(), and pretty_printer::prefix.
Referenced by diagnostic_append_note(), and diagnostic_report_diagnostic().
void pp_emit_prefix | ( | ) |
Write out PRETTY-PRINTER's prefix.
References DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE, DIAGNOSTICS_SHOW_PREFIX_NEVER, DIAGNOSTICS_SHOW_PREFIX_ONCE, pretty_printer::emitted_prefix, pp_append_r(), pp_indent(), pretty_printer::prefix, and strlen().
Referenced by pp_append_text().
void pp_flush | ( | ) |
Flush the content of BUFFER onto the attached stream.
References pp_clear_state(), and pp_write_text_to_stream().
Referenced by draw_cfg_edges(), draw_cfg_node(), draw_cfg_node_succ_edges(), dump_insn_slim(), dump_rtl_slim(), dump_value_slim(), gimple_dump_bb_buff(), pp_newline_and_flush(), print_generic_expr(), print_gimple_expr(), print_graph_cfg(), and start_graph_dump().
void pp_format | ( | ) |
The following format specifiers are recognized as being client independent: %d, %i: (signed) integer in base ten. %u: unsigned integer in base ten. %o: unsigned integer in base eight. %x: unsigned integer in base sixteen. %ld, %li, %lo, %lu, %lx: long versions of the above. %lld, %lli, %llo, %llu, %llx: long long versions. %wd, %wi, %wo, %wu, %wx: HOST_WIDE_INT versions. %c: character. %s: string. %p: pointer. %r: if pp_show_color(pp), switch to color identified by const char *. %R: if pp_show_color(pp), reset color. %m: strerror(text->err_no) - does not consume a value from args_ptr. %%: '%'. %<: opening quote. %>: closing quote. %': apostrophe (should only be used in untranslated messages; translations should use appropriate punctuation directly). %.*s: a substring the length of which is specified by an argument integer. %Ns: likewise, but length specified as constant in the format string. Flag 'q': quote formatted text (must come immediately after '%'). Arguments can be used sequentially, or through %N$ resp. *N$ notation Nth argument after the format string. If %N$ / *N$ notation is used, it must be used for all arguments, except %m, %%, %<, %> and %', which may not have a number, as they do not consume an argument. When %M$.*N$s is used, M must be N + 1. (This may also be written %M$.*s, provided N is not otherwise used.) The format string must have conversion specifiers with argument numbers 1 up to highest argument; each argument may only be used once. A format string can have at most 30 arguments.
Formatting phases 1 and 2: render TEXT->format_spec plus TEXT->args_ptr into a series of chunks in pp_buffer (PP)->args[]. Phase 3 is in pp_format_text.
References chunk_info::args, text_info::args_ptr, buffer, output_buffer::chunk_obstack, close_quote, colorize_start(), colorize_stop(), output_buffer::cur_chunk_array, text_info::err_no, text_info::format_spec, output_buffer::formatted_obstack, HOST_WIDE_INT, HOST_WIDE_INT_PRINT, HOST_WIDE_INT_PRINT_HEX, HOST_WIDE_INT_PRINT_UNSIGNED, output_buffer::line_length, memset(), output_buffer::obstack, open_quote, pp_append_text(), pp_character(), pp_clear_state(), pp_string(), chunk_info::prev, and strlen().
Referenced by diagnostic_append_note(), diagnostic_report_diagnostic(), pp_format_verbatim(), and pp_printf().
void pp_format_verbatim | ( | ) |
Helper subroutine of output_verbatim and verbatim. Do the appropriate settings needed by BUFFER for a verbatim formatting.
References pp_format(), and pp_output_formatted_text().
Referenced by pp_verbatim(), and verbatim().
const char* pp_formatted_text | ( | ) |
Finishes constructing a NULL-terminated character string representing the PRETTY-PRINTED text.
References obstack.
Referenced by asan_pp_string(), mf_varname_tree(), pp_write_text_as_dot_label_to_stream(), pp_write_text_to_stream(), and str_pattern_slim().
void pp_indent | ( | ) |
Insert enough spaces into the output area of PRETTY-PRINTER to bring the column position to the current indentation level, assuming that a newline has just been written to the buffer.
Referenced by pp_emit_prefix(), and pp_newline_and_indent().
const char* pp_last_position_in_text | ( | ) |
Return a pointer to the last character emitted in PRETTY-PRINTER's output area. A NULL pointer means no character available.
References obstack.
void pp_maybe_space | ( | ) |
Maybe print out a whitespace if needed.
References pretty_printer::padding, and pp_none.
|
inlinestatic |
Same as pp_wrap_text but wrap text only when in line-wrapping mode.
References pp_append_text(), and pp_wrap_text().
Referenced by pp_string().
void pp_newline | ( | ) |
Have PRETTY-PRINTER start a new line.
References obstack.
Referenced by diagnostic_append_note(), diagnostic_report_current_module(), diagnostic_show_locus(), dump_generic_node(), dump_gimple_bind(), dump_gimple_fmt(), dump_gimple_omp_block(), dump_gimple_omp_critical(), dump_gimple_omp_for(), dump_gimple_omp_parallel(), dump_gimple_omp_sections(), dump_gimple_omp_single(), dump_gimple_omp_task(), dump_gimple_seq(), dump_gimple_transaction(), dump_gimple_try(), dump_implicit_edges(), dump_phi_nodes(), gimple_dump_bb_for_graph(), lhd_print_error_function(), newline_and_indent(), pp_character(), pp_newline_and_flush(), pp_newline_and_indent(), pp_wrap_text(), print_insn_with_notes(), print_pattern(), and print_struct_decl().
void pp_newline_and_flush | ( | ) |
void pp_newline_and_indent | ( | ) |
References pp_indent(), and pp_newline().
void pp_output_formatted_text | ( | ) |
Format of a message pointed to by TEXT.
References chunk_info::args, buffer, output_buffer::chunk_obstack, output_buffer::cur_chunk_array, output_buffer::formatted_obstack, output_buffer::line_length, output_buffer::obstack, pp_string(), and chunk_info::prev.
Referenced by diagnostic_append_note(), diagnostic_report_diagnostic(), pp_format_verbatim(), and pp_printf().
void pp_printf | ( | ) |
Format a message into BUFFER a la printf.
References text_info::args_ptr, text_info::err_no, errno, text_info::format_spec, text_info::locus, pp_format(), and pp_output_formatted_text().
Referenced by do_niy(), draw_cfg_edges(), draw_cfg_node(), draw_cfg_node_succ_edges(), draw_cfg_nodes_for_loop(), dump_bb_for_graph(), dump_block_node(), dump_decl_name(), dump_generic_node(), dump_gimple_label(), dump_gimple_phi(), dump_gimple_transaction(), gimple_dump_bb_for_graph(), lhd_print_error_function(), pp_gimple_stmt_1(), print_graph_cfg(), print_insn(), print_insn_with_notes(), print_pattern(), and print_value().
int pp_remaining_character_count_for_line | ( | ) |
Return the amount of characters PRETTY-PRINTER can accept to make a full line. Meaningful only in line-wrapping mode.
References pretty_printer::maximum_length.
Referenced by pp_character(), and pp_wrap_text().
void pp_separate_with | ( | ) |
References pp_character().
void pp_set_line_maximum_length | ( | ) |
Sets the number of maximum characters per line PRETTY-PRINTER can output in line-wrapping mode. A LENGTH value 0 suppresses line-wrapping.
References pp_set_real_maximum_length().
Referenced by common_handle_option().
void pp_set_prefix | ( | ) |
Set PREFIX for PRETTY-PRINTER.
References pretty_printer::emitted_prefix, pp_set_real_maximum_length(), and pretty_printer::prefix.
Referenced by default_diagnostic_starter(), default_tree_diagnostic_starter(), diagnostic_append_note(), diagnostic_show_locus(), lhd_print_error_function(), and pretty_printer::pretty_printer().
|
static |
Subroutine of pp_set_maximum_length. Set up PRETTY-PRINTER's internal maximum characters per line.
References DIAGNOSTICS_SHOW_PREFIX_NEVER, DIAGNOSTICS_SHOW_PREFIX_ONCE, pretty_printer::maximum_length, pretty_printer::prefix, and strlen().
Referenced by pp_set_line_maximum_length(), and pp_set_prefix().
void pp_string | ( | ) |
Append a STRING to the output area of PRETTY-PRINTER; the STRING may be line-wrapped if in appropriate mode.
References pp_maybe_wrap_text(), and strlen().
Referenced by asan_add_global(), asan_emit_stack_protection(), default_tree_printer(), diagnostic_show_locus(), do_niy(), draw_cfg_node(), dump_array_domain(), dump_binary_rhs(), dump_block_node(), dump_decl_name(), dump_function_declaration(), dump_function_name(), dump_generic_node(), dump_gimple_asm(), dump_gimple_assign(), dump_gimple_call(), dump_gimple_call_args(), dump_gimple_cond(), dump_gimple_fmt(), dump_gimple_label(), dump_gimple_mem_ops(), dump_gimple_omp_atomic_load(), dump_gimple_omp_atomic_store(), dump_gimple_omp_block(), dump_gimple_omp_continue(), dump_gimple_omp_critical(), dump_gimple_omp_for(), dump_gimple_omp_parallel(), dump_gimple_omp_return(), dump_gimple_omp_sections(), dump_gimple_omp_single(), dump_gimple_omp_task(), dump_gimple_phi(), dump_gimple_return(), dump_gimple_switch(), dump_gimple_transaction(), dump_gimple_try(), dump_implicit_edges(), dump_location(), dump_omp_clause(), dump_phi_nodes(), dump_ternary_rhs(), dump_unary_rhs(), gimple_dump_bb_for_graph(), mf_varname_tree(), pp_cfg_jump(), pp_format(), pp_gimple_stmt_1(), pp_output_formatted_text(), pp_points_to_solution(), pretty_print_string(), print_call_name(), print_declaration(), print_exp(), print_insn(), print_insn_with_notes(), print_pattern(), print_struct_decl(), print_value(), and start_graph_dump().
void pp_verbatim | ( | ) |
Output MESSAGE verbatim into BUFFER.
References text_info::args_ptr, text_info::err_no, errno, text_info::format_spec, text_info::locus, and pp_format_verbatim().
Referenced by diagnostic_finish(), and diagnostic_report_current_module().
|
static |
Wrap a text delimited by START and END into PRETTY-PRINTER.
References pp_append_text(), pp_newline(), and pp_remaining_character_count_for_line().
Referenced by pp_maybe_wrap_text().
void pp_write_text_as_dot_label_to_stream | ( | ) |
As pp_write_text_to_stream, but for GraphViz label output. Flush the formatted text of pretty-printer PP onto the attached stream. Replace characters in PPF that have special meaning in a GraphViz .dot file. This routine is not very fast, but it doesn't have to be as this is only be used by routines dumping intermediate representations in graph form.
References pp_clear_output_area(), and pp_formatted_text().
Referenced by gimple_dump_bb_for_graph(), rtl_dump_bb_for_graph(), and start_graph_dump().
void pp_write_text_to_stream | ( | ) |
Flush the formatted text of PRETTY-PRINTER onto the attached stream.
References pp_clear_output_area(), and pp_formatted_text().
Referenced by draw_cfg_node(), dump_bb_for_graph(), gimple_dump_bb_for_graph(), pp_flush(), print_generic_decl(), rtl_dump_bb_for_graph(), and start_graph_dump().
void*(* identifier_to_locale_alloc)(size_t) = xmalloc |
Allocator for identifier_to_locale and corresponding function to free memory.
Referenced by general_init(), and identifier_to_locale().
void(* identifier_to_locale_free)(void *) = free |
Referenced by general_init(), and identifier_to_locale().