GCC Middle and Back End API Reference
|
#include <dump-context.h>
Data Structures | |
class | stashed_item |
Public Member Functions | |
dump_pretty_printer (dump_context *context, dump_flags_t dump_kind) | |
void | emit_items (optinfo *dest) |
virtual pretty_printer * | clone () const |
Private Member Functions | |
bool | decode_format (text_info *text, const char *spec, const char **buffer_ptr) |
void | stash_item (const char **buffer_ptr, optinfo_item *item) |
void | emit_any_pending_textual_chunks (optinfo *dest) |
void | emit_item (optinfo_item *item, optinfo *dest) |
Static Private Member Functions | |
static bool | format_decoder_cb (pretty_printer *pp, text_info *text, const char *spec, int, bool, bool, bool, bool @endverbatim *, const char **buffer_ptr) |
Private Attributes | |
dump_context * | m_context |
dump_flags_t | m_dump_kind |
auto_vec< stashed_item > | m_stashed_items |
A subclass of pretty_printer for implementing dump_context::dump_printf_va. In particular, the formatted chunks are captured as optinfo_item instances, thus retaining metadata about the entities being dumped (e.g. source locations), rather than just as plain text.
dump_pretty_printer::dump_pretty_printer | ( | dump_context * | context, |
dump_flags_t | dump_kind ) |
dump_pretty_printer's ctor.
References format_decoder_cb(), and pp_format_decoder.
|
virtualinherited |
Base class implementation of pretty_printer::clone vfunc.
References pretty_printer::pretty_printer().
Referenced by attr_access::array_as_string().
|
private |
Format decoder for dump_pretty_printer, and thus for dump_printf and dump_printf_loc. Supported format codes (in addition to the standard pretty_printer ones) are: %C: cgraph_node *: Equivalent to: dump_symtab_node (MSG_*, node) %E: gimple *: Equivalent to: dump_gimple_expr (MSG_*, TDF_SLIM, stmt, 0) %G: gimple *: Equivalent to: dump_gimple_stmt (MSG_*, TDF_SLIM, stmt, 0) %T: tree: Equivalent to: dump_generic_expr (MSG_*, arg, TDF_SLIM). TODO: add a format code that can handle (symtab_node*) *and* both subclasses (presumably means teaching -Wformat about non-virtual subclasses). These format codes build optinfo_item instances, thus capturing metadata about the arguments being dumped, as well as the textual output.
References ggc_alloc(), make_item_for_dump_generic_expr(), make_item_for_dump_gimple_expr(), make_item_for_dump_gimple_stmt(), make_item_for_dump_symtab_node(), stash_item(), and TDF_SLIM.
Subroutine of dump_pretty_printer::emit_items for consolidating multiple adjacent pure-text chunks into single optinfo_items (in phase 3).
References pretty_printer::buffer, emit_item(), output_buffer::formatted_obstack, gcc_assert, ggc_alloc(), NULL, output_buffer::obstack, OPTINFO_ITEM_KIND_TEXT, output_buffer_last_position_in_text(), pp_formatted_text(), and UNKNOWN_LOCATION.
Referenced by emit_items().
|
private |
Emit ITEM and take ownership of it. If DEST is non-NULL, add ITEM to DEST; otherwise delete ITEM.
References optinfo::add_item(), dump_context::emit_item(), m_context, and m_dump_kind.
Referenced by emit_any_pending_textual_chunks(), and emit_items().
Phase 3 of formatting; compare with pp_output_formatted_text. Emit optinfo_item instances for the various formatted chunks from phases 1 and 2 (i.e. pp_format). Some chunks may already have had their items built (during decode_format). These chunks have been stashed into m_stashed_items; we emit them here. For all other purely textual chunks, they are printed into buffer->formatted_obstack, and then emitted as a textual optinfo_item. This consolidates multiple adjacent text chunks into a single text optinfo_item.
References pretty_printer::buffer, output_buffer::chunk_obstack, output_buffer::cur_chunk_array, emit_any_pending_textual_chunks(), emit_item(), output_buffer::formatted_obstack, gcc_assert, ggc_alloc(), output_buffer::line_length, m_stashed_items, output_buffer::obstack, pp_buffer, and pp_string().
Referenced by dump_context::dump_printf_va(), and opt_problem::opt_problem().
|
staticprivate |
pp_format_decoder callback for dump_pretty_printer, and thus for dump_printf and dump_printf_loc. A wrapper around decode_format, for type-safety.
References ggc_alloc().
Referenced by dump_pretty_printer().
|
private |
Record that ITEM (generated in phase 2 of formatting) is to be used for the chunk at BUFFER_PTR in phase 3 (by emit_items).
References gcc_assert, and m_stashed_items.
Referenced by decode_format().
|
inherited |
Referenced by dot_rdg_1(), ana::one_way_id_map< T >::dump(), vrange::dump(), irange_bitmask::dump(), digraph< GraphTraits >::dump_dot_to_file(), dump_ssaname_info_to_file(), emit_any_pending_textual_chunks(), emit_items(), gimple_dump_bb(), maybe_init_pretty_print(), pp_flush(), print_gimple_expr(), print_gimple_seq(), print_gimple_stmt(), print_node(), and pretty_printer::~pretty_printer().
|
inherited |
Referenced by pp_clear_state(), pp_emit_prefix(), and pp_set_prefix().
|
inherited |
|
inherited |
|
private |
Referenced by emit_item().
|
private |
Referenced by emit_item().
|
inherited |
Referenced by pp_format(), pretty_printer::pretty_printer(), and pretty_printer::~pretty_printer().
|
inherited |
Referenced by pp_begin_url(), and pp_end_url().
|
private |
Referenced by emit_items(), and stash_item().
|
inherited |
|
inherited |
|
inherited |
Referenced by pp_maybe_space().
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |