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) |
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 | ( | ) |
References free(), ggc_alloc(), and i.
|
private |
FILE * gcc::dump_manager::dump_begin | ( | int | phase, |
dump_flags_t * | flag_ptr, | ||
int | part ) |
References dump_open(), free(), ggc_alloc(), NULL, pflags, 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(), ggc_alloc(), i, dump_file_info::pfilename, dump_file_info::pflags, dump_file_info::pstate, TDI_end, and TDI_none.
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_flags, ggc_alloc(), NULL, pflags, set_alt_dump_file(), set_dump_file(), and TDF_NONE.
Referenced by coverage_init(), and pass_fini_dump_file().
References ggc_alloc().
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 ggc_alloc().
|
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_files, ggc_alloc(), i, TDI_end, TDI_none, and TDI_tree_all.
Referenced by dump_start().
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, ggc_alloc(), and TDI_end.
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, count, dump_open(), dump_open_alternate_stream(), dump_phase_enabled_p(), free(), get_dump_file_info(), get_dump_file_name(), ggc_alloc(), pflags, set_alt_dump_file(), set_dump_file(), and TDI_none.
Referenced by coverage_init().
References candidates, dump_files, error(), find_closest_string(), ggc_alloc(), 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, free(), ggc_alloc(), NULL, parse_dump_option(), skip_leading_substring, 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 dump_start().
struct dump_file_info * gcc::dump_manager::get_dump_file_info_by_switch | ( | const char * | swtch | ) | const |
Locate the dump_file_info with swtch equal to SWTCH, or return NULL if no such dump_file_info exists.
References ggc_alloc(), i, and NULL.
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 ggc_alloc(), NULL, and TDI_none.
Referenced by dump_start().
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 gcc_assert, ggc_alloc(), and NULL.
|
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, ggc_alloc(), i, TDI_end, and TDI_none.
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().
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, ggc_alloc(), GIMPLE_PASS, IPA_PASS, 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.
|
private |
Use the saved -fopt-info options to update DFI. Return true if the dump is enabled.
References CONST_CAST, free(), gcc_assert, and ggc_alloc().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |