DEBUG_FUNCTION void
access_range::dump (bool simple) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp, simple);
pp_newline (&pp);
- pp_flush (&pp);
}
void
DEBUG_FUNCTION void
call_details::dump (bool simple) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp, simple);
- pp_flush (&pp);
}
/* Get a conjured_svalue for this call for REG,
FILE *fp,
bool simple) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (fp);
+ tree_dump_pretty_printer pp (fp);
dump_to_pp (ext_state, &pp, simple);
- pp_flush (&pp);
}
/* Dump a multiline representation of this object to stderr. */
void
call_summary_replay::dump (FILE *fp, bool simple) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (fp);
+ tree_dump_pretty_printer pp (fp);
dump_to_pp (&pp, simple);
- pp_flush (&pp);
}
/* Dump a multiline representation of this object to stderr. */
DEBUG_FUNCTION void
checker_event::debug () const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump (&pp);
pp_newline (&pp);
- pp_flush (&pp);
}
/* Hook for being notified when this event has its final id EMISSION_ID
DEBUG_FUNCTION void
range::dump () const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp);
pp_newline (&pp);
- pp_flush (&pp);
}
/* Determine if there is only one possible value for this range.
void
bounded_range::dump (bool show_types) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp, show_types);
pp_newline (&pp);
- pp_flush (&pp);
}
json::object *
DEBUG_FUNCTION void
bounded_ranges::dump (bool show_types) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp, show_types);
pp_newline (&pp);
- pp_flush (&pp);
}
json::value *
void
constraint_manager::dump (FILE *fp) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (fp);
+ tree_dump_pretty_printer pp (fp);
dump_to_pp (&pp, true);
- pp_flush (&pp);
}
/* Dump a multiline representation of this constraint_manager to stderr. */
exploded_node::dump (FILE *fp,
const extrinsic_state &ext_state) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (fp);
+ tree_dump_pretty_printer pp (fp);
dump_to_pp (&pp, ext_state);
- pp_flush (&pp);
}
/* Dump a multiline representation of this node to stderr. */
void
exploded_path::dump (FILE *fp, const extrinsic_state *ext_state) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (fp);
+ tree_dump_pretty_printer pp (fp);
dump_to_pp (&pp, ext_state);
- pp_flush (&pp);
}
/* Dump this path in multiline form to stderr. */
DEBUG_FUNCTION void
program_point::dump () const
{
- pretty_printer pp;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
print (&pp, format (true));
- pp_flush (&pp);
}
/* Return a new json::object of the form
void
extrinsic_state::dump_to_file (FILE *outf) const
{
- pretty_printer pp;
- if (outf == stderr)
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (outf);
+ tree_dump_pretty_printer pp (outf);
dump_to_pp (&pp);
- pp_flush (&pp);
}
/* Dump a multiline representation of this state to stderr. */
DEBUG_FUNCTION void
sm_state_map::dump (bool simple) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
print (NULL, simple, true, &pp);
pp_newline (&pp);
- pp_flush (&pp);
}
/* Return a new json::object of the form
bool summarize, bool multiline,
FILE *outf) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- if (outf == stderr)
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (outf);
+ tree_dump_pretty_printer pp (outf);
dump_to_pp (ext_state, summarize, multiline, &pp);
- pp_flush (&pp);
}
/* Dump a multiline representation of this state to stderr. */
void
symbolic_byte_offset::dump (bool simple) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp, simple);
pp_newline (&pp);
- pp_flush (&pp);
}
json::value *
void
symbolic_byte_range::dump (bool simple, region_model_manager &mgr) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp, simple, mgr);
pp_newline (&pp);
- pp_flush (&pp);
}
json::value *
void
record_layout::dump () const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp);
- pp_flush (&pp);
}
const record_layout::item *
DEBUG_FUNCTION void
reachable_regions::dump () const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp);
- pp_flush (&pp);
}
} // namespace ana
DEBUG_FUNCTION void
region_to_value_map::dump (bool simple) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp, simple, true);
pp_newline (&pp);
- pp_flush (&pp);
}
/* Generate a JSON value for this region_to_value_map.
void
region_model::dump (FILE *fp, bool simple, bool multiline) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (fp);
+ tree_dump_pretty_printer pp (fp);
dump_to_pp (&pp, simple, multiline);
pp_newline (&pp);
- pp_flush (&pp);
}
/* Dump a multiline representation of this model to stderr. */
void
model_merger::dump (FILE *fp, bool simple) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (fp);
+ tree_dump_pretty_printer pp (fp);
dump_to_pp (&pp, simple);
- pp_flush (&pp);
}
/* Dump a multiline representation of this merger to stderr. */
DEBUG_FUNCTION void
region_offset::dump (bool simple) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp, simple);
pp_newline (&pp);
- pp_flush (&pp);
}
/* An svalue that matches the pattern (BASE * FACTOR) + OFFSET
DEBUG_FUNCTION void
region::dump (bool simple) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp, simple);
pp_newline (&pp);
- pp_flush (&pp);
}
/* Dump a tree-like representation of this region and its constituent symbols
DEBUG_FUNCTION void
deallocator_set::dump () const
{
- pretty_printer pp;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp);
pp_newline (&pp);
- pp_flush (&pp);
}
/* struct custom_deallocator_set : public deallocator_set. */
DEBUG_FUNCTION void
uncertainty_t::dump (bool simple) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp, simple);
pp_newline (&pp);
- pp_flush (&pp);
}
/* class binding_key. */
DEBUG_FUNCTION void
binding_key::dump (bool simple) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp, simple);
pp_newline (&pp);
- pp_flush (&pp);
}
/* Get a description of this binding_key. */
DEBUG_FUNCTION void
bit_range::dump () const
{
- pretty_printer pp;
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp);
pp_newline (&pp);
- pp_flush (&pp);
}
/* Generate a JSON value for this bit_range.
DEBUG_FUNCTION void
byte_range::dump () const
{
- pretty_printer pp;
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp);
pp_newline (&pp);
- pp_flush (&pp);
}
/* Generate a JSON value for this byte_range.
DEBUG_FUNCTION void
binding_map::dump (bool simple) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp, simple, true);
pp_newline (&pp);
- pp_flush (&pp);
}
/* Return a new json::object of the form
DEBUG_FUNCTION void
binding_cluster::dump (bool simple) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
pp_string (&pp, " cluster for: ");
m_base_region->dump_to_pp (&pp, simple);
pp_string (&pp, ": ");
pp_newline (&pp);
dump_to_pp (&pp, simple, true);
pp_newline (&pp);
- pp_flush (&pp);
}
/* Assert that this object is valid. */
DEBUG_FUNCTION void
store::dump (bool simple) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp, simple, true, NULL);
pp_newline (&pp);
- pp_flush (&pp);
}
/* Assert that this object is valid. */
DEBUG_FUNCTION void
superedge::dump () const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump (&pp);
pp_newline (&pp);
- pp_flush (&pp);
}
/* Implementation of dedge::dump_dot for superedges.
DEBUG_FUNCTION void
svalue::dump (bool simple) const
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (stderr);
+ tree_dump_pretty_printer pp (stderr);
dump_to_pp (&pp, simple);
pp_newline (&pp);
- pp_flush (&pp);
}
/* Generate a textual representation of this svalue for debugging purposes. */
template <typename T>
void dump_to_file (const T &obj, FILE *outf)
{
- pretty_printer pp;
- pp_format_decoder (&pp) = default_tree_printer;
- if (outf == stderr)
- pp_show_color (&pp) = pp_show_color (global_dc->m_printer);
- pp.set_output_stream (outf);
-
+ tree_dump_pretty_printer pp (outf);
text_art::theme *theme = global_dc->get_diagram_theme ();
dump_to_pp (obj, theme, &pp);
- pp_flush (&pp);
}
/* Dump OBJ to stderr, using OBJ's make_dump_widget member function. */
bool default_tree_printer (pretty_printer *, text_info *, const char *,
int, bool, bool, bool, bool *, pp_token_list &);
+/* A subclass of pretty_printer for writing "dump" functions.
+ Wires itself up to a FILE *, and colorizes if it's stderr and
+ the user requested colorization. */
+
+class tree_dump_pretty_printer : public pretty_printer
+{
+public:
+ tree_dump_pretty_printer (FILE *outf)
+ {
+ pp_format_decoder (this) = default_tree_printer;
+ if (outf == stderr)
+ pp_show_color (this) = pp_show_color (global_dc->m_printer);
+ set_output_stream (outf);
+ }
+ ~tree_dump_pretty_printer ()
+ {
+ pp_flush (this);
+ }
+};
+
#endif /* ! GCC_TREE_DIAGNOSTIC_H */