diff options
Diffstat (limited to 'gcc/df-core.c')
-rw-r--r-- | gcc/df-core.c | 161 |
1 files changed, 107 insertions, 54 deletions
diff --git a/gcc/df-core.c b/gcc/df-core.c index d0e316c5c0f..95df1c1b056 100644 --- a/gcc/df-core.c +++ b/gcc/df-core.c @@ -746,26 +746,44 @@ gate_opt (void) } -struct rtl_opt_pass pass_df_initialize_opt = -{ - { - RTL_PASS, - "dfinit", /* name */ - OPTGROUP_NONE, /* optinfo_flags */ - gate_opt, /* gate */ - rest_of_handle_df_initialize, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_DF_SCAN, /* tv_id */ - 0, /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - 0 /* todo_flags_finish */ - } +namespace { + +const pass_data pass_data_df_initialize_opt = +{ + RTL_PASS, /* type */ + "dfinit", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + true, /* has_gate */ + true, /* has_execute */ + TV_DF_SCAN, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0, /* todo_flags_finish */ }; +class pass_df_initialize_opt : public rtl_opt_pass +{ +public: + pass_df_initialize_opt(gcc::context *ctxt) + : rtl_opt_pass(pass_data_df_initialize_opt, ctxt) + {} + + /* opt_pass methods: */ + bool gate () { return gate_opt (); } + unsigned int execute () { return rest_of_handle_df_initialize (); } + +}; // class pass_df_initialize_opt + +} // anon namespace + +rtl_opt_pass * +make_pass_df_initialize_opt (gcc::context *ctxt) +{ + return new pass_df_initialize_opt (ctxt); +} + static bool gate_no_opt (void) @@ -774,26 +792,44 @@ gate_no_opt (void) } -struct rtl_opt_pass pass_df_initialize_no_opt = -{ - { - RTL_PASS, - "no-opt dfinit", /* name */ - OPTGROUP_NONE, /* optinfo_flags */ - gate_no_opt, /* gate */ - rest_of_handle_df_initialize, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_DF_SCAN, /* tv_id */ - 0, /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - 0 /* todo_flags_finish */ - } +namespace { + +const pass_data pass_data_df_initialize_no_opt = +{ + RTL_PASS, /* type */ + "no-opt dfinit", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + true, /* has_gate */ + true, /* has_execute */ + TV_DF_SCAN, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0, /* todo_flags_finish */ }; +class pass_df_initialize_no_opt : public rtl_opt_pass +{ +public: + pass_df_initialize_no_opt(gcc::context *ctxt) + : rtl_opt_pass(pass_data_df_initialize_no_opt, ctxt) + {} + + /* opt_pass methods: */ + bool gate () { return gate_no_opt (); } + unsigned int execute () { return rest_of_handle_df_initialize (); } + +}; // class pass_df_initialize_no_opt + +} // anon namespace + +rtl_opt_pass * +make_pass_df_initialize_no_opt (gcc::context *ctxt) +{ + return new pass_df_initialize_no_opt (ctxt); +} + /* Free all the dataflow info and the DF structure. This should be called from the df_finish macro which also NULLs the parm. */ @@ -822,26 +858,43 @@ rest_of_handle_df_finish (void) } -struct rtl_opt_pass pass_df_finish = -{ - { - RTL_PASS, - "dfinish", /* name */ - OPTGROUP_NONE, /* optinfo_flags */ - NULL, /* gate */ - rest_of_handle_df_finish, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_NONE, /* tv_id */ - 0, /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - 0 /* todo_flags_finish */ - } +namespace { + +const pass_data pass_data_df_finish = +{ + RTL_PASS, /* type */ + "dfinish", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + false, /* has_gate */ + true, /* has_execute */ + TV_NONE, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0, /* todo_flags_finish */ }; +class pass_df_finish : public rtl_opt_pass +{ +public: + pass_df_finish(gcc::context *ctxt) + : rtl_opt_pass(pass_data_df_finish, ctxt) + {} + + /* opt_pass methods: */ + unsigned int execute () { return rest_of_handle_df_finish (); } + +}; // class pass_df_finish + +} // anon namespace + +rtl_opt_pass * +make_pass_df_finish (gcc::context *ctxt) +{ + return new pass_df_finish (ctxt); +} + |