22#ifndef GCC_DUMP_CONTEXT_H
23#define GCC_DUMP_CONTEXT_H 1
93 const char *format, va_list *
ap)
96 template<
unsigned int N,
typename C>
187 const char *spec,
int ,
196 std::unique_ptr<optinfo_item> item);
231class temp_dump_context
234 temp_dump_context (
bool forcibly_enable_optinfo,
235 bool forcibly_enable_dumping,
237 ~temp_dump_context ();
240 optinfo *get_pending_optinfo ()
const {
return m_context.m_pending; }
241 const char *get_dumped_text ();
251extern void verify_dumped_text (
const location &loc,
252 temp_dump_context *context,
253 const char *expected_text);
259#define ASSERT_DUMPED_TEXT_EQ(CONTEXT, EXPECTED_TEXT) \
260 SELFTEST_BEGIN_STMT \
261 verify_dumped_text (SELFTEST_LOCATION, &(CONTEXT), (EXPECTED_TEXT)); \
268verify_item (
const location &loc,
271 location_t expected_location,
272 const char *expected_text);
276#define ASSERT_IS_TEXT(ITEM, EXPECTED_TEXT) \
277 SELFTEST_BEGIN_STMT \
278 verify_item (SELFTEST_LOCATION, (ITEM), OPTINFO_ITEM_KIND_TEXT, \
279 UNKNOWN_LOCATION, (EXPECTED_TEXT)); \
284#define ASSERT_IS_TREE(ITEM, EXPECTED_LOCATION, EXPECTED_TEXT) \
285 SELFTEST_BEGIN_STMT \
286 verify_item (SELFTEST_LOCATION, (ITEM), OPTINFO_ITEM_KIND_TREE, \
287 (EXPECTED_LOCATION), (EXPECTED_TEXT)); \
292#define ASSERT_IS_GIMPLE(ITEM, EXPECTED_LOCATION, EXPECTED_TEXT) \
293 SELFTEST_BEGIN_STMT \
294 verify_item (SELFTEST_LOCATION, (ITEM), OPTINFO_ITEM_KIND_GIMPLE, \
295 (EXPECTED_LOCATION), (EXPECTED_TEXT)); \
300#define ASSERT_IS_SYMTAB_NODE(ITEM, EXPECTED_LOCATION, EXPECTED_TEXT) \
301 SELFTEST_BEGIN_STMT \
302 verify_item (SELFTEST_LOCATION, (ITEM), OPTINFO_ITEM_KIND_SYMTAB_NODE, \
303 (EXPECTED_LOCATION), (EXPECTED_TEXT)); \
Definition dump-context.h:210
dump_flags_t m_saved_pflags
Definition dump-context.h:219
debug_dump_context(FILE *f=stderr)
Definition dumpfile.cc:2117
dump_context m_context
Definition dump-context.h:216
~debug_dump_context()
Definition dumpfile.cc:2132
dump_flags_t m_saved_flags
Definition dump-context.h:218
dump_context * m_saved
Definition dump-context.h:217
FILE * m_saved_file
Definition dump-context.h:220
Definition dump-context.h:44
optinfo & ensure_pending_optinfo(const dump_metadata_t &metadata)
Definition dumpfile.cc:1208
void emit_optinfo(const optinfo *info)
Definition dumpfile.cc:1247
void dump_loc_immediate(dump_flags_t dump_kind, const dump_user_location_t &loc)
Definition dumpfile.cc:614
void begin_scope(const char *name, const dump_user_location_t &user_location, const dump_impl_location_t &impl_location)
Definition dumpfile.cc:1142
void dump_gimple_stmt_loc(const dump_metadata_t &metadata, const dump_user_location_t &loc, dump_flags_t extra_dump_flags, gimple *gs, int spc)
Definition dumpfile.cc:669
optinfo & begin_next_optinfo(const dump_metadata_t &metadata, const dump_user_location_t &loc)
Definition dumpfile.cc:1219
void dump_gimple_stmt(const dump_metadata_t &metadata, dump_flags_t extra_dump_flags, gimple *gs, int spc)
Definition dumpfile.cc:651
bool optinfo_enabled_p() const
Definition dumpfile.cc:1199
static dump_context s_default
Definition dump-context.h:153
void set_json_writer(optrecord_json_writer *writer)
Definition dumpfile.cc:536
friend class selftest::temp_dump_context
Definition dump-context.h:45
void refresh_dumps_are_enabled()
Definition dumpfile.cc:561
pretty_printer * m_test_pp
Definition dump-context.h:146
void dump_printf_va(const dump_metadata_t &metadata, const char *format, va_list *ap) ATTRIBUTE_GCC_DUMP_PRINTF(3
Definition dumpfile.cc:1029
optinfo * m_pending
Definition dump-context.h:138
void dump_gimple_expr_loc(const dump_metadata_t &metadata, const dump_user_location_t &loc, dump_flags_t extra_dump_flags, gimple *gs, int spc)
Definition dumpfile.cc:718
void dump_loc(const dump_metadata_t &metadata, const dump_user_location_t &loc)
Definition dumpfile.cc:600
bool optimization_records_enabled_p() const
Definition dump-context.h:113
void void dump_printf_loc_va(const dump_metadata_t &metadata, const dump_user_location_t &loc, const char *format, va_list *ap) ATTRIBUTE_GCC_DUMP_PRINTF(4
Definition dumpfile.cc:1056
~dump_context()
Definition dumpfile.cc:530
void dump_generic_expr_loc(const dump_metadata_t &metadata, const dump_user_location_t &loc, dump_flags_t extra_dump_flags, tree t)
Definition dumpfile.cc:772
static dump_context * s_current
Definition dump-context.h:150
unsigned int get_scope_depth() const
Definition dumpfile.cc:1130
void emit_item(const optinfo_item &item, dump_flags_t dump_kind)
Definition dumpfile.cc:1258
void end_any_optinfo()
Definition dumpfile.cc:1234
bool apply_dump_filter_p(dump_flags_t dump_kind, dump_flags_t filter) const
Definition dumpfile.cc:574
optrecord_json_writer * m_json_writer
Definition dump-context.h:142
void dump_gimple_expr(const dump_metadata_t &metadata, dump_flags_t extra_dump_flags, gimple *gs, int spc)
Definition dumpfile.cc:700
void end_scope()
Definition dumpfile.cc:1185
unsigned int m_scope_depth
Definition dump-context.h:134
static dump_context & get()
Definition dump-context.h:49
void void void dump_dec(const dump_metadata_t &metadata, const poly_int< N, C > &value)
void finish_any_json_writer()
Definition dumpfile.cc:547
void dump_symtab_node(const dump_metadata_t &metadata, symtab_node *node)
Definition dumpfile.cc:1113
void dump_generic_expr(const dump_metadata_t &metadata, dump_flags_t extra_dump_flags, tree t)
Definition dumpfile.cc:752
dump_flags_t m_test_pp_flags
Definition dump-context.h:147
Definition dumpfile.h:381
Definition dump-context.h:165
dump_context * m_context
Definition dump-context.h:200
dump_flags_t m_dump_kind
Definition dump-context.h:201
void stash_item(pp_token_list &formatted_tok_list, std::unique_ptr< optinfo_item > item)
Definition dumpfile.cc:844
void emit_item(std::unique_ptr< optinfo_item > item, optinfo *dest)
Definition dumpfile.cc:832
static bool format_decoder_cb(pretty_printer *pp, text_info *text, const char *spec, int, bool, bool, bool, bool @endverbatim *, pp_token_list &formatted_tok_list)
Definition dumpfile.cc:860
custom_token_printer m_token_printer
Definition dump-context.h:202
bool decode_format(text_info *text, const char *spec, pp_token_list &formatted_tok_list)
Definition dumpfile.cc:893
void set_optinfo(optinfo *info)
Definition dump-context.h:169
dump_pretty_printer(dump_context *context, dump_flags_t dump_kind)
Definition dumpfile.cc:817
Definition dumpfile.h:340
Definition optinfo-emit-json.h:31
Definition poly-int.h:378
Definition pretty-print-format-impl.h:300
Definition pretty-print.h:241
Definition pretty-print.h:208
union tree_node * tree
Definition coretypes.h:97
dump_kind
Definition dumpfile.h:64
#define ATTRIBUTE_GCC_DUMP_PRINTF(m, n)
Definition dumpfile.h:36
enum dump_flag dump_flags_t
Definition dumpfile.h:209
Definition dump-context.h:31
optinfo_item_kind
Definition optinfo.h:141
static void const char va_list ap
Definition read-md.cc:205
Definition dump-context.h:173
dump_pretty_printer & m_dump_pp
Definition dump-context.h:182
optinfo * m_optinfo
Definition dump-context.h:183
custom_token_printer(dump_pretty_printer &dump_pp)
Definition dump-context.h:174
void emit_any_pending_textual_chunks()
Definition dumpfile.cc:1004
void print_tokens(pretty_printer *pp, const pp_token_list &tokens) final override
Definition dumpfile.cc:947
Definition pretty-print.h:34
#define NULL
Definition system.h:50