GCC Middle and Back End API Reference
|
#include <dumpfile.h>
Public Member Functions | |
dump_manager () | |
~dump_manager () | |
unsigned int | dump_register (const char *suffix, const char *swtch, const char *glob, dump_kind dkind, optgroup_flags_t optgroup_flags, bool take_ownership) |
void | register_dumps () |
struct dump_file_info * | get_dump_file_info (int phase) const |
struct dump_file_info * | get_dump_file_info_by_switch (const char *swtch) const |
char * | get_dump_file_name (int phase, int part=-1) const |
char * | get_dump_file_name (struct dump_file_info *dfi, int part=-1) const |
void | dump_switch_p (const char *arg) |
int | dump_start (int phase, dump_flags_t *flag_ptr) |
void | dump_finish (int phase) |
FILE * | dump_begin (int phase, dump_flags_t *flag_ptr, int part) |
int | dump_initialized_p (int phase) const |
const char * | dump_flag_name (int phase) const |
void | register_pass (opt_pass *pass) |
Private Member Functions | |
int | dump_phase_enabled_p (int phase) const |
int | dump_switch_p_1 (const char *arg, struct dump_file_info *dfi, bool doglob) |
int | dump_enable_all (dump_kind dkind, dump_flags_t flags, const char *filename) |
int | opt_info_enable_passes (optgroup_flags_t optgroup_flags, dump_flags_t flags, const char *filename) |
bool | update_dfi_for_opt_info (dump_file_info *dfi) const |
friend | bool::enable_rtl_dump_file (void) |
friend | int::opt_info_switch_p (const char *arg) |
Private Attributes | |
int | m_next_dump |
struct dump_file_info * | m_extra_dump_files |
size_t | m_extra_dump_files_in_use |
size_t | m_extra_dump_files_alloced |
optgroup_flags_t | m_optgroup_flags |
dump_flags_t | m_optinfo_flags |
char * | m_optinfo_filename |
A class for managing all of the various dump files used by the optimization passes.
gcc::dump_manager::dump_manager | ( | ) |
gcc::dump_manager::~dump_manager | ( | ) |
|
private |
FILE * gcc::dump_manager::dump_begin | ( | int | phase, |
dump_flags_t * | flag_ptr, | ||
int | part ) |
References dump_open(), free(), NULL, dump_file_info::pflags, pflags, dump_file_info::pstate, and TDI_none.
Referenced by dump_begin().
|
private |
Enable all tree dumps with FLAGS on FILENAME. Return number of enabled tree dumps.
References CONST_CAST, dump_files, free(), i, dump_file_info::pfilename, dump_file_info::pflags, dump_file_info::pstate, TDI_end, and TDI_none.
Referenced by enable_rtl_dump_file().
void gcc::dump_manager::dump_finish | ( | int | phase | ) |
Finish a tree dump for PHASE and close associated dump streams. Also reset the globals DUMP_FILE, ALT_DUMP_FILE, and DUMP_FLAGS.
References alt_flags, dump_file_info::alt_stream, dump_flags, NULL, pflags, dump_file_info::pstream, set_alt_dump_file(), set_dump_file(), and TDF_NONE.
Referenced by coverage_init(), gcc::pass_manager::finish_optimization_passes(), and pass_fini_dump_file().
const char * gcc::dump_manager::dump_flag_name | ( | int | phase | ) | const |
References dump_file_info::swtch.
Referenced by dump_flag_name().
int gcc::dump_manager::dump_initialized_p | ( | int | phase | ) | const |
Returns nonzero if tree dump PHASE has been initialized.
References dump_file_info::alt_state, and dump_file_info::pstate.
Referenced by pass_init_dump_file().
|
private |
Returns nonzero if dump PHASE is enabled for at least one stream. If PHASE is TDI_tree_all, return nonzero if any dump is enabled for any phase.
References dump_file_info::alt_state, dump_files, i, dump_file_info::pstate, TDI_end, TDI_none, and TDI_tree_all.
unsigned int gcc::dump_manager::dump_register | ( | const char * | suffix, |
const char * | swtch, | ||
const char * | glob, | ||
dump_kind | dkind, | ||
optgroup_flags_t | optgroup_flags, | ||
bool | take_ownership ) |
References count, and TDI_end.
Referenced by debuginfo_early_init(), gcc::pass_manager::register_one_dump_file(), and statistics_early_init().
int gcc::dump_manager::dump_start | ( | int | phase, |
dump_flags_t * | flag_ptr ) |
Start a dump for PHASE. Store user-supplied dump flags in *FLAG_PTR. Return the number of streams opened. Set globals DUMP_FILE, and ALT_DUMP_FILE to point to the opened streams, and set dump_flags appropriately for both pass dump stream and -fopt-info stream.
References alt_flags, dump_file_info::alt_flags, dump_file_info::alt_stream, count, dump_open(), dump_open_alternate_stream(), free(), dump_file_info::pflags, pflags, dump_file_info::pstate, dump_file_info::pstream, set_alt_dump_file(), set_dump_file(), and TDI_none.
Referenced by coverage_init(), gcc::pass_manager::finish_optimization_passes(), and pass_init_dump_file().
void gcc::dump_manager::dump_switch_p | ( | const char * | arg | ) |
References candidates, dump_files, error(), find_closest_string(), i, dump_file_info::swtch, TDI_end, and TDI_none.
Referenced by handle_deferred_dump_options().
|
private |
Parse ARG as a dump switch. Return nonzero if it is, and store the relevant details in the dump_files array.
References CONST_CAST, dump_file_info::dkind, free(), dump_file_info::glob, NULL, parse_dump_option(), dump_file_info::pfilename, dump_file_info::pflags, dump_file_info::pstate, skip_leading_substring, dump_file_info::suffix, dump_file_info::swtch, and TDF_NONE.
struct dump_file_info * gcc::dump_manager::get_dump_file_info | ( | int | phase | ) | const |
Return the dump_file_info for the given phase.
References dump_files, NULL, and TDI_end.
Referenced by debuginfo_init(), gcc::pass_manager::dump_profile_report(), execute_function_dump(), gcc::pass_manager::finish_optimization_passes(), pass_init_dump_file(), and statistics_init().
struct dump_file_info * gcc::dump_manager::get_dump_file_info_by_switch | ( | const char * | swtch | ) | const |
char * gcc::dump_manager::get_dump_file_name | ( | int | phase, |
int | part = -1 ) const |
Return the name of the dump file for the given phase. The caller is responsible for calling free on the returned buffer. If the dump is not enabled, returns NULL.
References NULL, and TDI_none.
Referenced by gcc::pass_manager::finish_optimization_passes(), and pass_init_dump_file().
char * gcc::dump_manager::get_dump_file_name | ( | struct dump_file_info * | dfi, |
int | part = -1 ) const |
Return the name of the dump file for the given dump_file_info. The caller is responsible for calling free on the returned buffer. If the dump is not enabled, returns NULL.
References dump_file_info::dkind, gcc_assert, NULL, dump_file_info::num, dump_file_info::pfilename, dump_file_info::pstate, and dump_file_info::suffix.
|
private |
|
private |
Enable -fopt-info dumps on all dump files matching OPTGROUP_FLAGS. Enable dumps with FLAGS on FILENAME. Return the number of enabled dumps.
References dump_files, i, TDI_end, and TDI_none.
Referenced by opt_info_switch_p().
void gcc::dump_manager::register_dumps | ( | ) |
Allow languages and middle-end to register their dumps before the optimization passes.
References dump_files, FIRST_ME_AUTO_NUMBERED_DUMP, gcc_assert, dump_file_info::num, lang_hooks::register_dumps, TDI_gimple, TDI_nested, and TDI_original.
Referenced by general_init().
void gcc::dump_manager::register_pass | ( | opt_pass * | pass | ) |
Handle -fdump-* and -fopt-info for a pass added after command-line options are parsed (those from plugins and those from backends). Because the registration of plugin/backend passes happens after the command-line options are parsed, the options that specify single pass dumping (e.g. -fdump-tree-PASSNAME) cannot be used for new passes. Therefore we currently can only enable dumping of new passes when the 'dump-all' flags (e.g. -fdump-tree-all) are specified. This is done here. Similarly, the saved -fopt-info options are wired up to the new pass.
References gcc_assert, GIMPLE_PASS, IPA_PASS, dump_file_info::pflags, dump_file_info::pstate, register_one_dump_file(), SIMPLE_IPA_PASS, opt_pass::static_pass_number, TDI_ipa_all, TDI_rtl_all, TDI_tree_all, and pass_data::type.
Referenced by gcc::pass_manager::register_pass().
|
private |
Use the saved -fopt-info options to update DFI. Return true if the dump is enabled.
References dump_file_info::alt_filename, dump_file_info::alt_flags, dump_file_info::alt_state, CONST_CAST, free(), gcc_assert, and dump_file_info::optgroup_flags.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |