GCC Middle and Back End API Reference
gcc::pass_manager Class Reference

#include <pass_manager.h>

Collaboration diagram for gcc::pass_manager:

Public Member Functions

 pass_manager (context *ctxt)
 ~pass_manager ()
void register_pass (struct register_pass_info *pass_info)
void register_one_dump_file (opt_pass *pass)
opt_passget_pass_for_id (int id) const
void dump_passes () const
void dump_profile_report () const
void finish_optimization_passes ()
void execute_early_local_passes ()
unsigned int execute_pass_mode_switching ()
opt_passget_pass_split_all_insns () const
opt_passget_pass_mode_switching () const
opt_passget_pass_peephole2 () const
opt_passget_pass_profile () const
void register_pass_name (opt_pass *pass, const char *name)
opt_passget_pass_by_name (const char *name)
opt_passget_rest_of_compilation () const
opt_passget_clean_slate () const

Data Fields

opt_pass ** passes_by_id
int passes_by_id_size
opt_pass ** pass_lists [PASS_LIST_NUM]

Private Member Functions

void set_pass_for_id (int id, opt_pass *pass)
void register_dump_files (opt_pass *pass)
void create_pass_tab () const

Private Attributes

hash_map< free_string_hash, opt_pass * > * m_name_to_pass_map

Constructor & Destructor Documentation

◆ pass_manager()

pass_manager::pass_manager ( context * ctxt)
Construct the pass tree.  The sequencing of passes is driven by
  the cgraph routines:

  finalize_compilation_unit ()
      for each node N in the cgraph
          cgraph_analyze_function (N)
              cgraph_lower_function (N) -> all_lowering_passes

  If we are optimizing, compile is then invoked:

  compile ()
      ipa_passes ()                     -> all_small_ipa_passes
                                -> Analysis of all_regular_ipa_passes
       * possible LTO streaming at compilation time *
                                -> Execution of all_regular_ipa_passes
       * possible LTO streaming at link time *
                                -> all_late_ipa_passes
      expand_all_functions ()
          for each node N in the cgraph
              expand_function (N)      -> Transformation of all_regular_ipa_passes
                                -> all_passes

References all_late_ipa_passes, all_lowering_passes, all_passes, all_regular_ipa_passes, all_small_ipa_passes, GCC_PASS_LISTS, and register_dump_files().

◆ ~pass_manager()

pass_manager::~pass_manager ( )

Member Function Documentation

◆ create_pass_tab()

void pass_manager::create_pass_tab ( void ) const
The function traverses NAME_TO_PASS_MAP and creates a pass info
table for dumping purpose.   

References m_name_to_pass_map, NULL, pass_tab, passes_by_id_size, passes_pass_traverse(), and hash_map< KeyId, Value, Traits >::traverse().

Referenced by dump_passes().

◆ dump_passes()

◆ dump_profile_report()

◆ execute_early_local_passes()

void pass_manager::execute_early_local_passes ( )

◆ execute_pass_mode_switching()

unsigned int pass_manager::execute_pass_mode_switching ( )

References cfun.

◆ finish_optimization_passes()

◆ get_clean_slate()

opt_pass * gcc::pass_manager::get_clean_slate ( ) const

Referenced by run_rtl_passes().

◆ get_pass_by_name()

opt_pass * pass_manager::get_pass_by_name ( const char * name)
Returns the pass with NAME.   

References hash_map< KeyId, Value, Traits >::get(), m_name_to_pass_map, and NULL.

Referenced by enable_disable_pass().

◆ get_pass_for_id()

opt_pass * pass_manager::get_pass_for_id ( int id) const
Return the pass with the static pass number ID.   

References NULL, passes_by_id, and passes_by_id_size.

Referenced by execute_all_ipa_transforms(), and statistics_fini().

◆ get_pass_mode_switching()

opt_pass * gcc::pass_manager::get_pass_mode_switching ( ) const

◆ get_pass_peephole2()

opt_pass * gcc::pass_manager::get_pass_peephole2 ( ) const

◆ get_pass_profile()

opt_pass * gcc::pass_manager::get_pass_profile ( ) const

Referenced by coverage_init().

◆ get_pass_split_all_insns()

opt_pass * gcc::pass_manager::get_pass_split_all_insns ( ) const

◆ get_rest_of_compilation()

opt_pass * gcc::pass_manager::get_rest_of_compilation ( ) const

Referenced by run_rtl_passes().

◆ register_dump_files()

void pass_manager::register_dump_files ( opt_pass * pass)
Register the dump files for the pass_manager starting at PASS.  

References pass_data::name, opt_pass::next, register_dump_files(), register_one_dump_file(), and opt_pass::sub.

Referenced by pass_manager(), and register_dump_files().

◆ register_one_dump_file()

◆ register_pass()

◆ register_pass_name()

void pass_manager::register_pass_name ( opt_pass * pass,
const char * name )

◆ set_pass_for_id()

void pass_manager::set_pass_for_id ( int id,
opt_pass * pass )
Set the static pass number of pass PASS to ID and record that
in the mapping from static pass number to pass.   

References passes_by_id, passes_by_id_size, and opt_pass::static_pass_number.

Referenced by register_one_dump_file().

Field Documentation

◆ all_late_ipa_passes

opt_pass* gcc::pass_manager::all_late_ipa_passes

◆ all_lowering_passes

opt_pass* gcc::pass_manager::all_lowering_passes

◆ all_passes

opt_pass* gcc::pass_manager::all_passes

◆ all_regular_ipa_passes

◆ all_small_ipa_passes

opt_pass* gcc::pass_manager::all_small_ipa_passes

◆ m_ctxt

◆ m_name_to_pass_map

hash_map<free_string_hash, opt_pass *>* gcc::pass_manager::m_name_to_pass_map

◆ pass_lists

opt_pass** gcc::pass_manager::pass_lists[PASS_LIST_NUM]

◆ passes_by_id

opt_pass** gcc::pass_manager::passes_by_id

◆ passes_by_id_size

The documentation for this class was generated from the following files: