summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog1373
-rw-r--r--gcc/asan.c109
-rw-r--r--gcc/auto-inc-dec.c52
-rw-r--r--gcc/bb-reorder.c156
-rw-r--r--gcc/bt-load.c108
-rw-r--r--gcc/cfgcleanup.c102
-rw-r--r--gcc/cfgexpand.c55
-rw-r--r--gcc/cfgrtl.c153
-rw-r--r--gcc/cgraphbuild.c157
-rw-r--r--gcc/combine-stack-adj.c52
-rw-r--r--gcc/combine.c52
-rw-r--r--gcc/compare-elim.c55
-rw-r--r--gcc/config/epiphany/epiphany.h4
-rw-r--r--gcc/config/epiphany/mode-switch-use.c51
-rw-r--r--gcc/config/epiphany/resolve-sw-modes.c53
-rw-r--r--gcc/config/i386/i386.c55
-rw-r--r--gcc/config/mips/mips.c53
-rw-r--r--gcc/config/sparc/sparc.c54
-rw-r--r--gcc/cprop.c55
-rw-r--r--gcc/cse.c164
-rw-r--r--gcc/dce.c104
-rw-r--r--gcc/df-core.c161
-rw-r--r--gcc/dse.c108
-rw-r--r--gcc/dwarf2cfi.c54
-rw-r--r--gcc/except.c107
-rw-r--r--gcc/final.c204
-rw-r--r--gcc/function.c216
-rw-r--r--gcc/fwprop.c107
-rw-r--r--gcc/gcse.c108
-rw-r--r--gcc/gimple-low.c51
-rw-r--r--gcc/gimple-ssa-strength-reduction.c54
-rw-r--r--gcc/ifcvt.c157
-rw-r--r--gcc/init-regs.c52
-rw-r--r--gcc/ipa-cp.c75
-rw-r--r--gcc/ipa-inline-analysis.c56
-rw-r--r--gcc/ipa-inline.c122
-rw-r--r--gcc/ipa-pure-const.c123
-rw-r--r--gcc/ipa-reference.c72
-rw-r--r--gcc/ipa-split.c104
-rw-r--r--gcc/ipa.c318
-rw-r--r--gcc/ira.c102
-rw-r--r--gcc/jump.c51
-rw-r--r--gcc/loop-init.c378
-rw-r--r--gcc/lower-subreg.c106
-rw-r--r--gcc/lto-streamer-out.c138
-rw-r--r--gcc/mode-switching.c53
-rw-r--r--gcc/modulo-sched.c57
-rw-r--r--gcc/omp-low.c163
-rw-r--r--gcc/passes.c319
-rw-r--r--gcc/postreload-gcse.c53
-rw-r--r--gcc/postreload.c53
-rw-r--r--gcc/predict.c108
-rw-r--r--gcc/recog.c325
-rw-r--r--gcc/ree.c53
-rw-r--r--gcc/reg-stack.c102
-rw-r--r--gcc/regcprop.c53
-rw-r--r--gcc/reginfo.c51
-rw-r--r--gcc/regmove.c52
-rw-r--r--gcc/regrename.c53
-rw-r--r--gcc/reorg.c104
-rw-r--r--gcc/sched-rgn.c112
-rw-r--r--gcc/stack-ptr-mod.c51
-rw-r--r--gcc/store-motion.c54
-rw-r--r--gcc/testsuite/ChangeLog23
-rw-r--r--gcc/testsuite/g++.dg/plugin/dumb_plugin.c52
-rw-r--r--gcc/testsuite/g++.dg/plugin/selfassign.c52
-rw-r--r--gcc/testsuite/gcc.dg/plugin/one_time_plugin.c52
-rw-r--r--gcc/testsuite/gcc.dg/plugin/selfassign.c52
-rw-r--r--gcc/tracer.c53
-rw-r--r--gcc/trans-mem.c377
-rw-r--r--gcc/tree-call-cdce.c52
-rw-r--r--gcc/tree-cfg.c267
-rw-r--r--gcc/tree-cfgcleanup.c53
-rw-r--r--gcc/tree-complex.c106
-rw-r--r--gcc/tree-eh.c261
-rw-r--r--gcc/tree-emutls.c52
-rw-r--r--gcc/tree-if-conv.c53
-rw-r--r--gcc/tree-into-ssa.c54
-rw-r--r--gcc/tree-loop-distribution.c52
-rw-r--r--gcc/tree-mudflap.c106
-rw-r--r--gcc/tree-nomudflap.c102
-rw-r--r--gcc/tree-nrv.c103
-rw-r--r--gcc/tree-object-size.c52
-rw-r--r--gcc/tree-optimize.c105
-rw-r--r--gcc/tree-pass.h466
-rw-r--r--gcc/tree-profile.c52
-rw-r--r--gcc/tree-sra.c158
-rw-r--r--gcc/tree-ssa-ccp.c109
-rw-r--r--gcc/tree-ssa-copy.c56
-rw-r--r--gcc/tree-ssa-copyrename.c53
-rw-r--r--gcc/tree-ssa-dce.c160
-rw-r--r--gcc/tree-ssa-dom.c116
-rw-r--r--gcc/tree-ssa-dse.c53
-rw-r--r--gcc/tree-ssa-forwprop.c54
-rw-r--r--gcc/tree-ssa-ifcombine.c53
-rw-r--r--gcc/tree-ssa-loop-ch.c55
-rw-r--r--gcc/tree-ssa-loop.c973
-rw-r--r--gcc/tree-ssa-math-opts.c215
-rw-r--r--gcc/tree-ssa-phiopt.c111
-rw-r--r--gcc/tree-ssa-phiprop.c53
-rw-r--r--gcc/tree-ssa-pre.c106
-rw-r--r--gcc/tree-ssa-reassoc.c57
-rw-r--r--gcc/tree-ssa-sink.c56
-rw-r--r--gcc/tree-ssa-strlen.c52
-rw-r--r--gcc/tree-ssa-structalias.c160
-rw-r--r--gcc/tree-ssa-uncprop.c53
-rw-r--r--gcc/tree-ssa-uninit.c53
-rw-r--r--gcc/tree-ssa.c153
-rw-r--r--gcc/tree-ssanames.c51
-rw-r--r--gcc/tree-stdarg.c52
-rw-r--r--gcc/tree-switch-conversion.c57
-rw-r--r--gcc/tree-tailcall.c105
-rw-r--r--gcc/tree-vect-generic.c116
-rw-r--r--gcc/tree-vectorizer.c109
-rw-r--r--gcc/tree-vrp.c58
-rw-r--r--gcc/tree.c53
-rw-r--r--gcc/tsan.c105
-rw-r--r--gcc/var-tracking.c55
-rw-r--r--gcc/web.c52
119 files changed, 9811 insertions, 4365 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b985e37aec3..f45646972cd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,1378 @@
2013-08-05 David Malcolm <dmalcolm@redhat.com>
+ This is the automated part of the conversion of passes from C
+ structs to C++ classes.
+
+ Patch autogenerated by refactor_passes.py from
+ https://github.com/davidmalcolm/gcc-refactoring-scripts
+ revision 03fe39476a4c4ea450b49e087cfa817b5f92021e
+
+ * asan.c (pass_asan): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_asan): ...new pass_data instance and...
+ (make_pass_asan): ...new function.
+ (pass_asan_O0): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_asan_O0): ...new pass_data instance and...
+ (make_pass_asan_O0): ...new function.
+ * auto-inc-dec.c (pass_inc_dec): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_inc_dec): ...new pass_data instance and...
+ (make_pass_inc_dec): ...new function.
+ * bb-reorder.c (pass_reorder_blocks): Convert from a global struct to
+ a subclass of rtl_opt_pass along with...
+ (pass_data_reorder_blocks): ...new pass_data instance and...
+ (make_pass_reorder_blocks): ...new function.
+ (pass_duplicate_computed_gotos): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_duplicate_computed_gotos): ...new pass_data instance and...
+ (make_pass_duplicate_computed_gotos): ...new function.
+ (pass_partition_blocks): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_partition_blocks): ...new pass_data instance and...
+ (make_pass_partition_blocks): ...new function.
+ * bt-load.c (pass_branch_target_load_optimize1): Convert from a global
+ struct to a subclass of rtl_opt_pass along with...
+ (pass_data_branch_target_load_optimize1): ...new pass_data instance
+ and...
+ (make_pass_branch_target_load_optimize1): ...new function.
+ (pass_branch_target_load_optimize2): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_branch_target_load_optimize2): ...new pass_data instance
+ and...
+ (make_pass_branch_target_load_optimize2): ...new function.
+ * cfgcleanup.c (pass_jump): Convert from a global struct to a subclass
+ of rtl_opt_pass along with...
+ (pass_data_jump): ...new pass_data instance and...
+ (make_pass_jump): ...new function.
+ (pass_jump2): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_jump2): ...new pass_data instance and...
+ (make_pass_jump2): ...new function.
+ * cfgexpand.c (pass_expand): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_expand): ...new pass_data instance and...
+ (make_pass_expand): ...new function.
+ * cfgrtl.c (pass_free_cfg): Convert from a global struct to a subclass
+ of rtl_opt_pass along with...
+ (pass_data_free_cfg): ...new pass_data instance and...
+ (make_pass_free_cfg): ...new function.
+ (pass_into_cfg_layout_mode): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_into_cfg_layout_mode): ...new pass_data instance and...
+ (make_pass_into_cfg_layout_mode): ...new function.
+ (pass_outof_cfg_layout_mode): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_outof_cfg_layout_mode): ...new pass_data instance and...
+ (make_pass_outof_cfg_layout_mode): ...new function.
+ * cgraphbuild.c (pass_build_cgraph_edges): Convert from a global
+ struct to a subclass of gimple_opt_pass along with...
+ (pass_data_build_cgraph_edges): ...new pass_data instance and...
+ (make_pass_build_cgraph_edges): ...new function.
+ (pass_rebuild_cgraph_edges): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_rebuild_cgraph_edges): ...new pass_data instance and...
+ (make_pass_rebuild_cgraph_edges): ...new function.
+ (pass_remove_cgraph_callee_edges): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_remove_cgraph_callee_edges): ...new pass_data instance
+ and...
+ (make_pass_remove_cgraph_callee_edges): ...new function.
+ * combine-stack-adj.c (pass_stack_adjustments): Convert from a global
+ struct to a subclass of rtl_opt_pass along with...
+ (pass_data_stack_adjustments): ...new pass_data instance and...
+ (make_pass_stack_adjustments): ...new function.
+ * combine.c (pass_combine): Convert from a global struct to a subclass
+ of rtl_opt_pass along with...
+ (pass_data_combine): ...new pass_data instance and...
+ (make_pass_combine): ...new function.
+ * compare-elim.c (pass_compare_elim_after_reload): Convert from a
+ global struct to a subclass of rtl_opt_pass along with...
+ (pass_data_compare_elim_after_reload): ...new pass_data instance
+ and...
+ (make_pass_compare_elim_after_reload): ...new function.
+ * cprop.c (pass_rtl_cprop): Convert from a global struct to a subclass
+ of rtl_opt_pass along with...
+ (pass_data_rtl_cprop): ...new pass_data instance and...
+ (make_pass_rtl_cprop): ...new function.
+ * cse.c (pass_cse): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_cse): ...new pass_data instance and...
+ (make_pass_cse): ...new function.
+ (pass_cse2): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_cse2): ...new pass_data instance and...
+ (make_pass_cse2): ...new function.
+ (pass_cse_after_global_opts): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_cse_after_global_opts): ...new pass_data instance and...
+ (make_pass_cse_after_global_opts): ...new function.
+ * dce.c (pass_ud_rtl_dce): Convert from a global struct to a subclass
+ of rtl_opt_pass along with...
+ (pass_data_ud_rtl_dce): ...new pass_data instance and...
+ (make_pass_ud_rtl_dce): ...new function.
+ (pass_fast_rtl_dce): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_fast_rtl_dce): ...new pass_data instance and...
+ (make_pass_fast_rtl_dce): ...new function.
+ * df-core.c (pass_df_initialize_opt): Convert from a global struct to
+ a subclass of rtl_opt_pass along with...
+ (pass_data_df_initialize_opt): ...new pass_data instance and...
+ (make_pass_df_initialize_opt): ...new function.
+ (pass_df_initialize_no_opt): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_df_initialize_no_opt): ...new pass_data instance and...
+ (make_pass_df_initialize_no_opt): ...new function.
+ (pass_df_finish): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_df_finish): ...new pass_data instance and...
+ (make_pass_df_finish): ...new function.
+ * dse.c (pass_rtl_dse1): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_rtl_dse1): ...new pass_data instance and...
+ (make_pass_rtl_dse1): ...new function.
+ (pass_rtl_dse2): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_rtl_dse2): ...new pass_data instance and...
+ (make_pass_rtl_dse2): ...new function.
+ * dwarf2cfi.c (pass_dwarf2_frame): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_dwarf2_frame): ...new pass_data instance and...
+ (make_pass_dwarf2_frame): ...new function.
+ * except.c (pass_set_nothrow_function_flags): Convert from a global
+ struct to a subclass of rtl_opt_pass along with...
+ (pass_data_set_nothrow_function_flags): ...new pass_data instance
+ and...
+ (make_pass_set_nothrow_function_flags): ...new function.
+ (pass_convert_to_eh_region_ranges): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_convert_to_eh_region_ranges): ...new pass_data instance
+ and...
+ (make_pass_convert_to_eh_region_ranges): ...new function.
+ * final.c (pass_compute_alignments): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_compute_alignments): ...new pass_data instance and...
+ (make_pass_compute_alignments): ...new function.
+ (pass_final): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_final): ...new pass_data instance and...
+ (make_pass_final): ...new function.
+ (pass_shorten_branches): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_shorten_branches): ...new pass_data instance and...
+ (make_pass_shorten_branches): ...new function.
+ (pass_clean_state): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_clean_state): ...new pass_data instance and...
+ (make_pass_clean_state): ...new function.
+ * function.c (pass_instantiate_virtual_regs): Convert from a global
+ struct to a subclass of rtl_opt_pass along with...
+ (pass_data_instantiate_virtual_regs): ...new pass_data instance and...
+ (make_pass_instantiate_virtual_regs): ...new function.
+ (pass_leaf_regs): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_leaf_regs): ...new pass_data instance and...
+ (make_pass_leaf_regs): ...new function.
+ (pass_thread_prologue_and_epilogue): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_thread_prologue_and_epilogue): ...new pass_data instance
+ and...
+ (make_pass_thread_prologue_and_epilogue): ...new function.
+ (pass_match_asm_constraints): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_match_asm_constraints): ...new pass_data instance and...
+ (make_pass_match_asm_constraints): ...new function.
+ * fwprop.c (pass_rtl_fwprop): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_rtl_fwprop): ...new pass_data instance and...
+ (make_pass_rtl_fwprop): ...new function.
+ (pass_rtl_fwprop_addr): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_rtl_fwprop_addr): ...new pass_data instance and...
+ (make_pass_rtl_fwprop_addr): ...new function.
+ * gcse.c (pass_rtl_pre): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_rtl_pre): ...new pass_data instance and...
+ (make_pass_rtl_pre): ...new function.
+ (pass_rtl_hoist): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_rtl_hoist): ...new pass_data instance and...
+ (make_pass_rtl_hoist): ...new function.
+ * gimple-low.c (pass_lower_cf): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_lower_cf): ...new pass_data instance and...
+ (make_pass_lower_cf): ...new function.
+ * gimple-ssa-strength-reduction.c (pass_strength_reduction): Convert
+ from a global struct to a subclass of gimple_opt_pass along with...
+ (pass_data_strength_reduction): ...new pass_data instance and...
+ (make_pass_strength_reduction): ...new function.
+ * ifcvt.c (pass_rtl_ifcvt): Convert from a global struct to a subclass
+ of rtl_opt_pass along with...
+ (pass_data_rtl_ifcvt): ...new pass_data instance and...
+ (make_pass_rtl_ifcvt): ...new function.
+ (pass_if_after_combine): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_if_after_combine): ...new pass_data instance and...
+ (make_pass_if_after_combine): ...new function.
+ (pass_if_after_reload): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_if_after_reload): ...new pass_data instance and...
+ (make_pass_if_after_reload): ...new function.
+ * init-regs.c (pass_initialize_regs): Convert from a global struct to
+ a subclass of rtl_opt_pass along with...
+ (pass_data_initialize_regs): ...new pass_data instance and...
+ (make_pass_initialize_regs): ...new function.
+ * ipa-cp.c (pass_ipa_cp): Convert from a global struct to a subclass
+ of ipa_opt_pass_d along with...
+ (pass_data_ipa_cp): ...new pass_data instance and...
+ (make_pass_ipa_cp): ...new function.
+ * ipa-inline-analysis.c (pass_inline_parameters): Convert from a
+ global struct to a subclass of gimple_opt_pass along with...
+ (pass_data_inline_parameters): ...new pass_data instance and...
+ (make_pass_inline_parameters): ...new function.
+ * ipa-inline.c (pass_early_inline): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_early_inline): ...new pass_data instance and...
+ (make_pass_early_inline): ...new function.
+ (pass_ipa_inline): Convert from a global struct to a subclass of
+ ipa_opt_pass_d along with...
+ (pass_data_ipa_inline): ...new pass_data instance and...
+ (make_pass_ipa_inline): ...new function.
+ * ipa-pure-const.c (pass_local_pure_const): Convert from a global
+ struct to a subclass of gimple_opt_pass along with...
+ (pass_data_local_pure_const): ...new pass_data instance and...
+ (make_pass_local_pure_const): ...new function.
+ (pass_ipa_pure_const): Convert from a global struct to a subclass of
+ ipa_opt_pass_d along with...
+ (pass_data_ipa_pure_const): ...new pass_data instance and...
+ (make_pass_ipa_pure_const): ...new function.
+ * ipa-reference.c (pass_ipa_reference): Convert from a global struct
+ to a subclass of ipa_opt_pass_d along with...
+ (pass_data_ipa_reference): ...new pass_data instance and...
+ (make_pass_ipa_reference): ...new function.
+ * ipa-split.c (pass_split_functions): Convert from a global struct to
+ a subclass of gimple_opt_pass along with...
+ (pass_data_split_functions): ...new pass_data instance and...
+ (make_pass_split_functions): ...new function.
+ (pass_feedback_split_functions): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_feedback_split_functions): ...new pass_data instance and...
+ (make_pass_feedback_split_functions): ...new function.
+ * ipa.c (pass_ipa_function_and_variable_visibility): Convert from a
+ global struct to a subclass of simple_ipa_opt_pass along with...
+ (pass_data_ipa_function_and_variable_visibility): ...new pass_data
+ instance and...
+ (make_pass_ipa_function_and_variable_visibility): ...new function.
+ (pass_ipa_free_inline_summary): Convert from a global struct to a
+ subclass of simple_ipa_opt_pass along with...
+ (pass_data_ipa_free_inline_summary): ...new pass_data instance and...
+ (make_pass_ipa_free_inline_summary): ...new function.
+ (pass_ipa_whole_program_visibility): Convert from a global struct to a
+ subclass of ipa_opt_pass_d along with...
+ (pass_data_ipa_whole_program_visibility): ...new pass_data instance
+ and...
+ (make_pass_ipa_whole_program_visibility): ...new function.
+ (pass_ipa_profile): Convert from a global struct to a subclass of
+ ipa_opt_pass_d along with...
+ (pass_data_ipa_profile): ...new pass_data instance and...
+ (make_pass_ipa_profile): ...new function.
+ (pass_ipa_cdtor_merge): Convert from a global struct to a subclass of
+ ipa_opt_pass_d along with...
+ (pass_data_ipa_cdtor_merge): ...new pass_data instance and...
+ (make_pass_ipa_cdtor_merge): ...new function.
+ * ira.c (pass_ira): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_ira): ...new pass_data instance and...
+ (make_pass_ira): ...new function.
+ (pass_reload): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_reload): ...new pass_data instance and...
+ (make_pass_reload): ...new function.
+ * jump.c (pass_cleanup_barriers): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_cleanup_barriers): ...new pass_data instance and...
+ (make_pass_cleanup_barriers): ...new function.
+ * loop-init.c (pass_loop2): Convert from a global struct to a subclass
+ of rtl_opt_pass along with...
+ (pass_data_loop2): ...new pass_data instance and...
+ (make_pass_loop2): ...new function.
+ (pass_rtl_loop_init): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_rtl_loop_init): ...new pass_data instance and...
+ (make_pass_rtl_loop_init): ...new function.
+ (pass_rtl_loop_done): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_rtl_loop_done): ...new pass_data instance and...
+ (make_pass_rtl_loop_done): ...new function.
+ (pass_rtl_move_loop_invariants): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_rtl_move_loop_invariants): ...new pass_data instance and...
+ (make_pass_rtl_move_loop_invariants): ...new function.
+ (pass_rtl_unswitch): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_rtl_unswitch): ...new pass_data instance and...
+ (make_pass_rtl_unswitch): ...new function.
+ (pass_rtl_unroll_and_peel_loops): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_rtl_unroll_and_peel_loops): ...new pass_data instance
+ and...
+ (make_pass_rtl_unroll_and_peel_loops): ...new function.
+ (pass_rtl_doloop): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_rtl_doloop): ...new pass_data instance and...
+ (make_pass_rtl_doloop): ...new function.
+ * lower-subreg.c (pass_lower_subreg): Convert from a global struct to
+ a subclass of rtl_opt_pass along with...
+ (pass_data_lower_subreg): ...new pass_data instance and...
+ (make_pass_lower_subreg): ...new function.
+ (pass_lower_subreg2): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_lower_subreg2): ...new pass_data instance and...
+ (make_pass_lower_subreg2): ...new function.
+ * lto-streamer-out.c (pass_ipa_lto_gimple_out): Convert from a global
+ struct to a subclass of ipa_opt_pass_d along with...
+ (pass_data_ipa_lto_gimple_out): ...new pass_data instance and...
+ (make_pass_ipa_lto_gimple_out): ...new function.
+ (pass_ipa_lto_finish_out): Convert from a global struct to a subclass
+ of ipa_opt_pass_d along with...
+ (pass_data_ipa_lto_finish_out): ...new pass_data instance and...
+ (make_pass_ipa_lto_finish_out): ...new function.
+ * mode-switching.c (pass_mode_switching): Convert from a global struct
+ to a subclass of rtl_opt_pass along with...
+ (pass_data_mode_switching): ...new pass_data instance and...
+ (make_pass_mode_switching): ...new function.
+ * modulo-sched.c (pass_sms): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_sms): ...new pass_data instance and...
+ (make_pass_sms): ...new function.
+ * omp-low.c (pass_expand_omp): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_expand_omp): ...new pass_data instance and...
+ (make_pass_expand_omp): ...new function.
+ (pass_lower_omp): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_lower_omp): ...new pass_data instance and...
+ (make_pass_lower_omp): ...new function.
+ (pass_diagnose_omp_blocks): Convert from a global struct to a subclass
+ of gimple_opt_pass along with...
+ (pass_data_diagnose_omp_blocks): ...new pass_data instance and...
+ (make_pass_diagnose_omp_blocks): ...new function.
+ * passes.c (pass_early_local_passes): Convert from a global struct to
+ a subclass of simple_ipa_opt_pass along with...
+ (pass_data_early_local_passes): ...new pass_data instance and...
+ (make_pass_early_local_passes): ...new function.
+ (pass_all_early_optimizations): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_all_early_optimizations): ...new pass_data instance and...
+ (make_pass_all_early_optimizations): ...new function.
+ (pass_all_optimizations): Convert from a global struct to a subclass
+ of gimple_opt_pass along with...
+ (pass_data_all_optimizations): ...new pass_data instance and...
+ (make_pass_all_optimizations): ...new function.
+ (pass_all_optimizations_g): Convert from a global struct to a subclass
+ of gimple_opt_pass along with...
+ (pass_data_all_optimizations_g): ...new pass_data instance and...
+ (make_pass_all_optimizations_g): ...new function.
+ (pass_rest_of_compilation): Convert from a global struct to a subclass
+ of rtl_opt_pass along with...
+ (pass_data_rest_of_compilation): ...new pass_data instance and...
+ (make_pass_rest_of_compilation): ...new function.
+ (pass_postreload): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_postreload): ...new pass_data instance and...
+ (make_pass_postreload): ...new function.
+ * postreload-gcse.c (pass_gcse2): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_gcse2): ...new pass_data instance and...
+ (make_pass_gcse2): ...new function.
+ * postreload.c (pass_postreload_cse): Convert from a global struct to
+ a subclass of rtl_opt_pass along with...
+ (pass_data_postreload_cse): ...new pass_data instance and...
+ (make_pass_postreload_cse): ...new function.
+ * predict.c (pass_profile): Convert from a global struct to a subclass
+ of gimple_opt_pass along with...
+ (pass_data_profile): ...new pass_data instance and...
+ (make_pass_profile): ...new function.
+ (pass_strip_predict_hints): Convert from a global struct to a subclass
+ of gimple_opt_pass along with...
+ (pass_data_strip_predict_hints): ...new pass_data instance and...
+ (make_pass_strip_predict_hints): ...new function.
+ * recog.c (pass_peephole2): Convert from a global struct to a subclass
+ of rtl_opt_pass along with...
+ (pass_data_peephole2): ...new pass_data instance and...
+ (make_pass_peephole2): ...new function.
+ (pass_split_all_insns): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_split_all_insns): ...new pass_data instance and...
+ (make_pass_split_all_insns): ...new function.
+ (pass_split_after_reload): Convert from a global struct to a subclass
+ of rtl_opt_pass along with...
+ (pass_data_split_after_reload): ...new pass_data instance and...
+ (make_pass_split_after_reload): ...new function.
+ (pass_split_before_regstack): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_split_before_regstack): ...new pass_data instance and...
+ (make_pass_split_before_regstack): ...new function.
+ (pass_split_before_sched2): Convert from a global struct to a subclass
+ of rtl_opt_pass along with...
+ (pass_data_split_before_sched2): ...new pass_data instance and...
+ (make_pass_split_before_sched2): ...new function.
+ (pass_split_for_shorten_branches): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_split_for_shorten_branches): ...new pass_data instance
+ and...
+ (make_pass_split_for_shorten_branches): ...new function.
+ * ree.c (pass_ree): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_ree): ...new pass_data instance and...
+ (make_pass_ree): ...new function.
+ * reg-stack.c (pass_stack_regs): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_stack_regs): ...new pass_data instance and...
+ (make_pass_stack_regs): ...new function.
+ (pass_stack_regs_run): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_stack_regs_run): ...new pass_data instance and...
+ (make_pass_stack_regs_run): ...new function.
+ * regcprop.c (pass_cprop_hardreg): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_cprop_hardreg): ...new pass_data instance and...
+ (make_pass_cprop_hardreg): ...new function.
+ * reginfo.c (pass_reginfo_init): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_reginfo_init): ...new pass_data instance and...
+ (make_pass_reginfo_init): ...new function.
+ * regmove.c (pass_regmove): Convert from a global struct to a subclass
+ of rtl_opt_pass along with...
+ (pass_data_regmove): ...new pass_data instance and...
+ (make_pass_regmove): ...new function.
+ * regrename.c (pass_regrename): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_regrename): ...new pass_data instance and...
+ (make_pass_regrename): ...new function.
+ * reorg.c (pass_delay_slots): Convert from a global struct to a
+ subclass of rtl_opt_pass along with...
+ (pass_data_delay_slots): ...new pass_data instance and...
+ (make_pass_delay_slots): ...new function.
+ (pass_machine_reorg): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_machine_reorg): ...new pass_data instance and...
+ (make_pass_machine_reorg): ...new function.
+ * sched-rgn.c (pass_sched): Convert from a global struct to a subclass
+ of rtl_opt_pass along with...
+ (pass_data_sched): ...new pass_data instance and...
+ (make_pass_sched): ...new function.
+ (pass_sched2): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_sched2): ...new pass_data instance and...
+ (make_pass_sched2): ...new function.
+ * stack-ptr-mod.c (pass_stack_ptr_mod): Convert from a global struct
+ to a subclass of rtl_opt_pass along with...
+ (pass_data_stack_ptr_mod): ...new pass_data instance and...
+ (make_pass_stack_ptr_mod): ...new function.
+ * store-motion.c (pass_rtl_store_motion): Convert from a global struct
+ to a subclass of rtl_opt_pass along with...
+ (pass_data_rtl_store_motion): ...new pass_data instance and...
+ (make_pass_rtl_store_motion): ...new function.
+ * tracer.c (pass_tracer): Convert from a global struct to a subclass
+ of gimple_opt_pass along with...
+ (pass_data_tracer): ...new pass_data instance and...
+ (make_pass_tracer): ...new function.
+ * trans-mem.c (pass_diagnose_tm_blocks): Convert from a global struct
+ to a subclass of gimple_opt_pass along with...
+ (pass_data_diagnose_tm_blocks): ...new pass_data instance and...
+ (make_pass_diagnose_tm_blocks): ...new function.
+ (pass_lower_tm): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_lower_tm): ...new pass_data instance and...
+ (make_pass_lower_tm): ...new function.
+ (pass_tm_init): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_tm_init): ...new pass_data instance and...
+ (make_pass_tm_init): ...new function.
+ (pass_tm_mark): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_tm_mark): ...new pass_data instance and...
+ (make_pass_tm_mark): ...new function.
+ (pass_tm_edges): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_tm_edges): ...new pass_data instance and...
+ (make_pass_tm_edges): ...new function.
+ (pass_tm_memopt): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_tm_memopt): ...new pass_data instance and...
+ (make_pass_tm_memopt): ...new function.
+ (pass_ipa_tm): Convert from a global struct to a subclass of
+ simple_ipa_opt_pass along with...
+ (pass_data_ipa_tm): ...new pass_data instance and...
+ (make_pass_ipa_tm): ...new function.
+ * tree-call-cdce.c (pass_call_cdce): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_call_cdce): ...new pass_data instance and...
+ (make_pass_call_cdce): ...new function.
+ * tree-cfg.c (pass_build_cfg): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_build_cfg): ...new pass_data instance and...
+ (make_pass_build_cfg): ...new function.
+ (pass_split_crit_edges): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_split_crit_edges): ...new pass_data instance and...
+ (make_pass_split_crit_edges): ...new function.
+ (pass_warn_function_return): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_warn_function_return): ...new pass_data instance and...
+ (make_pass_warn_function_return): ...new function.
+ (pass_warn_function_noreturn): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_warn_function_noreturn): ...new pass_data instance and...
+ (make_pass_warn_function_noreturn): ...new function.
+ (pass_warn_unused_result): Convert from a global struct to a subclass
+ of gimple_opt_pass along with...
+ (pass_data_warn_unused_result): ...new pass_data instance and...
+ (make_pass_warn_unused_result): ...new function.
+ * tree-cfgcleanup.c (pass_merge_phi): Convert from a global struct to
+ a subclass of gimple_opt_pass along with...
+ (pass_data_merge_phi): ...new pass_data instance and...
+ (make_pass_merge_phi): ...new function.
+ * tree-complex.c (pass_lower_complex): Convert from a global struct to
+ a subclass of gimple_opt_pass along with...
+ (pass_data_lower_complex): ...new pass_data instance and...
+ (make_pass_lower_complex): ...new function.
+ (pass_lower_complex_O0): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_lower_complex_O0): ...new pass_data instance and...
+ (make_pass_lower_complex_O0): ...new function.
+ * tree-eh.c (pass_lower_eh): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_lower_eh): ...new pass_data instance and...
+ (make_pass_lower_eh): ...new function.
+ (pass_refactor_eh): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_refactor_eh): ...new pass_data instance and...
+ (make_pass_refactor_eh): ...new function.
+ (pass_lower_resx): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_lower_resx): ...new pass_data instance and...
+ (make_pass_lower_resx): ...new function.
+ (pass_lower_eh_dispatch): Convert from a global struct to a subclass
+ of gimple_opt_pass along with...
+ (pass_data_lower_eh_dispatch): ...new pass_data instance and...
+ (make_pass_lower_eh_dispatch): ...new function.
+ (pass_cleanup_eh): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_cleanup_eh): ...new pass_data instance and...
+ (make_pass_cleanup_eh): ...new function.
+ * tree-emutls.c (pass_ipa_lower_emutls): Convert from a global struct
+ to a subclass of simple_ipa_opt_pass along with...
+ (pass_data_ipa_lower_emutls): ...new pass_data instance and...
+ (make_pass_ipa_lower_emutls): ...new function.
+ * tree-if-conv.c (pass_if_conversion): Convert from a global struct to
+ a subclass of gimple_opt_pass along with...
+ (pass_data_if_conversion): ...new pass_data instance and...
+ (make_pass_if_conversion): ...new function.
+ * tree-into-ssa.c (pass_build_ssa): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_build_ssa): ...new pass_data instance and...
+ (make_pass_build_ssa): ...new function.
+ * tree-loop-distribution.c (pass_loop_distribution): Convert from a
+ global struct to a subclass of gimple_opt_pass along with...
+ (pass_data_loop_distribution): ...new pass_data instance and...
+ (make_pass_loop_distribution): ...new function.
+ * tree-mudflap.c (pass_mudflap_1): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_mudflap_1): ...new pass_data instance and...
+ (make_pass_mudflap_1): ...new function.
+ (pass_mudflap_2): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_mudflap_2): ...new pass_data instance and...
+ (make_pass_mudflap_2): ...new function.
+ * tree-nomudflap.c (pass_mudflap_1): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_mudflap_1): ...new pass_data instance and...
+ (make_pass_mudflap_1): ...new function.
+ (pass_mudflap_2): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_mudflap_2): ...new pass_data instance and...
+ (make_pass_mudflap_2): ...new function.
+ * tree-nrv.c (pass_nrv): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_nrv): ...new pass_data instance and...
+ (make_pass_nrv): ...new function.
+ (pass_return_slot): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_return_slot): ...new pass_data instance and...
+ (make_pass_return_slot): ...new function.
+ * tree-object-size.c (pass_object_sizes): Convert from a global struct
+ to a subclass of gimple_opt_pass along with...
+ (pass_data_object_sizes): ...new pass_data instance and...
+ (make_pass_object_sizes): ...new function.
+ * tree-optimize.c (pass_cleanup_cfg_post_optimizing): Convert from a
+ global struct to a subclass of gimple_opt_pass along with...
+ (pass_data_cleanup_cfg_post_optimizing): ...new pass_data instance
+ and...
+ (make_pass_cleanup_cfg_post_optimizing): ...new function.
+ (pass_fixup_cfg): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_fixup_cfg): ...new pass_data instance and...
+ (make_pass_fixup_cfg): ...new function.
+ * tree-pass.h (pass_mudflap_1): Replace declaration with that of...
+ (make_pass_mudflap_1): ...new function.
+ (pass_mudflap_2): Replace declaration with that of...
+ (make_pass_mudflap_2): ...new function.
+ (pass_asan): Replace declaration with that of...
+ (make_pass_asan): ...new function.
+ (pass_asan_O0): Replace declaration with that of...
+ (make_pass_asan_O0): ...new function.
+ (pass_tsan): Replace declaration with that of...
+ (make_pass_tsan): ...new function.
+ (pass_tsan_O0): Replace declaration with that of...
+ (make_pass_tsan_O0): ...new function.
+ (pass_lower_cf): Replace declaration with that of...
+ (make_pass_lower_cf): ...new function.
+ (pass_refactor_eh): Replace declaration with that of...
+ (make_pass_refactor_eh): ...new function.
+ (pass_lower_eh): Replace declaration with that of...
+ (make_pass_lower_eh): ...new function.
+ (pass_lower_eh_dispatch): Replace declaration with that of...
+ (make_pass_lower_eh_dispatch): ...new function.
+ (pass_lower_resx): Replace declaration with that of...
+ (make_pass_lower_resx): ...new function.
+ (pass_build_cfg): Replace declaration with that of...
+ (make_pass_build_cfg): ...new function.
+ (pass_early_tree_profile): Replace declaration with that of...
+ (make_pass_early_tree_profile): ...new function.
+ (pass_cleanup_eh): Replace declaration with that of...
+ (make_pass_cleanup_eh): ...new function.
+ (pass_sra): Replace declaration with that of...
+ (make_pass_sra): ...new function.
+ (pass_sra_early): Replace declaration with that of...
+ (make_pass_sra_early): ...new function.
+ (pass_early_ipa_sra): Replace declaration with that of...
+ (make_pass_early_ipa_sra): ...new function.
+ (pass_tail_recursion): Replace declaration with that of...
+ (make_pass_tail_recursion): ...new function.
+ (pass_tail_calls): Replace declaration with that of...
+ (make_pass_tail_calls): ...new function.
+ (pass_tree_loop): Replace declaration with that of...
+ (make_pass_tree_loop): ...new function.
+ (pass_tree_loop_init): Replace declaration with that of...
+ (make_pass_tree_loop_init): ...new function.
+ (pass_lim): Replace declaration with that of...
+ (make_pass_lim): ...new function.
+ (pass_tree_unswitch): Replace declaration with that of...
+ (make_pass_tree_unswitch): ...new function.
+ (pass_predcom): Replace declaration with that of...
+ (make_pass_predcom): ...new function.
+ (pass_iv_canon): Replace declaration with that of...
+ (make_pass_iv_canon): ...new function.
+ (pass_scev_cprop): Replace declaration with that of...
+ (make_pass_scev_cprop): ...new function.
+ (pass_empty_loop): Replace declaration with that of...
+ (make_pass_empty_loop): ...new function.
+ (pass_record_bounds): Replace declaration with that of...
+ (make_pass_record_bounds): ...new function.
+ (pass_graphite): Replace declaration with that of...
+ (make_pass_graphite): ...new function.
+ (pass_graphite_transforms): Replace declaration with that of...
+ (make_pass_graphite_transforms): ...new function.
+ (pass_if_conversion): Replace declaration with that of...
+ (make_pass_if_conversion): ...new function.
+ (pass_loop_distribution): Replace declaration with that of...
+ (make_pass_loop_distribution): ...new function.
+ (pass_vectorize): Replace declaration with that of...
+ (make_pass_vectorize): ...new function.
+ (pass_slp_vectorize): Replace declaration with that of...
+ (make_pass_slp_vectorize): ...new function.
+ (pass_complete_unroll): Replace declaration with that of...
+ (make_pass_complete_unroll): ...new function.
+ (pass_complete_unrolli): Replace declaration with that of...
+ (make_pass_complete_unrolli): ...new function.
+ (pass_parallelize_loops): Replace declaration with that of...
+ (make_pass_parallelize_loops): ...new function.
+ (pass_loop_prefetch): Replace declaration with that of...
+ (make_pass_loop_prefetch): ...new function.
+ (pass_iv_optimize): Replace declaration with that of...
+ (make_pass_iv_optimize): ...new function.
+ (pass_tree_loop_done): Replace declaration with that of...
+ (make_pass_tree_loop_done): ...new function.
+ (pass_ch): Replace declaration with that of...
+ (make_pass_ch): ...new function.
+ (pass_ccp): Replace declaration with that of...
+ (make_pass_ccp): ...new function.
+ (pass_phi_only_cprop): Replace declaration with that of...
+ (make_pass_phi_only_cprop): ...new function.
+ (pass_build_ssa): Replace declaration with that of...
+ (make_pass_build_ssa): ...new function.
+ (pass_build_alias): Replace declaration with that of...
+ (make_pass_build_alias): ...new function.
+ (pass_build_ealias): Replace declaration with that of...
+ (make_pass_build_ealias): ...new function.
+ (pass_dominator): Replace declaration with that of...
+ (make_pass_dominator): ...new function.
+ (pass_dce): Replace declaration with that of...
+ (make_pass_dce): ...new function.
+ (pass_dce_loop): Replace declaration with that of...
+ (make_pass_dce_loop): ...new function.
+ (pass_cd_dce): Replace declaration with that of...
+ (make_pass_cd_dce): ...new function.
+ (pass_call_cdce): Replace declaration with that of...
+ (make_pass_call_cdce): ...new function.
+ (pass_merge_phi): Replace declaration with that of...
+ (make_pass_merge_phi): ...new function.
+ (pass_split_crit_edges): Replace declaration with that of...
+ (make_pass_split_crit_edges): ...new function.
+ (pass_pre): Replace declaration with that of...
+ (make_pass_pre): ...new function.
+ (pass_profile): Replace declaration with that of...
+ (make_pass_profile): ...new function.
+ (pass_strip_predict_hints): Replace declaration with that of...
+ (make_pass_strip_predict_hints): ...new function.
+ (pass_lower_complex_O0): Replace declaration with that of...
+ (make_pass_lower_complex_O0): ...new function.
+ (pass_lower_complex): Replace declaration with that of...
+ (make_pass_lower_complex): ...new function.
+ (pass_lower_vector): Replace declaration with that of...
+ (make_pass_lower_vector): ...new function.
+ (pass_lower_vector_ssa): Replace declaration with that of...
+ (make_pass_lower_vector_ssa): ...new function.
+ (pass_lower_omp): Replace declaration with that of...
+ (make_pass_lower_omp): ...new function.
+ (pass_diagnose_omp_blocks): Replace declaration with that of...
+ (make_pass_diagnose_omp_blocks): ...new function.
+ (pass_expand_omp): Replace declaration with that of...
+ (make_pass_expand_omp): ...new function.
+ (pass_expand_omp_ssa): Replace declaration with that of...
+ (make_pass_expand_omp_ssa): ...new function.
+ (pass_object_sizes): Replace declaration with that of...
+ (make_pass_object_sizes): ...new function.
+ (pass_strlen): Replace declaration with that of...
+ (make_pass_strlen): ...new function.
+ (pass_fold_builtins): Replace declaration with that of...
+ (make_pass_fold_builtins): ...new function.
+ (pass_stdarg): Replace declaration with that of...
+ (make_pass_stdarg): ...new function.
+ (pass_early_warn_uninitialized): Replace declaration with that of...
+ (make_pass_early_warn_uninitialized): ...new function.
+ (pass_late_warn_uninitialized): Replace declaration with that of...
+ (make_pass_late_warn_uninitialized): ...new function.
+ (pass_cse_reciprocals): Replace declaration with that of...
+ (make_pass_cse_reciprocals): ...new function.
+ (pass_cse_sincos): Replace declaration with that of...
+ (make_pass_cse_sincos): ...new function.
+ (pass_optimize_bswap): Replace declaration with that of...
+ (make_pass_optimize_bswap): ...new function.
+ (pass_optimize_widening_mul): Replace declaration with that of...
+ (make_pass_optimize_widening_mul): ...new function.
+ (pass_warn_function_return): Replace declaration with that of...
+ (make_pass_warn_function_return): ...new function.
+ (pass_warn_function_noreturn): Replace declaration with that of...
+ (make_pass_warn_function_noreturn): ...new function.
+ (pass_cselim): Replace declaration with that of...
+ (make_pass_cselim): ...new function.
+ (pass_phiopt): Replace declaration with that of...
+ (make_pass_phiopt): ...new function.
+ (pass_forwprop): Replace declaration with that of...
+ (make_pass_forwprop): ...new function.
+ (pass_phiprop): Replace declaration with that of...
+ (make_pass_phiprop): ...new function.
+ (pass_tree_ifcombine): Replace declaration with that of...
+ (make_pass_tree_ifcombine): ...new function.
+ (pass_dse): Replace declaration with that of...
+ (make_pass_dse): ...new function.
+ (pass_nrv): Replace declaration with that of...
+ (make_pass_nrv): ...new function.
+ (pass_rename_ssa_copies): Replace declaration with that of...
+ (make_pass_rename_ssa_copies): ...new function.
+ (pass_sink_code): Replace declaration with that of...
+ (make_pass_sink_code): ...new function.
+ (pass_fre): Replace declaration with that of...
+ (make_pass_fre): ...new function.
+ (pass_check_data_deps): Replace declaration with that of...
+ (make_pass_check_data_deps): ...new function.
+ (pass_copy_prop): Replace declaration with that of...
+ (make_pass_copy_prop): ...new function.
+ (pass_vrp): Replace declaration with that of...
+ (make_pass_vrp): ...new function.
+ (pass_uncprop): Replace declaration with that of...
+ (make_pass_uncprop): ...new function.
+ (pass_return_slot): Replace declaration with that of...
+ (make_pass_return_slot): ...new function.
+ (pass_reassoc): Replace declaration with that of...
+ (make_pass_reassoc): ...new function.
+ (pass_rebuild_cgraph_edges): Replace declaration with that of...
+ (make_pass_rebuild_cgraph_edges): ...new function.
+ (pass_remove_cgraph_callee_edges): Replace declaration with that of...
+ (make_pass_remove_cgraph_callee_edges): ...new function.
+ (pass_build_cgraph_edges): Replace declaration with that of...
+ (make_pass_build_cgraph_edges): ...new function.
+ (pass_local_pure_const): Replace declaration with that of...
+ (make_pass_local_pure_const): ...new function.
+ (pass_tracer): Replace declaration with that of...
+ (make_pass_tracer): ...new function.
+ (pass_warn_unused_result): Replace declaration with that of...
+ (make_pass_warn_unused_result): ...new function.
+ (pass_diagnose_tm_blocks): Replace declaration with that of...
+ (make_pass_diagnose_tm_blocks): ...new function.
+ (pass_lower_tm): Replace declaration with that of...
+ (make_pass_lower_tm): ...new function.
+ (pass_tm_init): Replace declaration with that of...
+ (make_pass_tm_init): ...new function.
+ (pass_tm_mark): Replace declaration with that of...
+ (make_pass_tm_mark): ...new function.
+ (pass_tm_memopt): Replace declaration with that of...
+ (make_pass_tm_memopt): ...new function.
+ (pass_tm_edges): Replace declaration with that of...
+ (make_pass_tm_edges): ...new function.
+ (pass_split_functions): Replace declaration with that of...
+ (make_pass_split_functions): ...new function.
+ (pass_feedback_split_functions): Replace declaration with that of...
+ (make_pass_feedback_split_functions): ...new function.
+ (pass_strength_reduction): Replace declaration with that of...
+ (make_pass_strength_reduction): ...new function.
+ (pass_ipa_lower_emutls): Replace declaration with that of...
+ (make_pass_ipa_lower_emutls): ...new function.
+ (pass_ipa_function_and_variable_visibility): Replace declaration with
+ that of...
+ (make_pass_ipa_function_and_variable_visibility): ...new function.
+ (pass_ipa_tree_profile): Replace declaration with that of...
+ (make_pass_ipa_tree_profile): ...new function.
+ (pass_early_local_passes): Replace declaration with that of...
+ (make_pass_early_local_passes): ...new function.
+ (pass_ipa_whole_program_visibility): Replace declaration with that
+ of...
+ (make_pass_ipa_whole_program_visibility): ...new function.
+ (pass_ipa_lto_gimple_out): Replace declaration with that of...
+ (make_pass_ipa_lto_gimple_out): ...new function.
+ (pass_ipa_increase_alignment): Replace declaration with that of...
+ (make_pass_ipa_increase_alignment): ...new function.
+ (pass_ipa_inline): Replace declaration with that of...
+ (make_pass_ipa_inline): ...new function.
+ (pass_ipa_free_lang_data): Replace declaration with that of...
+ (make_pass_ipa_free_lang_data): ...new function.
+ (pass_ipa_free_inline_summary): Replace declaration with that of...
+ (make_pass_ipa_free_inline_summary): ...new function.
+ (pass_ipa_cp): Replace declaration with that of...
+ (make_pass_ipa_cp): ...new function.
+ (pass_ipa_reference): Replace declaration with that of...
+ (make_pass_ipa_reference): ...new function.
+ (pass_ipa_pure_const): Replace declaration with that of...
+ (make_pass_ipa_pure_const): ...new function.
+ (pass_ipa_pta): Replace declaration with that of...
+ (make_pass_ipa_pta): ...new function.
+ (pass_ipa_lto_finish_out): Replace declaration with that of...
+ (make_pass_ipa_lto_finish_out): ...new function.
+ (pass_ipa_tm): Replace declaration with that of...
+ (make_pass_ipa_tm): ...new function.
+ (pass_ipa_profile): Replace declaration with that of...
+ (make_pass_ipa_profile): ...new function.
+ (pass_ipa_cdtor_merge): Replace declaration with that of...
+ (make_pass_ipa_cdtor_merge): ...new function.
+ (pass_cleanup_cfg_post_optimizing): Replace declaration with that
+ of...
+ (make_pass_cleanup_cfg_post_optimizing): ...new function.
+ (pass_init_datastructures): Replace declaration with that of...
+ (make_pass_init_datastructures): ...new function.
+ (pass_fixup_cfg): Replace declaration with that of...
+ (make_pass_fixup_cfg): ...new function.
+ (pass_expand): Replace declaration with that of...
+ (make_pass_expand): ...new function.
+ (pass_instantiate_virtual_regs): Replace declaration with that of...
+ (make_pass_instantiate_virtual_regs): ...new function.
+ (pass_rtl_fwprop): Replace declaration with that of...
+ (make_pass_rtl_fwprop): ...new function.
+ (pass_rtl_fwprop_addr): Replace declaration with that of...
+ (make_pass_rtl_fwprop_addr): ...new function.
+ (pass_jump): Replace declaration with that of...
+ (make_pass_jump): ...new function.
+ (pass_jump2): Replace declaration with that of...
+ (make_pass_jump2): ...new function.
+ (pass_lower_subreg): Replace declaration with that of...
+ (make_pass_lower_subreg): ...new function.
+ (pass_cse): Replace declaration with that of...
+ (make_pass_cse): ...new function.
+ (pass_fast_rtl_dce): Replace declaration with that of...
+ (make_pass_fast_rtl_dce): ...new function.
+ (pass_ud_rtl_dce): Replace declaration with that of...
+ (make_pass_ud_rtl_dce): ...new function.
+ (pass_rtl_dce): Replace declaration with that of...
+ (make_pass_rtl_dce): ...new function.
+ (pass_rtl_dse1): Replace declaration with that of...
+ (make_pass_rtl_dse1): ...new function.
+ (pass_rtl_dse2): Replace declaration with that of...
+ (make_pass_rtl_dse2): ...new function.
+ (pass_rtl_dse3): Replace declaration with that of...
+ (make_pass_rtl_dse3): ...new function.
+ (pass_rtl_cprop): Replace declaration with that of...
+ (make_pass_rtl_cprop): ...new function.
+ (pass_rtl_pre): Replace declaration with that of...
+ (make_pass_rtl_pre): ...new function.
+ (pass_rtl_hoist): Replace declaration with that of...
+ (make_pass_rtl_hoist): ...new function.
+ (pass_rtl_store_motion): Replace declaration with that of...
+ (make_pass_rtl_store_motion): ...new function.
+ (pass_cse_after_global_opts): Replace declaration with that of...
+ (make_pass_cse_after_global_opts): ...new function.
+ (pass_rtl_ifcvt): Replace declaration with that of...
+ (make_pass_rtl_ifcvt): ...new function.
+ (pass_into_cfg_layout_mode): Replace declaration with that of...
+ (make_pass_into_cfg_layout_mode): ...new function.
+ (pass_outof_cfg_layout_mode): Replace declaration with that of...
+ (make_pass_outof_cfg_layout_mode): ...new function.
+ (pass_loop2): Replace declaration with that of...
+ (make_pass_loop2): ...new function.
+ (pass_rtl_loop_init): Replace declaration with that of...
+ (make_pass_rtl_loop_init): ...new function.
+ (pass_rtl_move_loop_invariants): Replace declaration with that of...
+ (make_pass_rtl_move_loop_invariants): ...new function.
+ (pass_rtl_unswitch): Replace declaration with that of...
+ (make_pass_rtl_unswitch): ...new function.
+ (pass_rtl_unroll_and_peel_loops): Replace declaration with that of...
+ (make_pass_rtl_unroll_and_peel_loops): ...new function.
+ (pass_rtl_doloop): Replace declaration with that of...
+ (make_pass_rtl_doloop): ...new function.
+ (pass_rtl_loop_done): Replace declaration with that of...
+ (make_pass_rtl_loop_done): ...new function.
+ (pass_web): Replace declaration with that of...
+ (make_pass_web): ...new function.
+ (pass_cse2): Replace declaration with that of...
+ (make_pass_cse2): ...new function.
+ (pass_df_initialize_opt): Replace declaration with that of...
+ (make_pass_df_initialize_opt): ...new function.
+ (pass_df_initialize_no_opt): Replace declaration with that of...
+ (make_pass_df_initialize_no_opt): ...new function.
+ (pass_reginfo_init): Replace declaration with that of...
+ (make_pass_reginfo_init): ...new function.
+ (pass_inc_dec): Replace declaration with that of...
+ (make_pass_inc_dec): ...new function.
+ (pass_stack_ptr_mod): Replace declaration with that of...
+ (make_pass_stack_ptr_mod): ...new function.
+ (pass_initialize_regs): Replace declaration with that of...
+ (make_pass_initialize_regs): ...new function.
+ (pass_combine): Replace declaration with that of...
+ (make_pass_combine): ...new function.
+ (pass_if_after_combine): Replace declaration with that of...
+ (make_pass_if_after_combine): ...new function.
+ (pass_ree): Replace declaration with that of...
+ (make_pass_ree): ...new function.
+ (pass_partition_blocks): Replace declaration with that of...
+ (make_pass_partition_blocks): ...new function.
+ (pass_match_asm_constraints): Replace declaration with that of...
+ (make_pass_match_asm_constraints): ...new function.
+ (pass_regmove): Replace declaration with that of...
+ (make_pass_regmove): ...new function.
+ (pass_split_all_insns): Replace declaration with that of...
+ (make_pass_split_all_insns): ...new function.
+ (pass_fast_rtl_byte_dce): Replace declaration with that of...
+ (make_pass_fast_rtl_byte_dce): ...new function.
+ (pass_lower_subreg2): Replace declaration with that of...
+ (make_pass_lower_subreg2): ...new function.
+ (pass_mode_switching): Replace declaration with that of...
+ (make_pass_mode_switching): ...new function.
+ (pass_sms): Replace declaration with that of...
+ (make_pass_sms): ...new function.
+ (pass_sched): Replace declaration with that of...
+ (make_pass_sched): ...new function.
+ (pass_ira): Replace declaration with that of...
+ (make_pass_ira): ...new function.
+ (pass_reload): Replace declaration with that of...
+ (make_pass_reload): ...new function.
+ (pass_clean_state): Replace declaration with that of...
+ (make_pass_clean_state): ...new function.
+ (pass_branch_prob): Replace declaration with that of...
+ (make_pass_branch_prob): ...new function.
+ (pass_value_profile_transformations): Replace declaration with that
+ of...
+ (make_pass_value_profile_transformations): ...new function.
+ (pass_postreload_cse): Replace declaration with that of...
+ (make_pass_postreload_cse): ...new function.
+ (pass_gcse2): Replace declaration with that of...
+ (make_pass_gcse2): ...new function.
+ (pass_split_after_reload): Replace declaration with that of...
+ (make_pass_split_after_reload): ...new function.
+ (pass_branch_target_load_optimize1): Replace declaration with that
+ of...
+ (make_pass_branch_target_load_optimize1): ...new function.
+ (pass_thread_prologue_and_epilogue): Replace declaration with that
+ of...
+ (make_pass_thread_prologue_and_epilogue): ...new function.
+ (pass_stack_adjustments): Replace declaration with that of...
+ (make_pass_stack_adjustments): ...new function.
+ (pass_peephole2): Replace declaration with that of...
+ (make_pass_peephole2): ...new function.
+ (pass_if_after_reload): Replace declaration with that of...
+ (make_pass_if_after_reload): ...new function.
+ (pass_regrename): Replace declaration with that of...
+ (make_pass_regrename): ...new function.
+ (pass_cprop_hardreg): Replace declaration with that of...
+ (make_pass_cprop_hardreg): ...new function.
+ (pass_reorder_blocks): Replace declaration with that of...
+ (make_pass_reorder_blocks): ...new function.
+ (pass_branch_target_load_optimize2): Replace declaration with that
+ of...
+ (make_pass_branch_target_load_optimize2): ...new function.
+ (pass_leaf_regs): Replace declaration with that of...
+ (make_pass_leaf_regs): ...new function.
+ (pass_split_before_sched2): Replace declaration with that of...
+ (make_pass_split_before_sched2): ...new function.
+ (pass_compare_elim_after_reload): Replace declaration with that of...
+ (make_pass_compare_elim_after_reload): ...new function.
+ (pass_sched2): Replace declaration with that of...
+ (make_pass_sched2): ...new function.
+ (pass_stack_regs): Replace declaration with that of...
+ (make_pass_stack_regs): ...new function.
+ (pass_stack_regs_run): Replace declaration with that of...
+ (make_pass_stack_regs_run): ...new function.
+ (pass_df_finish): Replace declaration with that of...
+ (make_pass_df_finish): ...new function.
+ (pass_compute_alignments): Replace declaration with that of...
+ (make_pass_compute_alignments): ...new function.
+ (pass_duplicate_computed_gotos): Replace declaration with that of...
+ (make_pass_duplicate_computed_gotos): ...new function.
+ (pass_variable_tracking): Replace declaration with that of...
+ (make_pass_variable_tracking): ...new function.
+ (pass_free_cfg): Replace declaration with that of...
+ (make_pass_free_cfg): ...new function.
+ (pass_machine_reorg): Replace declaration with that of...
+ (make_pass_machine_reorg): ...new function.
+ (pass_cleanup_barriers): Replace declaration with that of...
+ (make_pass_cleanup_barriers): ...new function.
+ (pass_delay_slots): Replace declaration with that of...
+ (make_pass_delay_slots): ...new function.
+ (pass_split_for_shorten_branches): Replace declaration with that of...
+ (make_pass_split_for_shorten_branches): ...new function.
+ (pass_split_before_regstack): Replace declaration with that of...
+ (make_pass_split_before_regstack): ...new function.
+ (pass_convert_to_eh_region_ranges): Replace declaration with that
+ of...
+ (make_pass_convert_to_eh_region_ranges): ...new function.
+ (pass_shorten_branches): Replace declaration with that of...
+ (make_pass_shorten_branches): ...new function.
+ (pass_set_nothrow_function_flags): Replace declaration with that of...
+ (make_pass_set_nothrow_function_flags): ...new function.
+ (pass_dwarf2_frame): Replace declaration with that of...
+ (make_pass_dwarf2_frame): ...new function.
+ (pass_final): Replace declaration with that of...
+ (make_pass_final): ...new function.
+ (pass_rtl_seqabstr): Replace declaration with that of...
+ (make_pass_rtl_seqabstr): ...new function.
+ (pass_release_ssa_names): Replace declaration with that of...
+ (make_pass_release_ssa_names): ...new function.
+ (pass_early_inline): Replace declaration with that of...
+ (make_pass_early_inline): ...new function.
+ (pass_inline_parameters): Replace declaration with that of...
+ (make_pass_inline_parameters): ...new function.
+ (pass_update_address_taken): Replace declaration with that of...
+ (make_pass_update_address_taken): ...new function.
+ (pass_convert_switch): Replace declaration with that of...
+ (make_pass_convert_switch): ...new function.
+ * tree-profile.c (pass_ipa_tree_profile): Convert from a global struct
+ to a subclass of simple_ipa_opt_pass along with...
+ (pass_data_ipa_tree_profile): ...new pass_data instance and...
+ (make_pass_ipa_tree_profile): ...new function.
+ * tree-sra.c (pass_sra_early): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_sra_early): ...new pass_data instance and...
+ (make_pass_sra_early): ...new function.
+ (pass_sra): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_sra): ...new pass_data instance and...
+ (make_pass_sra): ...new function.
+ (pass_early_ipa_sra): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_early_ipa_sra): ...new pass_data instance and...
+ (make_pass_early_ipa_sra): ...new function.
+ * tree-ssa-ccp.c (pass_ccp): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_ccp): ...new pass_data instance and...
+ (make_pass_ccp): ...new function.
+ (pass_fold_builtins): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_fold_builtins): ...new pass_data instance and...
+ (make_pass_fold_builtins): ...new function.
+ * tree-ssa-copy.c (pass_copy_prop): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_copy_prop): ...new pass_data instance and...
+ (make_pass_copy_prop): ...new function.
+ * tree-ssa-copyrename.c (pass_rename_ssa_copies): Convert from a
+ global struct to a subclass of gimple_opt_pass along with...
+ (pass_data_rename_ssa_copies): ...new pass_data instance and...
+ (make_pass_rename_ssa_copies): ...new function.
+ * tree-ssa-dce.c (pass_dce): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_dce): ...new pass_data instance and...
+ (make_pass_dce): ...new function.
+ (pass_dce_loop): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_dce_loop): ...new pass_data instance and...
+ (make_pass_dce_loop): ...new function.
+ (pass_cd_dce): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_cd_dce): ...new pass_data instance and...
+ (make_pass_cd_dce): ...new function.
+ * tree-ssa-dom.c (pass_dominator): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_dominator): ...new pass_data instance and...
+ (make_pass_dominator): ...new function.
+ (pass_phi_only_cprop): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_phi_only_cprop): ...new pass_data instance and...
+ (make_pass_phi_only_cprop): ...new function.
+ * tree-ssa-dse.c (pass_dse): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_dse): ...new pass_data instance and...
+ (make_pass_dse): ...new function.
+ * tree-ssa-forwprop.c (pass_forwprop): Convert from a global struct to
+ a subclass of gimple_opt_pass along with...
+ (pass_data_forwprop): ...new pass_data instance and...
+ (make_pass_forwprop): ...new function.
+ * tree-ssa-ifcombine.c (pass_tree_ifcombine): Convert from a global
+ struct to a subclass of gimple_opt_pass along with...
+ (pass_data_tree_ifcombine): ...new pass_data instance and...
+ (make_pass_tree_ifcombine): ...new function.
+ * tree-ssa-loop-ch.c (pass_ch): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_ch): ...new pass_data instance and...
+ (make_pass_ch): ...new function.
+ * tree-ssa-loop.c (pass_tree_loop): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_tree_loop): ...new pass_data instance and...
+ (make_pass_tree_loop): ...new function.
+ (pass_tree_loop_init): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_tree_loop_init): ...new pass_data instance and...
+ (make_pass_tree_loop_init): ...new function.
+ (pass_lim): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_lim): ...new pass_data instance and...
+ (make_pass_lim): ...new function.
+ (pass_tree_unswitch): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_tree_unswitch): ...new pass_data instance and...
+ (make_pass_tree_unswitch): ...new function.
+ (pass_predcom): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_predcom): ...new pass_data instance and...
+ (make_pass_predcom): ...new function.
+ (pass_vectorize): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_vectorize): ...new pass_data instance and...
+ (make_pass_vectorize): ...new function.
+ (pass_graphite): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_graphite): ...new pass_data instance and...
+ (make_pass_graphite): ...new function.
+ (pass_graphite_transforms): Convert from a global struct to a subclass
+ of gimple_opt_pass along with...
+ (pass_data_graphite_transforms): ...new pass_data instance and...
+ (make_pass_graphite_transforms): ...new function.
+ (pass_check_data_deps): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_check_data_deps): ...new pass_data instance and...
+ (make_pass_check_data_deps): ...new function.
+ (pass_iv_canon): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_iv_canon): ...new pass_data instance and...
+ (make_pass_iv_canon): ...new function.
+ (pass_scev_cprop): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_scev_cprop): ...new pass_data instance and...
+ (make_pass_scev_cprop): ...new function.
+ (pass_record_bounds): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_record_bounds): ...new pass_data instance and...
+ (make_pass_record_bounds): ...new function.
+ (pass_complete_unroll): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_complete_unroll): ...new pass_data instance and...
+ (make_pass_complete_unroll): ...new function.
+ (pass_complete_unrolli): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_complete_unrolli): ...new pass_data instance and...
+ (make_pass_complete_unrolli): ...new function.
+ (pass_parallelize_loops): Convert from a global struct to a subclass
+ of gimple_opt_pass along with...
+ (pass_data_parallelize_loops): ...new pass_data instance and...
+ (make_pass_parallelize_loops): ...new function.
+ (pass_loop_prefetch): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_loop_prefetch): ...new pass_data instance and...
+ (make_pass_loop_prefetch): ...new function.
+ (pass_iv_optimize): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_iv_optimize): ...new pass_data instance and...
+ (make_pass_iv_optimize): ...new function.
+ (pass_tree_loop_done): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_tree_loop_done): ...new pass_data instance and...
+ (make_pass_tree_loop_done): ...new function.
+ * tree-ssa-math-opts.c (pass_cse_reciprocals): Convert from a global
+ struct to a subclass of gimple_opt_pass along with...
+ (pass_data_cse_reciprocals): ...new pass_data instance and...
+ (make_pass_cse_reciprocals): ...new function.
+ (pass_cse_sincos): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_cse_sincos): ...new pass_data instance and...
+ (make_pass_cse_sincos): ...new function.
+ (pass_optimize_bswap): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_optimize_bswap): ...new pass_data instance and...
+ (make_pass_optimize_bswap): ...new function.
+ (pass_optimize_widening_mul): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_optimize_widening_mul): ...new pass_data instance and...
+ (make_pass_optimize_widening_mul): ...new function.
+ * tree-ssa-phiopt.c (pass_phiopt): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_phiopt): ...new pass_data instance and...
+ (make_pass_phiopt): ...new function.
+ (pass_cselim): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_cselim): ...new pass_data instance and...
+ (make_pass_cselim): ...new function.
+ * tree-ssa-phiprop.c (pass_phiprop): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_phiprop): ...new pass_data instance and...
+ (make_pass_phiprop): ...new function.
+ * tree-ssa-pre.c (pass_pre): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_pre): ...new pass_data instance and...
+ (make_pass_pre): ...new function.
+ (pass_fre): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_fre): ...new pass_data instance and...
+ (make_pass_fre): ...new function.
+ * tree-ssa-reassoc.c (pass_reassoc): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_reassoc): ...new pass_data instance and...
+ (make_pass_reassoc): ...new function.
+ * tree-ssa-sink.c (pass_sink_code): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_sink_code): ...new pass_data instance and...
+ (make_pass_sink_code): ...new function.
+ * tree-ssa-strlen.c (pass_strlen): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_strlen): ...new pass_data instance and...
+ (make_pass_strlen): ...new function.
+ * tree-ssa-structalias.c (pass_build_alias): Convert from a global
+ struct to a subclass of gimple_opt_pass along with...
+ (pass_data_build_alias): ...new pass_data instance and...
+ (make_pass_build_alias): ...new function.
+ (pass_build_ealias): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_build_ealias): ...new pass_data instance and...
+ (make_pass_build_ealias): ...new function.
+ (pass_ipa_pta): Convert from a global struct to a subclass of
+ simple_ipa_opt_pass along with...
+ (pass_data_ipa_pta): ...new pass_data instance and...
+ (make_pass_ipa_pta): ...new function.
+ * tree-ssa-uncprop.c (pass_uncprop): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_uncprop): ...new pass_data instance and...
+ (make_pass_uncprop): ...new function.
+ * tree-ssa-uninit.c (pass_late_warn_uninitialized): Convert from a
+ global struct to a subclass of gimple_opt_pass along with...
+ (pass_data_late_warn_uninitialized): ...new pass_data instance and...
+ (make_pass_late_warn_uninitialized): ...new function.
+ * tree-ssa.c (pass_init_datastructures): Convert from a global struct
+ to a subclass of gimple_opt_pass along with...
+ (pass_data_init_datastructures): ...new pass_data instance and...
+ (make_pass_init_datastructures): ...new function.
+ (pass_early_warn_uninitialized): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_early_warn_uninitialized): ...new pass_data instance and...
+ (make_pass_early_warn_uninitialized): ...new function.
+ (pass_update_address_taken): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_update_address_taken): ...new pass_data instance and...
+ (make_pass_update_address_taken): ...new function.
+ * tree-ssanames.c (pass_release_ssa_names): Convert from a global
+ struct to a subclass of gimple_opt_pass along with...
+ (pass_data_release_ssa_names): ...new pass_data instance and...
+ (make_pass_release_ssa_names): ...new function.
+ * tree-stdarg.c (pass_stdarg): Convert from a global struct to a
+ subclass of gimple_opt_pass along with...
+ (pass_data_stdarg): ...new pass_data instance and...
+ (make_pass_stdarg): ...new function.
+ * tree-switch-conversion.c (pass_convert_switch): Convert from a
+ global struct to a subclass of gimple_opt_pass along with...
+ (pass_data_convert_switch): ...new pass_data instance and...
+ (make_pass_convert_switch): ...new function.
+ * tree-tailcall.c (pass_tail_recursion): Convert from a global struct
+ to a subclass of gimple_opt_pass along with...
+ (pass_data_tail_recursion): ...new pass_data instance and...
+ (make_pass_tail_recursion): ...new function.
+ (pass_tail_calls): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_tail_calls): ...new pass_data instance and...
+ (make_pass_tail_calls): ...new function.
+ * tree-vect-generic.c (pass_lower_vector): Convert from a global
+ struct to a subclass of gimple_opt_pass along with...
+ (pass_data_lower_vector): ...new pass_data instance and...
+ (make_pass_lower_vector): ...new function.
+ (pass_lower_vector_ssa): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_lower_vector_ssa): ...new pass_data instance and...
+ (make_pass_lower_vector_ssa): ...new function.
+ * tree-vectorizer.c (pass_slp_vectorize): Convert from a global struct
+ to a subclass of gimple_opt_pass along with...
+ (pass_data_slp_vectorize): ...new pass_data instance and...
+ (make_pass_slp_vectorize): ...new function.
+ (pass_ipa_increase_alignment): Convert from a global struct to a
+ subclass of simple_ipa_opt_pass along with...
+ (pass_data_ipa_increase_alignment): ...new pass_data instance and...
+ (make_pass_ipa_increase_alignment): ...new function.
+ * tree-vrp.c (pass_vrp): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_vrp): ...new pass_data instance and...
+ (make_pass_vrp): ...new function.
+ * tree.c (pass_ipa_free_lang_data): Convert from a global struct to a
+ subclass of simple_ipa_opt_pass along with...
+ (pass_data_ipa_free_lang_data): ...new pass_data instance and...
+ (make_pass_ipa_free_lang_data): ...new function.
+ * tsan.c (pass_tsan): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_tsan): ...new pass_data instance and...
+ (make_pass_tsan): ...new function.
+ (pass_tsan_O0): Convert from a global struct to a subclass of
+ gimple_opt_pass along with...
+ (pass_data_tsan_O0): ...new pass_data instance and...
+ (make_pass_tsan_O0): ...new function.
+ * var-tracking.c (pass_variable_tracking): Convert from a global
+ struct to a subclass of rtl_opt_pass along with...
+ (pass_data_variable_tracking): ...new pass_data instance and...
+ (make_pass_variable_tracking): ...new function.
+ * web.c (pass_web): Convert from a global struct to a subclass of
+ rtl_opt_pass along with...
+ (pass_data_web): ...new pass_data instance and...
+ (make_pass_web): ...new function.
+ * config/epiphany/epiphany.h (pass_mode_switch_use): Replace
+ declaration with that of...
+ (make_pass_mode_switch_use): ...new function.
+ (pass_resolve_sw_modes): Replace declaration with that of...
+ (make_pass_resolve_sw_modes): ...new function.
+ * config/epiphany/mode-switch-use.c (pass_mode_switch_use): Convert
+ from a global struct to a subclass of rtl_opt_pass along with...
+ (pass_data_mode_switch_use): ...new pass_data instance and...
+ (make_pass_mode_switch_use): ...new function.
+ * config/epiphany/resolve-sw-modes.c (pass_resolve_sw_modes): Convert
+ from a global struct to a subclass of rtl_opt_pass along with...
+ (pass_data_resolve_sw_modes): ...new pass_data instance and...
+ (make_pass_resolve_sw_modes): ...new function.
+ * config/i386/i386.c (pass_insert_vzeroupper): Convert from a global
+ struct to a subclass of rtl_opt_pass along with...
+ (pass_data_insert_vzeroupper): ...new pass_data instance and...
+ (make_pass_insert_vzeroupper): ...new function.
+ * config/sparc/sparc.c (pass_work_around_errata): Convert from a
+ global struct to a subclass of rtl_opt_pass along with...
+ (pass_data_work_around_errata): ...new pass_data instance and...
+ (make_pass_work_around_errata): ...new function.
+ * config/mips/mips.c (pass_mips_machine_reorg2): Convert from a global
+ struct to a subclass of rtl_opt_pass along with...
+ (pass_data_mips_machine_reorg2): ...new pass_data instance and...
+ (make_pass_mips_machine_reorg2): ...new function.
+
+2013-08-05 David Malcolm <dmalcolm@redhat.com>
+
* passes.c (pass_manager::operator new): New.
2013-08-05 David Malcolm <dmalcolm@redhat.com>
diff --git a/gcc/asan.c b/gcc/asan.c
index ecc5905082a..78321b0ed39 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -2241,52 +2241,89 @@ gate_asan (void)
DECL_ATTRIBUTES (current_function_decl));
}
-struct gimple_opt_pass pass_asan =
+namespace {
+
+const pass_data pass_data_asan =
{
- {
- GIMPLE_PASS,
- "asan", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_asan, /* gate */
- asan_instrument, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_ssa | PROP_cfg | PROP_gimple_leh,/* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_flow | TODO_verify_stmts
- | TODO_update_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "asan", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ ( PROP_ssa | PROP_cfg | PROP_gimple_leh ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_flow | TODO_verify_stmts
+ | TODO_update_ssa ), /* todo_flags_finish */
};
+class pass_asan : public gimple_opt_pass
+{
+public:
+ pass_asan(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_asan, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_asan (ctxt_); }
+ bool gate () { return gate_asan (); }
+ unsigned int execute () { return asan_instrument (); }
+
+}; // class pass_asan
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_asan (gcc::context *ctxt)
+{
+ return new pass_asan (ctxt);
+}
+
static bool
gate_asan_O0 (void)
{
return !optimize && gate_asan ();
}
-struct gimple_opt_pass pass_asan_O0 =
+namespace {
+
+const pass_data pass_data_asan_O0 =
{
- {
- GIMPLE_PASS,
- "asan0", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_asan_O0, /* gate */
- asan_instrument, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_ssa | PROP_cfg | PROP_gimple_leh,/* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_flow | TODO_verify_stmts
- | TODO_update_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "asan0", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ ( PROP_ssa | PROP_cfg | PROP_gimple_leh ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_flow | TODO_verify_stmts
+ | TODO_update_ssa ), /* todo_flags_finish */
};
+class pass_asan_O0 : public gimple_opt_pass
+{
+public:
+ pass_asan_O0(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_asan_O0, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_asan_O0 (); }
+ unsigned int execute () { return asan_instrument (); }
+
+}; // class pass_asan_O0
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_asan_O0 (gcc::context *ctxt)
+{
+ return new pass_asan_O0 (ctxt);
+}
+
#include "gt-asan.h"
diff --git a/gcc/auto-inc-dec.c b/gcc/auto-inc-dec.c
index 6119bb6e757..0d92b1d79b5 100644
--- a/gcc/auto-inc-dec.c
+++ b/gcc/auto-inc-dec.c
@@ -1506,22 +1506,40 @@ gate_auto_inc_dec (void)
}
-struct rtl_opt_pass pass_inc_dec =
+namespace {
+
+const pass_data pass_data_inc_dec =
{
- {
- RTL_PASS,
- "auto_inc_dec", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_auto_inc_dec, /* gate */
- rest_of_handle_auto_inc_dec, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_AUTO_INC_DEC, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish, /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "auto_inc_dec", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_AUTO_INC_DEC, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_df_finish, /* todo_flags_finish */
};
+
+class pass_inc_dec : public rtl_opt_pass
+{
+public:
+ pass_inc_dec(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_inc_dec, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_auto_inc_dec (); }
+ unsigned int execute () { return rest_of_handle_auto_inc_dec (); }
+
+}; // class pass_inc_dec
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_inc_dec (gcc::context *ctxt)
+{
+ return new pass_inc_dec (ctxt);
+}
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 2cbeb6ae9f3..526ede632d4 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -2179,26 +2179,44 @@ rest_of_handle_reorder_blocks (void)
return 0;
}
-struct rtl_opt_pass pass_reorder_blocks =
+namespace {
+
+const pass_data pass_data_reorder_blocks =
{
- {
- RTL_PASS,
- "bbro", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_reorder_blocks, /* gate */
- rest_of_handle_reorder_blocks, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_REORDER_BLOCKS, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_rtl_sharing, /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "bbro", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_REORDER_BLOCKS, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_rtl_sharing, /* todo_flags_finish */
};
+class pass_reorder_blocks : public rtl_opt_pass
+{
+public:
+ pass_reorder_blocks(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_reorder_blocks, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_reorder_blocks (); }
+ unsigned int execute () { return rest_of_handle_reorder_blocks (); }
+
+}; // class pass_reorder_blocks
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_reorder_blocks (gcc::context *ctxt)
+{
+ return new pass_reorder_blocks (ctxt);
+}
+
/* Duplicate the blocks containing computed gotos. This basically unfactors
computed gotos that were factored early on in the compilation process to
speed up edge based data flow. We used to not unfactoring them again,
@@ -2327,26 +2345,44 @@ done:
return 0;
}
-struct rtl_opt_pass pass_duplicate_computed_gotos =
+namespace {
+
+const pass_data pass_data_duplicate_computed_gotos =
{
- {
- RTL_PASS,
- "compgotos", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_duplicate_computed_gotos, /* gate */
- duplicate_computed_gotos, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_REORDER_BLOCKS, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_rtl_sharing,/* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "compgotos", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_REORDER_BLOCKS, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_rtl_sharing, /* todo_flags_finish */
};
+class pass_duplicate_computed_gotos : public rtl_opt_pass
+{
+public:
+ pass_duplicate_computed_gotos(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_duplicate_computed_gotos, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_duplicate_computed_gotos (); }
+ unsigned int execute () { return duplicate_computed_gotos (); }
+
+}; // class pass_duplicate_computed_gotos
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_duplicate_computed_gotos (gcc::context *ctxt)
+{
+ return new pass_duplicate_computed_gotos (ctxt);
+}
+
static bool
gate_handle_partition_blocks (void)
{
@@ -2533,22 +2569,40 @@ partition_hot_cold_basic_blocks (void)
return TODO_verify_flow | TODO_verify_rtl_sharing;
}
-struct rtl_opt_pass pass_partition_blocks =
+namespace {
+
+const pass_data pass_data_partition_blocks =
{
- {
- RTL_PASS,
- "bbpart", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_partition_blocks, /* gate */
- partition_hot_cold_basic_blocks, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_REORDER_BLOCKS, /* tv_id */
- PROP_cfglayout, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "bbpart", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_REORDER_BLOCKS, /* tv_id */
+ PROP_cfglayout, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_partition_blocks : public rtl_opt_pass
+{
+public:
+ pass_partition_blocks(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_partition_blocks, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_partition_blocks (); }
+ unsigned int execute () { return partition_hot_cold_basic_blocks (); }
+
+}; // class pass_partition_blocks
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_partition_blocks (gcc::context *ctxt)
+{
+ return new pass_partition_blocks (ctxt);
+}
diff --git a/gcc/bt-load.c b/gcc/bt-load.c
index 9ca1bd98dcd..b53435680ec 100644
--- a/gcc/bt-load.c
+++ b/gcc/bt-load.c
@@ -1504,26 +1504,46 @@ rest_of_handle_branch_target_load_optimize1 (void)
return 0;
}
-struct rtl_opt_pass pass_branch_target_load_optimize1 =
+namespace {
+
+const pass_data pass_data_branch_target_load_optimize1 =
{
- {
- RTL_PASS,
- "btl1", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_branch_target_load_optimize1, /* gate */
- rest_of_handle_branch_target_load_optimize1, /* 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 */
- TODO_verify_rtl_sharing, /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "btl1", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_rtl_sharing, /* todo_flags_finish */
};
+class pass_branch_target_load_optimize1 : public rtl_opt_pass
+{
+public:
+ pass_branch_target_load_optimize1(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_branch_target_load_optimize1, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_branch_target_load_optimize1 (); }
+ unsigned int execute () {
+ return rest_of_handle_branch_target_load_optimize1 ();
+ }
+
+}; // class pass_branch_target_load_optimize1
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_branch_target_load_optimize1 (gcc::context *ctxt)
+{
+ return new pass_branch_target_load_optimize1 (ctxt);
+}
+
static bool
gate_handle_branch_target_load_optimize2 (void)
{
@@ -1553,22 +1573,42 @@ rest_of_handle_branch_target_load_optimize2 (void)
return 0;
}
-struct rtl_opt_pass pass_branch_target_load_optimize2 =
+namespace {
+
+const pass_data pass_data_branch_target_load_optimize2 =
{
- {
- RTL_PASS,
- "btl2", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_branch_target_load_optimize2, /* gate */
- rest_of_handle_branch_target_load_optimize2, /* 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 */
- }
+ RTL_PASS, /* type */
+ "btl2", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* 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_branch_target_load_optimize2 : public rtl_opt_pass
+{
+public:
+ pass_branch_target_load_optimize2(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_branch_target_load_optimize2, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_branch_target_load_optimize2 (); }
+ unsigned int execute () {
+ return rest_of_handle_branch_target_load_optimize2 ();
+ }
+
+}; // class pass_branch_target_load_optimize2
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_branch_target_load_optimize2 (gcc::context *ctxt)
+{
+ return new pass_branch_target_load_optimize2 (ctxt);
+}
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 99e0baa756e..f4f58cb588d 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -3040,25 +3040,42 @@ execute_jump (void)
return 0;
}
-struct rtl_opt_pass pass_jump =
+namespace {
+
+const pass_data pass_data_jump =
{
- {
- RTL_PASS,
- "jump", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- execute_jump, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_JUMP, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_rtl_sharing, /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "jump", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_JUMP, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_rtl_sharing, /* todo_flags_finish */
};
+
+class pass_jump : public rtl_opt_pass
+{
+public:
+ pass_jump(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_jump, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return execute_jump (); }
+
+}; // class pass_jump
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_jump (gcc::context *ctxt)
+{
+ return new pass_jump (ctxt);
+}
static unsigned int
execute_jump2 (void)
@@ -3067,22 +3084,39 @@ execute_jump2 (void)
return 0;
}
-struct rtl_opt_pass pass_jump2 =
+namespace {
+
+const pass_data pass_data_jump2 =
{
- {
- RTL_PASS,
- "jump2", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- execute_jump2, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_JUMP, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_rtl_sharing, /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "jump2", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_JUMP, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_rtl_sharing, /* todo_flags_finish */
};
+
+class pass_jump2 : public rtl_opt_pass
+{
+public:
+ pass_jump2(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_jump2, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return execute_jump2 (); }
+
+}; // class pass_jump2
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_jump2 (gcc::context *ctxt)
+{
+ return new pass_jump2 (ctxt);
+}
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index c1872731240..a7d9170779c 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -4906,25 +4906,42 @@ gimple_expand_cfg (void)
return 0;
}
-struct rtl_opt_pass pass_expand =
+namespace {
+
+const pass_data pass_data_expand =
{
- {
- RTL_PASS,
- "expand", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- gimple_expand_cfg, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_EXPAND, /* tv_id */
- PROP_ssa | PROP_gimple_leh | PROP_cfg
+ RTL_PASS, /* type */
+ "expand", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_EXPAND, /* tv_id */
+ ( PROP_ssa | PROP_gimple_leh | PROP_cfg
| PROP_gimple_lcx
- | PROP_gimple_lvec, /* properties_required */
- PROP_rtl, /* properties_provided */
- PROP_ssa | PROP_trees, /* properties_destroyed */
- TODO_verify_ssa | TODO_verify_flow
- | TODO_verify_stmts, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ | PROP_gimple_lvec ), /* properties_required */
+ PROP_rtl, /* properties_provided */
+ ( PROP_ssa | PROP_trees ), /* properties_destroyed */
+ ( TODO_verify_ssa | TODO_verify_flow
+ | TODO_verify_stmts ), /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_expand : public rtl_opt_pass
+{
+public:
+ pass_expand(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_expand, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return gimple_expand_cfg (); }
+
+}; // class pass_expand
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_expand (gcc::context *ctxt)
+{
+ return new pass_expand (ctxt);
+}
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 36438b8409b..610fccc46dd 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -459,26 +459,43 @@ rest_of_pass_free_cfg (void)
return 0;
}
-struct rtl_opt_pass pass_free_cfg =
+namespace {
+
+const pass_data pass_data_free_cfg =
{
- {
- RTL_PASS,
- "*free_cfg", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- rest_of_pass_free_cfg, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- PROP_cfg, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0, /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "*free_cfg", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ PROP_cfg, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_free_cfg : public rtl_opt_pass
+{
+public:
+ pass_free_cfg(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_free_cfg, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return rest_of_pass_free_cfg (); }
+
+}; // class pass_free_cfg
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_free_cfg (gcc::context *ctxt)
+{
+ return new pass_free_cfg (ctxt);
+}
+
/* Return RTX to emit after when we want to emit code on the entry of function. */
rtx
entry_of_function (void)
@@ -3297,45 +3314,79 @@ outof_cfg_layout_mode (void)
return 0;
}
-struct rtl_opt_pass pass_into_cfg_layout_mode =
+namespace {
+
+const pass_data pass_data_into_cfg_layout_mode =
{
- {
- RTL_PASS,
- "into_cfglayout", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- into_cfg_layout_mode, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_CFG, /* tv_id */
- 0, /* properties_required */
- PROP_cfglayout, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "into_cfglayout", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_CFG, /* tv_id */
+ 0, /* properties_required */
+ PROP_cfglayout, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
-struct rtl_opt_pass pass_outof_cfg_layout_mode =
+class pass_into_cfg_layout_mode : public rtl_opt_pass
{
- {
- RTL_PASS,
- "outof_cfglayout", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- outof_cfg_layout_mode, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_CFG, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- PROP_cfglayout, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+public:
+ pass_into_cfg_layout_mode(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_into_cfg_layout_mode, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return into_cfg_layout_mode (); }
+
+}; // class pass_into_cfg_layout_mode
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_into_cfg_layout_mode (gcc::context *ctxt)
+{
+ return new pass_into_cfg_layout_mode (ctxt);
+}
+
+namespace {
+
+const pass_data pass_data_outof_cfg_layout_mode =
+{
+ RTL_PASS, /* type */
+ "outof_cfglayout", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_CFG, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ PROP_cfglayout, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_outof_cfg_layout_mode : public rtl_opt_pass
+{
+public:
+ pass_outof_cfg_layout_mode(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_outof_cfg_layout_mode, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return outof_cfg_layout_mode (); }
+
+}; // class pass_outof_cfg_layout_mode
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_outof_cfg_layout_mode (gcc::context *ctxt)
+{
+ return new pass_outof_cfg_layout_mode (ctxt);
+}
/* Link the basic blocks in the correct order, compacting the basic
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c
index fb1515d6037..a7872dea9e1 100644
--- a/gcc/cgraphbuild.c
+++ b/gcc/cgraphbuild.c
@@ -370,26 +370,43 @@ build_cgraph_edges (void)
return 0;
}
-struct gimple_opt_pass pass_build_cgraph_edges =
+namespace {
+
+const pass_data pass_data_build_cgraph_edges =
{
- {
- GIMPLE_PASS,
- "*build_cgraph_edges", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- build_cgraph_edges, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "*build_cgraph_edges", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_build_cgraph_edges : public gimple_opt_pass
+{
+public:
+ pass_build_cgraph_edges(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_build_cgraph_edges, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return build_cgraph_edges (); }
+
+}; // class pass_build_cgraph_edges
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_build_cgraph_edges (gcc::context *ctxt)
+{
+ return new pass_build_cgraph_edges (ctxt);
+}
+
/* Record references to functions and other variables present in the
initial value of DECL, a variable.
When ONLY_VARS is true, we mark needed only variables, not functions. */
@@ -478,26 +495,44 @@ cgraph_rebuild_references (void)
record_eh_tables (node, cfun);
}
-struct gimple_opt_pass pass_rebuild_cgraph_edges =
+namespace {
+
+const pass_data pass_data_rebuild_cgraph_edges =
{
- {
- GIMPLE_PASS,
- "*rebuild_cgraph_edges", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- rebuild_cgraph_edges, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_CGRAPH, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0, /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "*rebuild_cgraph_edges", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_CGRAPH, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_rebuild_cgraph_edges : public gimple_opt_pass
+{
+public:
+ pass_rebuild_cgraph_edges(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_rebuild_cgraph_edges, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_rebuild_cgraph_edges (ctxt_); }
+ unsigned int execute () { return rebuild_cgraph_edges (); }
+
+}; // class pass_rebuild_cgraph_edges
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_rebuild_cgraph_edges (gcc::context *ctxt)
+{
+ return new pass_rebuild_cgraph_edges (ctxt);
+}
+
static unsigned int
remove_cgraph_callee_edges (void)
@@ -506,22 +541,42 @@ remove_cgraph_callee_edges (void)
return 0;
}
-struct gimple_opt_pass pass_remove_cgraph_callee_edges =
+namespace {
+
+const pass_data pass_data_remove_cgraph_callee_edges =
{
- {
- GIMPLE_PASS,
- "*remove_cgraph_callee_edges", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- remove_cgraph_callee_edges, /* 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 */
- }
+ GIMPLE_PASS, /* type */
+ "*remove_cgraph_callee_edges", /* 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_remove_cgraph_callee_edges : public gimple_opt_pass
+{
+public:
+ pass_remove_cgraph_callee_edges(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_remove_cgraph_callee_edges, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () {
+ return new pass_remove_cgraph_callee_edges (ctxt_);
+ }
+ unsigned int execute () { return remove_cgraph_callee_edges (); }
+
+}; // class pass_remove_cgraph_callee_edges
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_remove_cgraph_callee_edges (gcc::context *ctxt)
+{
+ return new pass_remove_cgraph_callee_edges (ctxt);
+}
diff --git a/gcc/combine-stack-adj.c b/gcc/combine-stack-adj.c
index 7392b92b3f5..be47665ebc0 100644
--- a/gcc/combine-stack-adj.c
+++ b/gcc/combine-stack-adj.c
@@ -643,22 +643,40 @@ rest_of_handle_stack_adjustments (void)
return 0;
}
-struct rtl_opt_pass pass_stack_adjustments =
+namespace {
+
+const pass_data pass_data_stack_adjustments =
{
- {
- RTL_PASS,
- "csa", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_stack_adjustments, /* gate */
- rest_of_handle_stack_adjustments, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_COMBINE_STACK_ADJUST, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "csa", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_COMBINE_STACK_ADJUST, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+
+class pass_stack_adjustments : public rtl_opt_pass
+{
+public:
+ pass_stack_adjustments(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_stack_adjustments, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_stack_adjustments (); }
+ unsigned int execute () { return rest_of_handle_stack_adjustments (); }
+
+}; // class pass_stack_adjustments
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_stack_adjustments (gcc::context *ctxt)
+{
+ return new pass_stack_adjustments (ctxt);
+}
diff --git a/gcc/combine.c b/gcc/combine.c
index 754cd341f45..d0aae69f269 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -13840,22 +13840,40 @@ rest_of_handle_combine (void)
return 0;
}
-struct rtl_opt_pass pass_combine =
+namespace {
+
+const pass_data pass_data_combine =
{
- {
- RTL_PASS,
- "combine", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_combine, /* gate */
- rest_of_handle_combine, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_COMBINE, /* tv_id */
- PROP_cfglayout, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "combine", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_COMBINE, /* tv_id */
+ PROP_cfglayout, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+
+class pass_combine : public rtl_opt_pass
+{
+public:
+ pass_combine(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_combine, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_combine (); }
+ unsigned int execute () { return rest_of_handle_combine (); }
+
+}; // class pass_combine
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_combine (gcc::context *ctxt)
+{
+ return new pass_combine (ctxt);
+}
diff --git a/gcc/compare-elim.c b/gcc/compare-elim.c
index 367cd8ea8dc..e907376c577 100644
--- a/gcc/compare-elim.c
+++ b/gcc/compare-elim.c
@@ -651,24 +651,41 @@ gate_compare_elim_after_reload (void)
return flag_compare_elim_after_reload;
}
-struct rtl_opt_pass pass_compare_elim_after_reload =
+namespace {
+
+const pass_data pass_data_compare_elim_after_reload =
{
- {
- RTL_PASS,
- "cmpelim", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_compare_elim_after_reload, /* gate */
- execute_compare_elim_after_reload, /* 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 */
- TODO_df_finish
- | TODO_df_verify
- | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "cmpelim", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_df_verify
+ | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+
+class pass_compare_elim_after_reload : public rtl_opt_pass
+{
+public:
+ pass_compare_elim_after_reload(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_compare_elim_after_reload, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_compare_elim_after_reload (); }
+ unsigned int execute () { return execute_compare_elim_after_reload (); }
+
+}; // class pass_compare_elim_after_reload
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_compare_elim_after_reload (gcc::context *ctxt)
+{
+ return new pass_compare_elim_after_reload (ctxt);
+}
diff --git a/gcc/config/epiphany/epiphany.h b/gcc/config/epiphany/epiphany.h
index bd84b5c793f..f16ab85dde9 100644
--- a/gcc/config/epiphany/epiphany.h
+++ b/gcc/config/epiphany/epiphany.h
@@ -929,8 +929,8 @@ enum
};
extern int epiphany_normal_fp_rounding;
-extern struct rtl_opt_pass pass_mode_switch_use;
-extern struct rtl_opt_pass pass_resolve_sw_modes;
+extern rtl_opt_pass *make_pass_mode_switch_use (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_resolve_sw_modes (gcc::context *ctxt);
/* This will need to be adjusted when FP_CONTRACT_ON is properly
implemented. */
diff --git a/gcc/config/epiphany/mode-switch-use.c b/gcc/config/epiphany/mode-switch-use.c
index 66529636801..8e278583215 100644
--- a/gcc/config/epiphany/mode-switch-use.c
+++ b/gcc/config/epiphany/mode-switch-use.c
@@ -71,22 +71,39 @@ insert_uses (void)
return 0;
}
-struct rtl_opt_pass pass_mode_switch_use =
+namespace {
+
+const pass_data pass_data_mode_switch_use =
{
- {
- RTL_PASS,
- "mode_switch_use", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- insert_uses, /* 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 */
- }
+ RTL_PASS, /* type */
+ "mode_switch_use", /* 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_mode_switch_use : public rtl_opt_pass
+{
+public:
+ pass_mode_switch_use(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_mode_switch_use, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return insert_uses (); }
+
+}; // class pass_mode_switch_use
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_mode_switch_use (gcc::context *ctxt)
+{
+ return new pass_mode_switch_use (ctxt);
+}
diff --git a/gcc/config/epiphany/resolve-sw-modes.c b/gcc/config/epiphany/resolve-sw-modes.c
index 729a0ffc9b7..b43b4d953cd 100644
--- a/gcc/config/epiphany/resolve-sw-modes.c
+++ b/gcc/config/epiphany/resolve-sw-modes.c
@@ -161,23 +161,40 @@ resolve_sw_modes (void)
return 0;
}
-struct rtl_opt_pass pass_resolve_sw_modes =
+namespace {
+
+const pass_data pass_data_resolve_sw_modes =
{
- {
- RTL_PASS,
- "resolve_sw_modes", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_resolve_sw_modes, /* gate */
- resolve_sw_modes, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_MODE_SWITCH, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- 0 /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "resolve_sw_modes", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_MODE_SWITCH, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing | 0 ), /* todo_flags_finish */
};
+
+class pass_resolve_sw_modes : public rtl_opt_pass
+{
+public:
+ pass_resolve_sw_modes(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_resolve_sw_modes, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_resolve_sw_modes (); }
+ unsigned int execute () { return resolve_sw_modes (); }
+
+}; // class pass_resolve_sw_modes
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_resolve_sw_modes (gcc::context *ctxt)
+{
+ return new pass_resolve_sw_modes (ctxt);
+}
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index cce3c9c80e8..a85a13cd7c0 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -2602,27 +2602,44 @@ rest_of_handle_insert_vzeroupper (void)
return 0;
}
-struct rtl_opt_pass pass_insert_vzeroupper =
-{
- {
- RTL_PASS,
- "vzeroupper", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_insert_vzeroupper, /* gate */
- rest_of_handle_insert_vzeroupper, /* 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 */
- TODO_df_finish | TODO_verify_rtl_sharing |
- 0, /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_insert_vzeroupper =
+{
+ RTL_PASS, /* type */
+ "vzeroupper", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing | 0 ), /* todo_flags_finish */
};
+class pass_insert_vzeroupper : public rtl_opt_pass
+{
+public:
+ pass_insert_vzeroupper(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_insert_vzeroupper, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_insert_vzeroupper (); }
+ unsigned int execute () { return rest_of_handle_insert_vzeroupper (); }
+
+}; // class pass_insert_vzeroupper
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_insert_vzeroupper (gcc::context *ctxt)
+{
+ return new pass_insert_vzeroupper (ctxt);
+}
+
/* Return true if a red-zone is in use. */
static inline bool
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 46e1d2d7c21..05ba003b7bd 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -16337,26 +16337,43 @@ mips_machine_reorg2 (void)
return 0;
}
-struct rtl_opt_pass pass_mips_machine_reorg2 =
-{
- {
- RTL_PASS,
- "mach2", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- mips_machine_reorg2, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_MACH_DEP, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_rtl_sharing, /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_mips_machine_reorg2 =
+{
+ RTL_PASS, /* type */
+ "mach2", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_MACH_DEP, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_rtl_sharing, /* todo_flags_finish */
};
+class pass_mips_machine_reorg2 : public rtl_opt_pass
+{
+public:
+ pass_mips_machine_reorg2(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_mips_machine_reorg2, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return mips_machine_reorg2 (); }
+
+}; // class pass_mips_machine_reorg2
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_mips_machine_reorg2 (gcc::context *ctxt)
+{
+ return new pass_mips_machine_reorg2 (ctxt);
+}
+
struct register_pass_info insert_pass_mips_machine_reorg2 =
{
&pass_mips_machine_reorg2.pass, /* pass */
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 87cfacaa72c..66c33f7212d 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -1000,26 +1000,44 @@ sparc_do_work_around_errata (void)
return 0;
}
-struct rtl_opt_pass pass_work_around_errata =
-{
- {
- RTL_PASS,
- "errata", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- sparc_gate_work_around_errata, /* gate */
- sparc_do_work_around_errata, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_MACH_DEP, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_rtl_sharing, /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_work_around_errata =
+{
+ RTL_PASS, /* type */
+ "errata", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_MACH_DEP, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_rtl_sharing, /* todo_flags_finish */
};
+class pass_work_around_errata : public rtl_opt_pass
+{
+public:
+ pass_work_around_errata(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_work_around_errata, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return sparc_gate_work_around_errata (); }
+ unsigned int execute () { return sparc_do_work_around_errata (); }
+
+}; // class pass_work_around_errata
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_work_around_errata (gcc::context *ctxt)
+{
+ return new pass_work_around_errata (ctxt);
+}
+
struct register_pass_info insert_pass_work_around_errata =
{
&pass_work_around_errata.pass, /* pass */
diff --git a/gcc/cprop.c b/gcc/cprop.c
index 6a6b5f1fd10..3518fd839ce 100644
--- a/gcc/cprop.c
+++ b/gcc/cprop.c
@@ -1913,23 +1913,42 @@ execute_rtl_cprop (void)
return 0;
}
-struct rtl_opt_pass pass_rtl_cprop =
+namespace {
+
+const pass_data pass_data_rtl_cprop =
{
- {
- RTL_PASS,
- "cprop", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_rtl_cprop, /* gate */
- execute_rtl_cprop, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_CPROP, /* tv_id */
- PROP_cfglayout, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_verify_flow /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "cprop", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_CPROP, /* tv_id */
+ PROP_cfglayout, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing
+ | TODO_verify_flow ), /* todo_flags_finish */
};
+
+class pass_rtl_cprop : public rtl_opt_pass
+{
+public:
+ pass_rtl_cprop(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_rtl_cprop, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_rtl_cprop (ctxt_); }
+ bool gate () { return gate_rtl_cprop (); }
+ unsigned int execute () { return execute_rtl_cprop (); }
+
+}; // class pass_rtl_cprop
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rtl_cprop (gcc::context *ctxt)
+{
+ return new pass_rtl_cprop (ctxt);
+}
diff --git a/gcc/cse.c b/gcc/cse.c
index 31a1cd03f66..ee1b7be1170 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -7449,27 +7449,45 @@ rest_of_handle_cse (void)
return 0;
}
-struct rtl_opt_pass pass_cse =
+namespace {
+
+const pass_data pass_data_cse =
{
- {
- RTL_PASS,
- "cse1", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_cse, /* gate */
- rest_of_handle_cse, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_CSE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_verify_flow /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "cse1", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_CSE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing
+ | TODO_verify_flow ), /* todo_flags_finish */
};
+class pass_cse : public rtl_opt_pass
+{
+public:
+ pass_cse(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_cse, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_cse (); }
+ unsigned int execute () { return rest_of_handle_cse (); }
+
+}; // class pass_cse
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_cse (gcc::context *ctxt)
+{
+ return new pass_cse (ctxt);
+}
+
static bool
gate_handle_cse2 (void)
@@ -7511,27 +7529,45 @@ rest_of_handle_cse2 (void)
}
-struct rtl_opt_pass pass_cse2 =
+namespace {
+
+const pass_data pass_data_cse2 =
{
- {
- RTL_PASS,
- "cse2", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_cse2, /* gate */
- rest_of_handle_cse2, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_CSE2, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_verify_flow /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "cse2", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_CSE2, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing
+ | TODO_verify_flow ), /* todo_flags_finish */
};
+class pass_cse2 : public rtl_opt_pass
+{
+public:
+ pass_cse2(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_cse2, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_cse2 (); }
+ unsigned int execute () { return rest_of_handle_cse2 (); }
+
+}; // class pass_cse2
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_cse2 (gcc::context *ctxt)
+{
+ return new pass_cse2 (ctxt);
+}
+
static bool
gate_handle_cse_after_global_opts (void)
{
@@ -7571,23 +7607,43 @@ rest_of_handle_cse_after_global_opts (void)
return 0;
}
-struct rtl_opt_pass pass_cse_after_global_opts =
+namespace {
+
+const pass_data pass_data_cse_after_global_opts =
{
- {
- RTL_PASS,
- "cse_local", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_cse_after_global_opts, /* gate */
- rest_of_handle_cse_after_global_opts, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_CSE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_verify_flow /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "cse_local", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_CSE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing
+ | TODO_verify_flow ), /* todo_flags_finish */
};
+
+class pass_cse_after_global_opts : public rtl_opt_pass
+{
+public:
+ pass_cse_after_global_opts(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_cse_after_global_opts, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_cse_after_global_opts (); }
+ unsigned int execute () {
+ return rest_of_handle_cse_after_global_opts ();
+ }
+
+}; // class pass_cse_after_global_opts
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_cse_after_global_opts (gcc::context *ctxt)
+{
+ return new pass_cse_after_global_opts (ctxt);
+}
diff --git a/gcc/dce.c b/gcc/dce.c
index 64ed81e35e8..fa22316b5cc 100644
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -786,26 +786,44 @@ gate_ud_dce (void)
&& dbg_cnt (dce_ud);
}
-struct rtl_opt_pass pass_ud_rtl_dce =
+namespace {
+
+const pass_data pass_data_ud_rtl_dce =
{
- {
- RTL_PASS,
- "ud_dce", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_ud_dce, /* gate */
- rest_of_handle_ud_dce, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_DCE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "ud_dce", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_DCE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+class pass_ud_rtl_dce : public rtl_opt_pass
+{
+public:
+ pass_ud_rtl_dce(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_ud_rtl_dce, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_ud_dce (); }
+ unsigned int execute () { return rest_of_handle_ud_dce (); }
+
+}; // class pass_ud_rtl_dce
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_ud_rtl_dce (gcc::context *ctxt)
+{
+ return new pass_ud_rtl_dce (ctxt);
+}
+
/* -------------------------------------------------------------------------
Fast DCE functions
@@ -1201,22 +1219,40 @@ gate_fast_dce (void)
&& dbg_cnt (dce_fast);
}
-struct rtl_opt_pass pass_fast_rtl_dce =
+namespace {
+
+const pass_data pass_data_fast_rtl_dce =
{
- {
- RTL_PASS,
- "rtl_dce", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_fast_dce, /* gate */
- rest_of_handle_fast_dce, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_DCE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "rtl_dce", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_DCE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+
+class pass_fast_rtl_dce : public rtl_opt_pass
+{
+public:
+ pass_fast_rtl_dce(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_fast_rtl_dce, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_fast_dce (); }
+ unsigned int execute () { return rest_of_handle_fast_dce (); }
+
+}; // class pass_fast_rtl_dce
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_fast_rtl_dce (gcc::context *ctxt)
+{
+ return new pass_fast_rtl_dce (ctxt);
+}
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);
+}
+
diff --git a/gcc/dse.c b/gcc/dse.c
index d643cb0b4fa..8b132eb2c91 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -3729,42 +3729,78 @@ gate_dse2 (void)
&& dbg_cnt (dse2);
}
-struct rtl_opt_pass pass_rtl_dse1 =
-{
- {
- RTL_PASS,
- "dse1", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_dse1, /* gate */
- rest_of_handle_dse, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_DSE1, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_rtl_dse1 =
+{
+ RTL_PASS, /* type */
+ "dse1", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_DSE1, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
-struct rtl_opt_pass pass_rtl_dse2 =
-{
- {
- RTL_PASS,
- "dse2", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_dse2, /* gate */
- rest_of_handle_dse, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_DSE2, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+class pass_rtl_dse1 : public rtl_opt_pass
+{
+public:
+ pass_rtl_dse1(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_rtl_dse1, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_dse1 (); }
+ unsigned int execute () { return rest_of_handle_dse (); }
+
+}; // class pass_rtl_dse1
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rtl_dse1 (gcc::context *ctxt)
+{
+ return new pass_rtl_dse1 (ctxt);
+}
+
+namespace {
+
+const pass_data pass_data_rtl_dse2 =
+{
+ RTL_PASS, /* type */
+ "dse2", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_DSE2, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+
+class pass_rtl_dse2 : public rtl_opt_pass
+{
+public:
+ pass_rtl_dse2(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_rtl_dse2, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_dse2 (); }
+ unsigned int execute () { return rest_of_handle_dse (); }
+
+}; // class pass_rtl_dse2
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rtl_dse2 (gcc::context *ctxt)
+{
+ return new pass_rtl_dse2 (ctxt);
+}
diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
index 29779d6ad6a..ee8d42c9b28 100644
--- a/gcc/dwarf2cfi.c
+++ b/gcc/dwarf2cfi.c
@@ -3370,24 +3370,42 @@ gate_dwarf2_frame (void)
return dwarf2out_do_frame ();
}
-struct rtl_opt_pass pass_dwarf2_frame =
-{
- {
- RTL_PASS,
- "dwarf2", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_dwarf2_frame, /* gate */
- execute_dwarf2_frame, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_FINAL, /* 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_dwarf2_frame =
+{
+ RTL_PASS, /* type */
+ "dwarf2", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_FINAL, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_dwarf2_frame : public rtl_opt_pass
+{
+public:
+ pass_dwarf2_frame(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_dwarf2_frame, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_dwarf2_frame (); }
+ unsigned int execute () { return execute_dwarf2_frame (); }
+
+}; // class pass_dwarf2_frame
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_dwarf2_frame (gcc::context *ctxt)
+{
+ return new pass_dwarf2_frame (ctxt);
+}
+
#include "gt-dwarf2cfi.h"
diff --git a/gcc/except.c b/gcc/except.c
index b25207b4c87..2d41d7b332d 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -2001,26 +2001,43 @@ set_nothrow_function_flags (void)
return 0;
}
-struct rtl_opt_pass pass_set_nothrow_function_flags =
-{
- {
- RTL_PASS,
- "nothrow", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- set_nothrow_function_flags, /* 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_set_nothrow_function_flags =
+{
+ RTL_PASS, /* type */
+ "nothrow", /* 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_set_nothrow_function_flags : public rtl_opt_pass
+{
+public:
+ pass_set_nothrow_function_flags(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_set_nothrow_function_flags, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return set_nothrow_function_flags (); }
+
+}; // class pass_set_nothrow_function_flags
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_set_nothrow_function_flags (gcc::context *ctxt)
+{
+ return new pass_set_nothrow_function_flags (ctxt);
+}
+
/* Various hooks for unwind library. */
@@ -2615,25 +2632,43 @@ gate_convert_to_eh_region_ranges (void)
return true;
}
-struct rtl_opt_pass pass_convert_to_eh_region_ranges =
-{
- {
- RTL_PASS,
- "eh_ranges", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_convert_to_eh_region_ranges, /* gate */
- convert_to_eh_region_ranges, /* 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_convert_to_eh_region_ranges =
+{
+ RTL_PASS, /* type */
+ "eh_ranges", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* 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_convert_to_eh_region_ranges : public rtl_opt_pass
+{
+public:
+ pass_convert_to_eh_region_ranges(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_convert_to_eh_region_ranges, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_convert_to_eh_region_ranges (); }
+ unsigned int execute () { return convert_to_eh_region_ranges (); }
+
+}; // class pass_convert_to_eh_region_ranges
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_convert_to_eh_region_ranges (gcc::context *ctxt)
+{
+ return new pass_convert_to_eh_region_ranges (ctxt);
+}
static void
push_uleb128 (vec<uchar, va_gc> **data_area, unsigned int value)
diff --git a/gcc/final.c b/gcc/final.c
index d9b4408aadf..b755957bebd 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -795,26 +795,43 @@ compute_alignments (void)
return 0;
}
-struct rtl_opt_pass pass_compute_alignments =
+namespace {
+
+const pass_data pass_data_compute_alignments =
{
- {
- RTL_PASS,
- "alignments", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- compute_alignments, /* 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 */
- TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "alignments", /* 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 */
+ TODO_verify_rtl_sharing, /* todo_flags_finish */
};
+class pass_compute_alignments : public rtl_opt_pass
+{
+public:
+ pass_compute_alignments(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_compute_alignments, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return compute_alignments (); }
+
+}; // class pass_compute_alignments
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_compute_alignments (gcc::context *ctxt)
+{
+ return new pass_compute_alignments (ctxt);
+}
+
/* Make a pass over all insns and compute their actual lengths by shortening
any branches of variable length if possible. */
@@ -4409,26 +4426,43 @@ rest_of_handle_final (void)
return 0;
}
-struct rtl_opt_pass pass_final =
+namespace {
+
+const pass_data pass_data_final =
{
- {
- RTL_PASS,
- "final", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- rest_of_handle_final, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_FINAL, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "final", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_FINAL, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_final : public rtl_opt_pass
+{
+public:
+ pass_final(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_final, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return rest_of_handle_final (); }
+
+}; // class pass_final
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_final (gcc::context *ctxt)
+{
+ return new pass_final (ctxt);
+}
+
static unsigned int
rest_of_handle_shorten_branches (void)
@@ -4438,26 +4472,43 @@ rest_of_handle_shorten_branches (void)
return 0;
}
-struct rtl_opt_pass pass_shorten_branches =
+namespace {
+
+const pass_data pass_data_shorten_branches =
{
- {
- RTL_PASS,
- "shorten", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- rest_of_handle_shorten_branches, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_SHORTEN_BRANCH, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "shorten", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_SHORTEN_BRANCH, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_shorten_branches : public rtl_opt_pass
+{
+public:
+ pass_shorten_branches(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_shorten_branches, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return rest_of_handle_shorten_branches (); }
+
+}; // class pass_shorten_branches
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_shorten_branches (gcc::context *ctxt)
+{
+ return new pass_shorten_branches (ctxt);
+}
+
static unsigned int
rest_of_clean_state (void)
@@ -4585,22 +4636,39 @@ rest_of_clean_state (void)
return 0;
}
-struct rtl_opt_pass pass_clean_state =
+namespace {
+
+const pass_data pass_data_clean_state =
{
- {
- RTL_PASS,
- "*clean_state", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- rest_of_clean_state, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_FINAL, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- PROP_rtl, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "*clean_state", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_FINAL, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ PROP_rtl, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_clean_state : public rtl_opt_pass
+{
+public:
+ pass_clean_state(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_clean_state, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return rest_of_clean_state (); }
+
+}; // class pass_clean_state
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_clean_state (gcc::context *ctxt)
+{
+ return new pass_clean_state (ctxt);
+}
diff --git a/gcc/function.c b/gcc/function.c
index 953fd48b2ad..4685cb02727 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1948,26 +1948,43 @@ instantiate_virtual_regs (void)
return 0;
}
-struct rtl_opt_pass pass_instantiate_virtual_regs =
-{
- {
- RTL_PASS,
- "vregs", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- instantiate_virtual_regs, /* 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_instantiate_virtual_regs =
+{
+ RTL_PASS, /* type */
+ "vregs", /* 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_instantiate_virtual_regs : public rtl_opt_pass
+{
+public:
+ pass_instantiate_virtual_regs(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_instantiate_virtual_regs, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return instantiate_virtual_regs (); }
+
+}; // class pass_instantiate_virtual_regs
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_instantiate_virtual_regs (gcc::context *ctxt)
+{
+ return new pass_instantiate_virtual_regs (ctxt);
+}
+
/* Return 1 if EXP is an aggregate type (or a value with aggregate type).
This means a type for which function calls must pass an address to the
@@ -6973,26 +6990,43 @@ types_used_by_var_decl_insert (tree type, tree var_decl)
}
}
-struct rtl_opt_pass pass_leaf_regs =
-{
- {
- RTL_PASS,
- "*leaf_regs", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- rest_of_handle_check_leaf_regs, /* 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_leaf_regs =
+{
+ RTL_PASS, /* type */
+ "*leaf_regs", /* 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_leaf_regs : public rtl_opt_pass
+{
+public:
+ pass_leaf_regs(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_leaf_regs, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return rest_of_handle_check_leaf_regs (); }
+
+}; // class pass_leaf_regs
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_leaf_regs (gcc::context *ctxt)
+{
+ return new pass_leaf_regs (ctxt);
+}
+
static unsigned int
rest_of_handle_thread_prologue_and_epilogue (void)
{
@@ -7012,26 +7046,45 @@ rest_of_handle_thread_prologue_and_epilogue (void)
return 0;
}
-struct rtl_opt_pass pass_thread_prologue_and_epilogue =
-{
- {
- RTL_PASS,
- "pro_and_epilogue", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- rest_of_handle_thread_prologue_and_epilogue, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_THREAD_PROLOGUE_AND_EPILOGUE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- TODO_verify_flow, /* todo_flags_start */
- TODO_df_verify | TODO_df_finish
- | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_thread_prologue_and_epilogue =
+{
+ RTL_PASS, /* type */
+ "pro_and_epilogue", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_THREAD_PROLOGUE_AND_EPILOGUE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ TODO_verify_flow, /* todo_flags_start */
+ ( TODO_df_verify | TODO_df_finish
+ | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+
+class pass_thread_prologue_and_epilogue : public rtl_opt_pass
+{
+public:
+ pass_thread_prologue_and_epilogue(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_thread_prologue_and_epilogue, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () {
+ return rest_of_handle_thread_prologue_and_epilogue ();
+ }
+
+}; // class pass_thread_prologue_and_epilogue
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_thread_prologue_and_epilogue (gcc::context *ctxt)
+{
+ return new pass_thread_prologue_and_epilogue (ctxt);
+}
/* This mini-pass fixes fall-out from SSA in asm statements that have
@@ -7213,25 +7266,42 @@ rest_of_match_asm_constraints (void)
return TODO_df_finish;
}
-struct rtl_opt_pass pass_match_asm_constraints =
-{
- {
- RTL_PASS,
- "asmcons", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- rest_of_match_asm_constraints, /* 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_match_asm_constraints =
+{
+ RTL_PASS, /* type */
+ "asmcons", /* 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_match_asm_constraints : public rtl_opt_pass
+{
+public:
+ pass_match_asm_constraints(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_match_asm_constraints, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return rest_of_match_asm_constraints (); }
+
+}; // class pass_match_asm_constraints
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_match_asm_constraints (gcc::context *ctxt)
+{
+ return new pass_match_asm_constraints (ctxt);
+}
+
#include "gt-function.h"
diff --git a/gcc/fwprop.c b/gcc/fwprop.c
index 17cc62aa2e4..8fe02ac2a43 100644
--- a/gcc/fwprop.c
+++ b/gcc/fwprop.c
@@ -1485,28 +1485,45 @@ fwprop (void)
return 0;
}
-struct rtl_opt_pass pass_rtl_fwprop =
+namespace {
+
+const pass_data pass_data_rtl_fwprop =
{
- {
- RTL_PASS,
- "fwprop1", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_fwprop, /* gate */
- fwprop, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_FWPROP, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish
- | TODO_verify_flow
- | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "fwprop1", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_FWPROP, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_flow
+ | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+class pass_rtl_fwprop : public rtl_opt_pass
+{
+public:
+ pass_rtl_fwprop(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_rtl_fwprop, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_fwprop (); }
+ unsigned int execute () { return fwprop (); }
+
+}; // class pass_rtl_fwprop
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rtl_fwprop (gcc::context *ctxt)
+{
+ return new pass_rtl_fwprop (ctxt);
+}
+
static unsigned int
fwprop_addr (void)
{
@@ -1535,22 +1552,40 @@ fwprop_addr (void)
return 0;
}
-struct rtl_opt_pass pass_rtl_fwprop_addr =
+namespace {
+
+const pass_data pass_data_rtl_fwprop_addr =
{
- {
- RTL_PASS,
- "fwprop2", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_fwprop, /* gate */
- fwprop_addr, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_FWPROP, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "fwprop2", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_FWPROP, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+
+class pass_rtl_fwprop_addr : public rtl_opt_pass
+{
+public:
+ pass_rtl_fwprop_addr(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_rtl_fwprop_addr, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_fwprop (); }
+ unsigned int execute () { return fwprop_addr (); }
+
+}; // class pass_rtl_fwprop_addr
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rtl_fwprop_addr (gcc::context *ctxt)
+{
+ return new pass_rtl_fwprop_addr (ctxt);
+}
diff --git a/gcc/gcse.c b/gcc/gcse.c
index ec80e8bde47..422d6f060eb 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -4148,46 +4148,82 @@ execute_rtl_hoist (void)
return 0;
}
-struct rtl_opt_pass pass_rtl_pre =
+namespace {
+
+const pass_data pass_data_rtl_pre =
{
- {
- RTL_PASS,
- "rtl pre", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_rtl_pre, /* gate */
- execute_rtl_pre, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_PRE, /* tv_id */
- PROP_cfglayout, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_verify_flow /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "rtl pre", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_PRE, /* tv_id */
+ PROP_cfglayout, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing
+ | TODO_verify_flow ), /* todo_flags_finish */
};
-struct rtl_opt_pass pass_rtl_hoist =
+class pass_rtl_pre : public rtl_opt_pass
+{
+public:
+ pass_rtl_pre(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_rtl_pre, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_rtl_pre (); }
+ unsigned int execute () { return execute_rtl_pre (); }
+
+}; // class pass_rtl_pre
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rtl_pre (gcc::context *ctxt)
+{
+ return new pass_rtl_pre (ctxt);
+}
+
+namespace {
+
+const pass_data pass_data_rtl_hoist =
{
- {
- RTL_PASS,
- "hoist", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_rtl_hoist, /* gate */
- execute_rtl_hoist, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_HOIST, /* tv_id */
- PROP_cfglayout, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_verify_flow /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "hoist", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_HOIST, /* tv_id */
+ PROP_cfglayout, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing
+ | TODO_verify_flow ), /* todo_flags_finish */
};
+class pass_rtl_hoist : public rtl_opt_pass
+{
+public:
+ pass_rtl_hoist(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_rtl_hoist, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_rtl_hoist (); }
+ unsigned int execute () { return execute_rtl_hoist (); }
+
+}; // class pass_rtl_hoist
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rtl_hoist (gcc::context *ctxt)
+{
+ return new pass_rtl_hoist (ctxt);
+}
+
#include "gt-gcse.h"
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index 64cc031785d..2884b6ff6fb 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -177,26 +177,43 @@ lower_function_body (void)
return 0;
}
-struct gimple_opt_pass pass_lower_cf =
+namespace {
+
+const pass_data pass_data_lower_cf =
{
- {
- GIMPLE_PASS,
- "lower", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- lower_function_body, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_gimple_any, /* properties_required */
- PROP_gimple_lcf, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "lower", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_gimple_any, /* properties_required */
+ PROP_gimple_lcf, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_lower_cf : public gimple_opt_pass
+{
+public:
+ pass_lower_cf(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_lower_cf, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return lower_function_body (); }
+
+}; // class pass_lower_cf
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_lower_cf (gcc::context *ctxt)
+{
+ return new pass_lower_cf (ctxt);
+}
+
/* Verify if the type of the argument matches that of the function
diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c
index 4a0d631722a..c6f305c35ea 100644
--- a/gcc/gimple-ssa-strength-reduction.c
+++ b/gcc/gimple-ssa-strength-reduction.c
@@ -3478,22 +3478,40 @@ gate_strength_reduction (void)
return flag_tree_slsr;
}
-struct gimple_opt_pass pass_strength_reduction =
-{
- {
- GIMPLE_PASS,
- "slsr", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_strength_reduction, /* gate */
- execute_strength_reduction, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_GIMPLE_SLSR, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_strength_reduction =
+{
+ GIMPLE_PASS, /* type */
+ "slsr", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_GIMPLE_SLSR, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
+
+class pass_strength_reduction : public gimple_opt_pass
+{
+public:
+ pass_strength_reduction(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_strength_reduction, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_strength_reduction (); }
+ unsigned int execute () { return execute_strength_reduction (); }
+
+}; // class pass_strength_reduction
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_strength_reduction (gcc::context *ctxt)
+{
+ return new pass_strength_reduction (ctxt);
+}
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index b149d54c793..5698b4f5e72 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -4480,27 +4480,44 @@ rest_of_handle_if_conversion (void)
return 0;
}
-struct rtl_opt_pass pass_rtl_ifcvt =
+namespace {
+
+const pass_data pass_data_rtl_ifcvt =
{
- {
- RTL_PASS,
- "ce1", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_if_conversion, /* gate */
- rest_of_handle_if_conversion, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IFCVT, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- 0 /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "ce1", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IFCVT, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing | 0 ), /* todo_flags_finish */
};
+class pass_rtl_ifcvt : public rtl_opt_pass
+{
+public:
+ pass_rtl_ifcvt(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_rtl_ifcvt, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_if_conversion (); }
+ unsigned int execute () { return rest_of_handle_if_conversion (); }
+
+}; // class pass_rtl_ifcvt
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rtl_ifcvt (gcc::context *ctxt)
+{
+ return new pass_rtl_ifcvt (ctxt);
+}
+
static bool
gate_handle_if_after_combine (void)
{
@@ -4518,26 +4535,44 @@ rest_of_handle_if_after_combine (void)
return 0;
}
-struct rtl_opt_pass pass_if_after_combine =
+namespace {
+
+const pass_data pass_data_if_after_combine =
{
- {
- RTL_PASS,
- "ce2", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_if_after_combine, /* gate */
- rest_of_handle_if_after_combine, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IFCVT, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "ce2", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IFCVT, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+class pass_if_after_combine : public rtl_opt_pass
+{
+public:
+ pass_if_after_combine(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_if_after_combine, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_if_after_combine (); }
+ unsigned int execute () { return rest_of_handle_if_after_combine (); }
+
+}; // class pass_if_after_combine
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_if_after_combine (gcc::context *ctxt)
+{
+ return new pass_if_after_combine (ctxt);
+}
+
static bool
gate_handle_if_after_reload (void)
@@ -4554,22 +4589,40 @@ rest_of_handle_if_after_reload (void)
}
-struct rtl_opt_pass pass_if_after_reload =
+namespace {
+
+const pass_data pass_data_if_after_reload =
{
- {
- RTL_PASS,
- "ce3", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_if_after_reload, /* gate */
- rest_of_handle_if_after_reload, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IFCVT2, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "ce3", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IFCVT2, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+
+class pass_if_after_reload : public rtl_opt_pass
+{
+public:
+ pass_if_after_reload(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_if_after_reload, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_if_after_reload (); }
+ unsigned int execute () { return rest_of_handle_if_after_reload (); }
+
+}; // class pass_if_after_reload
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_if_after_reload (gcc::context *ctxt)
+{
+ return new pass_if_after_reload (ctxt);
+}
diff --git a/gcc/init-regs.c b/gcc/init-regs.c
index 270d39b1628..ddb0b3792ba 100644
--- a/gcc/init-regs.c
+++ b/gcc/init-regs.c
@@ -138,22 +138,40 @@ rest_of_handle_initialize_regs (void)
return 0;
}
-struct rtl_opt_pass pass_initialize_regs =
+namespace {
+
+const pass_data pass_data_initialize_regs =
{
- {
- RTL_PASS,
- "init-regs", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_initialize_regs, /* gate */
- rest_of_handle_initialize_regs, /* 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 */
- TODO_df_finish /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "init-regs", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_df_finish, /* todo_flags_finish */
};
+
+class pass_initialize_regs : public rtl_opt_pass
+{
+public:
+ pass_initialize_regs(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_initialize_regs, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_initialize_regs (); }
+ unsigned int execute () { return rest_of_handle_initialize_regs (); }
+
+}; // class pass_initialize_regs
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_initialize_regs (gcc::context *ctxt)
+{
+ return new pass_initialize_regs (ctxt);
+}
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index b463a62f72a..688209dd49c 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -3652,32 +3652,51 @@ cgraph_gate_cp (void)
return flag_ipa_cp && optimize;
}
-struct ipa_opt_pass_d pass_ipa_cp =
-{
- {
- IPA_PASS,
- "cp", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- cgraph_gate_cp, /* gate */
- ipcp_driver, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_CONSTANT_PROP, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_dump_symtab |
- TODO_remove_functions /* todo_flags_finish */
- },
- ipcp_generate_summary, /* generate_summary */
- ipcp_write_summary, /* write_summary */
- ipcp_read_summary, /* read_summary */
- ipa_prop_write_all_agg_replacement, /* write_optimization_summary */
- ipa_prop_read_all_agg_replacement, /* read_optimization_summary */
- NULL, /* stmt_fixup */
- 0, /* TODOs */
- ipcp_transform_function, /* function_transform */
- NULL, /* variable_transform */
+namespace {
+
+const pass_data pass_data_ipa_cp =
+{
+ IPA_PASS, /* type */
+ "cp", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IPA_CONSTANT_PROP, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_dump_symtab | TODO_remove_functions ), /* todo_flags_finish */
};
+
+class pass_ipa_cp : public ipa_opt_pass_d
+{
+public:
+ pass_ipa_cp(gcc::context *ctxt)
+ : ipa_opt_pass_d(pass_data_ipa_cp, ctxt,
+ ipcp_generate_summary, /* generate_summary */
+ ipcp_write_summary, /* write_summary */
+ ipcp_read_summary, /* read_summary */
+ ipa_prop_write_all_agg_replacement, /*
+ write_optimization_summary */
+ ipa_prop_read_all_agg_replacement, /*
+ read_optimization_summary */
+ NULL, /* stmt_fixup */
+ 0, /* function_transform_todo_flags_start */
+ ipcp_transform_function, /* function_transform */
+ NULL) /* variable_transform */
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return cgraph_gate_cp (); }
+ unsigned int execute () { return ipcp_driver (); }
+
+}; // class pass_ipa_cp
+
+} // anon namespace
+
+ipa_opt_pass_d *
+make_pass_ipa_cp (gcc::context *ctxt)
+{
+ return new pass_ipa_cp (ctxt);
+}
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 518d3b99ba9..2f30797443a 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -2715,26 +2715,46 @@ compute_inline_parameters_for_current (void)
return 0;
}
-struct gimple_opt_pass pass_inline_parameters =
-{
- {
- GIMPLE_PASS,
- "inline_param", /* name */
- OPTGROUP_INLINE, /* optinfo_flags */
- NULL, /* gate */
- compute_inline_parameters_for_current, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_INLINE_PARAMETERS, /* 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_inline_parameters =
+{
+ GIMPLE_PASS, /* type */
+ "inline_param", /* name */
+ OPTGROUP_INLINE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_INLINE_PARAMETERS, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_inline_parameters : public gimple_opt_pass
+{
+public:
+ pass_inline_parameters(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_inline_parameters, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_inline_parameters (ctxt_); }
+ unsigned int execute () {
+ return compute_inline_parameters_for_current ();
+ }
+
+}; // class pass_inline_parameters
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_inline_parameters (gcc::context *ctxt)
+{
+ return new pass_inline_parameters (ctxt);
+}
+
/* Estimate benefit devirtualizing indirect edge IE, provided KNOWN_VALS and
KNOWN_BINFOS. */
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 6eede0d35fc..96cbc9a0133 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -2086,26 +2086,43 @@ early_inliner (void)
return todo;
}
-struct gimple_opt_pass pass_early_inline =
+namespace {
+
+const pass_data pass_data_early_inline =
{
- {
- GIMPLE_PASS,
- "einline", /* name */
- OPTGROUP_INLINE, /* optinfo_flags */
- NULL, /* gate */
- early_inliner, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_EARLY_INLINING, /* tv_id */
- PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "einline", /* name */
+ OPTGROUP_INLINE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_EARLY_INLINING, /* tv_id */
+ PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_early_inline : public gimple_opt_pass
+{
+public:
+ pass_early_inline(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_early_inline, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return early_inliner (); }
+
+}; // class pass_early_inline
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_early_inline (gcc::context *ctxt)
+{
+ return new pass_early_inline (ctxt);
+}
+
/* When to run IPA inlining. Inlining of always-inline functions
happens during early inlining.
@@ -2119,32 +2136,49 @@ gate_ipa_inline (void)
return optimize || flag_lto || flag_wpa;
}
-struct ipa_opt_pass_d pass_ipa_inline =
+namespace {
+
+const pass_data pass_data_ipa_inline =
{
- {
- IPA_PASS,
- "inline", /* name */
- OPTGROUP_INLINE, /* optinfo_flags */
- gate_ipa_inline, /* gate */
- ipa_inline, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_INLINING, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- TODO_remove_functions, /* todo_flags_finish */
- TODO_dump_symtab
- | TODO_remove_functions /* todo_flags_finish */
- },
- inline_generate_summary, /* generate_summary */
- inline_write_summary, /* write_summary */
- inline_read_summary, /* read_summary */
- NULL, /* write_optimization_summary */
- NULL, /* read_optimization_summary */
- NULL, /* stmt_fixup */
- 0, /* TODOs */
- inline_transform, /* function_transform */
- NULL, /* variable_transform */
+ IPA_PASS, /* type */
+ "inline", /* name */
+ OPTGROUP_INLINE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IPA_INLINING, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ TODO_remove_functions, /* todo_flags_start */
+ ( TODO_dump_symtab | TODO_remove_functions ), /* todo_flags_finish */
};
+
+class pass_ipa_inline : public ipa_opt_pass_d
+{
+public:
+ pass_ipa_inline(gcc::context *ctxt)
+ : ipa_opt_pass_d(pass_data_ipa_inline, ctxt,
+ inline_generate_summary, /* generate_summary */
+ inline_write_summary, /* write_summary */
+ inline_read_summary, /* read_summary */
+ NULL, /* write_optimization_summary */
+ NULL, /* read_optimization_summary */
+ NULL, /* stmt_fixup */
+ 0, /* function_transform_todo_flags_start */
+ inline_transform, /* function_transform */
+ NULL) /* variable_transform */
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_ipa_inline (); }
+ unsigned int execute () { return ipa_inline (); }
+
+}; // class pass_ipa_inline
+
+} // anon namespace
+
+ipa_opt_pass_d *
+make_pass_ipa_inline (gcc::context *ctxt)
+{
+ return new pass_ipa_inline (ctxt);
+}
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index b00ae2374a3..7a293657114 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -1498,35 +1498,53 @@ gate_pure_const (void)
&& !seen_error ());
}
-struct ipa_opt_pass_d pass_ipa_pure_const =
+namespace {
+
+const pass_data pass_data_ipa_pure_const =
{
- {
- IPA_PASS,
- "pure-const", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_pure_const, /* gate */
- propagate, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_PURE_CONST, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- },
- pure_const_generate_summary, /* generate_summary */
- pure_const_write_summary, /* write_summary */
- pure_const_read_summary, /* read_summary */
- NULL, /* write_optimization_summary */
- NULL, /* read_optimization_summary */
- NULL, /* stmt_fixup */
- 0, /* TODOs */
- NULL, /* function_transform */
- NULL /* variable_transform */
+ IPA_PASS, /* type */
+ "pure-const", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IPA_PURE_CONST, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_ipa_pure_const : public ipa_opt_pass_d
+{
+public:
+ pass_ipa_pure_const(gcc::context *ctxt)
+ : ipa_opt_pass_d(pass_data_ipa_pure_const, ctxt,
+ pure_const_generate_summary, /* generate_summary */
+ pure_const_write_summary, /* write_summary */
+ pure_const_read_summary, /* read_summary */
+ NULL, /* write_optimization_summary */
+ NULL, /* read_optimization_summary */
+ NULL, /* stmt_fixup */
+ 0, /* function_transform_todo_flags_start */
+ NULL, /* function_transform */
+ NULL) /* variable_transform */
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_pure_const (); }
+ unsigned int execute () { return propagate (); }
+
+}; // class pass_ipa_pure_const
+
+} // anon namespace
+
+ipa_opt_pass_d *
+make_pass_ipa_pure_const (gcc::context *ctxt)
+{
+ return new pass_ipa_pure_const (ctxt);
+}
+
/* Return true if function should be skipped for local pure const analysis. */
static bool
@@ -1664,22 +1682,41 @@ local_pure_const (void)
return 0;
}
-struct gimple_opt_pass pass_local_pure_const =
+namespace {
+
+const pass_data pass_data_local_pure_const =
{
- {
- GIMPLE_PASS,
- "local-pure-const", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_pure_const, /* gate */
- local_pure_const, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_PURE_CONST, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "local-pure-const", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IPA_PURE_CONST, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_local_pure_const : public gimple_opt_pass
+{
+public:
+ pass_local_pure_const(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_local_pure_const, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_local_pure_const (ctxt_); }
+ bool gate () { return gate_pure_const (); }
+ unsigned int execute () { return local_pure_const (); }
+
+}; // class pass_local_pure_const
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_local_pure_const (gcc::context *ctxt)
+{
+ return new pass_local_pure_const (ctxt);
+}
diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c
index 9c56b7f5518..3742474ed65 100644
--- a/gcc/ipa-reference.c
+++ b/gcc/ipa-reference.c
@@ -1155,31 +1155,51 @@ gate_reference (void)
&& !seen_error ());
}
-struct ipa_opt_pass_d pass_ipa_reference =
+namespace {
+
+const pass_data pass_data_ipa_reference =
{
- {
- IPA_PASS,
- "static-var", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_reference, /* gate */
- propagate, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_REFERENCE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- },
- NULL, /* generate_summary */
- NULL, /* write_summary */
- NULL, /* read_summary */
- ipa_reference_write_optimization_summary,/* write_optimization_summary */
- ipa_reference_read_optimization_summary,/* read_optimization_summary */
- NULL, /* stmt_fixup */
- 0, /* TODOs */
- NULL, /* function_transform */
- NULL /* variable_transform */
+ IPA_PASS, /* type */
+ "static-var", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IPA_REFERENCE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_ipa_reference : public ipa_opt_pass_d
+{
+public:
+ pass_ipa_reference(gcc::context *ctxt)
+ : ipa_opt_pass_d(pass_data_ipa_reference, ctxt,
+ NULL, /* generate_summary */
+ NULL, /* write_summary */
+ NULL, /* read_summary */
+ ipa_reference_write_optimization_summary, /*
+ write_optimization_summary */
+ ipa_reference_read_optimization_summary, /*
+ read_optimization_summary */
+ NULL, /* stmt_fixup */
+ 0, /* function_transform_todo_flags_start */
+ NULL, /* function_transform */
+ NULL) /* variable_transform */
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_reference (); }
+ unsigned int execute () { return propagate (); }
+
+}; // class pass_ipa_reference
+
+} // anon namespace
+
+ipa_opt_pass_d *
+make_pass_ipa_reference (gcc::context *ctxt)
+{
+ return new pass_ipa_reference (ctxt);
+}
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index e786478981e..c83c4d04dbf 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -1624,26 +1624,44 @@ gate_split_functions (void)
&& !profile_arc_flag && !flag_branch_probabilities);
}
-struct gimple_opt_pass pass_split_functions =
+namespace {
+
+const pass_data pass_data_split_functions =
{
- {
- GIMPLE_PASS,
- "fnsplit", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_split_functions, /* gate */
- execute_split_functions, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_FNSPLIT, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_all /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "fnsplit", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IPA_FNSPLIT, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_all, /* todo_flags_finish */
};
+class pass_split_functions : public gimple_opt_pass
+{
+public:
+ pass_split_functions(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_split_functions, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_split_functions (); }
+ unsigned int execute () { return execute_split_functions (); }
+
+}; // class pass_split_functions
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_split_functions (gcc::context *ctxt)
+{
+ return new pass_split_functions (ctxt);
+}
+
/* Gate feedback driven function splitting pass.
We don't need to split when profiling at all, we are producing
lousy code anyway. */
@@ -1666,22 +1684,40 @@ execute_feedback_split_functions (void)
return retval;
}
-struct gimple_opt_pass pass_feedback_split_functions =
+namespace {
+
+const pass_data pass_data_feedback_split_functions =
{
- {
- GIMPLE_PASS,
- "feedback_fnsplit", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_feedback_split_functions, /* gate */
- execute_feedback_split_functions, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_FNSPLIT, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_all /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "feedback_fnsplit", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IPA_FNSPLIT, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_all, /* todo_flags_finish */
};
+
+class pass_feedback_split_functions : public gimple_opt_pass
+{
+public:
+ pass_feedback_split_functions(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_feedback_split_functions, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_feedback_split_functions (); }
+ unsigned int execute () { return execute_feedback_split_functions (); }
+
+}; // class pass_feedback_split_functions
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_feedback_split_functions (gcc::context *ctxt)
+{
+ return new pass_feedback_split_functions (ctxt);
+}
diff --git a/gcc/ipa.c b/gcc/ipa.c
index aa6485c87a6..01e9bee2e28 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -1012,26 +1012,45 @@ local_function_and_variable_visibility (void)
return function_and_variable_visibility (flag_whole_program && !flag_lto);
}
-struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility =
+namespace {
+
+const pass_data pass_data_ipa_function_and_variable_visibility =
{
- {
- SIMPLE_IPA_PASS,
- "visibility", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- local_function_and_variable_visibility,/* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_CGRAPHOPT, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_remove_functions | TODO_dump_symtab /* todo_flags_finish */
- }
+ SIMPLE_IPA_PASS, /* type */
+ "visibility", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_CGRAPHOPT, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_remove_functions | TODO_dump_symtab ), /* todo_flags_finish */
};
+class pass_ipa_function_and_variable_visibility : public simple_ipa_opt_pass
+{
+public:
+ pass_ipa_function_and_variable_visibility(gcc::context *ctxt)
+ : simple_ipa_opt_pass(pass_data_ipa_function_and_variable_visibility, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () {
+ return local_function_and_variable_visibility ();
+ }
+
+}; // class pass_ipa_function_and_variable_visibility
+
+} // anon namespace
+
+simple_ipa_opt_pass *
+make_pass_ipa_function_and_variable_visibility (gcc::context *ctxt)
+{
+ return new pass_ipa_function_and_variable_visibility (ctxt);
+}
+
/* Free inline summary. */
static unsigned
@@ -1041,26 +1060,43 @@ free_inline_summary (void)
return 0;
}
-struct simple_ipa_opt_pass pass_ipa_free_inline_summary =
+namespace {
+
+const pass_data pass_data_ipa_free_inline_summary =
{
- {
- SIMPLE_IPA_PASS,
- "*free_inline_summary", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- free_inline_summary, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_FREE_INLINE_SUMMARY, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ SIMPLE_IPA_PASS, /* type */
+ "*free_inline_summary", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_IPA_FREE_INLINE_SUMMARY, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_ipa_free_inline_summary : public simple_ipa_opt_pass
+{
+public:
+ pass_ipa_free_inline_summary(gcc::context *ctxt)
+ : simple_ipa_opt_pass(pass_data_ipa_free_inline_summary, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return free_inline_summary (); }
+
+}; // class pass_ipa_free_inline_summary
+
+} // anon namespace
+
+simple_ipa_opt_pass *
+make_pass_ipa_free_inline_summary (gcc::context *ctxt)
+{
+ return new pass_ipa_free_inline_summary (ctxt);
+}
+
/* Do not re-run on ltrans stage. */
static bool
@@ -1080,35 +1116,57 @@ whole_program_function_and_variable_visibility (void)
return 0;
}
-struct ipa_opt_pass_d pass_ipa_whole_program_visibility =
+namespace {
+
+const pass_data pass_data_ipa_whole_program_visibility =
{
- {
- IPA_PASS,
- "whole-program", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_whole_program_function_and_variable_visibility,/* gate */
- whole_program_function_and_variable_visibility,/* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_CGRAPHOPT, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_remove_functions | TODO_dump_symtab /* todo_flags_finish */
- },
- NULL, /* generate_summary */
- NULL, /* write_summary */
- NULL, /* read_summary */
- NULL, /* write_optimization_summary */
- NULL, /* read_optimization_summary */
- NULL, /* stmt_fixup */
- 0, /* TODOs */
- NULL, /* function_transform */
- NULL, /* variable_transform */
+ IPA_PASS, /* type */
+ "whole-program", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_CGRAPHOPT, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_remove_functions | TODO_dump_symtab ), /* todo_flags_finish */
};
+class pass_ipa_whole_program_visibility : public ipa_opt_pass_d
+{
+public:
+ pass_ipa_whole_program_visibility(gcc::context *ctxt)
+ : ipa_opt_pass_d(pass_data_ipa_whole_program_visibility, ctxt,
+ NULL, /* generate_summary */
+ NULL, /* write_summary */
+ NULL, /* read_summary */
+ NULL, /* write_optimization_summary */
+ NULL, /* read_optimization_summary */
+ NULL, /* stmt_fixup */
+ 0, /* function_transform_todo_flags_start */
+ NULL, /* function_transform */
+ NULL) /* variable_transform */
+ {}
+
+ /* opt_pass methods: */
+ bool gate () {
+ return gate_whole_program_function_and_variable_visibility ();
+ }
+ unsigned int execute () {
+ return whole_program_function_and_variable_visibility ();
+ }
+
+}; // class pass_ipa_whole_program_visibility
+
+} // anon namespace
+
+ipa_opt_pass_d *
+make_pass_ipa_whole_program_visibility (gcc::context *ctxt)
+{
+ return new pass_ipa_whole_program_visibility (ctxt);
+}
+
/* Entry in the histogram. */
struct histogram_entry
@@ -1427,35 +1485,53 @@ gate_ipa_profile (void)
return flag_ipa_profile;
}
-struct ipa_opt_pass_d pass_ipa_profile =
+namespace {
+
+const pass_data pass_data_ipa_profile =
{
- {
- IPA_PASS,
- "profile_estimate", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_ipa_profile, /* gate */
- ipa_profile, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_PROFILE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- },
- ipa_profile_generate_summary, /* generate_summary */
- ipa_profile_write_summary, /* write_summary */
- ipa_profile_read_summary, /* read_summary */
- NULL, /* write_optimization_summary */
- NULL, /* read_optimization_summary */
- NULL, /* stmt_fixup */
- 0, /* TODOs */
- NULL, /* function_transform */
- NULL /* variable_transform */
+ IPA_PASS, /* type */
+ "profile_estimate", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IPA_PROFILE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_ipa_profile : public ipa_opt_pass_d
+{
+public:
+ pass_ipa_profile(gcc::context *ctxt)
+ : ipa_opt_pass_d(pass_data_ipa_profile, ctxt,
+ ipa_profile_generate_summary, /* generate_summary */
+ ipa_profile_write_summary, /* write_summary */
+ ipa_profile_read_summary, /* read_summary */
+ NULL, /* write_optimization_summary */
+ NULL, /* read_optimization_summary */
+ NULL, /* stmt_fixup */
+ 0, /* function_transform_todo_flags_start */
+ NULL, /* function_transform */
+ NULL) /* variable_transform */
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_ipa_profile (); }
+ unsigned int execute () { return ipa_profile (); }
+
+}; // class pass_ipa_profile
+
+} // anon namespace
+
+ipa_opt_pass_d *
+make_pass_ipa_profile (gcc::context *ctxt)
+{
+ return new pass_ipa_profile (ctxt);
+}
+
/* Generate and emit a static constructor or destructor. WHICH must
be one of 'I' (for a constructor) or 'D' (for a destructor). BODY
is a STATEMENT_LIST containing GENERIC statements. PRIORITY is the
@@ -1738,31 +1814,49 @@ gate_ipa_cdtor_merge (void)
return !targetm.have_ctors_dtors || (optimize && in_lto_p);
}
-struct ipa_opt_pass_d pass_ipa_cdtor_merge =
+namespace {
+
+const pass_data pass_data_ipa_cdtor_merge =
{
- {
- IPA_PASS,
- "cdtor", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_ipa_cdtor_merge, /* gate */
- ipa_cdtor_merge, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_CGRAPHOPT, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- },
- NULL, /* generate_summary */
- NULL, /* write_summary */
- NULL, /* read_summary */
- NULL, /* write_optimization_summary */
- NULL, /* read_optimization_summary */
- NULL, /* stmt_fixup */
- 0, /* TODOs */
- NULL, /* function_transform */
- NULL /* variable_transform */
+ IPA_PASS, /* type */
+ "cdtor", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_CGRAPHOPT, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_ipa_cdtor_merge : public ipa_opt_pass_d
+{
+public:
+ pass_ipa_cdtor_merge(gcc::context *ctxt)
+ : ipa_opt_pass_d(pass_data_ipa_cdtor_merge, ctxt,
+ NULL, /* generate_summary */
+ NULL, /* write_summary */
+ NULL, /* read_summary */
+ NULL, /* write_optimization_summary */
+ NULL, /* read_optimization_summary */
+ NULL, /* stmt_fixup */
+ 0, /* function_transform_todo_flags_start */
+ NULL, /* function_transform */
+ NULL) /* variable_transform */
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_ipa_cdtor_merge (); }
+ unsigned int execute () { return ipa_cdtor_merge (); }
+
+}; // class pass_ipa_cdtor_merge
+
+} // anon namespace
+
+ipa_opt_pass_d *
+make_pass_ipa_cdtor_merge (gcc::context *ctxt)
+{
+ return new pass_ipa_cdtor_merge (ctxt);
+}
diff --git a/gcc/ira.c b/gcc/ira.c
index ee0c5e80d99..487746ee637 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -4775,26 +4775,43 @@ rest_of_handle_ira (void)
return 0;
}
-struct rtl_opt_pass pass_ira =
+namespace {
+
+const pass_data pass_data_ira =
{
- {
- RTL_PASS,
- "ira", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- rest_of_handle_ira, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IRA, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_do_not_ggc_collect /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "ira", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_IRA, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_do_not_ggc_collect, /* todo_flags_finish */
};
+class pass_ira : public rtl_opt_pass
+{
+public:
+ pass_ira(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_ira, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return rest_of_handle_ira (); }
+
+}; // class pass_ira
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_ira (gcc::context *ctxt)
+{
+ return new pass_ira (ctxt);
+}
+
static unsigned int
rest_of_handle_reload (void)
{
@@ -4802,22 +4819,39 @@ rest_of_handle_reload (void)
return 0;
}
-struct rtl_opt_pass pass_reload =
+namespace {
+
+const pass_data pass_data_reload =
{
- {
- RTL_PASS,
- "reload", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- rest_of_handle_reload, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_RELOAD, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "reload", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_RELOAD, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_reload : public rtl_opt_pass
+{
+public:
+ pass_reload(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_reload, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return rest_of_handle_reload (); }
+
+}; // class pass_reload
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_reload (gcc::context *ctxt)
+{
+ return new pass_reload (ctxt);
+}
diff --git a/gcc/jump.c b/gcc/jump.c
index 4fb1e6e6bef..6f7bcb72d1c 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -139,26 +139,43 @@ cleanup_barriers (void)
return 0;
}
-struct rtl_opt_pass pass_cleanup_barriers =
+namespace {
+
+const pass_data pass_data_cleanup_barriers =
{
- {
- RTL_PASS,
- "barriers", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- cleanup_barriers, /* 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 */
- }
+ RTL_PASS, /* type */
+ "barriers", /* 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_cleanup_barriers : public rtl_opt_pass
+{
+public:
+ pass_cleanup_barriers(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_cleanup_barriers, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return cleanup_barriers (); }
+
+}; // class pass_cleanup_barriers
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_cleanup_barriers (gcc::context *ctxt)
+{
+ return new pass_cleanup_barriers (ctxt);
+}
+
/* Initialize LABEL_NUSES and JUMP_LABEL fields, add REG_LABEL_TARGET
for remaining targets for JUMP_P. Delete any REG_LABEL_OPERAND
diff --git a/gcc/loop-init.c b/gcc/loop-init.c
index 65f9c6c9d4a..80c31ef70cd 100644
--- a/gcc/loop-init.c
+++ b/gcc/loop-init.c
@@ -316,26 +316,43 @@ gate_handle_loop2 (void)
}
}
-struct rtl_opt_pass pass_loop2 =
-{
- {
- RTL_PASS,
- "loop2", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_handle_loop2, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_LOOP, /* 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_loop2 =
+{
+ RTL_PASS, /* type */
+ "loop2", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ false, /* has_execute */
+ TV_LOOP, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_loop2 : public rtl_opt_pass
+{
+public:
+ pass_loop2(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_loop2, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_loop2 (); }
+
+}; // class pass_loop2
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_loop2 (gcc::context *ctxt)
+{
+ return new pass_loop2 (ctxt);
+}
+
/* Initialization of the RTL loop passes. */
static unsigned int
@@ -353,26 +370,43 @@ rtl_loop_init (void)
return 0;
}
-struct rtl_opt_pass pass_rtl_loop_init =
-{
- {
- RTL_PASS,
- "loop2_init", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- NULL, /* gate */
- rtl_loop_init, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_LOOP, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_rtl_loop_init =
+{
+ RTL_PASS, /* type */
+ "loop2_init", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_LOOP, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_rtl_sharing, /* todo_flags_finish */
};
+class pass_rtl_loop_init : public rtl_opt_pass
+{
+public:
+ pass_rtl_loop_init(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_rtl_loop_init, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return rtl_loop_init (); }
+
+}; // class pass_rtl_loop_init
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rtl_loop_init (gcc::context *ctxt)
+{
+ return new pass_rtl_loop_init (ctxt);
+}
+
/* Finalization of the RTL loop passes. */
@@ -394,27 +428,43 @@ rtl_loop_done (void)
return 0;
}
-struct rtl_opt_pass pass_rtl_loop_done =
-{
- {
- RTL_PASS,
- "loop2_done", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- NULL, /* gate */
- rtl_loop_done, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_LOOP, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- PROP_loops, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_flow
- | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_rtl_loop_done =
+{
+ RTL_PASS, /* type */
+ "loop2_done", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_LOOP, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ PROP_loops, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_flow | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+class pass_rtl_loop_done : public rtl_opt_pass
+{
+public:
+ pass_rtl_loop_done(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_rtl_loop_done, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return rtl_loop_done (); }
+
+}; // class pass_rtl_loop_done
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rtl_loop_done (gcc::context *ctxt)
+{
+ return new pass_rtl_loop_done (ctxt);
+}
+
/* Loop invariant code motion. */
static bool
@@ -431,27 +481,45 @@ rtl_move_loop_invariants (void)
return 0;
}
-struct rtl_opt_pass pass_rtl_move_loop_invariants =
-{
- {
- RTL_PASS,
- "loop2_invariant", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_rtl_move_loop_invariants, /* gate */
- rtl_move_loop_invariants, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_LOOP_MOVE_INVARIANTS, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_verify |
- TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_rtl_move_loop_invariants =
+{
+ RTL_PASS, /* type */
+ "loop2_invariant", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_LOOP_MOVE_INVARIANTS, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_verify | TODO_df_finish
+ | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+class pass_rtl_move_loop_invariants : public rtl_opt_pass
+{
+public:
+ pass_rtl_move_loop_invariants(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_rtl_move_loop_invariants, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_rtl_move_loop_invariants (); }
+ unsigned int execute () { return rtl_move_loop_invariants (); }
+
+}; // class pass_rtl_move_loop_invariants
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rtl_move_loop_invariants (gcc::context *ctxt)
+{
+ return new pass_rtl_move_loop_invariants (ctxt);
+}
+
/* Loop unswitching for RTL. */
static bool
@@ -468,26 +536,44 @@ rtl_unswitch (void)
return 0;
}
-struct rtl_opt_pass pass_rtl_unswitch =
-{
- {
- RTL_PASS,
- "loop2_unswitch", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_rtl_unswitch, /* gate */
- rtl_unswitch, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_LOOP_UNSWITCH, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_rtl_sharing, /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_rtl_unswitch =
+{
+ RTL_PASS, /* type */
+ "loop2_unswitch", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_LOOP_UNSWITCH, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_rtl_sharing, /* todo_flags_finish */
};
+class pass_rtl_unswitch : public rtl_opt_pass
+{
+public:
+ pass_rtl_unswitch(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_rtl_unswitch, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_rtl_unswitch (); }
+ unsigned int execute () { return rtl_unswitch (); }
+
+}; // class pass_rtl_unswitch
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rtl_unswitch (gcc::context *ctxt)
+{
+ return new pass_rtl_unswitch (ctxt);
+}
+
/* Loop unswitching for RTL. */
static bool
@@ -517,26 +603,44 @@ rtl_unroll_and_peel_loops (void)
return 0;
}
-struct rtl_opt_pass pass_rtl_unroll_and_peel_loops =
-{
- {
- RTL_PASS,
- "loop2_unroll", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_rtl_unroll_and_peel_loops, /* gate */
- rtl_unroll_and_peel_loops, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_LOOP_UNROLL, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_rtl_sharing, /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_rtl_unroll_and_peel_loops =
+{
+ RTL_PASS, /* type */
+ "loop2_unroll", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_LOOP_UNROLL, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_rtl_sharing, /* todo_flags_finish */
};
+class pass_rtl_unroll_and_peel_loops : public rtl_opt_pass
+{
+public:
+ pass_rtl_unroll_and_peel_loops(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_rtl_unroll_and_peel_loops, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_rtl_unroll_and_peel_loops (); }
+ unsigned int execute () { return rtl_unroll_and_peel_loops (); }
+
+}; // class pass_rtl_unroll_and_peel_loops
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rtl_unroll_and_peel_loops (gcc::context *ctxt)
+{
+ return new pass_rtl_unroll_and_peel_loops (ctxt);
+}
+
/* The doloop optimization. */
static bool
@@ -559,22 +663,40 @@ rtl_doloop (void)
return 0;
}
-struct rtl_opt_pass pass_rtl_doloop =
-{
- {
- RTL_PASS,
- "loop2_doloop", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_rtl_doloop, /* gate */
- rtl_doloop, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_LOOP_DOLOOP, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_rtl_doloop =
+{
+ RTL_PASS, /* type */
+ "loop2_doloop", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_LOOP_DOLOOP, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_rtl_sharing, /* todo_flags_finish */
};
+
+class pass_rtl_doloop : public rtl_opt_pass
+{
+public:
+ pass_rtl_doloop(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_rtl_doloop, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_rtl_doloop (); }
+ unsigned int execute () { return rtl_doloop (); }
+
+}; // class pass_rtl_doloop
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rtl_doloop (gcc::context *ctxt)
+{
+ return new pass_rtl_doloop (ctxt);
+}
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index eb22d8c87f5..ac67398a2db 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -1689,43 +1689,79 @@ rest_of_handle_lower_subreg2 (void)
return 0;
}
-struct rtl_opt_pass pass_lower_subreg =
+namespace {
+
+const pass_data pass_data_lower_subreg =
{
- {
- RTL_PASS,
- "subreg1", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_lower_subreg, /* gate */
- rest_of_handle_lower_subreg, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_LOWER_SUBREG, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_flow /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "subreg1", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_LOWER_SUBREG, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_flow, /* todo_flags_finish */
};
-struct rtl_opt_pass pass_lower_subreg2 =
+class pass_lower_subreg : public rtl_opt_pass
+{
+public:
+ pass_lower_subreg(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_lower_subreg, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_lower_subreg (); }
+ unsigned int execute () { return rest_of_handle_lower_subreg (); }
+
+}; // class pass_lower_subreg
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_lower_subreg (gcc::context *ctxt)
+{
+ return new pass_lower_subreg (ctxt);
+}
+
+namespace {
+
+const pass_data pass_data_lower_subreg2 =
{
- {
- RTL_PASS,
- "subreg2", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_lower_subreg, /* gate */
- rest_of_handle_lower_subreg2, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_LOWER_SUBREG, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_verify_flow /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "subreg2", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_LOWER_SUBREG, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing
+ | TODO_verify_flow ), /* todo_flags_finish */
};
+
+class pass_lower_subreg2 : public rtl_opt_pass
+{
+public:
+ pass_lower_subreg2(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_lower_subreg2, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_lower_subreg (); }
+ unsigned int execute () { return rest_of_handle_lower_subreg2 (); }
+
+}; // class pass_lower_subreg2
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_lower_subreg2 (gcc::context *ctxt)
+{
+ return new pass_lower_subreg2 (ctxt);
+}
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index ab7a8996861..5649bd8443e 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -1988,35 +1988,52 @@ lto_output (void)
#endif
}
-struct ipa_opt_pass_d pass_ipa_lto_gimple_out =
+namespace {
+
+const pass_data pass_data_ipa_lto_gimple_out =
{
- {
- IPA_PASS,
- "lto_gimple_out", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_lto_out, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_LTO_GIMPLE_OUT, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- },
- NULL, /* generate_summary */
- lto_output, /* write_summary */
- NULL, /* read_summary */
- lto_output, /* write_optimization_summary */
- NULL, /* read_optimization_summary */
- NULL, /* stmt_fixup */
- 0, /* TODOs */
- NULL, /* function_transform */
- NULL /* variable_transform */
+ IPA_PASS, /* type */
+ "lto_gimple_out", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ false, /* has_execute */
+ TV_IPA_LTO_GIMPLE_OUT, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_ipa_lto_gimple_out : public ipa_opt_pass_d
+{
+public:
+ pass_ipa_lto_gimple_out(gcc::context *ctxt)
+ : ipa_opt_pass_d(pass_data_ipa_lto_gimple_out, ctxt,
+ NULL, /* generate_summary */
+ lto_output, /* write_summary */
+ NULL, /* read_summary */
+ lto_output, /* write_optimization_summary */
+ NULL, /* read_optimization_summary */
+ NULL, /* stmt_fixup */
+ 0, /* function_transform_todo_flags_start */
+ NULL, /* function_transform */
+ NULL) /* variable_transform */
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_lto_out (); }
+
+}; // class pass_ipa_lto_gimple_out
+
+} // anon namespace
+
+ipa_opt_pass_d *
+make_pass_ipa_lto_gimple_out (gcc::context *ctxt)
+{
+ return new pass_ipa_lto_gimple_out (ctxt);
+}
+
/* Write each node in encoded by ENCODER to OB, as well as those reachable
from it and required for correct representation of its semantics.
@@ -2443,31 +2460,48 @@ produce_asm_for_decls (void)
}
-struct ipa_opt_pass_d pass_ipa_lto_finish_out =
+namespace {
+
+const pass_data pass_data_ipa_lto_finish_out =
{
- {
- IPA_PASS,
- "lto_decls_out", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_lto_out, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_LTO_DECL_OUT, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- },
- NULL, /* generate_summary */
- produce_asm_for_decls, /* write_summary */
- NULL, /* read_summary */
- produce_asm_for_decls, /* write_optimization_summary */
- NULL, /* read_optimization_summary */
- NULL, /* stmt_fixup */
- 0, /* TODOs */
- NULL, /* function_transform */
- NULL /* variable_transform */
+ IPA_PASS, /* type */
+ "lto_decls_out", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ false, /* has_execute */
+ TV_IPA_LTO_DECL_OUT, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_ipa_lto_finish_out : public ipa_opt_pass_d
+{
+public:
+ pass_ipa_lto_finish_out(gcc::context *ctxt)
+ : ipa_opt_pass_d(pass_data_ipa_lto_finish_out, ctxt,
+ NULL, /* generate_summary */
+ produce_asm_for_decls, /* write_summary */
+ NULL, /* read_summary */
+ produce_asm_for_decls, /* write_optimization_summary */
+ NULL, /* read_optimization_summary */
+ NULL, /* stmt_fixup */
+ 0, /* function_transform_todo_flags_start */
+ NULL, /* function_transform */
+ NULL) /* variable_transform */
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_lto_out (); }
+
+}; // class pass_ipa_lto_finish_out
+
+} // anon namespace
+
+ipa_opt_pass_d *
+make_pass_ipa_lto_finish_out (gcc::context *ctxt)
+{
+ return new pass_ipa_lto_finish_out (ctxt);
+}
diff --git a/gcc/mode-switching.c b/gcc/mode-switching.c
index 0d112b19074..c941eb11672 100644
--- a/gcc/mode-switching.c
+++ b/gcc/mode-switching.c
@@ -784,23 +784,40 @@ rest_of_handle_mode_switching (void)
}
-struct rtl_opt_pass pass_mode_switching =
+namespace {
+
+const pass_data pass_data_mode_switching =
{
- {
- RTL_PASS,
- "mode_sw", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_mode_switching, /* gate */
- rest_of_handle_mode_switching, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_MODE_SWITCH, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- 0 /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "mode_sw", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_MODE_SWITCH, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing | 0 ), /* todo_flags_finish */
};
+
+class pass_mode_switching : public rtl_opt_pass
+{
+public:
+ pass_mode_switching(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_mode_switching, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_mode_switching (); }
+ unsigned int execute () { return rest_of_handle_mode_switching (); }
+
+}; // class pass_mode_switching
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_mode_switching (gcc::context *ctxt)
+{
+ return new pass_mode_switching (ctxt);
+}
diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c
index 1e9b16c6fcb..0df5fb61a25 100644
--- a/gcc/modulo-sched.c
+++ b/gcc/modulo-sched.c
@@ -3351,24 +3351,41 @@ rest_of_handle_sms (void)
return 0;
}
-struct rtl_opt_pass pass_sms =
-{
- {
- RTL_PASS,
- "sms", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_sms, /* gate */
- rest_of_handle_sms, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_SMS, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish
- | TODO_verify_flow
- | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_sms =
+{
+ RTL_PASS, /* type */
+ "sms", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_SMS, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_flow
+ | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+
+class pass_sms : public rtl_opt_pass
+{
+public:
+ pass_sms(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_sms, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_sms (); }
+ unsigned int execute () { return rest_of_handle_sms (); }
+
+}; // class pass_sms
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_sms (gcc::context *ctxt)
+{
+ return new pass_sms (ctxt);
+}
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index e07c21a4e6c..e5eaddb51fc 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -6018,25 +6018,43 @@ gate_expand_omp (void)
return (flag_openmp != 0 && !seen_error ());
}
-struct gimple_opt_pass pass_expand_omp =
-{
- {
- GIMPLE_PASS,
- "ompexp", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_expand_omp, /* gate */
- execute_expand_omp, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_gimple_any, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_expand_omp =
+{
+ GIMPLE_PASS, /* type */
+ "ompexp", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_gimple_any, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_expand_omp : public gimple_opt_pass
+{
+public:
+ pass_expand_omp(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_expand_omp, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_expand_omp (); }
+ unsigned int execute () { return execute_expand_omp (); }
+
+}; // class pass_expand_omp
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_expand_omp (gcc::context *ctxt)
+{
+ return new pass_expand_omp (ctxt);
+}
/* Routines to lower OpenMP directives into OMP-GIMPLE. */
@@ -7193,25 +7211,42 @@ execute_lower_omp (void)
return 0;
}
-struct gimple_opt_pass pass_lower_omp =
-{
- {
- GIMPLE_PASS,
- "omplower", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- execute_lower_omp, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_gimple_any, /* properties_required */
- PROP_gimple_lomp, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_lower_omp =
+{
+ GIMPLE_PASS, /* type */
+ "omplower", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_gimple_any, /* properties_required */
+ PROP_gimple_lomp, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_lower_omp : public gimple_opt_pass
+{
+public:
+ pass_lower_omp(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_lower_omp, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return execute_lower_omp (); }
+
+}; // class pass_lower_omp
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_lower_omp (gcc::context *ctxt)
+{
+ return new pass_lower_omp (ctxt);
+}
/* The following is a utility to diagnose OpenMP structured block violations.
It is not part of the "omplower" pass, as that's invoked too late. It
@@ -7457,24 +7492,44 @@ gate_diagnose_omp_blocks (void)
return flag_openmp != 0;
}
-struct gimple_opt_pass pass_diagnose_omp_blocks =
-{
- {
- GIMPLE_PASS,
- "*diagnose_omp_blocks", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_diagnose_omp_blocks, /* gate */
- diagnose_omp_structured_block_errors, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_gimple_any, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0, /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_diagnose_omp_blocks =
+{
+ GIMPLE_PASS, /* type */
+ "*diagnose_omp_blocks", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_gimple_any, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_diagnose_omp_blocks : public gimple_opt_pass
+{
+public:
+ pass_diagnose_omp_blocks(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_diagnose_omp_blocks, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_diagnose_omp_blocks (); }
+ unsigned int execute () {
+ return diagnose_omp_structured_block_errors ();
+ }
+
+}; // class pass_diagnose_omp_blocks
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_diagnose_omp_blocks (gcc::context *ctxt)
+{
+ return new pass_diagnose_omp_blocks (ctxt);
+}
+
#include "gt-omp-low.h"
diff --git a/gcc/passes.c b/gcc/passes.c
index 8efce30b6e6..fd82c4ccb77 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -330,26 +330,44 @@ gate_all_early_local_passes (void)
return (!seen_error () && !in_lto_p);
}
-struct simple_ipa_opt_pass pass_early_local_passes =
-{
- {
- SIMPLE_IPA_PASS,
- "early_local_cleanups", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_all_early_local_passes, /* gate */
- execute_all_early_local_passes, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_EARLY_LOCAL, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_remove_functions /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_early_local_passes =
+{
+ SIMPLE_IPA_PASS, /* type */
+ "early_local_cleanups", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_EARLY_LOCAL, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_remove_functions, /* todo_flags_finish */
};
+class pass_early_local_passes : public simple_ipa_opt_pass
+{
+public:
+ pass_early_local_passes(gcc::context *ctxt)
+ : simple_ipa_opt_pass(pass_data_early_local_passes, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_all_early_local_passes (); }
+ unsigned int execute () { return execute_all_early_local_passes (); }
+
+}; // class pass_early_local_passes
+
+} // anon namespace
+
+simple_ipa_opt_pass *
+make_pass_early_local_passes (gcc::context *ctxt)
+{
+ return new pass_early_local_passes (ctxt);
+}
+
/* Gate: execute, or not, all of the non-trivial optimizations. */
static bool
@@ -360,26 +378,43 @@ gate_all_early_optimizations (void)
&& !seen_error ());
}
-static struct gimple_opt_pass pass_all_early_optimizations =
-{
- {
- GIMPLE_PASS,
- "early_optimizations", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_all_early_optimizations, /* gate */
- NULL, /* 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_all_early_optimizations =
+{
+ GIMPLE_PASS, /* type */
+ "early_optimizations", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ false, /* 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_all_early_optimizations : public gimple_opt_pass
+{
+public:
+ pass_all_early_optimizations(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_all_early_optimizations, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_all_early_optimizations (); }
+
+}; // class pass_all_early_optimizations
+
+} // anon namespace
+
+static gimple_opt_pass *
+make_pass_all_early_optimizations (gcc::context *ctxt)
+{
+ return new pass_all_early_optimizations (ctxt);
+}
+
/* Gate: execute, or not, all of the non-trivial optimizations. */
static bool
@@ -388,26 +423,43 @@ gate_all_optimizations (void)
return optimize >= 1 && !optimize_debug;
}
-static struct gimple_opt_pass pass_all_optimizations =
-{
- {
- GIMPLE_PASS,
- "*all_optimizations", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_all_optimizations, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_OPTIMIZE, /* 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_all_optimizations =
+{
+ GIMPLE_PASS, /* type */
+ "*all_optimizations", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ false, /* has_execute */
+ TV_OPTIMIZE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_all_optimizations : public gimple_opt_pass
+{
+public:
+ pass_all_optimizations(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_all_optimizations, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_all_optimizations (); }
+
+}; // class pass_all_optimizations
+
+} // anon namespace
+
+static gimple_opt_pass *
+make_pass_all_optimizations (gcc::context *ctxt)
+{
+ return new pass_all_optimizations (ctxt);
+}
+
/* Gate: execute, or not, all of the non-trivial optimizations. */
static bool
@@ -416,26 +468,43 @@ gate_all_optimizations_g (void)
return optimize >= 1 && optimize_debug;
}
-static struct gimple_opt_pass pass_all_optimizations_g =
-{
- {
- GIMPLE_PASS,
- "*all_optimizations_g", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_all_optimizations_g, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_OPTIMIZE, /* 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_all_optimizations_g =
+{
+ GIMPLE_PASS, /* type */
+ "*all_optimizations_g", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ false, /* has_execute */
+ TV_OPTIMIZE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_all_optimizations_g : public gimple_opt_pass
+{
+public:
+ pass_all_optimizations_g(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_all_optimizations_g, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_all_optimizations_g (); }
+
+}; // class pass_all_optimizations_g
+
+} // anon namespace
+
+static gimple_opt_pass *
+make_pass_all_optimizations_g (gcc::context *ctxt)
+{
+ return new pass_all_optimizations_g (ctxt);
+}
+
static bool
gate_rest_of_compilation (void)
{
@@ -444,52 +513,86 @@ gate_rest_of_compilation (void)
return !(rtl_dump_and_exit || flag_syntax_only || seen_error ());
}
-static struct rtl_opt_pass pass_rest_of_compilation =
-{
- {
- RTL_PASS,
- "*rest_of_compilation", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_rest_of_compilation, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_REST_OF_COMPILATION, /* tv_id */
- PROP_rtl, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_rest_of_compilation =
+{
+ RTL_PASS, /* type */
+ "*rest_of_compilation", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ false, /* has_execute */
+ TV_REST_OF_COMPILATION, /* tv_id */
+ PROP_rtl, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_rest_of_compilation : public rtl_opt_pass
+{
+public:
+ pass_rest_of_compilation(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_rest_of_compilation, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_rest_of_compilation (); }
+
+}; // class pass_rest_of_compilation
+
+} // anon namespace
+
+static rtl_opt_pass *
+make_pass_rest_of_compilation (gcc::context *ctxt)
+{
+ return new pass_rest_of_compilation (ctxt);
+}
+
static bool
gate_postreload (void)
{
return reload_completed;
}
-static struct rtl_opt_pass pass_postreload =
-{
- {
- RTL_PASS,
- "*all-postreload", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_postreload, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_POSTRELOAD, /* tv_id */
- PROP_rtl, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_postreload =
+{
+ RTL_PASS, /* type */
+ "*all-postreload", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ false, /* has_execute */
+ TV_POSTRELOAD, /* tv_id */
+ PROP_rtl, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_rtl_sharing, /* todo_flags_finish */
};
+class pass_postreload : public rtl_opt_pass
+{
+public:
+ pass_postreload(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_postreload, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_postreload (); }
+
+}; // class pass_postreload
+
+} // anon namespace
+
+static rtl_opt_pass *
+make_pass_postreload (gcc::context *ctxt)
+{
+ return new pass_postreload (ctxt);
+}
+
/* Set the static pass number of pass PASS to ID and record that
diff --git a/gcc/postreload-gcse.c b/gcc/postreload-gcse.c
index aeffc14435e..0f3ed7acda6 100644
--- a/gcc/postreload-gcse.c
+++ b/gcc/postreload-gcse.c
@@ -1324,23 +1324,40 @@ rest_of_handle_gcse2 (void)
return 0;
}
-struct rtl_opt_pass pass_gcse2 =
+namespace {
+
+const pass_data pass_data_gcse2 =
{
- {
- RTL_PASS,
- "gcse2", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_gcse2, /* gate */
- rest_of_handle_gcse2, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_GCSE_AFTER_RELOAD, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_rtl_sharing
- | TODO_verify_flow /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "gcse2", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_GCSE_AFTER_RELOAD, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_rtl_sharing | TODO_verify_flow ), /* todo_flags_finish */
};
+
+class pass_gcse2 : public rtl_opt_pass
+{
+public:
+ pass_gcse2(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_gcse2, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_gcse2 (); }
+ unsigned int execute () { return rest_of_handle_gcse2 (); }
+
+}; // class pass_gcse2
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_gcse2 (gcc::context *ctxt)
+{
+ return new pass_gcse2 (ctxt);
+}
diff --git a/gcc/postreload.c b/gcc/postreload.c
index f340503f69c..97d7e5d0332 100644
--- a/gcc/postreload.c
+++ b/gcc/postreload.c
@@ -2339,23 +2339,40 @@ rest_of_handle_postreload (void)
return 0;
}
-struct rtl_opt_pass pass_postreload_cse =
+namespace {
+
+const pass_data pass_data_postreload_cse =
{
- {
- RTL_PASS,
- "postreload", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_postreload, /* gate */
- rest_of_handle_postreload, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_RELOAD_CSE_REGS, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- 0 /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "postreload", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_RELOAD_CSE_REGS, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing | 0 ), /* todo_flags_finish */
};
+
+class pass_postreload_cse : public rtl_opt_pass
+{
+public:
+ pass_postreload_cse(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_postreload_cse, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_postreload (); }
+ unsigned int execute () { return rest_of_handle_postreload (); }
+
+}; // class pass_postreload_cse
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_postreload_cse (gcc::context *ctxt)
+{
+ return new pass_postreload_cse (ctxt);
+}
diff --git a/gcc/predict.c b/gcc/predict.c
index 9a15c87dac9..ec793382658 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -2900,46 +2900,82 @@ predictor_name (enum br_predictor predictor)
return predictor_info[predictor].name;
}
-struct gimple_opt_pass pass_profile =
-{
- {
- GIMPLE_PASS,
- "profile_estimate", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_estimate_probability, /* gate */
- tree_estimate_probability_driver, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_BRANCH_PROB, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_profile =
+{
+ GIMPLE_PASS, /* type */
+ "profile_estimate", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_BRANCH_PROB, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
-struct gimple_opt_pass pass_strip_predict_hints =
-{
- {
- GIMPLE_PASS,
- "*strip_predict_hints", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- strip_predict_hints, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_BRANCH_PROB, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+class pass_profile : public gimple_opt_pass
+{
+public:
+ pass_profile(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_profile, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_estimate_probability (); }
+ unsigned int execute () { return tree_estimate_probability_driver (); }
+
+}; // class pass_profile
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_profile (gcc::context *ctxt)
+{
+ return new pass_profile (ctxt);
+}
+
+namespace {
+
+const pass_data pass_data_strip_predict_hints =
+{
+ GIMPLE_PASS, /* type */
+ "*strip_predict_hints", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_BRANCH_PROB, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
+class pass_strip_predict_hints : public gimple_opt_pass
+{
+public:
+ pass_strip_predict_hints(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_strip_predict_hints, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_strip_predict_hints (ctxt_); }
+ unsigned int execute () { return strip_predict_hints (); }
+
+}; // class pass_strip_predict_hints
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_strip_predict_hints (gcc::context *ctxt)
+{
+ return new pass_strip_predict_hints (ctxt);
+}
+
/* Rebuild function frequencies. Passes are in general expected to
maintain profile by hand, however in some cases this is not possible:
for example when inlining several functions with loops freuqencies might run
diff --git a/gcc/recog.c b/gcc/recog.c
index aa026a27d59..352fbac896d 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -3778,27 +3778,44 @@ rest_of_handle_peephole2 (void)
return 0;
}
-struct rtl_opt_pass pass_peephole2 =
-{
- {
- RTL_PASS,
- "peephole2", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_peephole2, /* gate */
- rest_of_handle_peephole2, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_PEEPHOLE2, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- 0 /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_peephole2 =
+{
+ RTL_PASS, /* type */
+ "peephole2", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_PEEPHOLE2, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing | 0 ), /* todo_flags_finish */
};
+class pass_peephole2 : public rtl_opt_pass
+{
+public:
+ pass_peephole2(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_peephole2, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_peephole2 (); }
+ unsigned int execute () { return rest_of_handle_peephole2 (); }
+
+}; // class pass_peephole2
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_peephole2 (gcc::context *ctxt)
+{
+ return new pass_peephole2 (ctxt);
+}
+
static unsigned int
rest_of_handle_split_all_insns (void)
{
@@ -3806,26 +3823,43 @@ rest_of_handle_split_all_insns (void)
return 0;
}
-struct rtl_opt_pass pass_split_all_insns =
-{
- {
- RTL_PASS,
- "split1", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- rest_of_handle_split_all_insns, /* 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_split_all_insns =
+{
+ RTL_PASS, /* type */
+ "split1", /* 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_split_all_insns : public rtl_opt_pass
+{
+public:
+ pass_split_all_insns(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_split_all_insns, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return rest_of_handle_split_all_insns (); }
+
+}; // class pass_split_all_insns
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_split_all_insns (gcc::context *ctxt)
+{
+ return new pass_split_all_insns (ctxt);
+}
+
static unsigned int
rest_of_handle_split_after_reload (void)
{
@@ -3837,26 +3871,43 @@ rest_of_handle_split_after_reload (void)
return 0;
}
-struct rtl_opt_pass pass_split_after_reload =
-{
- {
- RTL_PASS,
- "split2", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- rest_of_handle_split_after_reload, /* 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_split_after_reload =
+{
+ RTL_PASS, /* type */
+ "split2", /* 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_split_after_reload : public rtl_opt_pass
+{
+public:
+ pass_split_after_reload(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_split_after_reload, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return rest_of_handle_split_after_reload (); }
+
+}; // class pass_split_after_reload
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_split_after_reload (gcc::context *ctxt)
+{
+ return new pass_split_after_reload (ctxt);
+}
+
static bool
gate_handle_split_before_regstack (void)
{
@@ -3882,26 +3933,46 @@ rest_of_handle_split_before_regstack (void)
return 0;
}
-struct rtl_opt_pass pass_split_before_regstack =
-{
- {
- RTL_PASS,
- "split3", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_split_before_regstack, /* gate */
- rest_of_handle_split_before_regstack, /* 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_split_before_regstack =
+{
+ RTL_PASS, /* type */
+ "split3", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* 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_split_before_regstack : public rtl_opt_pass
+{
+public:
+ pass_split_before_regstack(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_split_before_regstack, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_split_before_regstack (); }
+ unsigned int execute () {
+ return rest_of_handle_split_before_regstack ();
+ }
+
+}; // class pass_split_before_regstack
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_split_before_regstack (gcc::context *ctxt)
+{
+ return new pass_split_before_regstack (ctxt);
+}
+
static bool
gate_handle_split_before_sched2 (void)
{
@@ -3921,26 +3992,44 @@ rest_of_handle_split_before_sched2 (void)
return 0;
}
-struct rtl_opt_pass pass_split_before_sched2 =
-{
- {
- RTL_PASS,
- "split4", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_split_before_sched2, /* gate */
- rest_of_handle_split_before_sched2, /* 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 */
- TODO_verify_flow /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_split_before_sched2 =
+{
+ RTL_PASS, /* type */
+ "split4", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_flow, /* todo_flags_finish */
};
+class pass_split_before_sched2 : public rtl_opt_pass
+{
+public:
+ pass_split_before_sched2(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_split_before_sched2, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_split_before_sched2 (); }
+ unsigned int execute () { return rest_of_handle_split_before_sched2 (); }
+
+}; // class pass_split_before_sched2
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_split_before_sched2 (gcc::context *ctxt)
+{
+ return new pass_split_before_sched2 (ctxt);
+}
+
/* The placement of the splitting that we do for shorten_branches
depends on whether regstack is used by the target or not. */
static bool
@@ -3953,22 +4042,40 @@ gate_do_final_split (void)
#endif
}
-struct rtl_opt_pass pass_split_for_shorten_branches =
-{
- {
- RTL_PASS,
- "split5", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_do_final_split, /* gate */
- split_all_insns_noflow, /* 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 */
- TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_split_for_shorten_branches =
+{
+ RTL_PASS, /* type */
+ "split5", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_rtl_sharing, /* todo_flags_finish */
};
+
+class pass_split_for_shorten_branches : public rtl_opt_pass
+{
+public:
+ pass_split_for_shorten_branches(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_split_for_shorten_branches, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_do_final_split (); }
+ unsigned int execute () { return split_all_insns_noflow (); }
+
+}; // class pass_split_for_shorten_branches
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_split_for_shorten_branches (gcc::context *ctxt)
+{
+ return new pass_split_for_shorten_branches (ctxt);
+}
diff --git a/gcc/ree.c b/gcc/ree.c
index c0d43c8f72a..4dab6e91995 100644
--- a/gcc/ree.c
+++ b/gcc/ree.c
@@ -940,23 +940,40 @@ gate_handle_ree (void)
return (optimize > 0 && flag_ree);
}
-struct rtl_opt_pass pass_ree =
+namespace {
+
+const pass_data pass_data_ree =
{
- {
- RTL_PASS,
- "ree", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_ree, /* gate */
- rest_of_handle_ree, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_REE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish
- | TODO_verify_rtl_sharing, /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "ree", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_REE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+
+class pass_ree : public rtl_opt_pass
+{
+public:
+ pass_ree(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_ree, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_ree (); }
+ unsigned int execute () { return rest_of_handle_ree (); }
+
+}; // class pass_ree
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_ree (gcc::context *ctxt)
+{
+ return new pass_ree (ctxt);
+}
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 2dd9289d118..b3574e66d17 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -3292,26 +3292,43 @@ gate_handle_stack_regs (void)
#endif
}
-struct rtl_opt_pass pass_stack_regs =
+namespace {
+
+const pass_data pass_data_stack_regs =
{
- {
- RTL_PASS,
- "*stack_regs", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_stack_regs, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_REG_STACK, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "*stack_regs", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ false, /* has_execute */
+ TV_REG_STACK, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_stack_regs : public rtl_opt_pass
+{
+public:
+ pass_stack_regs(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_stack_regs, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_stack_regs (); }
+
+}; // class pass_stack_regs
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_stack_regs (gcc::context *ctxt)
+{
+ return new pass_stack_regs (ctxt);
+}
+
/* Convert register usage from flat register file usage to a stack
register file. */
static unsigned int
@@ -3324,22 +3341,39 @@ rest_of_handle_stack_regs (void)
return 0;
}
-struct rtl_opt_pass pass_stack_regs_run =
+namespace {
+
+const pass_data pass_data_stack_regs_run =
{
- {
- RTL_PASS,
- "stack", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- rest_of_handle_stack_regs, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_REG_STACK, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "stack", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_REG_STACK, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+
+class pass_stack_regs_run : public rtl_opt_pass
+{
+public:
+ pass_stack_regs_run(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_stack_regs_run, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return rest_of_handle_stack_regs (); }
+
+}; // class pass_stack_regs_run
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_stack_regs_run (gcc::context *ctxt)
+{
+ return new pass_stack_regs_run (ctxt);
+}
diff --git a/gcc/regcprop.c b/gcc/regcprop.c
index 896902f3012..19f33495170 100644
--- a/gcc/regcprop.c
+++ b/gcc/regcprop.c
@@ -1236,23 +1236,40 @@ gate_handle_cprop (void)
}
-struct rtl_opt_pass pass_cprop_hardreg =
+namespace {
+
+const pass_data pass_data_cprop_hardreg =
{
- {
- RTL_PASS,
- "cprop_hardreg", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_cprop, /* gate */
- copyprop_hardreg_forward, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_CPROP_REGISTERS, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish
- | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "cprop_hardreg", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_CPROP_REGISTERS, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+
+class pass_cprop_hardreg : public rtl_opt_pass
+{
+public:
+ pass_cprop_hardreg(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_cprop_hardreg, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_cprop (); }
+ unsigned int execute () { return copyprop_hardreg_forward (); }
+
+}; // class pass_cprop_hardreg
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_cprop_hardreg (gcc::context *ctxt)
+{
+ return new pass_cprop_hardreg (ctxt);
+}
diff --git a/gcc/reginfo.c b/gcc/reginfo.c
index 0153cd9d8ec..1fb6b5d226b 100644
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -965,26 +965,43 @@ reginfo_init (void)
return 1;
}
-struct rtl_opt_pass pass_reginfo_init =
+namespace {
+
+const pass_data pass_data_reginfo_init =
{
- {
- RTL_PASS,
- "reginfo", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- reginfo_init, /* 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 */
- }
+ RTL_PASS, /* type */
+ "reginfo", /* 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_reginfo_init : public rtl_opt_pass
+{
+public:
+ pass_reginfo_init(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_reginfo_init, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return reginfo_init (); }
+
+}; // class pass_reginfo_init
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_reginfo_init (gcc::context *ctxt)
+{
+ return new pass_reginfo_init (ctxt);
+}
+
/* Set up preferred, alternate, and allocno classes for REGNO as
diff --git a/gcc/regmove.c b/gcc/regmove.c
index 1ce8a7ed285..da7fac9844e 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -1361,22 +1361,40 @@ gate_handle_regmove (void)
}
-struct rtl_opt_pass pass_regmove =
+namespace {
+
+const pass_data pass_data_regmove =
{
- {
- RTL_PASS,
- "regmove", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_regmove, /* gate */
- regmove_optimize, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_REGMOVE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "regmove", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_REGMOVE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+
+class pass_regmove : public rtl_opt_pass
+{
+public:
+ pass_regmove(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_regmove, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_regmove (); }
+ unsigned int execute () { return regmove_optimize (); }
+
+}; // class pass_regmove
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_regmove (gcc::context *ctxt)
+{
+ return new pass_regmove (ctxt);
+}
diff --git a/gcc/regrename.c b/gcc/regrename.c
index 20e2ae9f792..6830bd8389a 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -1842,23 +1842,40 @@ gate_handle_regrename (void)
return (optimize > 0 && (flag_rename_registers));
}
-struct rtl_opt_pass pass_regrename =
+namespace {
+
+const pass_data pass_data_regrename =
{
- {
- RTL_PASS,
- "rnreg", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_regrename, /* gate */
- regrename_optimize, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_RENAME_REGISTERS, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- 0 /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "rnreg", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_RENAME_REGISTERS, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing | 0 ), /* todo_flags_finish */
};
+
+class pass_regrename : public rtl_opt_pass
+{
+public:
+ pass_regrename(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_regrename, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_regrename (); }
+ unsigned int execute () { return regrename_optimize (); }
+
+}; // class pass_regrename
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_regrename (gcc::context *ctxt)
+{
+ return new pass_regrename (ctxt);
+}
diff --git a/gcc/reorg.c b/gcc/reorg.c
index e601818a0d0..78804088a43 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -3852,26 +3852,44 @@ rest_of_handle_delay_slots (void)
return 0;
}
-struct rtl_opt_pass pass_delay_slots =
+namespace {
+
+const pass_data pass_data_delay_slots =
{
- {
- RTL_PASS,
- "dbr", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_delay_slots, /* gate */
- rest_of_handle_delay_slots, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_DBR_SCHED, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "dbr", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_DBR_SCHED, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_delay_slots : public rtl_opt_pass
+{
+public:
+ pass_delay_slots(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_delay_slots, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_delay_slots (); }
+ unsigned int execute () { return rest_of_handle_delay_slots (); }
+
+}; // class pass_delay_slots
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_delay_slots (gcc::context *ctxt)
+{
+ return new pass_delay_slots (ctxt);
+}
+
/* Machine dependent reorg pass. */
static bool
gate_handle_machine_reorg (void)
@@ -3887,22 +3905,40 @@ rest_of_handle_machine_reorg (void)
return 0;
}
-struct rtl_opt_pass pass_machine_reorg =
+namespace {
+
+const pass_data pass_data_machine_reorg =
{
- {
- RTL_PASS,
- "mach", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_machine_reorg, /* gate */
- rest_of_handle_machine_reorg, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_MACH_DEP, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "mach", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_MACH_DEP, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_machine_reorg : public rtl_opt_pass
+{
+public:
+ pass_machine_reorg(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_machine_reorg, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_machine_reorg (); }
+ unsigned int execute () { return rest_of_handle_machine_reorg (); }
+
+}; // class pass_machine_reorg
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_machine_reorg (gcc::context *ctxt)
+{
+ return new pass_machine_reorg (ctxt);
+}
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index 2c971e2a999..e1a2dce16a2 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -3617,44 +3617,80 @@ rest_of_handle_sched2 (void)
return 0;
}
-struct rtl_opt_pass pass_sched =
-{
- {
- RTL_PASS,
- "sched1", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_sched, /* gate */
- rest_of_handle_sched, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_SCHED, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_verify_flow /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_sched =
+{
+ RTL_PASS, /* type */
+ "sched1", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_SCHED, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing
+ | TODO_verify_flow ), /* todo_flags_finish */
};
-struct rtl_opt_pass pass_sched2 =
-{
- {
- RTL_PASS,
- "sched2", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_sched2, /* gate */
- rest_of_handle_sched2, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_SCHED2, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_verify_flow /* todo_flags_finish */
- }
+class pass_sched : public rtl_opt_pass
+{
+public:
+ pass_sched(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_sched, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_sched (); }
+ unsigned int execute () { return rest_of_handle_sched (); }
+
+}; // class pass_sched
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_sched (gcc::context *ctxt)
+{
+ return new pass_sched (ctxt);
+}
+
+namespace {
+
+const pass_data pass_data_sched2 =
+{
+ RTL_PASS, /* type */
+ "sched2", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_SCHED2, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing
+ | TODO_verify_flow ), /* todo_flags_finish */
};
+
+class pass_sched2 : public rtl_opt_pass
+{
+public:
+ pass_sched2(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_sched2, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_sched2 (); }
+ unsigned int execute () { return rest_of_handle_sched2 (); }
+
+}; // class pass_sched2
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_sched2 (gcc::context *ctxt)
+{
+ return new pass_sched2 (ctxt);
+}
diff --git a/gcc/stack-ptr-mod.c b/gcc/stack-ptr-mod.c
index 739bcfc3ac5..737a07f5727 100644
--- a/gcc/stack-ptr-mod.c
+++ b/gcc/stack-ptr-mod.c
@@ -90,22 +90,39 @@ rest_of_handle_stack_ptr_mod (void)
return 0;
}
-struct rtl_opt_pass pass_stack_ptr_mod =
+namespace {
+
+const pass_data pass_data_stack_ptr_mod =
{
- {
- RTL_PASS,
- "*stack_ptr_mod", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- rest_of_handle_stack_ptr_mod, /* 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 */
- }
+ RTL_PASS, /* type */
+ "*stack_ptr_mod", /* 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_stack_ptr_mod : public rtl_opt_pass
+{
+public:
+ pass_stack_ptr_mod(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_stack_ptr_mod, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return rest_of_handle_stack_ptr_mod (); }
+
+}; // class pass_stack_ptr_mod
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_stack_ptr_mod (gcc::context *ctxt)
+{
+ return new pass_stack_ptr_mod (ctxt);
+}
diff --git a/gcc/store-motion.c b/gcc/store-motion.c
index df756707408..e0b58477d4c 100644
--- a/gcc/store-motion.c
+++ b/gcc/store-motion.c
@@ -1235,23 +1235,41 @@ execute_rtl_store_motion (void)
return 0;
}
-struct rtl_opt_pass pass_rtl_store_motion =
+namespace {
+
+const pass_data pass_data_rtl_store_motion =
{
- {
- RTL_PASS,
- "store_motion", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_rtl_store_motion, /* gate */
- execute_rtl_store_motion, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_LSM, /* tv_id */
- PROP_cfglayout, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_verify_flow /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "store_motion", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_LSM, /* tv_id */
+ PROP_cfglayout, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing
+ | TODO_verify_flow ), /* todo_flags_finish */
};
+
+class pass_rtl_store_motion : public rtl_opt_pass
+{
+public:
+ pass_rtl_store_motion(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_rtl_store_motion, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_rtl_store_motion (); }
+ unsigned int execute () { return execute_rtl_store_motion (); }
+
+}; // class pass_rtl_store_motion
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rtl_store_motion (gcc::context *ctxt)
+{
+ return new pass_rtl_store_motion (ctxt);
+}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 387006e2e3d..757c9f27424 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,28 @@
2013-08-05 David Malcolm <dmalcolm@redhat.com>
+ Patch autogenerated by refactor_passes.py from
+ https://github.com/davidmalcolm/gcc-refactoring-scripts
+ revision 03fe39476a4c4ea450b49e087cfa817b5f92021e
+
+ * gcc.dg/plugin/one_time_plugin.c (one_pass): Convert from a global
+ struct to a subclass of gimple_opt_pass along with...
+ (pass_data_one_pass): ...new pass_data instance and...
+ (make_one_pass): ...new function.
+ * gcc.dg/plugin/selfassign.c (pass_warn_self_assign): Convert from a
+ global struct to a subclass of gimple_opt_pass along with...
+ (pass_data_warn_self_assign): ...new pass_data instance and...
+ (make_pass_warn_self_assign): ...new function.
+ * g++.dg/plugin/dumb_plugin.c (pass_dumb_plugin_example): Convert from
+ a global struct to a subclass of gimple_opt_pass along with...
+ (pass_data_dumb_plugin_example): ...new pass_data instance and...
+ (make_pass_dumb_plugin_example): ...new function.
+ * g++.dg/plugin/selfassign.c (pass_warn_self_assign): Convert from a
+ global struct to a subclass of gimple_opt_pass along with...
+ (pass_data_warn_self_assign): ...new pass_data instance and...
+ (make_pass_warn_self_assign): ...new function.
+
+2013-08-05 David Malcolm <dmalcolm@redhat.com>
+
* g++.dg/plugin/dumb_plugin.c (plugin_init): Rework how the pass
is created and added to the pass_manager to reflect
autogenerated changes.
diff --git a/gcc/testsuite/g++.dg/plugin/dumb_plugin.c b/gcc/testsuite/g++.dg/plugin/dumb_plugin.c
index ab69c14294e..e197d667251 100644
--- a/gcc/testsuite/g++.dg/plugin/dumb_plugin.c
+++ b/gcc/testsuite/g++.dg/plugin/dumb_plugin.c
@@ -58,26 +58,44 @@ gate_dumb_plugin_example (void)
return true;
}
-static struct gimple_opt_pass pass_dumb_plugin_example =
+namespace {
+
+const pass_data pass_data_dumb_plugin_example =
{
- {
- GIMPLE_PASS,
- "dumb_plugin_example", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_dumb_plugin_example, /* gate */
- execute_dumb_plugin_example, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "dumb_plugin_example", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_dumb_plugin_example : public gimple_opt_pass
+{
+public:
+ pass_dumb_plugin_example(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_dumb_plugin_example, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_dumb_plugin_example (); }
+ unsigned int execute () { return execute_dumb_plugin_example (); }
+
+}; // class pass_dumb_plugin_example
+
+} // anon namespace
+
+static gimple_opt_pass *
+make_pass_dumb_plugin_example (gcc::context *ctxt)
+{
+ return new pass_dumb_plugin_example (ctxt);
+}
+
/* Initialization function that GCC calls. This plugin takes an argument
that specifies the name of the reference pass and an instance number,
both of which determine where the plugin pass should be inserted. */
diff --git a/gcc/testsuite/g++.dg/plugin/selfassign.c b/gcc/testsuite/g++.dg/plugin/selfassign.c
index 3e0b38ec341..7235089c7d3 100644
--- a/gcc/testsuite/g++.dg/plugin/selfassign.c
+++ b/gcc/testsuite/g++.dg/plugin/selfassign.c
@@ -264,26 +264,44 @@ gate_warn_self_assign (void)
return true;
}
-static struct gimple_opt_pass pass_warn_self_assign =
+namespace {
+
+const pass_data pass_data_warn_self_assign =
{
- {
- GIMPLE_PASS,
- "warn_self_assign", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_warn_self_assign, /* gate */
- execute_warn_self_assign, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "warn_self_assign", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_warn_self_assign : public gimple_opt_pass
+{
+public:
+ pass_warn_self_assign(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_warn_self_assign, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_warn_self_assign (); }
+ unsigned int execute () { return execute_warn_self_assign (); }
+
+}; // class pass_warn_self_assign
+
+} // anon namespace
+
+static gimple_opt_pass *
+make_pass_warn_self_assign (gcc::context *ctxt)
+{
+ return new pass_warn_self_assign (ctxt);
+}
+
/* The initialization routine exposed to and called by GCC. The spec of this
function is defined in gcc/gcc-plugin.h.
diff --git a/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c b/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c
index 31dfe69b1fb..2d996da1235 100644
--- a/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c
+++ b/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c
@@ -28,26 +28,44 @@ static unsigned int one_pass_exec (void)
return 0;
}
-struct gimple_opt_pass one_pass =
+namespace {
+
+const pass_data pass_data_one_pass =
{
- {
- GIMPLE_PASS,
- "cfg", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- one_pass_gate, /* gate */
- one_pass_exec, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_gimple_any, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "cfg", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_gimple_any, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class one_pass : public gimple_opt_pass
+{
+public:
+ one_pass(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_one_pass, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return one_pass_gate (); }
+ unsigned int execute () { return one_pass_exec (); }
+
+}; // class one_pass
+
+} // anon namespace
+
+gimple_opt_pass *
+make_one_pass (gcc::context *ctxt)
+{
+ return new one_pass (ctxt);
+}
+
int plugin_init (struct plugin_name_args *plugin_info,
struct plugin_gcc_version *version)
diff --git a/gcc/testsuite/gcc.dg/plugin/selfassign.c b/gcc/testsuite/gcc.dg/plugin/selfassign.c
index 3e0b38ec341..7235089c7d3 100644
--- a/gcc/testsuite/gcc.dg/plugin/selfassign.c
+++ b/gcc/testsuite/gcc.dg/plugin/selfassign.c
@@ -264,26 +264,44 @@ gate_warn_self_assign (void)
return true;
}
-static struct gimple_opt_pass pass_warn_self_assign =
+namespace {
+
+const pass_data pass_data_warn_self_assign =
{
- {
- GIMPLE_PASS,
- "warn_self_assign", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_warn_self_assign, /* gate */
- execute_warn_self_assign, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "warn_self_assign", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_warn_self_assign : public gimple_opt_pass
+{
+public:
+ pass_warn_self_assign(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_warn_self_assign, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_warn_self_assign (); }
+ unsigned int execute () { return execute_warn_self_assign (); }
+
+}; // class pass_warn_self_assign
+
+} // anon namespace
+
+static gimple_opt_pass *
+make_pass_warn_self_assign (gcc::context *ctxt)
+{
+ return new pass_warn_self_assign (ctxt);
+}
+
/* The initialization routine exposed to and called by GCC. The spec of this
function is defined in gcc/gcc-plugin.h.
diff --git a/gcc/tracer.c b/gcc/tracer.c
index 975cadb9285..0139669aa16 100644
--- a/gcc/tracer.c
+++ b/gcc/tracer.c
@@ -397,23 +397,40 @@ gate_tracer (void)
return (optimize > 0 && flag_tracer && flag_reorder_blocks);
}
-struct gimple_opt_pass pass_tracer =
+namespace {
+
+const pass_data pass_data_tracer =
{
- {
- GIMPLE_PASS,
- "tracer", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_tracer, /* gate */
- tracer, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TRACER, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa
- | TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "tracer", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TRACER, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */
};
+
+class pass_tracer : public gimple_opt_pass
+{
+public:
+ pass_tracer(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_tracer, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tracer (); }
+ unsigned int execute () { return tracer (); }
+
+}; // class pass_tracer
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_tracer (gcc::context *ctxt)
+{
+ return new pass_tracer (ctxt);
+}
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index 5b07e7185bf..220ded277b5 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -801,25 +801,43 @@ diagnose_tm_blocks (void)
return 0;
}
-struct gimple_opt_pass pass_diagnose_tm_blocks =
-{
- {
- GIMPLE_PASS,
- "*diagnose_tm_blocks", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_tm, /* gate */
- diagnose_tm_blocks, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TRANS_MEM, /* tv_id */
- PROP_gimple_any, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0, /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_diagnose_tm_blocks =
+{
+ GIMPLE_PASS, /* type */
+ "*diagnose_tm_blocks", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TRANS_MEM, /* tv_id */
+ PROP_gimple_any, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_diagnose_tm_blocks : public gimple_opt_pass
+{
+public:
+ pass_diagnose_tm_blocks(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_diagnose_tm_blocks, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tm (); }
+ unsigned int execute () { return diagnose_tm_blocks (); }
+
+}; // class pass_diagnose_tm_blocks
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_diagnose_tm_blocks (gcc::context *ctxt)
+{
+ return new pass_diagnose_tm_blocks (ctxt);
+}
/* Instead of instrumenting thread private memory, we save the
addresses in a log which we later use to save/restore the addresses
@@ -1706,25 +1724,43 @@ execute_lower_tm (void)
return 0;
}
-struct gimple_opt_pass pass_lower_tm =
-{
- {
- GIMPLE_PASS,
- "tmlower", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_tm, /* gate */
- execute_lower_tm, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TRANS_MEM, /* tv_id */
- PROP_gimple_lcf, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0, /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_lower_tm =
+{
+ GIMPLE_PASS, /* type */
+ "tmlower", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TRANS_MEM, /* tv_id */
+ PROP_gimple_lcf, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_lower_tm : public gimple_opt_pass
+{
+public:
+ pass_lower_tm(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_lower_tm, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tm (); }
+ unsigned int execute () { return execute_lower_tm (); }
+
+}; // class pass_lower_tm
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_lower_tm (gcc::context *ctxt)
+{
+ return new pass_lower_tm (ctxt);
+}
/* Collect region information for each transaction. */
@@ -1968,25 +2004,42 @@ gate_tm_init (void)
return true;
}
-struct gimple_opt_pass pass_tm_init =
-{
- {
- GIMPLE_PASS,
- "*tminit", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_tm_init, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TRANS_MEM, /* tv_id */
- PROP_ssa | PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0, /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_tm_init =
+{
+ GIMPLE_PASS, /* type */
+ "*tminit", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ false, /* has_execute */
+ TV_TRANS_MEM, /* tv_id */
+ ( PROP_ssa | PROP_cfg ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_tm_init : public gimple_opt_pass
+{
+public:
+ pass_tm_init(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_tm_init, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tm_init (); }
+
+}; // class pass_tm_init
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_tm_init (gcc::context *ctxt)
+{
+ return new pass_tm_init (ctxt);
+}
/* Add FLAGS to the GIMPLE_TRANSACTION subcode for the transaction region
represented by STATE. */
@@ -2927,26 +2980,42 @@ execute_tm_mark (void)
return 0;
}
-struct gimple_opt_pass pass_tm_mark =
-{
- {
- GIMPLE_PASS,
- "tmmark", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- execute_tm_mark, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TRANS_MEM, /* tv_id */
- PROP_ssa | PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa
- | TODO_verify_ssa, /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_tm_mark =
+{
+ GIMPLE_PASS, /* type */
+ "tmmark", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_TRANS_MEM, /* tv_id */
+ ( PROP_ssa | PROP_cfg ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */
};
+
+class pass_tm_mark : public gimple_opt_pass
+{
+public:
+ pass_tm_mark(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_tm_mark, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return execute_tm_mark (); }
+
+}; // class pass_tm_mark
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_tm_mark (gcc::context *ctxt)
+{
+ return new pass_tm_mark (ctxt);
+}
/* Create an abnormal edge from STMT at iter, splitting the block
@@ -3094,26 +3163,42 @@ execute_tm_edges (void)
return 0;
}
-struct gimple_opt_pass pass_tm_edges =
-{
- {
- GIMPLE_PASS,
- "tmedge", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- execute_tm_edges, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TRANS_MEM, /* tv_id */
- PROP_ssa | PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa
- | TODO_verify_ssa, /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_tm_edges =
+{
+ GIMPLE_PASS, /* type */
+ "tmedge", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_TRANS_MEM, /* tv_id */
+ ( PROP_ssa | PROP_cfg ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */
};
+
+class pass_tm_edges : public gimple_opt_pass
+{
+public:
+ pass_tm_edges(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_tm_edges, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return execute_tm_edges (); }
+
+}; // class pass_tm_edges
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_tm_edges (gcc::context *ctxt)
+{
+ return new pass_tm_edges (ctxt);
+}
/* Helper function for expand_regions. Expand REGION and recurse to
the inner region. Call CALLBACK on each region. CALLBACK returns
@@ -3818,26 +3903,44 @@ gate_tm_memopt (void)
return flag_tm && optimize > 0;
}
-struct gimple_opt_pass pass_tm_memopt =
-{
- {
- GIMPLE_PASS,
- "tmmemopt", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_tm_memopt, /* gate */
- execute_tm_memopt, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TRANS_MEM, /* tv_id */
- PROP_ssa | PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0, /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_tm_memopt =
+{
+ GIMPLE_PASS, /* type */
+ "tmmemopt", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TRANS_MEM, /* tv_id */
+ ( PROP_ssa | PROP_cfg ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_tm_memopt : public gimple_opt_pass
+{
+public:
+ pass_tm_memopt(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_tm_memopt, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tm_memopt (); }
+ unsigned int execute () { return execute_tm_memopt (); }
+
+}; // class pass_tm_memopt
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_tm_memopt (gcc::context *ctxt)
+{
+ return new pass_tm_memopt (ctxt);
+}
+
/* Interprocedual analysis for the creation of transactional clones.
The aim of this pass is to find which functions are referenced in
@@ -5435,24 +5538,42 @@ ipa_tm_execute (void)
return 0;
}
-struct simple_ipa_opt_pass pass_ipa_tm =
-{
- {
- SIMPLE_IPA_PASS,
- "tmipa", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_tm, /* gate */
- ipa_tm_execute, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TRANS_MEM, /* tv_id */
- PROP_ssa | PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0, /* todo_flags_finish */
- },
+namespace {
+
+const pass_data pass_data_ipa_tm =
+{
+ SIMPLE_IPA_PASS, /* type */
+ "tmipa", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TRANS_MEM, /* tv_id */
+ ( PROP_ssa | PROP_cfg ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_ipa_tm : public simple_ipa_opt_pass
+{
+public:
+ pass_ipa_tm(gcc::context *ctxt)
+ : simple_ipa_opt_pass(pass_data_ipa_tm, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tm (); }
+ unsigned int execute () { return ipa_tm_execute (); }
+
+}; // class pass_ipa_tm
+
+} // anon namespace
+
+simple_ipa_opt_pass *
+make_pass_ipa_tm (gcc::context *ctxt)
+{
+ return new pass_ipa_tm (ctxt);
+}
+
#include "gt-trans-mem.h"
diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c
index 9b6186e3393..8edcad93b8b 100644
--- a/gcc/tree-call-cdce.c
+++ b/gcc/tree-call-cdce.c
@@ -913,22 +913,40 @@ gate_call_cdce (void)
return flag_tree_builtin_call_dce != 0 && optimize_function_for_speed_p (cfun);
}
-struct gimple_opt_pass pass_call_cdce =
+namespace {
+
+const pass_data pass_data_call_cdce =
{
- {
- GIMPLE_PASS,
- "cdce", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_call_cdce, /* gate */
- tree_call_cdce, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_CALL_CDCE, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "cdce", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_CALL_CDCE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
+
+class pass_call_cdce : public gimple_opt_pass
+{
+public:
+ pass_call_cdce(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_call_cdce, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_call_cdce (); }
+ unsigned int execute () { return tree_call_cdce (); }
+
+}; // class pass_call_cdce
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_call_cdce (gcc::context *ctxt)
+{
+ return new pass_call_cdce (ctxt);
+}
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 4b91a35f17d..af8685c7a75 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -253,26 +253,43 @@ execute_build_cfg (void)
return 0;
}
-struct gimple_opt_pass pass_build_cfg =
-{
- {
- GIMPLE_PASS,
- "cfg", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- execute_build_cfg, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_CFG, /* tv_id */
- PROP_gimple_leh, /* properties_required */
- PROP_cfg | PROP_loops, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_stmts /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_build_cfg =
+{
+ GIMPLE_PASS, /* type */
+ "cfg", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_CFG, /* tv_id */
+ PROP_gimple_leh, /* properties_required */
+ ( PROP_cfg | PROP_loops ), /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_stmts, /* todo_flags_finish */
};
+class pass_build_cfg : public gimple_opt_pass
+{
+public:
+ pass_build_cfg(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_build_cfg, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return execute_build_cfg (); }
+
+}; // class pass_build_cfg
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_build_cfg (gcc::context *ctxt)
+{
+ return new pass_build_cfg (ctxt);
+}
+
/* Return true if T is a computed goto. */
@@ -7890,26 +7907,43 @@ split_critical_edges (void)
return 0;
}
-struct gimple_opt_pass pass_split_crit_edges =
-{
- {
- GIMPLE_PASS,
- "crited", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- split_critical_edges, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_SPLIT_EDGES, /* tv_id */
- PROP_cfg, /* properties required */
- PROP_no_crit_edges, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_flow /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_split_crit_edges =
+{
+ GIMPLE_PASS, /* type */
+ "crited", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_SPLIT_EDGES, /* tv_id */
+ PROP_cfg, /* properties_required */
+ PROP_no_crit_edges, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_flow, /* todo_flags_finish */
};
+class pass_split_crit_edges : public gimple_opt_pass
+{
+public:
+ pass_split_crit_edges(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_split_crit_edges, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return split_critical_edges (); }
+
+}; // class pass_split_crit_edges
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_split_crit_edges (gcc::context *ctxt)
+{
+ return new pass_split_crit_edges (ctxt);
+}
+
/* Build a ternary operation and gimplify it. Emit code before GSI.
Return the gimple_val holding the result. */
@@ -8044,26 +8078,43 @@ extract_true_false_edges_from_block (basic_block b,
}
}
-struct gimple_opt_pass pass_warn_function_return =
-{
- {
- GIMPLE_PASS,
- "*warn_function_return", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- execute_warn_function_return, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_warn_function_return =
+{
+ GIMPLE_PASS, /* type */
+ "*warn_function_return", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_warn_function_return : public gimple_opt_pass
+{
+public:
+ pass_warn_function_return(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_warn_function_return, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return execute_warn_function_return (); }
+
+}; // class pass_warn_function_return
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_warn_function_return (gcc::context *ctxt)
+{
+ return new pass_warn_function_return (ctxt);
+}
+
/* Emit noreturn warnings. */
static unsigned int
@@ -8081,26 +8132,44 @@ gate_warn_function_noreturn (void)
return warn_suggest_attribute_noreturn;
}
-struct gimple_opt_pass pass_warn_function_noreturn =
-{
- {
- GIMPLE_PASS,
- "*warn_function_noreturn", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_warn_function_noreturn, /* gate */
- execute_warn_function_noreturn, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_warn_function_noreturn =
+{
+ GIMPLE_PASS, /* type */
+ "*warn_function_noreturn", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_warn_function_noreturn : public gimple_opt_pass
+{
+public:
+ pass_warn_function_noreturn(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_warn_function_noreturn, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_warn_function_noreturn (); }
+ unsigned int execute () { return execute_warn_function_noreturn (); }
+
+}; // class pass_warn_function_noreturn
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_warn_function_noreturn (gcc::context *ctxt)
+{
+ return new pass_warn_function_noreturn (ctxt);
+}
+
/* Walk a gimplified function and warn for functions whose return value is
ignored and attribute((warn_unused_result)) is set. This is done before
@@ -8180,26 +8249,44 @@ gate_warn_unused_result (void)
return flag_warn_unused_result;
}
-struct gimple_opt_pass pass_warn_unused_result =
-{
- {
- GIMPLE_PASS,
- "*warn_unused_result", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_warn_unused_result, /* gate */
- run_warn_unused_result, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_gimple_any, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0, /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_warn_unused_result =
+{
+ GIMPLE_PASS, /* type */
+ "*warn_unused_result", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_gimple_any, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_warn_unused_result : public gimple_opt_pass
+{
+public:
+ pass_warn_unused_result(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_warn_unused_result, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_warn_unused_result (); }
+ unsigned int execute () { return run_warn_unused_result (); }
+
+}; // class pass_warn_unused_result
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_warn_unused_result (gcc::context *ctxt)
+{
+ return new pass_warn_unused_result (ctxt);
+}
+
/* Garbage collection support for edge_def. */
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index 9b314f73ea6..8917f855705 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -989,22 +989,41 @@ gate_merge_phi (void)
return 1;
}
-struct gimple_opt_pass pass_merge_phi =
+namespace {
+
+const pass_data pass_data_merge_phi =
{
- {
- GIMPLE_PASS,
- "mergephi", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_merge_phi, /* gate */
- merge_phi_nodes, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_MERGE_PHI, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "mergephi", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_MERGE_PHI, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
+
+class pass_merge_phi : public gimple_opt_pass
+{
+public:
+ pass_merge_phi(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_merge_phi, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_merge_phi (ctxt_); }
+ bool gate () { return gate_merge_phi (); }
+ unsigned int execute () { return merge_phi_nodes (); }
+
+}; // class pass_merge_phi
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_merge_phi (gcc::context *ctxt)
+{
+ return new pass_merge_phi (ctxt);
+}
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index 5caba01cde4..225728fdaeb 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -1637,27 +1637,44 @@ tree_lower_complex (void)
return 0;
}
-struct gimple_opt_pass pass_lower_complex =
+namespace {
+
+const pass_data pass_data_lower_complex =
{
- {
- GIMPLE_PASS,
- "cplxlower", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- 0, /* gate */
- tree_lower_complex, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_ssa, /* properties_required */
- PROP_gimple_lcx, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa
- | TODO_verify_stmts /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "cplxlower", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_ssa, /* properties_required */
+ PROP_gimple_lcx, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_stmts ), /* todo_flags_finish */
};
+class pass_lower_complex : public gimple_opt_pass
+{
+public:
+ pass_lower_complex(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_lower_complex, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_lower_complex (ctxt_); }
+ unsigned int execute () { return tree_lower_complex (); }
+
+}; // class pass_lower_complex
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_lower_complex (gcc::context *ctxt)
+{
+ return new pass_lower_complex (ctxt);
+}
+
static bool
gate_no_optimization (void)
@@ -1667,23 +1684,40 @@ gate_no_optimization (void)
return !(cfun->curr_properties & PROP_gimple_lcx);
}
-struct gimple_opt_pass pass_lower_complex_O0 =
+namespace {
+
+const pass_data pass_data_lower_complex_O0 =
{
- {
- GIMPLE_PASS,
- "cplxlower0", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_no_optimization, /* gate */
- tree_lower_complex, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg, /* properties_required */
- PROP_gimple_lcx, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa
- | TODO_verify_stmts /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "cplxlower0", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_cfg, /* properties_required */
+ PROP_gimple_lcx, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_stmts ), /* todo_flags_finish */
};
+
+class pass_lower_complex_O0 : public gimple_opt_pass
+{
+public:
+ pass_lower_complex_O0(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_lower_complex_O0, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_no_optimization (); }
+ unsigned int execute () { return tree_lower_complex (); }
+
+}; // class pass_lower_complex_O0
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_lower_complex_O0 (gcc::context *ctxt)
+{
+ return new pass_lower_complex_O0 (ctxt);
+}
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 0850bd53cf1..6ffbd266711 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -2157,25 +2157,42 @@ lower_eh_constructs (void)
return 0;
}
-struct gimple_opt_pass pass_lower_eh =
+namespace {
+
+const pass_data pass_data_lower_eh =
{
- {
- GIMPLE_PASS,
- "eh", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- lower_eh_constructs, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_EH, /* tv_id */
- PROP_gimple_lcf, /* properties_required */
- PROP_gimple_leh, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "eh", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_EH, /* tv_id */
+ PROP_gimple_lcf, /* properties_required */
+ PROP_gimple_leh, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_lower_eh : public gimple_opt_pass
+{
+public:
+ pass_lower_eh(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_lower_eh, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return lower_eh_constructs (); }
+
+}; // class pass_lower_eh
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_lower_eh (gcc::context *ctxt)
+{
+ return new pass_lower_eh (ctxt);
+}
/* Create the multiple edges from an EH_DISPATCH statement to all of
the possible handlers for its EH region. Return true if there's
@@ -3017,25 +3034,43 @@ gate_refactor_eh (void)
return flag_exceptions != 0;
}
-struct gimple_opt_pass pass_refactor_eh =
+namespace {
+
+const pass_data pass_data_refactor_eh =
{
- {
- GIMPLE_PASS,
- "ehopt", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_refactor_eh, /* gate */
- refactor_eh, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_EH, /* tv_id */
- PROP_gimple_lcf, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "ehopt", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_EH, /* tv_id */
+ PROP_gimple_lcf, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_refactor_eh : public gimple_opt_pass
+{
+public:
+ pass_refactor_eh(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_refactor_eh, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_refactor_eh (); }
+ unsigned int execute () { return refactor_eh (); }
+
+}; // class pass_refactor_eh
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_refactor_eh (gcc::context *ctxt)
+{
+ return new pass_refactor_eh (ctxt);
+}
/* At the end of gimple optimization, we can lower RESX. */
@@ -3226,26 +3261,44 @@ gate_lower_resx (void)
return flag_exceptions != 0;
}
-struct gimple_opt_pass pass_lower_resx =
+namespace {
+
+const pass_data pass_data_lower_resx =
{
- {
- GIMPLE_PASS,
- "resx", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_lower_resx, /* gate */
- execute_lower_resx, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_EH, /* tv_id */
- PROP_gimple_lcf, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_flow /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "resx", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_EH, /* tv_id */
+ PROP_gimple_lcf, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_flow, /* todo_flags_finish */
};
+class pass_lower_resx : public gimple_opt_pass
+{
+public:
+ pass_lower_resx(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_lower_resx, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_lower_resx (); }
+ unsigned int execute () { return execute_lower_resx (); }
+
+}; // class pass_lower_resx
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_lower_resx (gcc::context *ctxt)
+{
+ return new pass_lower_resx (ctxt);
+}
+
/* Try to optimize var = {v} {CLOBBER} stmts followed just by
external throw. */
@@ -3619,25 +3672,43 @@ gate_lower_eh_dispatch (void)
return cfun->eh->region_tree != NULL;
}
-struct gimple_opt_pass pass_lower_eh_dispatch =
+namespace {
+
+const pass_data pass_data_lower_eh_dispatch =
{
- {
- GIMPLE_PASS,
- "ehdisp", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_lower_eh_dispatch, /* gate */
- execute_lower_eh_dispatch, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_EH, /* tv_id */
- PROP_gimple_lcf, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_flow /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "ehdisp", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_EH, /* tv_id */
+ PROP_gimple_lcf, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_flow, /* todo_flags_finish */
};
+
+class pass_lower_eh_dispatch : public gimple_opt_pass
+{
+public:
+ pass_lower_eh_dispatch(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_lower_eh_dispatch, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_lower_eh_dispatch (); }
+ unsigned int execute () { return execute_lower_eh_dispatch (); }
+
+}; // class pass_lower_eh_dispatch
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_lower_eh_dispatch (gcc::context *ctxt)
+{
+ return new pass_lower_eh_dispatch (ctxt);
+}
/* Walk statements, see what regions and, optionally, landing pads
are really referenced.
@@ -4445,24 +4516,44 @@ gate_cleanup_eh (void)
return cfun->eh != NULL && cfun->eh->region_tree != NULL;
}
-struct gimple_opt_pass pass_cleanup_eh = {
- {
- GIMPLE_PASS,
- "ehcleanup", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_cleanup_eh, /* gate */
- execute_cleanup_eh, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_EH, /* tv_id */
- PROP_gimple_lcf, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_cleanup_eh =
+{
+ GIMPLE_PASS, /* type */
+ "ehcleanup", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_EH, /* tv_id */
+ PROP_gimple_lcf, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
+
+class pass_cleanup_eh : public gimple_opt_pass
+{
+public:
+ pass_cleanup_eh(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_cleanup_eh, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_cleanup_eh (ctxt_); }
+ bool gate () { return gate_cleanup_eh (); }
+ unsigned int execute () { return execute_cleanup_eh (); }
+
+}; // class pass_cleanup_eh
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_cleanup_eh (gcc::context *ctxt)
+{
+ return new pass_cleanup_eh (ctxt);
+}
/* Verify that BB containing STMT as the last statement, has precisely the
edge that make_eh_edges would create. */
diff --git a/gcc/tree-emutls.c b/gcc/tree-emutls.c
index 6329fdd5015..ed8edc3569c 100644
--- a/gcc/tree-emutls.c
+++ b/gcc/tree-emutls.c
@@ -811,22 +811,40 @@ gate_emutls (void)
return !targetm.have_tls;
}
-struct simple_ipa_opt_pass pass_ipa_lower_emutls =
+namespace {
+
+const pass_data pass_data_ipa_lower_emutls =
{
- {
- SIMPLE_IPA_PASS,
- "emutls", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_emutls, /* gate */
- ipa_lower_emutls, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_OPT, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0, /* todo_flags_finish */
- }
+ SIMPLE_IPA_PASS, /* type */
+ "emutls", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IPA_OPT, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_ipa_lower_emutls : public simple_ipa_opt_pass
+{
+public:
+ pass_ipa_lower_emutls(gcc::context *ctxt)
+ : simple_ipa_opt_pass(pass_data_ipa_lower_emutls, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_emutls (); }
+ unsigned int execute () { return ipa_lower_emutls (); }
+
+}; // class pass_ipa_lower_emutls
+
+} // anon namespace
+
+simple_ipa_opt_pass *
+make_pass_ipa_lower_emutls (gcc::context *ctxt)
+{
+ return new pass_ipa_lower_emutls (ctxt);
+}
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 0ebb8c36cea..a886169ed00 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -1853,23 +1853,40 @@ gate_tree_if_conversion (void)
|| flag_tree_loop_if_convert_stores == 1);
}
-struct gimple_opt_pass pass_if_conversion =
+namespace {
+
+const pass_data pass_data_if_conversion =
{
- {
- GIMPLE_PASS,
- "ifcvt", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_tree_if_conversion, /* gate */
- main_tree_if_conversion, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_stmts | TODO_verify_flow
- /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "ifcvt", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_stmts | TODO_verify_flow ), /* todo_flags_finish */
};
+
+class pass_if_conversion : public gimple_opt_pass
+{
+public:
+ pass_if_conversion(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_if_conversion, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tree_if_conversion (); }
+ unsigned int execute () { return main_tree_if_conversion (); }
+
+}; // class pass_if_conversion
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_if_conversion (gcc::context *ctxt)
+{
+ return new pass_if_conversion (ctxt);
+}
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index 4c630a3130e..33d4ba8c623 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -2410,27 +2410,43 @@ rewrite_into_ssa (void)
}
-struct gimple_opt_pass pass_build_ssa =
-{
- {
- GIMPLE_PASS,
- "ssa", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- rewrite_into_ssa, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_SSA_OTHER, /* tv_id */
- PROP_cfg, /* properties_required */
- PROP_ssa, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa
- | TODO_remove_unused_locals /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_build_ssa =
+{
+ GIMPLE_PASS, /* type */
+ "ssa", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_SSA_OTHER, /* tv_id */
+ PROP_cfg, /* properties_required */
+ PROP_ssa, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_ssa | TODO_remove_unused_locals ), /* todo_flags_finish */
};
+class pass_build_ssa : public gimple_opt_pass
+{
+public:
+ pass_build_ssa(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_build_ssa, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return rewrite_into_ssa (); }
+
+}; // class pass_build_ssa
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_build_ssa (gcc::context *ctxt)
+{
+ return new pass_build_ssa (ctxt);
+}
+
/* Mark the definition of VAR at STMT and BB as interesting for the
renamer. BLOCKS is the set of blocks that need updating. */
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 13b78cc37d2..2317edcc7a3 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -1589,22 +1589,40 @@ gate_tree_loop_distribution (void)
|| flag_tree_loop_distribute_patterns;
}
-struct gimple_opt_pass pass_loop_distribution =
+namespace {
+
+const pass_data pass_data_loop_distribution =
{
- {
- GIMPLE_PASS,
- "ldist", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_tree_loop_distribution, /* gate */
- tree_loop_distribution, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_LOOP_DISTRIBUTION, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "ldist", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_LOOP_DISTRIBUTION, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
+
+class pass_loop_distribution : public gimple_opt_pass
+{
+public:
+ pass_loop_distribution(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_loop_distribution, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tree_loop_distribution (); }
+ unsigned int execute () { return tree_loop_distribution (); }
+
+}; // class pass_loop_distribution
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_loop_distribution (gcc::context *ctxt)
+{
+ return new pass_loop_distribution (ctxt);
+}
diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c
index 7f24cbf5e40..adf2f7bd7d2 100644
--- a/gcc/tree-mudflap.c
+++ b/gcc/tree-mudflap.c
@@ -1378,45 +1378,81 @@ gate_mudflap (void)
return flag_mudflap != 0;
}
-struct gimple_opt_pass pass_mudflap_1 =
+namespace {
+
+const pass_data pass_data_mudflap_1 =
{
- {
- GIMPLE_PASS,
- "mudflap1", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_mudflap, /* gate */
- execute_mudflap_function_decls, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_gimple_any, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "mudflap1", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_gimple_any, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
-struct gimple_opt_pass pass_mudflap_2 =
+class pass_mudflap_1 : public gimple_opt_pass
+{
+public:
+ pass_mudflap_1(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_mudflap_1, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_mudflap (); }
+ unsigned int execute () { return execute_mudflap_function_decls (); }
+
+}; // class pass_mudflap_1
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_mudflap_1 (gcc::context *ctxt)
+{
+ return new pass_mudflap_1 (ctxt);
+}
+
+namespace {
+
+const pass_data pass_data_mudflap_2 =
{
- {
- GIMPLE_PASS,
- "mudflap2", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_mudflap, /* gate */
- execute_mudflap_function_ops, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_ssa | PROP_cfg | PROP_gimple_leh,/* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_flow | TODO_verify_stmts
- | TODO_update_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "mudflap2", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ ( PROP_ssa | PROP_cfg | PROP_gimple_leh ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_flow | TODO_verify_stmts
+ | TODO_update_ssa ), /* todo_flags_finish */
};
+class pass_mudflap_2 : public gimple_opt_pass
+{
+public:
+ pass_mudflap_2(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_mudflap_2, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_mudflap (); }
+ unsigned int execute () { return execute_mudflap_function_ops (); }
+
+}; // class pass_mudflap_2
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_mudflap_2 (gcc::context *ctxt)
+{
+ return new pass_mudflap_2 (ctxt);
+}
+
#include "gt-tree-mudflap.h"
diff --git a/gcc/tree-nomudflap.c b/gcc/tree-nomudflap.c
index 657c82dad53..6659f05f5b1 100644
--- a/gcc/tree-nomudflap.c
+++ b/gcc/tree-nomudflap.c
@@ -85,46 +85,80 @@ gate_mudflap (void)
return flag_mudflap != 0;
}
-struct gimple_opt_pass pass_mudflap_1 =
+namespace {
+
+const pass_data pass_data_mudflap_1 =
{
- {
- GIMPLE_PASS,
- "mudflap1", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_mudflap, /* gate */
- NULL, /* 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 */
- }
+ GIMPLE_PASS, /* type */
+ "mudflap1", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ false, /* has_execute */
+ TV_NONE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
-struct gimple_opt_pass pass_mudflap_2 =
+class pass_mudflap_1 : public gimple_opt_pass
+{
+public:
+ pass_mudflap_1(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_mudflap_1, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_mudflap (); }
+
+}; // class pass_mudflap_1
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_mudflap_1 (gcc::context *ctxt)
+{
+ return new pass_mudflap_1 (ctxt);
+}
+
+namespace {
+
+const pass_data pass_data_mudflap_2 =
{
- {
- GIMPLE_PASS,
- "mudflap2", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_mudflap, /* gate */
- NULL, /* 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 */
- }
+ GIMPLE_PASS, /* type */
+ "mudflap2", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ false, /* 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_mudflap_2 : public gimple_opt_pass
+{
+public:
+ pass_mudflap_2(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_mudflap_2, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_mudflap (); }
+
+}; // class pass_mudflap_2
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_mudflap_2 (gcc::context *ctxt)
+{
+ return new pass_mudflap_2 (ctxt);
+}
+
/* Instead of:
#include "gt-tree-mudflap.h"
We prepare a little dummy struct here.
diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c
index 51bc7cd90cd..2acb2ebaa34 100644
--- a/gcc/tree-nrv.c
+++ b/gcc/tree-nrv.c
@@ -269,26 +269,44 @@ gate_pass_return_slot (void)
return optimize > 0;
}
-struct gimple_opt_pass pass_nrv =
+namespace {
+
+const pass_data pass_data_nrv =
{
- {
- GIMPLE_PASS,
- "nrv", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_pass_return_slot, /* gate */
- tree_nrv, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_NRV, /* tv_id */
- PROP_ssa | PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "nrv", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_NRV, /* tv_id */
+ ( PROP_ssa | PROP_cfg ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_nrv : public gimple_opt_pass
+{
+public:
+ pass_nrv(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_nrv, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_pass_return_slot (); }
+ unsigned int execute () { return tree_nrv (); }
+
+}; // class pass_nrv
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_nrv (gcc::context *ctxt)
+{
+ return new pass_nrv (ctxt);
+}
+
/* Determine (pessimistically) whether DEST is available for NRV
optimization, where DEST is expected to be the LHS of a modify
expression where the RHS is a function returning an aggregate.
@@ -355,22 +373,39 @@ execute_return_slot_opt (void)
return 0;
}
-struct gimple_opt_pass pass_return_slot =
+namespace {
+
+const pass_data pass_data_return_slot =
{
- {
- GIMPLE_PASS,
- "retslot", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- execute_return_slot_opt, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "retslot", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_return_slot : public gimple_opt_pass
+{
+public:
+ pass_return_slot(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_return_slot, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return execute_return_slot_opt (); }
+
+}; // class pass_return_slot
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_return_slot (gcc::context *ctxt)
+{
+ return new pass_return_slot (ctxt);
+}
diff --git a/gcc/tree-object-size.c b/gcc/tree-object-size.c
index 16345713505..1a52a416a63 100644
--- a/gcc/tree-object-size.c
+++ b/gcc/tree-object-size.c
@@ -1262,22 +1262,40 @@ compute_object_sizes (void)
return 0;
}
-struct gimple_opt_pass pass_object_sizes =
+namespace {
+
+const pass_data pass_data_object_sizes =
{
- {
- GIMPLE_PASS,
- "objsz", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- compute_object_sizes, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "objsz", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
+
+class pass_object_sizes : public gimple_opt_pass
+{
+public:
+ pass_object_sizes(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_object_sizes, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_object_sizes (ctxt_); }
+ unsigned int execute () { return compute_object_sizes (); }
+
+}; // class pass_object_sizes
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_object_sizes (gcc::context *ctxt)
+{
+ return new pass_object_sizes (ctxt);
+}
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index 0948d2e6977..9c99ec23a2e 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -88,26 +88,45 @@ execute_cleanup_cfg_post_optimizing (void)
return todo;
}
-struct gimple_opt_pass pass_cleanup_cfg_post_optimizing =
+namespace {
+
+const pass_data pass_data_cleanup_cfg_post_optimizing =
{
- {
- GIMPLE_PASS,
- "optimized", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- execute_cleanup_cfg_post_optimizing, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_CLEANUP_CFG, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_remove_unused_locals /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "optimized", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_CLEANUP_CFG, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_remove_unused_locals, /* todo_flags_finish */
};
+class pass_cleanup_cfg_post_optimizing : public gimple_opt_pass
+{
+public:
+ pass_cleanup_cfg_post_optimizing(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_cleanup_cfg_post_optimizing, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () {
+ return execute_cleanup_cfg_post_optimizing ();
+ }
+
+}; // class pass_cleanup_cfg_post_optimizing
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_cleanup_cfg_post_optimizing (gcc::context *ctxt)
+{
+ return new pass_cleanup_cfg_post_optimizing (ctxt);
+}
+
/* IPA passes, compilation of earlier functions or inlining
might have changed some properties, such as marked functions nothrow,
pure, const or noreturn.
@@ -211,22 +230,40 @@ execute_fixup_cfg (void)
return todo;
}
-struct gimple_opt_pass pass_fixup_cfg =
+namespace {
+
+const pass_data pass_data_fixup_cfg =
{
- {
- GIMPLE_PASS,
- "*free_cfg_annotations", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- execute_fixup_cfg, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "*free_cfg_annotations", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_fixup_cfg : public gimple_opt_pass
+{
+public:
+ pass_fixup_cfg(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_fixup_cfg, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_fixup_cfg (ctxt_); }
+ unsigned int execute () { return execute_fixup_cfg (); }
+
+}; // class pass_fixup_cfg
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_fixup_cfg (gcc::context *ctxt)
+{
+ return new pass_fixup_cfg (ctxt);
+}
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index 41f7d176c40..41d5d92c8a9 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -330,237 +330,247 @@ struct register_pass_info
enum pass_positioning_ops pos_op; /* how to insert the new pass. */
};
-extern struct gimple_opt_pass pass_mudflap_1;
-extern struct gimple_opt_pass pass_mudflap_2;
-extern struct gimple_opt_pass pass_asan;
-extern struct gimple_opt_pass pass_asan_O0;
-extern struct gimple_opt_pass pass_tsan;
-extern struct gimple_opt_pass pass_tsan_O0;
-extern struct gimple_opt_pass pass_lower_cf;
-extern struct gimple_opt_pass pass_refactor_eh;
-extern struct gimple_opt_pass pass_lower_eh;
-extern struct gimple_opt_pass pass_lower_eh_dispatch;
-extern struct gimple_opt_pass pass_lower_resx;
-extern struct gimple_opt_pass pass_build_cfg;
-extern struct gimple_opt_pass pass_early_tree_profile;
-extern struct gimple_opt_pass pass_cleanup_eh;
-extern struct gimple_opt_pass pass_sra;
-extern struct gimple_opt_pass pass_sra_early;
-extern struct gimple_opt_pass pass_early_ipa_sra;
-extern struct gimple_opt_pass pass_tail_recursion;
-extern struct gimple_opt_pass pass_tail_calls;
-extern struct gimple_opt_pass pass_tree_loop;
-extern struct gimple_opt_pass pass_tree_loop_init;
-extern struct gimple_opt_pass pass_lim;
-extern struct gimple_opt_pass pass_tree_unswitch;
-extern struct gimple_opt_pass pass_predcom;
-extern struct gimple_opt_pass pass_iv_canon;
-extern struct gimple_opt_pass pass_scev_cprop;
-extern struct gimple_opt_pass pass_empty_loop;
-extern struct gimple_opt_pass pass_record_bounds;
-extern struct gimple_opt_pass pass_graphite;
-extern struct gimple_opt_pass pass_graphite_transforms;
-extern struct gimple_opt_pass pass_if_conversion;
-extern struct gimple_opt_pass pass_loop_distribution;
-extern struct gimple_opt_pass pass_vectorize;
-extern struct gimple_opt_pass pass_slp_vectorize;
-extern struct gimple_opt_pass pass_complete_unroll;
-extern struct gimple_opt_pass pass_complete_unrolli;
-extern struct gimple_opt_pass pass_parallelize_loops;
-extern struct gimple_opt_pass pass_loop_prefetch;
-extern struct gimple_opt_pass pass_iv_optimize;
-extern struct gimple_opt_pass pass_tree_loop_done;
-extern struct gimple_opt_pass pass_ch;
-extern struct gimple_opt_pass pass_ccp;
-extern struct gimple_opt_pass pass_phi_only_cprop;
-extern struct gimple_opt_pass pass_build_ssa;
-extern struct gimple_opt_pass pass_build_alias;
-extern struct gimple_opt_pass pass_build_ealias;
-extern struct gimple_opt_pass pass_dominator;
-extern struct gimple_opt_pass pass_dce;
-extern struct gimple_opt_pass pass_dce_loop;
-extern struct gimple_opt_pass pass_cd_dce;
-extern struct gimple_opt_pass pass_call_cdce;
-extern struct gimple_opt_pass pass_merge_phi;
-extern struct gimple_opt_pass pass_split_crit_edges;
-extern struct gimple_opt_pass pass_pre;
+extern gimple_opt_pass *make_pass_mudflap_1 (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_mudflap_2 (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_asan (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_asan_O0 (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_tsan (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_tsan_O0 (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_lower_cf (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_refactor_eh (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_lower_eh (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_lower_eh_dispatch (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_lower_resx (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_build_cfg (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_early_tree_profile (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_cleanup_eh (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_sra (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_sra_early (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_early_ipa_sra (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_tail_recursion (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_tail_calls (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_tree_loop (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_tree_loop_init (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_lim (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_tree_unswitch (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_predcom (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_iv_canon (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_scev_cprop (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_empty_loop (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_record_bounds (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_graphite (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_graphite_transforms (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_if_conversion (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_loop_distribution (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_vectorize (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_slp_vectorize (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_complete_unroll (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_complete_unrolli (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_parallelize_loops (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_loop_prefetch (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_iv_optimize (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_tree_loop_done (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_ch (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_ccp (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_phi_only_cprop (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_build_ssa (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_build_alias (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_build_ealias (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_dominator (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_dce (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_dce_loop (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_cd_dce (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_call_cdce (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_merge_phi (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_split_crit_edges (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_pre (gcc::context *ctxt);
extern unsigned int tail_merge_optimize (unsigned int);
-extern struct gimple_opt_pass pass_profile;
-extern struct gimple_opt_pass pass_strip_predict_hints;
-extern struct gimple_opt_pass pass_lower_complex_O0;
-extern struct gimple_opt_pass pass_lower_complex;
-extern struct gimple_opt_pass pass_lower_vector;
-extern struct gimple_opt_pass pass_lower_vector_ssa;
-extern struct gimple_opt_pass pass_lower_omp;
-extern struct gimple_opt_pass pass_diagnose_omp_blocks;
-extern struct gimple_opt_pass pass_expand_omp;
-extern struct gimple_opt_pass pass_expand_omp_ssa;
-extern struct gimple_opt_pass pass_object_sizes;
-extern struct gimple_opt_pass pass_strlen;
-extern struct gimple_opt_pass pass_fold_builtins;
-extern struct gimple_opt_pass pass_stdarg;
-extern struct gimple_opt_pass pass_early_warn_uninitialized;
-extern struct gimple_opt_pass pass_late_warn_uninitialized;
-extern struct gimple_opt_pass pass_cse_reciprocals;
-extern struct gimple_opt_pass pass_cse_sincos;
-extern struct gimple_opt_pass pass_optimize_bswap;
-extern struct gimple_opt_pass pass_optimize_widening_mul;
-extern struct gimple_opt_pass pass_warn_function_return;
-extern struct gimple_opt_pass pass_warn_function_noreturn;
-extern struct gimple_opt_pass pass_cselim;
-extern struct gimple_opt_pass pass_phiopt;
-extern struct gimple_opt_pass pass_forwprop;
-extern struct gimple_opt_pass pass_phiprop;
-extern struct gimple_opt_pass pass_tree_ifcombine;
-extern struct gimple_opt_pass pass_dse;
-extern struct gimple_opt_pass pass_nrv;
-extern struct gimple_opt_pass pass_rename_ssa_copies;
-extern struct gimple_opt_pass pass_sink_code;
-extern struct gimple_opt_pass pass_fre;
-extern struct gimple_opt_pass pass_check_data_deps;
-extern struct gimple_opt_pass pass_copy_prop;
-extern struct gimple_opt_pass pass_vrp;
-extern struct gimple_opt_pass pass_uncprop;
-extern struct gimple_opt_pass pass_return_slot;
-extern struct gimple_opt_pass pass_reassoc;
-extern struct gimple_opt_pass pass_rebuild_cgraph_edges;
-extern struct gimple_opt_pass pass_remove_cgraph_callee_edges;
-extern struct gimple_opt_pass pass_build_cgraph_edges;
-extern struct gimple_opt_pass pass_local_pure_const;
-extern struct gimple_opt_pass pass_tracer;
-extern struct gimple_opt_pass pass_warn_unused_result;
-extern struct gimple_opt_pass pass_diagnose_tm_blocks;
-extern struct gimple_opt_pass pass_lower_tm;
-extern struct gimple_opt_pass pass_tm_init;
-extern struct gimple_opt_pass pass_tm_mark;
-extern struct gimple_opt_pass pass_tm_memopt;
-extern struct gimple_opt_pass pass_tm_edges;
-extern struct gimple_opt_pass pass_split_functions;
-extern struct gimple_opt_pass pass_feedback_split_functions;
-extern struct gimple_opt_pass pass_strength_reduction;
+extern gimple_opt_pass *make_pass_profile (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_strip_predict_hints (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_lower_complex_O0 (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_lower_complex (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_lower_vector (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_lower_vector_ssa (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_lower_omp (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_diagnose_omp_blocks (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_expand_omp (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_expand_omp_ssa (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_object_sizes (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_strlen (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_fold_builtins (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_stdarg (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_early_warn_uninitialized (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_late_warn_uninitialized (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_cse_reciprocals (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_cse_sincos (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_optimize_bswap (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_optimize_widening_mul (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_warn_function_return (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_warn_function_noreturn (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_cselim (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_phiopt (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_forwprop (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_phiprop (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_tree_ifcombine (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_dse (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_nrv (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_rename_ssa_copies (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_sink_code (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_fre (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_check_data_deps (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_copy_prop (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_vrp (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_uncprop (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_return_slot (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_reassoc (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_rebuild_cgraph_edges (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_remove_cgraph_callee_edges (gcc::context
+ *ctxt);
+extern gimple_opt_pass *make_pass_build_cgraph_edges (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_local_pure_const (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_tracer (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_warn_unused_result (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_diagnose_tm_blocks (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_lower_tm (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_tm_init (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_tm_mark (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_tm_memopt (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_tm_edges (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_split_functions (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_feedback_split_functions (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_strength_reduction (gcc::context *ctxt);
/* IPA Passes */
-extern struct simple_ipa_opt_pass pass_ipa_lower_emutls;
-extern struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility;
-extern struct simple_ipa_opt_pass pass_ipa_tree_profile;
-
-extern struct simple_ipa_opt_pass pass_early_local_passes;
-
-extern struct ipa_opt_pass_d pass_ipa_whole_program_visibility;
-extern struct ipa_opt_pass_d pass_ipa_lto_gimple_out;
-extern struct simple_ipa_opt_pass pass_ipa_increase_alignment;
-extern struct ipa_opt_pass_d pass_ipa_inline;
-extern struct simple_ipa_opt_pass pass_ipa_free_lang_data;
-extern struct simple_ipa_opt_pass pass_ipa_free_inline_summary;
-extern struct ipa_opt_pass_d pass_ipa_cp;
-extern struct ipa_opt_pass_d pass_ipa_reference;
-extern struct ipa_opt_pass_d pass_ipa_pure_const;
-extern struct simple_ipa_opt_pass pass_ipa_pta;
-extern struct ipa_opt_pass_d pass_ipa_lto_finish_out;
-extern struct simple_ipa_opt_pass pass_ipa_tm;
-extern struct ipa_opt_pass_d pass_ipa_profile;
-extern struct ipa_opt_pass_d pass_ipa_cdtor_merge;
-
-extern struct gimple_opt_pass pass_cleanup_cfg_post_optimizing;
-extern struct gimple_opt_pass pass_init_datastructures;
-extern struct gimple_opt_pass pass_fixup_cfg;
-
-extern struct rtl_opt_pass pass_expand;
-extern struct rtl_opt_pass pass_instantiate_virtual_regs;
-extern struct rtl_opt_pass pass_rtl_fwprop;
-extern struct rtl_opt_pass pass_rtl_fwprop_addr;
-extern struct rtl_opt_pass pass_jump;
-extern struct rtl_opt_pass pass_jump2;
-extern struct rtl_opt_pass pass_lower_subreg;
-extern struct rtl_opt_pass pass_cse;
-extern struct rtl_opt_pass pass_fast_rtl_dce;
-extern struct rtl_opt_pass pass_ud_rtl_dce;
-extern struct rtl_opt_pass pass_rtl_dce;
-extern struct rtl_opt_pass pass_rtl_dse1;
-extern struct rtl_opt_pass pass_rtl_dse2;
-extern struct rtl_opt_pass pass_rtl_dse3;
-extern struct rtl_opt_pass pass_rtl_cprop;
-extern struct rtl_opt_pass pass_rtl_pre;
-extern struct rtl_opt_pass pass_rtl_hoist;
-extern struct rtl_opt_pass pass_rtl_store_motion;
-extern struct rtl_opt_pass pass_cse_after_global_opts;
-extern struct rtl_opt_pass pass_rtl_ifcvt;
-
-extern struct rtl_opt_pass pass_into_cfg_layout_mode;
-extern struct rtl_opt_pass pass_outof_cfg_layout_mode;
-
-extern struct rtl_opt_pass pass_loop2;
-extern struct rtl_opt_pass pass_rtl_loop_init;
-extern struct rtl_opt_pass pass_rtl_move_loop_invariants;
-extern struct rtl_opt_pass pass_rtl_unswitch;
-extern struct rtl_opt_pass pass_rtl_unroll_and_peel_loops;
-extern struct rtl_opt_pass pass_rtl_doloop;
-extern struct rtl_opt_pass pass_rtl_loop_done;
-
-extern struct rtl_opt_pass pass_web;
-extern struct rtl_opt_pass pass_cse2;
-extern struct rtl_opt_pass pass_df_initialize_opt;
-extern struct rtl_opt_pass pass_df_initialize_no_opt;
-extern struct rtl_opt_pass pass_reginfo_init;
-extern struct rtl_opt_pass pass_inc_dec;
-extern struct rtl_opt_pass pass_stack_ptr_mod;
-extern struct rtl_opt_pass pass_initialize_regs;
-extern struct rtl_opt_pass pass_combine;
-extern struct rtl_opt_pass pass_if_after_combine;
-extern struct rtl_opt_pass pass_ree;
-extern struct rtl_opt_pass pass_partition_blocks;
-extern struct rtl_opt_pass pass_match_asm_constraints;
-extern struct rtl_opt_pass pass_regmove;
-extern struct rtl_opt_pass pass_split_all_insns;
-extern struct rtl_opt_pass pass_fast_rtl_byte_dce;
-extern struct rtl_opt_pass pass_lower_subreg2;
-extern struct rtl_opt_pass pass_mode_switching;
-extern struct rtl_opt_pass pass_sms;
-extern struct rtl_opt_pass pass_sched;
-extern struct rtl_opt_pass pass_ira;
-extern struct rtl_opt_pass pass_reload;
-extern struct rtl_opt_pass pass_clean_state;
-extern struct rtl_opt_pass pass_branch_prob;
-extern struct rtl_opt_pass pass_value_profile_transformations;
-extern struct rtl_opt_pass pass_postreload_cse;
-extern struct rtl_opt_pass pass_gcse2;
-extern struct rtl_opt_pass pass_split_after_reload;
-extern struct rtl_opt_pass pass_branch_target_load_optimize1;
-extern struct rtl_opt_pass pass_thread_prologue_and_epilogue;
-extern struct rtl_opt_pass pass_stack_adjustments;
-extern struct rtl_opt_pass pass_peephole2;
-extern struct rtl_opt_pass pass_if_after_reload;
-extern struct rtl_opt_pass pass_regrename;
-extern struct rtl_opt_pass pass_cprop_hardreg;
-extern struct rtl_opt_pass pass_reorder_blocks;
-extern struct rtl_opt_pass pass_branch_target_load_optimize2;
-extern struct rtl_opt_pass pass_leaf_regs;
-extern struct rtl_opt_pass pass_split_before_sched2;
-extern struct rtl_opt_pass pass_compare_elim_after_reload;
-extern struct rtl_opt_pass pass_sched2;
-extern struct rtl_opt_pass pass_stack_regs;
-extern struct rtl_opt_pass pass_stack_regs_run;
-extern struct rtl_opt_pass pass_df_finish;
-extern struct rtl_opt_pass pass_compute_alignments;
-extern struct rtl_opt_pass pass_duplicate_computed_gotos;
-extern struct rtl_opt_pass pass_variable_tracking;
-extern struct rtl_opt_pass pass_free_cfg;
-extern struct rtl_opt_pass pass_machine_reorg;
-extern struct rtl_opt_pass pass_cleanup_barriers;
-extern struct rtl_opt_pass pass_delay_slots;
-extern struct rtl_opt_pass pass_split_for_shorten_branches;
-extern struct rtl_opt_pass pass_split_before_regstack;
-extern struct rtl_opt_pass pass_convert_to_eh_region_ranges;
-extern struct rtl_opt_pass pass_shorten_branches;
-extern struct rtl_opt_pass pass_set_nothrow_function_flags;
-extern struct rtl_opt_pass pass_dwarf2_frame;
-extern struct rtl_opt_pass pass_final;
-extern struct rtl_opt_pass pass_rtl_seqabstr;
-extern struct gimple_opt_pass pass_release_ssa_names;
-extern struct gimple_opt_pass pass_early_inline;
-extern struct gimple_opt_pass pass_inline_parameters;
-extern struct gimple_opt_pass pass_update_address_taken;
-extern struct gimple_opt_pass pass_convert_switch;
+extern simple_ipa_opt_pass *make_pass_ipa_lower_emutls (gcc::context *ctxt);
+extern simple_ipa_opt_pass
+ *make_pass_ipa_function_and_variable_visibility (gcc::context *ctxt);
+extern simple_ipa_opt_pass *make_pass_ipa_tree_profile (gcc::context *ctxt);
+
+extern simple_ipa_opt_pass *make_pass_early_local_passes (gcc::context *ctxt);
+
+extern ipa_opt_pass_d *make_pass_ipa_whole_program_visibility (gcc::context
+ *ctxt);
+extern ipa_opt_pass_d *make_pass_ipa_lto_gimple_out (gcc::context *ctxt);
+extern simple_ipa_opt_pass *make_pass_ipa_increase_alignment (gcc::context
+ *ctxt);
+extern ipa_opt_pass_d *make_pass_ipa_inline (gcc::context *ctxt);
+extern simple_ipa_opt_pass *make_pass_ipa_free_lang_data (gcc::context *ctxt);
+extern simple_ipa_opt_pass *make_pass_ipa_free_inline_summary (gcc::context
+ *ctxt);
+extern ipa_opt_pass_d *make_pass_ipa_cp (gcc::context *ctxt);
+extern ipa_opt_pass_d *make_pass_ipa_reference (gcc::context *ctxt);
+extern ipa_opt_pass_d *make_pass_ipa_pure_const (gcc::context *ctxt);
+extern simple_ipa_opt_pass *make_pass_ipa_pta (gcc::context *ctxt);
+extern ipa_opt_pass_d *make_pass_ipa_lto_finish_out (gcc::context *ctxt);
+extern simple_ipa_opt_pass *make_pass_ipa_tm (gcc::context *ctxt);
+extern ipa_opt_pass_d *make_pass_ipa_profile (gcc::context *ctxt);
+extern ipa_opt_pass_d *make_pass_ipa_cdtor_merge (gcc::context *ctxt);
+
+extern gimple_opt_pass *make_pass_cleanup_cfg_post_optimizing (gcc::context
+ *ctxt);
+extern gimple_opt_pass *make_pass_init_datastructures (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_fixup_cfg (gcc::context *ctxt);
+
+extern rtl_opt_pass *make_pass_expand (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_instantiate_virtual_regs (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_fwprop (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_fwprop_addr (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_jump (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_jump2 (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_lower_subreg (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_cse (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_fast_rtl_dce (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_ud_rtl_dce (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_dce (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_dse1 (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_dse2 (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_dse3 (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_cprop (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_pre (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_hoist (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_store_motion (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_cse_after_global_opts (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_ifcvt (gcc::context *ctxt);
+
+extern rtl_opt_pass *make_pass_into_cfg_layout_mode (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_outof_cfg_layout_mode (gcc::context *ctxt);
+
+extern rtl_opt_pass *make_pass_loop2 (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_loop_init (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_move_loop_invariants (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_unswitch (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_unroll_and_peel_loops (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_doloop (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_loop_done (gcc::context *ctxt);
+
+extern rtl_opt_pass *make_pass_web (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_cse2 (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_df_initialize_opt (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_df_initialize_no_opt (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_reginfo_init (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_inc_dec (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_stack_ptr_mod (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_initialize_regs (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_combine (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_if_after_combine (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_ree (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_partition_blocks (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_match_asm_constraints (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_regmove (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_split_all_insns (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_fast_rtl_byte_dce (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_lower_subreg2 (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_mode_switching (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_sms (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_sched (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_ira (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_reload (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_clean_state (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_branch_prob (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_value_profile_transformations (gcc::context
+ *ctxt);
+extern rtl_opt_pass *make_pass_postreload_cse (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_gcse2 (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_split_after_reload (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_branch_target_load_optimize1 (gcc::context
+ *ctxt);
+extern rtl_opt_pass *make_pass_thread_prologue_and_epilogue (gcc::context
+ *ctxt);
+extern rtl_opt_pass *make_pass_stack_adjustments (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_peephole2 (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_if_after_reload (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_regrename (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_cprop_hardreg (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_reorder_blocks (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_branch_target_load_optimize2 (gcc::context
+ *ctxt);
+extern rtl_opt_pass *make_pass_leaf_regs (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_split_before_sched2 (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_compare_elim_after_reload (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_sched2 (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_stack_regs (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_stack_regs_run (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_df_finish (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_compute_alignments (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_duplicate_computed_gotos (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_variable_tracking (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_free_cfg (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_machine_reorg (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_cleanup_barriers (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_delay_slots (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_split_for_shorten_branches (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_split_before_regstack (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_convert_to_eh_region_ranges (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_shorten_branches (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_set_nothrow_function_flags (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_dwarf2_frame (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_final (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_rtl_seqabstr (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_release_ssa_names (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_early_inline (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_inline_parameters (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_update_address_taken (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_convert_switch (gcc::context *ctxt);
/* Current optimization pass. */
extern struct opt_pass *current_pass;
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
index 9985b40a2a8..e276a592b2f 100644
--- a/gcc/tree-profile.c
+++ b/gcc/tree-profile.c
@@ -561,24 +561,42 @@ gate_tree_profile_ipa (void)
|| profile_arc_flag));
}
-struct simple_ipa_opt_pass pass_ipa_tree_profile =
+namespace {
+
+const pass_data pass_data_ipa_tree_profile =
{
- {
- SIMPLE_IPA_PASS,
- "profile", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_tree_profile_ipa, /* gate */
- tree_profiling, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_PROFILE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ SIMPLE_IPA_PASS, /* type */
+ "profile", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IPA_PROFILE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_ipa_tree_profile : public simple_ipa_opt_pass
+{
+public:
+ pass_ipa_tree_profile(gcc::context *ctxt)
+ : simple_ipa_opt_pass(pass_data_ipa_tree_profile, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tree_profile_ipa (); }
+ unsigned int execute () { return tree_profiling (); }
+
+}; // class pass_ipa_tree_profile
+
+} // anon namespace
+
+simple_ipa_opt_pass *
+make_pass_ipa_tree_profile (gcc::context *ctxt)
+{
+ return new pass_ipa_tree_profile (ctxt);
+}
+
#include "gt-tree-profile.h"
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 7e950aeecdf..2bce84843b9 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -3442,48 +3442,82 @@ gate_intra_sra (void)
}
-struct gimple_opt_pass pass_sra_early =
+namespace {
+
+const pass_data pass_data_sra_early =
{
- {
- GIMPLE_PASS,
- "esra", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_intra_sra, /* gate */
- early_intra_sra, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_SRA, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa
- | TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "esra", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_SRA, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */
};
-struct gimple_opt_pass pass_sra =
+class pass_sra_early : public gimple_opt_pass
+{
+public:
+ pass_sra_early(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_sra_early, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_intra_sra (); }
+ unsigned int execute () { return early_intra_sra (); }
+
+}; // class pass_sra_early
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_sra_early (gcc::context *ctxt)
+{
+ return new pass_sra_early (ctxt);
+}
+
+namespace {
+
+const pass_data pass_data_sra =
{
- {
- GIMPLE_PASS,
- "sra", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_intra_sra, /* gate */
- late_intra_sra, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_SRA, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- TODO_update_address_taken, /* todo_flags_start */
- TODO_update_ssa
- | TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "sra", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_SRA, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ TODO_update_address_taken, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */
};
+class pass_sra : public gimple_opt_pass
+{
+public:
+ pass_sra(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_sra, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_intra_sra (); }
+ unsigned int execute () { return late_intra_sra (); }
+
+}; // class pass_sra
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_sra (gcc::context *ctxt)
+{
+ return new pass_sra (ctxt);
+}
+
/* Return true iff PARM (which must be a parm_decl) is an unused scalar
parameter. */
@@ -5018,22 +5052,40 @@ ipa_early_sra_gate (void)
return flag_ipa_sra && dbg_cnt (eipa_sra);
}
-struct gimple_opt_pass pass_early_ipa_sra =
+namespace {
+
+const pass_data pass_data_early_ipa_sra =
{
- {
- GIMPLE_PASS,
- "eipa_sra", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- ipa_early_sra_gate, /* gate */
- ipa_early_sra, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_SRA, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_dump_symtab /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "eipa_sra", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IPA_SRA, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_dump_symtab, /* todo_flags_finish */
};
+
+class pass_early_ipa_sra : public gimple_opt_pass
+{
+public:
+ pass_early_ipa_sra(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_early_ipa_sra, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return ipa_early_sra_gate (); }
+ unsigned int execute () { return ipa_early_sra (); }
+
+}; // class pass_early_ipa_sra
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_early_ipa_sra (gcc::context *ctxt)
+{
+ return new pass_early_ipa_sra (ctxt);
+}
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 1bc4c2fb7b5..6472f484e33 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -2121,28 +2121,46 @@ gate_ccp (void)
}
-struct gimple_opt_pass pass_ccp =
+namespace {
+
+const pass_data pass_data_ccp =
{
- {
- GIMPLE_PASS,
- "ccp", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_ccp, /* gate */
- do_ssa_ccp, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_CCP, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa
- | TODO_update_address_taken
- | TODO_verify_stmts /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "ccp", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_CCP, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_ssa | TODO_update_address_taken
+ | TODO_verify_stmts ), /* todo_flags_finish */
};
+class pass_ccp : public gimple_opt_pass
+{
+public:
+ pass_ccp(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_ccp, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_ccp (ctxt_); }
+ bool gate () { return gate_ccp (); }
+ unsigned int execute () { return do_ssa_ccp (); }
+
+}; // class pass_ccp
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_ccp (gcc::context *ctxt)
+{
+ return new pass_ccp (ctxt);
+}
+
/* Try to optimize out __builtin_stack_restore. Optimize it out
@@ -2521,23 +2539,40 @@ execute_fold_all_builtins (void)
}
-struct gimple_opt_pass pass_fold_builtins =
+namespace {
+
+const pass_data pass_data_fold_builtins =
{
- {
- GIMPLE_PASS,
- "fab", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- execute_fold_all_builtins, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa
- | TODO_update_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "fab", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_ssa | TODO_update_ssa ), /* todo_flags_finish */
};
+
+class pass_fold_builtins : public gimple_opt_pass
+{
+public:
+ pass_fold_builtins(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_fold_builtins, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_fold_builtins (ctxt_); }
+ unsigned int execute () { return execute_fold_all_builtins (); }
+
+}; // class pass_fold_builtins
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_fold_builtins (gcc::context *ctxt)
+{
+ return new pass_fold_builtins (ctxt);
+}
diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c
index 625f46e1942..75ab54aeda6 100644
--- a/gcc/tree-ssa-copy.c
+++ b/gcc/tree-ssa-copy.c
@@ -823,24 +823,42 @@ gate_copy_prop (void)
return flag_tree_copy_prop != 0;
}
-struct gimple_opt_pass pass_copy_prop =
+namespace {
+
+const pass_data pass_data_copy_prop =
{
- {
- GIMPLE_PASS,
- "copyprop", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_copy_prop, /* gate */
- execute_copy_prop, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_COPY_PROP, /* tv_id */
- PROP_ssa | PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_cleanup_cfg
- | TODO_verify_ssa
- | TODO_update_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "copyprop", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_COPY_PROP, /* tv_id */
+ ( PROP_ssa | PROP_cfg ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_cleanup_cfg | TODO_verify_ssa
+ | TODO_update_ssa ), /* todo_flags_finish */
};
+
+class pass_copy_prop : public gimple_opt_pass
+{
+public:
+ pass_copy_prop(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_copy_prop, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_copy_prop (ctxt_); }
+ bool gate () { return gate_copy_prop (); }
+ unsigned int execute () { return execute_copy_prop (); }
+
+}; // class pass_copy_prop
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_copy_prop (gcc::context *ctxt)
+{
+ return new pass_copy_prop (ctxt);
+}
diff --git a/gcc/tree-ssa-copyrename.c b/gcc/tree-ssa-copyrename.c
index 6f49b7ecf5a..990598ef29b 100644
--- a/gcc/tree-ssa-copyrename.c
+++ b/gcc/tree-ssa-copyrename.c
@@ -435,22 +435,41 @@ gate_copyrename (void)
return flag_tree_copyrename != 0;
}
-struct gimple_opt_pass pass_rename_ssa_copies =
+namespace {
+
+const pass_data pass_data_rename_ssa_copies =
{
- {
- GIMPLE_PASS,
- "copyrename", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_copyrename, /* gate */
- rename_ssa_copies, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_COPY_RENAME, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "copyrename", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_COPY_RENAME, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
+
+class pass_rename_ssa_copies : public gimple_opt_pass
+{
+public:
+ pass_rename_ssa_copies(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_rename_ssa_copies, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_rename_ssa_copies (ctxt_); }
+ bool gate () { return gate_copyrename (); }
+ unsigned int execute () { return rename_ssa_copies (); }
+
+}; // class pass_rename_ssa_copies
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_rename_ssa_copies (gcc::context *ctxt)
+{
+ return new pass_rename_ssa_copies (ctxt);
+}
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index fd1bc69be56..4fd3cd8ad24 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -1643,63 +1643,119 @@ gate_dce (void)
return flag_tree_dce != 0;
}
-struct gimple_opt_pass pass_dce =
+namespace {
+
+const pass_data pass_data_dce =
{
- {
- GIMPLE_PASS,
- "dce", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_dce, /* gate */
- tree_ssa_dce, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_DCE, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "dce", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_DCE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
-struct gimple_opt_pass pass_dce_loop =
+class pass_dce : public gimple_opt_pass
+{
+public:
+ pass_dce(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_dce, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_dce (ctxt_); }
+ bool gate () { return gate_dce (); }
+ unsigned int execute () { return tree_ssa_dce (); }
+
+}; // class pass_dce
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_dce (gcc::context *ctxt)
+{
+ return new pass_dce (ctxt);
+}
+
+namespace {
+
+const pass_data pass_data_dce_loop =
{
- {
- GIMPLE_PASS,
- "dceloop", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_dce, /* gate */
- tree_ssa_dce_loop, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_DCE, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "dceloop", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_DCE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
-struct gimple_opt_pass pass_cd_dce =
+class pass_dce_loop : public gimple_opt_pass
{
- {
- GIMPLE_PASS,
- "cddce", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_dce, /* gate */
- tree_ssa_cd_dce, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_CD_DCE, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa
- | TODO_verify_flow /* todo_flags_finish */
- }
+public:
+ pass_dce_loop(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_dce_loop, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_dce_loop (ctxt_); }
+ bool gate () { return gate_dce (); }
+ unsigned int execute () { return tree_ssa_dce_loop (); }
+
+}; // class pass_dce_loop
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_dce_loop (gcc::context *ctxt)
+{
+ return new pass_dce_loop (ctxt);
+}
+
+namespace {
+
+const pass_data pass_data_cd_dce =
+{
+ GIMPLE_PASS, /* type */
+ "cddce", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_CD_DCE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_ssa | TODO_verify_flow ), /* todo_flags_finish */
};
+
+class pass_cd_dce : public gimple_opt_pass
+{
+public:
+ pass_cd_dce(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_cd_dce, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_cd_dce (ctxt_); }
+ bool gate () { return gate_dce (); }
+ unsigned int execute () { return tree_ssa_cd_dce (); }
+
+}; // class pass_cd_dce
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_cd_dce (gcc::context *ctxt)
+{
+ return new pass_cd_dce (ctxt);
+}
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 83ca27a0bf4..691e6f905a2 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -919,29 +919,47 @@ gate_dominator (void)
return flag_tree_dom != 0;
}
-struct gimple_opt_pass pass_dominator =
-{
- {
- GIMPLE_PASS,
- "dom", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_dominator, /* gate */
- tree_ssa_dominator_optimize, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_SSA_DOMINATOR_OPTS, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_cleanup_cfg
- | TODO_update_ssa
+namespace {
+
+const pass_data pass_data_dominator =
+{
+ GIMPLE_PASS, /* type */
+ "dom", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_SSA_DOMINATOR_OPTS, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_cleanup_cfg | TODO_update_ssa
| TODO_verify_ssa
- | TODO_verify_flow /* todo_flags_finish */
- }
+ | TODO_verify_flow ), /* todo_flags_finish */
};
+class pass_dominator : public gimple_opt_pass
+{
+public:
+ pass_dominator(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_dominator, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_dominator (ctxt_); }
+ bool gate () { return gate_dominator (); }
+ unsigned int execute () { return tree_ssa_dominator_optimize (); }
+
+}; // class pass_dominator
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_dominator (gcc::context *ctxt)
+{
+ return new pass_dominator (ctxt);
+}
+
/* Given a conditional statement CONDSTMT, convert the
condition to a canonical form. */
@@ -3094,25 +3112,43 @@ eliminate_degenerate_phis (void)
return 0;
}
-struct gimple_opt_pass pass_phi_only_cprop =
-{
- {
- GIMPLE_PASS,
- "phicprop", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_dominator, /* gate */
- eliminate_degenerate_phis, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_PHI_CPROP, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_cleanup_cfg
- | TODO_verify_ssa
+namespace {
+
+const pass_data pass_data_phi_only_cprop =
+{
+ GIMPLE_PASS, /* type */
+ "phicprop", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_PHI_CPROP, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_cleanup_cfg | TODO_verify_ssa
| TODO_verify_stmts
- | TODO_update_ssa /* todo_flags_finish */
- }
+ | TODO_update_ssa ), /* todo_flags_finish */
};
+
+class pass_phi_only_cprop : public gimple_opt_pass
+{
+public:
+ pass_phi_only_cprop(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_phi_only_cprop, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_phi_only_cprop (ctxt_); }
+ bool gate () { return gate_dominator (); }
+ unsigned int execute () { return eliminate_degenerate_phis (); }
+
+}; // class pass_phi_only_cprop
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_phi_only_cprop (gcc::context *ctxt)
+{
+ return new pass_phi_only_cprop (ctxt);
+}
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index 39f47abd83b..65787582a28 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -366,22 +366,41 @@ gate_dse (void)
return flag_tree_dse != 0;
}
-struct gimple_opt_pass pass_dse =
+namespace {
+
+const pass_data pass_data_dse =
{
- {
- GIMPLE_PASS,
- "dse", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_dse, /* gate */
- tree_ssa_dse, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_DSE, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "dse", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_DSE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
+
+class pass_dse : public gimple_opt_pass
+{
+public:
+ pass_dse(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_dse, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_dse (ctxt_); }
+ bool gate () { return gate_dse (); }
+ unsigned int execute () { return tree_ssa_dse (); }
+
+}; // class pass_dse
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_dse (gcc::context *ctxt)
+{
+ return new pass_dse (ctxt);
+}
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index df192952a1d..c3e0fac0775 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -3548,23 +3548,41 @@ gate_forwprop (void)
return flag_tree_forwprop;
}
-struct gimple_opt_pass pass_forwprop =
+namespace {
+
+const pass_data pass_data_forwprop =
{
- {
- GIMPLE_PASS,
- "forwprop", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_forwprop, /* gate */
- ssa_forward_propagate_and_combine, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_FORWPROP, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa
- | TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "forwprop", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_FORWPROP, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */
};
+
+class pass_forwprop : public gimple_opt_pass
+{
+public:
+ pass_forwprop(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_forwprop, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_forwprop (ctxt_); }
+ bool gate () { return gate_forwprop (); }
+ unsigned int execute () { return ssa_forward_propagate_and_combine (); }
+
+}; // class pass_forwprop
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_forwprop (gcc::context *ctxt)
+{
+ return new pass_forwprop (ctxt);
+}
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c
index 9598eb81a45..984a7634ef6 100644
--- a/gcc/tree-ssa-ifcombine.c
+++ b/gcc/tree-ssa-ifcombine.c
@@ -648,23 +648,40 @@ gate_ifcombine (void)
return 1;
}
-struct gimple_opt_pass pass_tree_ifcombine =
+namespace {
+
+const pass_data pass_data_tree_ifcombine =
{
- {
- GIMPLE_PASS,
- "ifcombine", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_ifcombine, /* gate */
- tree_ssa_ifcombine, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_IFCOMBINE, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa
- | TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "ifcombine", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_IFCOMBINE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */
};
+
+class pass_tree_ifcombine : public gimple_opt_pass
+{
+public:
+ pass_tree_ifcombine(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_tree_ifcombine, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_ifcombine (); }
+ unsigned int execute () { return tree_ssa_ifcombine (); }
+
+}; // class pass_tree_ifcombine
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_tree_ifcombine (gcc::context *ctxt)
+{
+ return new pass_tree_ifcombine (ctxt);
+}
diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c
index ff17c7e78fb..f500761c9c2 100644
--- a/gcc/tree-ssa-loop-ch.c
+++ b/gcc/tree-ssa-loop-ch.c
@@ -256,24 +256,41 @@ gate_ch (void)
return flag_tree_ch != 0;
}
-struct gimple_opt_pass pass_ch =
+namespace {
+
+const pass_data pass_data_ch =
{
- {
- GIMPLE_PASS,
- "ch", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_ch, /* gate */
- copy_loop_headers, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_CH, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_cleanup_cfg
- | TODO_verify_ssa
- | TODO_verify_flow /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "ch", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_CH, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_cleanup_cfg | TODO_verify_ssa
+ | TODO_verify_flow ), /* todo_flags_finish */
};
+
+class pass_ch : public gimple_opt_pass
+{
+public:
+ pass_ch(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_ch, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_ch (); }
+ unsigned int execute () { return copy_loop_headers (); }
+
+}; // class pass_ch
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_ch (gcc::context *ctxt)
+{
+ return new pass_ch (ctxt);
+}
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index 99e27a1359a..717f54ee932 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -41,26 +41,43 @@ gate_tree_loop (void)
return flag_tree_loop_optimize != 0;
}
-struct gimple_opt_pass pass_tree_loop =
-{
- {
- GIMPLE_PASS,
- "loop", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_tree_loop, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_LOOP, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_tree_loop =
+{
+ GIMPLE_PASS, /* type */
+ "loop", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ false, /* has_execute */
+ TV_TREE_LOOP, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
+class pass_tree_loop : public gimple_opt_pass
+{
+public:
+ pass_tree_loop(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_tree_loop, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tree_loop (); }
+
+}; // class pass_tree_loop
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_tree_loop (gcc::context *ctxt)
+{
+ return new pass_tree_loop (ctxt);
+}
+
/* Loop optimizer initialization. */
static unsigned int
@@ -80,26 +97,43 @@ tree_ssa_loop_init (void)
return 0;
}
-struct gimple_opt_pass pass_tree_loop_init =
-{
- {
- GIMPLE_PASS,
- "loopinit", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- NULL, /* gate */
- tree_ssa_loop_init, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_tree_loop_init =
+{
+ GIMPLE_PASS, /* type */
+ "loopinit", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_tree_loop_init : public gimple_opt_pass
+{
+public:
+ pass_tree_loop_init(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_tree_loop_init, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return tree_ssa_loop_init (); }
+
+}; // class pass_tree_loop_init
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_tree_loop_init (gcc::context *ctxt)
+{
+ return new pass_tree_loop_init (ctxt);
+}
+
/* Loop invariant motion pass. */
static unsigned int
@@ -117,26 +151,45 @@ gate_tree_ssa_loop_im (void)
return flag_tree_loop_im != 0;
}
-struct gimple_opt_pass pass_lim =
-{
- {
- GIMPLE_PASS,
- "lim", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_tree_ssa_loop_im, /* gate */
- tree_ssa_loop_im, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_LIM, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_lim =
+{
+ GIMPLE_PASS, /* type */
+ "lim", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_LIM, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_lim : public gimple_opt_pass
+{
+public:
+ pass_lim(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_lim, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_lim (ctxt_); }
+ bool gate () { return gate_tree_ssa_loop_im (); }
+ unsigned int execute () { return tree_ssa_loop_im (); }
+
+}; // class pass_lim
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_lim (gcc::context *ctxt)
+{
+ return new pass_lim (ctxt);
+}
+
/* Loop unswitching pass. */
static unsigned int
@@ -154,26 +207,44 @@ gate_tree_ssa_loop_unswitch (void)
return flag_unswitch_loops != 0;
}
-struct gimple_opt_pass pass_tree_unswitch =
-{
- {
- GIMPLE_PASS,
- "unswitch", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_tree_ssa_loop_unswitch, /* gate */
- tree_ssa_loop_unswitch, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_LOOP_UNSWITCH, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_tree_unswitch =
+{
+ GIMPLE_PASS, /* type */
+ "unswitch", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_LOOP_UNSWITCH, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_tree_unswitch : public gimple_opt_pass
+{
+public:
+ pass_tree_unswitch(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_tree_unswitch, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tree_ssa_loop_unswitch (); }
+ unsigned int execute () { return tree_ssa_loop_unswitch (); }
+
+}; // class pass_tree_unswitch
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_tree_unswitch (gcc::context *ctxt)
+{
+ return new pass_tree_unswitch (ctxt);
+}
+
/* Predictive commoning. */
static unsigned
@@ -191,26 +262,44 @@ gate_tree_predictive_commoning (void)
return flag_predictive_commoning != 0;
}
-struct gimple_opt_pass pass_predcom =
-{
- {
- GIMPLE_PASS,
- "pcom", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_tree_predictive_commoning, /* gate */
- run_tree_predictive_commoning, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_PREDCOM, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa_only_virtuals /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_predcom =
+{
+ GIMPLE_PASS, /* type */
+ "pcom", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_PREDCOM, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_update_ssa_only_virtuals, /* todo_flags_finish */
};
+class pass_predcom : public gimple_opt_pass
+{
+public:
+ pass_predcom(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_predcom, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tree_predictive_commoning (); }
+ unsigned int execute () { return run_tree_predictive_commoning (); }
+
+}; // class pass_predcom
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_predcom (gcc::context *ctxt)
+{
+ return new pass_predcom (ctxt);
+}
+
/* Loop autovectorization. */
static unsigned int
@@ -228,27 +317,44 @@ gate_tree_vectorize (void)
return flag_tree_vectorize;
}
-struct gimple_opt_pass pass_vectorize =
-{
- {
- GIMPLE_PASS,
- "vect", /* name */
- OPTGROUP_LOOP
- | OPTGROUP_VEC, /* optinfo_flags */
- gate_tree_vectorize, /* gate */
- tree_vectorize, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_VECTORIZATION, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_vectorize =
+{
+ GIMPLE_PASS, /* type */
+ "vect", /* name */
+ OPTGROUP_LOOP | OPTGROUP_VEC, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_VECTORIZATION, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_vectorize : public gimple_opt_pass
+{
+public:
+ pass_vectorize(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_vectorize, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tree_vectorize (); }
+ unsigned int execute () { return tree_vectorize (); }
+
+}; // class pass_vectorize
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_vectorize (gcc::context *ctxt)
+{
+ return new pass_vectorize (ctxt);
+}
+
/* GRAPHITE optimizations. */
static unsigned int
@@ -278,46 +384,81 @@ gate_graphite_transforms (void)
return flag_graphite != 0;
}
-struct gimple_opt_pass pass_graphite =
-{
- {
- GIMPLE_PASS,
- "graphite0", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_graphite_transforms, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_GRAPHITE, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_graphite =
+{
+ GIMPLE_PASS, /* type */
+ "graphite0", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ false, /* has_execute */
+ TV_GRAPHITE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
-struct gimple_opt_pass pass_graphite_transforms =
-{
- {
- GIMPLE_PASS,
- "graphite", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_graphite_transforms, /* gate */
- graphite_transforms, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_GRAPHITE_TRANSFORMS, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+class pass_graphite : public gimple_opt_pass
+{
+public:
+ pass_graphite(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_graphite, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_graphite_transforms (); }
+
+}; // class pass_graphite
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_graphite (gcc::context *ctxt)
+{
+ return new pass_graphite (ctxt);
+}
+
+namespace {
+
+const pass_data pass_data_graphite_transforms =
+{
+ GIMPLE_PASS, /* type */
+ "graphite", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_GRAPHITE_TRANSFORMS, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_graphite_transforms : public gimple_opt_pass
+{
+public:
+ pass_graphite_transforms(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_graphite_transforms, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_graphite_transforms (); }
+ unsigned int execute () { return graphite_transforms (); }
+
+}; // class pass_graphite_transforms
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_graphite_transforms (gcc::context *ctxt)
+{
+ return new pass_graphite_transforms (ctxt);
+}
+
/* Check the correctness of the data dependence analyzers. */
static unsigned int
@@ -336,26 +477,44 @@ gate_check_data_deps (void)
return flag_check_data_deps != 0;
}
-struct gimple_opt_pass pass_check_data_deps =
-{
- {
- GIMPLE_PASS,
- "ckdd", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_check_data_deps, /* gate */
- check_data_deps, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_CHECK_DATA_DEPS, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_check_data_deps =
+{
+ GIMPLE_PASS, /* type */
+ "ckdd", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_CHECK_DATA_DEPS, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_check_data_deps : public gimple_opt_pass
+{
+public:
+ pass_check_data_deps(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_check_data_deps, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_check_data_deps (); }
+ unsigned int execute () { return check_data_deps (); }
+
+}; // class pass_check_data_deps
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_check_data_deps (gcc::context *ctxt)
+{
+ return new pass_check_data_deps (ctxt);
+}
+
/* Canonical induction variable creation pass. */
static unsigned int
@@ -373,26 +532,44 @@ gate_tree_ssa_loop_ivcanon (void)
return flag_tree_loop_ivcanon != 0;
}
-struct gimple_opt_pass pass_iv_canon =
-{
- {
- GIMPLE_PASS,
- "ivcanon", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_tree_ssa_loop_ivcanon, /* gate */
- tree_ssa_loop_ivcanon, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_LOOP_IVCANON, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_iv_canon =
+{
+ GIMPLE_PASS, /* type */
+ "ivcanon", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_LOOP_IVCANON, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_iv_canon : public gimple_opt_pass
+{
+public:
+ pass_iv_canon(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_iv_canon, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tree_ssa_loop_ivcanon (); }
+ unsigned int execute () { return tree_ssa_loop_ivcanon (); }
+
+}; // class pass_iv_canon
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_iv_canon (gcc::context *ctxt)
+{
+ return new pass_iv_canon (ctxt);
+}
+
/* Propagation of constants using scev. */
static bool
@@ -401,28 +578,45 @@ gate_scev_const_prop (void)
return flag_tree_scev_cprop;
}
-struct gimple_opt_pass pass_scev_cprop =
-{
- {
- GIMPLE_PASS,
- "sccp", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_scev_const_prop, /* gate */
- scev_const_prop, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_SCEV_CONST, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_cleanup_cfg
- | TODO_update_ssa_only_virtuals
- /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_scev_cprop =
+{
+ GIMPLE_PASS, /* type */
+ "sccp", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_SCEV_CONST, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_cleanup_cfg
+ | TODO_update_ssa_only_virtuals ), /* todo_flags_finish */
};
+class pass_scev_cprop : public gimple_opt_pass
+{
+public:
+ pass_scev_cprop(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_scev_cprop, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_scev_const_prop (); }
+ unsigned int execute () { return scev_const_prop (); }
+
+}; // class pass_scev_cprop
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_scev_cprop (gcc::context *ctxt)
+{
+ return new pass_scev_cprop (ctxt);
+}
+
/* Record bounds on numbers of iterations of loops. */
static unsigned int
@@ -436,26 +630,43 @@ tree_ssa_loop_bounds (void)
return 0;
}
-struct gimple_opt_pass pass_record_bounds =
-{
- {
- GIMPLE_PASS,
- "*record_bounds", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- tree_ssa_loop_bounds, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_LOOP_BOUNDS, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_record_bounds =
+{
+ GIMPLE_PASS, /* type */
+ "*record_bounds", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_LOOP_BOUNDS, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_record_bounds : public gimple_opt_pass
+{
+public:
+ pass_record_bounds(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_record_bounds, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return tree_ssa_loop_bounds (); }
+
+}; // class pass_record_bounds
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_record_bounds (gcc::context *ctxt)
+{
+ return new pass_record_bounds (ctxt);
+}
+
/* Complete unrolling of loops. */
static unsigned int
@@ -475,26 +686,44 @@ gate_tree_complete_unroll (void)
return true;
}
-struct gimple_opt_pass pass_complete_unroll =
-{
- {
- GIMPLE_PASS,
- "cunroll", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_tree_complete_unroll, /* gate */
- tree_complete_unroll, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_COMPLETE_UNROLL, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_complete_unroll =
+{
+ GIMPLE_PASS, /* type */
+ "cunroll", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_COMPLETE_UNROLL, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_complete_unroll : public gimple_opt_pass
+{
+public:
+ pass_complete_unroll(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_complete_unroll, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tree_complete_unroll (); }
+ unsigned int execute () { return tree_complete_unroll (); }
+
+}; // class pass_complete_unroll
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_complete_unroll (gcc::context *ctxt)
+{
+ return new pass_complete_unroll (ctxt);
+}
+
/* Complete unrolling of inner loops. */
static unsigned int
@@ -522,26 +751,44 @@ gate_tree_complete_unroll_inner (void)
return optimize >= 2;
}
-struct gimple_opt_pass pass_complete_unrolli =
-{
- {
- GIMPLE_PASS,
- "cunrolli", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_tree_complete_unroll_inner, /* gate */
- tree_complete_unroll_inner, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_COMPLETE_UNROLL, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_flow /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_complete_unrolli =
+{
+ GIMPLE_PASS, /* type */
+ "cunrolli", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_COMPLETE_UNROLL, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_flow, /* todo_flags_finish */
};
+class pass_complete_unrolli : public gimple_opt_pass
+{
+public:
+ pass_complete_unrolli(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_complete_unrolli, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tree_complete_unroll_inner (); }
+ unsigned int execute () { return tree_complete_unroll_inner (); }
+
+}; // class pass_complete_unrolli
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_complete_unrolli (gcc::context *ctxt)
+{
+ return new pass_complete_unrolli (ctxt);
+}
+
/* Parallelization. */
static bool
@@ -561,26 +808,44 @@ tree_parallelize_loops (void)
return 0;
}
-struct gimple_opt_pass pass_parallelize_loops =
-{
- {
- GIMPLE_PASS,
- "parloops", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_tree_parallelize_loops, /* gate */
- tree_parallelize_loops, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_PARALLELIZE_LOOPS, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_flow /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_parallelize_loops =
+{
+ GIMPLE_PASS, /* type */
+ "parloops", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_PARALLELIZE_LOOPS, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_flow, /* todo_flags_finish */
};
+class pass_parallelize_loops : public gimple_opt_pass
+{
+public:
+ pass_parallelize_loops(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_parallelize_loops, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tree_parallelize_loops (); }
+ unsigned int execute () { return tree_parallelize_loops (); }
+
+}; // class pass_parallelize_loops
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_parallelize_loops (gcc::context *ctxt)
+{
+ return new pass_parallelize_loops (ctxt);
+}
+
/* Prefetching. */
static unsigned int
@@ -598,26 +863,44 @@ gate_tree_ssa_loop_prefetch (void)
return flag_prefetch_loop_arrays > 0;
}
-struct gimple_opt_pass pass_loop_prefetch =
-{
- {
- GIMPLE_PASS,
- "aprefetch", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_tree_ssa_loop_prefetch, /* gate */
- tree_ssa_loop_prefetch, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_PREFETCH, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_loop_prefetch =
+{
+ GIMPLE_PASS, /* type */
+ "aprefetch", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_PREFETCH, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_loop_prefetch : public gimple_opt_pass
+{
+public:
+ pass_loop_prefetch(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_loop_prefetch, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tree_ssa_loop_prefetch (); }
+ unsigned int execute () { return tree_ssa_loop_prefetch (); }
+
+}; // class pass_loop_prefetch
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_loop_prefetch (gcc::context *ctxt)
+{
+ return new pass_loop_prefetch (ctxt);
+}
+
/* Induction variable optimizations. */
static unsigned int
@@ -636,26 +919,44 @@ gate_tree_ssa_loop_ivopts (void)
return flag_ivopts != 0;
}
-struct gimple_opt_pass pass_iv_optimize =
-{
- {
- GIMPLE_PASS,
- "ivopts", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- gate_tree_ssa_loop_ivopts, /* gate */
- tree_ssa_loop_ivopts, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_LOOP_IVOPTS, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_iv_optimize =
+{
+ GIMPLE_PASS, /* type */
+ "ivopts", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_LOOP_IVOPTS, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_update_ssa, /* todo_flags_finish */
};
+class pass_iv_optimize : public gimple_opt_pass
+{
+public:
+ pass_iv_optimize(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_iv_optimize, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tree_ssa_loop_ivopts (); }
+ unsigned int execute () { return tree_ssa_loop_ivopts (); }
+
+}; // class pass_iv_optimize
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_iv_optimize (gcc::context *ctxt)
+{
+ return new pass_iv_optimize (ctxt);
+}
+
/* Loop optimizer finalization. */
static unsigned int
@@ -667,23 +968,39 @@ tree_ssa_loop_done (void)
return 0;
}
-struct gimple_opt_pass pass_tree_loop_done =
-{
- {
- GIMPLE_PASS,
- "loopdone", /* name */
- OPTGROUP_LOOP, /* optinfo_flags */
- NULL, /* gate */
- tree_ssa_loop_done, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_cleanup_cfg
- | TODO_verify_flow /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_tree_loop_done =
+{
+ GIMPLE_PASS, /* type */
+ "loopdone", /* name */
+ OPTGROUP_LOOP, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_cleanup_cfg | TODO_verify_flow ), /* todo_flags_finish */
};
+
+class pass_tree_loop_done : public gimple_opt_pass
+{
+public:
+ pass_tree_loop_done(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_tree_loop_done, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return tree_ssa_loop_done (); }
+
+}; // class pass_tree_loop_done
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_tree_loop_done (gcc::context *ctxt)
+{
+ return new pass_tree_loop_done (ctxt);
+}
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index e9c32b3c8be..d1691478c4b 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -636,27 +636,45 @@ execute_cse_reciprocals (void)
return 0;
}
-struct gimple_opt_pass pass_cse_reciprocals =
+namespace {
+
+const pass_data pass_data_cse_reciprocals =
{
- {
- GIMPLE_PASS,
- "recip", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_cse_reciprocals, /* gate */
- execute_cse_reciprocals, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa | TODO_verify_ssa
- | TODO_verify_stmts /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "recip", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_ssa
+ | TODO_verify_stmts ), /* todo_flags_finish */
};
+class pass_cse_reciprocals : public gimple_opt_pass
+{
+public:
+ pass_cse_reciprocals(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_cse_reciprocals, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_cse_reciprocals (); }
+ unsigned int execute () { return execute_cse_reciprocals (); }
+
+}; // class pass_cse_reciprocals
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_cse_reciprocals (gcc::context *ctxt)
+{
+ return new pass_cse_reciprocals (ctxt);
+}
+
/* Records an occurrence at statement USE_STMT in the vector of trees
STMTS if it is dominated by *TOP_BB or dominates it or this basic block
is not yet initialized. Returns true if the occurrence was pushed on
@@ -1535,27 +1553,45 @@ gate_cse_sincos (void)
return optimize;
}
-struct gimple_opt_pass pass_cse_sincos =
+namespace {
+
+const pass_data pass_data_cse_sincos =
{
- {
- GIMPLE_PASS,
- "sincos", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_cse_sincos, /* gate */
- execute_cse_sincos, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa | TODO_verify_ssa
- | TODO_verify_stmts /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "sincos", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_ssa
+ | TODO_verify_stmts ), /* todo_flags_finish */
};
+class pass_cse_sincos : public gimple_opt_pass
+{
+public:
+ pass_cse_sincos(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_cse_sincos, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_cse_sincos (); }
+ unsigned int execute () { return execute_cse_sincos (); }
+
+}; // class pass_cse_sincos
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_cse_sincos (gcc::context *ctxt)
+{
+ return new pass_cse_sincos (ctxt);
+}
+
/* A symbolic number is used to detect byte permutation and selection
patterns. Therefore the field N contains an artificial number
consisting of byte size markers:
@@ -2008,26 +2044,44 @@ gate_optimize_bswap (void)
return flag_expensive_optimizations && optimize;
}
-struct gimple_opt_pass pass_optimize_bswap =
+namespace {
+
+const pass_data pass_data_optimize_bswap =
{
- {
- GIMPLE_PASS,
- "bswap", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_optimize_bswap, /* gate */
- execute_optimize_bswap, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "bswap", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_optimize_bswap : public gimple_opt_pass
+{
+public:
+ pass_optimize_bswap(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_optimize_bswap, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_optimize_bswap (); }
+ unsigned int execute () { return execute_optimize_bswap (); }
+
+}; // class pass_optimize_bswap
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_optimize_bswap (gcc::context *ctxt)
+{
+ return new pass_optimize_bswap (ctxt);
+}
+
/* Return true if stmt is a type conversion operation that can be stripped
when used in a widening multiply operation. */
static bool
@@ -2795,24 +2849,41 @@ gate_optimize_widening_mul (void)
return flag_expensive_optimizations && optimize;
}
-struct gimple_opt_pass pass_optimize_widening_mul =
+namespace {
+
+const pass_data pass_data_optimize_widening_mul =
{
- {
- GIMPLE_PASS,
- "widening_mul", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_optimize_widening_mul, /* gate */
- execute_optimize_widening_mul, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa
- | TODO_verify_stmts
- | TODO_update_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "widening_mul", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_ssa | TODO_verify_stmts
+ | TODO_update_ssa ), /* todo_flags_finish */
};
+
+class pass_optimize_widening_mul : public gimple_opt_pass
+{
+public:
+ pass_optimize_widening_mul(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_optimize_widening_mul, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_optimize_widening_mul (); }
+ unsigned int execute () { return execute_optimize_widening_mul (); }
+
+}; // class pass_optimize_widening_mul
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_optimize_widening_mul (gcc::context *ctxt)
+{
+ return new pass_optimize_widening_mul (ctxt);
+}
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 5e99678ac01..ddcd040ba7c 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -2015,52 +2015,87 @@ gate_phiopt (void)
return 1;
}
-struct gimple_opt_pass pass_phiopt =
+namespace {
+
+const pass_data pass_data_phiopt =
{
- {
- GIMPLE_PASS,
- "phiopt", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_phiopt, /* gate */
- tree_ssa_phiopt, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_PHIOPT, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa
- | TODO_verify_flow
- | TODO_verify_stmts /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "phiopt", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_PHIOPT, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_ssa | TODO_verify_flow
+ | TODO_verify_stmts ), /* todo_flags_finish */
};
+class pass_phiopt : public gimple_opt_pass
+{
+public:
+ pass_phiopt(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_phiopt, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_phiopt (ctxt_); }
+ bool gate () { return gate_phiopt (); }
+ unsigned int execute () { return tree_ssa_phiopt (); }
+
+}; // class pass_phiopt
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_phiopt (gcc::context *ctxt)
+{
+ return new pass_phiopt (ctxt);
+}
+
static bool
gate_cselim (void)
{
return flag_tree_cselim;
}
-struct gimple_opt_pass pass_cselim =
+namespace {
+
+const pass_data pass_data_cselim =
{
- {
- GIMPLE_PASS,
- "cselim", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_cselim, /* gate */
- tree_ssa_cs_elim, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_PHIOPT, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa
- | TODO_verify_flow
- | TODO_verify_stmts /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "cselim", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_PHIOPT, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_ssa | TODO_verify_flow
+ | TODO_verify_stmts ), /* todo_flags_finish */
};
+
+class pass_cselim : public gimple_opt_pass
+{
+public:
+ pass_cselim(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_cselim, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_cselim (); }
+ unsigned int execute () { return tree_ssa_cs_elim (); }
+
+}; // class pass_cselim
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_cselim (gcc::context *ctxt)
+{
+ return new pass_cselim (ctxt);
+}
diff --git a/gcc/tree-ssa-phiprop.c b/gcc/tree-ssa-phiprop.c
index 96d7ba6a935..1257334f51b 100644
--- a/gcc/tree-ssa-phiprop.c
+++ b/gcc/tree-ssa-phiprop.c
@@ -394,23 +394,40 @@ gate_phiprop (void)
return flag_tree_phiprop;
}
-struct gimple_opt_pass pass_phiprop =
+namespace {
+
+const pass_data pass_data_phiprop =
{
- {
- GIMPLE_PASS,
- "phiprop", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_phiprop, /* gate */
- tree_ssa_phiprop, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_PHIPROP, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa
- | TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "phiprop", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_PHIPROP, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */
};
+
+class pass_phiprop : public gimple_opt_pass
+{
+public:
+ pass_phiprop(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_phiprop, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_phiprop (); }
+ unsigned int execute () { return tree_ssa_phiprop (); }
+
+}; // class pass_phiprop
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_phiprop (gcc::context *ctxt)
+{
+ return new pass_phiprop (ctxt);
+}
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 642a343afe8..f6928a8c0b3 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -4786,27 +4786,44 @@ gate_pre (void)
return flag_tree_pre != 0;
}
-struct gimple_opt_pass pass_pre =
+namespace {
+
+const pass_data pass_data_pre =
{
- {
- GIMPLE_PASS,
- "pre", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_pre, /* gate */
- do_pre, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_PRE, /* tv_id */
- PROP_no_crit_edges | PROP_cfg
- | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- TODO_rebuild_alias, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "pre", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_PRE, /* tv_id */
+ ( PROP_no_crit_edges | PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ TODO_rebuild_alias, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
+class pass_pre : public gimple_opt_pass
+{
+public:
+ pass_pre(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_pre, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_pre (); }
+ unsigned int execute () { return do_pre (); }
+
+}; // class pass_pre
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_pre (gcc::context *ctxt)
+{
+ return new pass_pre (ctxt);
+}
+
/* Gate and execute functions for FRE. */
@@ -4839,22 +4856,41 @@ gate_fre (void)
return flag_tree_fre != 0;
}
-struct gimple_opt_pass pass_fre =
+namespace {
+
+const pass_data pass_data_fre =
{
- {
- GIMPLE_PASS,
- "fre", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_fre, /* gate */
- execute_fre, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_FRE, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "fre", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_FRE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
+
+class pass_fre : public gimple_opt_pass
+{
+public:
+ pass_fre(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_fre, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_fre (ctxt_); }
+ bool gate () { return gate_fre (); }
+ unsigned int execute () { return execute_fre (); }
+
+}; // class pass_fre
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_fre (gcc::context *ctxt)
+{
+ return new pass_fre (ctxt);
+}
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 1a2619d607c..7e1d8c77a3f 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -4450,24 +4450,43 @@ gate_tree_ssa_reassoc (void)
return flag_tree_reassoc != 0;
}
-struct gimple_opt_pass pass_reassoc =
+namespace {
+
+const pass_data pass_data_reassoc =
{
- {
- GIMPLE_PASS,
- "reassoc", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_tree_ssa_reassoc, /* gate */
- execute_reassoc, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_REASSOC, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa
- | TODO_update_ssa_only_virtuals
- | TODO_verify_flow /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "reassoc", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_REASSOC, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_ssa
+ | TODO_update_ssa_only_virtuals
+ | TODO_verify_flow ), /* todo_flags_finish */
};
+
+class pass_reassoc : public gimple_opt_pass
+{
+public:
+ pass_reassoc(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_reassoc, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_reassoc (ctxt_); }
+ bool gate () { return gate_tree_ssa_reassoc (); }
+ unsigned int execute () { return execute_reassoc (); }
+
+}; // class pass_reassoc
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_reassoc (gcc::context *ctxt)
+{
+ return new pass_reassoc (ctxt);
+}
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index 87a0a599110..e8540e80534 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -586,25 +586,41 @@ gate_sink (void)
return flag_tree_sink != 0;
}
-struct gimple_opt_pass pass_sink_code =
+namespace {
+
+const pass_data pass_data_sink_code =
{
- {
- GIMPLE_PASS,
- "sink", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_sink, /* gate */
- do_sink, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_SINK, /* tv_id */
- PROP_no_crit_edges | PROP_cfg
- | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa
- | TODO_verify_ssa
- | TODO_verify_flow /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "sink", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_SINK, /* tv_id */
+ ( PROP_no_crit_edges | PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_ssa
+ | TODO_verify_flow ), /* todo_flags_finish */
};
+
+class pass_sink_code : public gimple_opt_pass
+{
+public:
+ pass_sink_code(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_sink_code, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_sink (); }
+ unsigned int execute () { return do_sink (); }
+
+}; // class pass_sink_code
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_sink_code (gcc::context *ctxt)
+{
+ return new pass_sink_code (ctxt);
+}
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index c0f9ccd5642..75d27f1989b 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -2065,22 +2065,40 @@ gate_strlen (void)
return flag_optimize_strlen != 0;
}
-struct gimple_opt_pass pass_strlen =
+namespace {
+
+const pass_data pass_data_strlen =
{
- {
- GIMPLE_PASS,
- "strlen", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_strlen, /* gate */
- tree_ssa_strlen, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_STRLEN, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "strlen", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_STRLEN, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
+
+class pass_strlen : public gimple_opt_pass
+{
+public:
+ pass_strlen(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_strlen, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_strlen (); }
+ unsigned int execute () { return tree_ssa_strlen (); }
+
+}; // class pass_strlen
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_strlen (gcc::context *ctxt)
+{
+ return new pass_strlen (ctxt);
+}
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index d46cbb34b88..a29db7f4df4 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -6960,49 +6960,83 @@ gate_tree_pta (void)
/* A dummy pass to cause points-to information to be computed via
TODO_rebuild_alias. */
-struct gimple_opt_pass pass_build_alias =
-{
- {
- GIMPLE_PASS,
- "alias", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_tree_pta, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_rebuild_alias /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_build_alias =
+{
+ GIMPLE_PASS, /* type */
+ "alias", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ false, /* has_execute */
+ TV_NONE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_rebuild_alias, /* todo_flags_finish */
};
+class pass_build_alias : public gimple_opt_pass
+{
+public:
+ pass_build_alias(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_build_alias, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tree_pta (); }
+
+}; // class pass_build_alias
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_build_alias (gcc::context *ctxt)
+{
+ return new pass_build_alias (ctxt);
+}
+
/* A dummy pass to cause points-to information to be computed via
TODO_rebuild_alias. */
-struct gimple_opt_pass pass_build_ealias =
-{
- {
- GIMPLE_PASS,
- "ealias", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_tree_pta, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_rebuild_alias /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_build_ealias =
+{
+ GIMPLE_PASS, /* type */
+ "ealias", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ false, /* has_execute */
+ TV_NONE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_rebuild_alias, /* todo_flags_finish */
};
+class pass_build_ealias : public gimple_opt_pass
+{
+public:
+ pass_build_ealias(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_build_ealias, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tree_pta (); }
+
+}; // class pass_build_ealias
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_build_ealias (gcc::context *ctxt)
+{
+ return new pass_build_ealias (ctxt);
+}
+
/* Return true if we should execute IPA PTA. */
static bool
@@ -7359,22 +7393,40 @@ ipa_pta_execute (void)
return 0;
}
-struct simple_ipa_opt_pass pass_ipa_pta =
-{
- {
- SIMPLE_IPA_PASS,
- "pta", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_ipa_pta, /* gate */
- ipa_pta_execute, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_PTA, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_ipa_pta =
+{
+ SIMPLE_IPA_PASS, /* type */
+ "pta", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IPA_PTA, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_update_ssa, /* todo_flags_finish */
};
+
+class pass_ipa_pta : public simple_ipa_opt_pass
+{
+public:
+ pass_ipa_pta(gcc::context *ctxt)
+ : simple_ipa_opt_pass(pass_data_ipa_pta, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_ipa_pta (); }
+ unsigned int execute () { return ipa_pta_execute (); }
+
+}; // class pass_ipa_pta
+
+} // anon namespace
+
+simple_ipa_opt_pass *
+make_pass_ipa_pta (gcc::context *ctxt)
+{
+ return new pass_ipa_pta (ctxt);
+}
diff --git a/gcc/tree-ssa-uncprop.c b/gcc/tree-ssa-uncprop.c
index 555485a07c3..837c4eaf066 100644
--- a/gcc/tree-ssa-uncprop.c
+++ b/gcc/tree-ssa-uncprop.c
@@ -585,22 +585,41 @@ gate_uncprop (void)
return flag_tree_dom != 0;
}
-struct gimple_opt_pass pass_uncprop =
+namespace {
+
+const pass_data pass_data_uncprop =
{
- {
- GIMPLE_PASS,
- "uncprop", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_uncprop, /* gate */
- tree_ssa_uncprop, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_SSA_UNCPROP, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "uncprop", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_SSA_UNCPROP, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
+
+class pass_uncprop : public gimple_opt_pass
+{
+public:
+ pass_uncprop(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_uncprop, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_uncprop (ctxt_); }
+ bool gate () { return gate_uncprop (); }
+ unsigned int execute () { return tree_ssa_uncprop (); }
+
+}; // class pass_uncprop
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_uncprop (gcc::context *ctxt)
+{
+ return new pass_uncprop (ctxt);
+}
diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c
index 9a726f115a9..6d2d768a243 100644
--- a/gcc/tree-ssa-uninit.c
+++ b/gcc/tree-ssa-uninit.c
@@ -2046,22 +2046,41 @@ gate_warn_uninitialized (void)
return warn_uninitialized != 0;
}
-struct gimple_opt_pass pass_late_warn_uninitialized =
+namespace {
+
+const pass_data pass_data_late_warn_uninitialized =
{
- {
- GIMPLE_PASS,
- "uninit", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_warn_uninitialized, /* gate */
- execute_late_warn_uninitialized, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "uninit", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_late_warn_uninitialized : public gimple_opt_pass
+{
+public:
+ pass_late_warn_uninitialized(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_late_warn_uninitialized, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_late_warn_uninitialized (ctxt_); }
+ bool gate () { return gate_warn_uninitialized (); }
+ unsigned int execute () { return execute_late_warn_uninitialized (); }
+
+}; // class pass_late_warn_uninitialized
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_late_warn_uninitialized (gcc::context *ctxt)
+{
+ return new pass_late_warn_uninitialized (ctxt);
+}
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 215206743e8..83a265c43ac 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1088,26 +1088,43 @@ execute_init_datastructures (void)
return 0;
}
-struct gimple_opt_pass pass_init_datastructures =
+namespace {
+
+const pass_data pass_data_init_datastructures =
{
- {
- GIMPLE_PASS,
- "*init_datastructures", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- execute_init_datastructures, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "*init_datastructures", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_init_datastructures : public gimple_opt_pass
+{
+public:
+ pass_init_datastructures(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_init_datastructures, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return execute_init_datastructures (); }
+
+}; // class pass_init_datastructures
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_init_datastructures (gcc::context *ctxt)
+{
+ return new pass_init_datastructures (ctxt);
+}
+
/* Deallocate memory associated with SSA data structures for FNDECL. */
void
@@ -1698,26 +1715,44 @@ gate_warn_uninitialized (void)
return warn_uninitialized != 0;
}
-struct gimple_opt_pass pass_early_warn_uninitialized =
+namespace {
+
+const pass_data pass_data_early_warn_uninitialized =
{
- {
- GIMPLE_PASS,
- "*early_warn_uninitialized", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_warn_uninitialized, /* gate */
- execute_early_warn_uninitialized, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_UNINIT, /* tv_id */
- PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "*early_warn_uninitialized", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_UNINIT, /* tv_id */
+ PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_early_warn_uninitialized : public gimple_opt_pass
+{
+public:
+ pass_early_warn_uninitialized(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_early_warn_uninitialized, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_warn_uninitialized (); }
+ unsigned int execute () { return execute_early_warn_uninitialized (); }
+
+}; // class pass_early_warn_uninitialized
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_early_warn_uninitialized (gcc::context *ctxt)
+{
+ return new pass_early_warn_uninitialized (ctxt);
+}
+
/* If necessary, rewrite the base of the reference tree *TP from
a MEM_REF to a plain or converted symbol. */
@@ -2130,22 +2165,38 @@ execute_update_addresses_taken (void)
timevar_pop (TV_ADDRESS_TAKEN);
}
-struct gimple_opt_pass pass_update_address_taken =
+namespace {
+
+const pass_data pass_data_update_address_taken =
{
- {
- GIMPLE_PASS,
- "addressables", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_ADDRESS_TAKEN, /* tv_id */
- PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_address_taken /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "addressables", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ false, /* has_execute */
+ TV_ADDRESS_TAKEN, /* tv_id */
+ PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_update_address_taken, /* todo_flags_finish */
};
+
+class pass_update_address_taken : public gimple_opt_pass
+{
+public:
+ pass_update_address_taken(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_update_address_taken, ctxt)
+ {}
+
+ /* opt_pass methods: */
+
+}; // class pass_update_address_taken
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_update_address_taken (gcc::context *ctxt)
+{
+ return new pass_update_address_taken (ctxt);
+}
diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c
index 0a405ce2a30..a6af3da192c 100644
--- a/gcc/tree-ssanames.c
+++ b/gcc/tree-ssanames.c
@@ -440,22 +440,39 @@ release_dead_ssa_names (void)
return 0;
}
-struct gimple_opt_pass pass_release_ssa_names =
+namespace {
+
+const pass_data pass_data_release_ssa_names =
{
- {
- GIMPLE_PASS,
- "release_ssa", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- release_dead_ssa_names, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_SSA_OTHER, /* tv_id */
- PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- TODO_remove_unused_locals, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "release_ssa", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_SSA_OTHER, /* tv_id */
+ PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ TODO_remove_unused_locals, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_release_ssa_names : public gimple_opt_pass
+{
+public:
+ pass_release_ssa_names(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_release_ssa_names, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return release_dead_ssa_names (); }
+
+}; // class pass_release_ssa_names
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_release_ssa_names (gcc::context *ctxt)
+{
+ return new pass_release_ssa_names (ctxt);
+}
diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c
index 8ad9fc2d22e..50592c03a36 100644
--- a/gcc/tree-stdarg.c
+++ b/gcc/tree-stdarg.c
@@ -985,22 +985,40 @@ finish:
}
-struct gimple_opt_pass pass_stdarg =
+namespace {
+
+const pass_data pass_data_stdarg =
{
- {
- GIMPLE_PASS,
- "stdarg", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_optimize_stdarg, /* gate */
- execute_optimize_stdarg, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "stdarg", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_stdarg : public gimple_opt_pass
+{
+public:
+ pass_stdarg(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_stdarg, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_optimize_stdarg (); }
+ unsigned int execute () { return execute_optimize_stdarg (); }
+
+}; // class pass_stdarg
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_stdarg (gcc::context *ctxt)
+{
+ return new pass_stdarg (ctxt);
+}
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index 9ad7daf0689..0d128981e38 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -1463,25 +1463,42 @@ switchconv_gate (void)
return flag_tree_switch_conversion != 0;
}
-struct gimple_opt_pass pass_convert_switch =
+namespace {
+
+const pass_data pass_data_convert_switch =
{
- {
- GIMPLE_PASS,
- "switchconv", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- switchconv_gate, /* gate */
- do_switchconv, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_SWITCH_CONVERSION, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa
- | TODO_verify_ssa
- | TODO_verify_stmts
- | TODO_verify_flow /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "switchconv", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_SWITCH_CONVERSION, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_ssa
+ | TODO_verify_stmts
+ | TODO_verify_flow ), /* todo_flags_finish */
};
+
+class pass_convert_switch : public gimple_opt_pass
+{
+public:
+ pass_convert_switch(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_convert_switch, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return switchconv_gate (); }
+ unsigned int execute () { return do_switchconv (); }
+
+}; // class pass_convert_switch
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_convert_switch (gcc::context *ctxt)
+{
+ return new pass_convert_switch (ctxt);
+}
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index c6581dcedcd..8cd7255e49b 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -1048,42 +1048,79 @@ execute_tail_calls (void)
return tree_optimize_tail_calls_1 (true);
}
-struct gimple_opt_pass pass_tail_recursion =
+namespace {
+
+const pass_data pass_data_tail_recursion =
{
- {
- GIMPLE_PASS,
- "tailr", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_tail_calls, /* gate */
- execute_tail_recursion, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "tailr", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
-struct gimple_opt_pass pass_tail_calls =
+class pass_tail_recursion : public gimple_opt_pass
+{
+public:
+ pass_tail_recursion(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_tail_recursion, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_tail_recursion (ctxt_); }
+ bool gate () { return gate_tail_calls (); }
+ unsigned int execute () { return execute_tail_recursion (); }
+
+}; // class pass_tail_recursion
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_tail_recursion (gcc::context *ctxt)
+{
+ return new pass_tail_recursion (ctxt);
+}
+
+namespace {
+
+const pass_data pass_data_tail_calls =
{
- {
- GIMPLE_PASS,
- "tailc", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_tail_calls, /* gate */
- execute_tail_calls, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "tailc", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
};
+
+class pass_tail_calls : public gimple_opt_pass
+{
+public:
+ pass_tail_calls(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_tail_calls, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_tail_calls (); }
+ unsigned int execute () { return execute_tail_calls (); }
+
+}; // class pass_tail_calls
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_tail_calls (gcc::context *ctxt)
+{
+ return new pass_tail_calls (ctxt);
+}
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index 516bd6f954c..b2a6944687c 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -1454,50 +1454,86 @@ expand_vector_operations (void)
return cfg_changed ? TODO_cleanup_cfg : 0;
}
-struct gimple_opt_pass pass_lower_vector =
+namespace {
+
+const pass_data pass_data_lower_vector =
{
- {
- GIMPLE_PASS,
- "veclower", /* name */
- OPTGROUP_VEC, /* optinfo_flags */
- gate_expand_vector_operations_ssa, /* gate */
- expand_vector_operations, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg, /* properties_required */
- PROP_gimple_lvec, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa /* todo_flags_finish */
- | TODO_verify_ssa
- | TODO_verify_stmts | TODO_verify_flow
- | TODO_cleanup_cfg
- }
+ GIMPLE_PASS, /* type */
+ "veclower", /* name */
+ OPTGROUP_VEC, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_cfg, /* properties_required */
+ PROP_gimple_lvec, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_ssa
+ | TODO_verify_stmts
+ | TODO_verify_flow
+ | TODO_cleanup_cfg ), /* todo_flags_finish */
};
-struct gimple_opt_pass pass_lower_vector_ssa =
+class pass_lower_vector : public gimple_opt_pass
+{
+public:
+ pass_lower_vector(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_lower_vector, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_expand_vector_operations_ssa (); }
+ unsigned int execute () { return expand_vector_operations (); }
+
+}; // class pass_lower_vector
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_lower_vector (gcc::context *ctxt)
+{
+ return new pass_lower_vector (ctxt);
+}
+
+namespace {
+
+const pass_data pass_data_lower_vector_ssa =
{
- {
- GIMPLE_PASS,
- "veclower2", /* name */
- OPTGROUP_VEC, /* optinfo_flags */
- 0, /* gate */
- expand_vector_operations, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_cfg, /* properties_required */
- PROP_gimple_lvec, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_update_ssa /* todo_flags_finish */
- | TODO_verify_ssa
- | TODO_verify_stmts | TODO_verify_flow
- | TODO_cleanup_cfg
- }
+ GIMPLE_PASS, /* type */
+ "veclower2", /* name */
+ OPTGROUP_VEC, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_cfg, /* properties_required */
+ PROP_gimple_lvec, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_ssa
+ | TODO_verify_stmts
+ | TODO_verify_flow
+ | TODO_cleanup_cfg ), /* todo_flags_finish */
};
+class pass_lower_vector_ssa : public gimple_opt_pass
+{
+public:
+ pass_lower_vector_ssa(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_lower_vector_ssa, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_lower_vector_ssa (ctxt_); }
+ unsigned int execute () { return expand_vector_operations (); }
+
+}; // class pass_lower_vector_ssa
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_lower_vector_ssa (gcc::context *ctxt)
+{
+ return new pass_lower_vector_ssa (ctxt);
+}
+
#include "gt-tree-vect-generic.h"
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 1ef31eefd1d..cfcc95d06f2 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -197,29 +197,45 @@ gate_vect_slp (void)
|| flag_tree_slp_vectorize == 1);
}
-struct gimple_opt_pass pass_slp_vectorize =
+namespace {
+
+const pass_data pass_data_slp_vectorize =
{
- {
- GIMPLE_PASS,
- "slp", /* name */
- OPTGROUP_LOOP
- | OPTGROUP_VEC, /* optinfo_flags */
- gate_vect_slp, /* gate */
- execute_vect_slp, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_SLP_VECTORIZATION, /* tv_id */
- PROP_ssa | PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa
- | TODO_update_ssa
- | TODO_verify_stmts /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "slp", /* name */
+ OPTGROUP_LOOP | OPTGROUP_VEC, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_SLP_VECTORIZATION, /* tv_id */
+ ( PROP_ssa | PROP_cfg ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_ssa | TODO_update_ssa
+ | TODO_verify_stmts ), /* todo_flags_finish */
};
+class pass_slp_vectorize : public gimple_opt_pass
+{
+public:
+ pass_slp_vectorize(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_slp_vectorize, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_vect_slp (); }
+ unsigned int execute () { return execute_vect_slp (); }
+
+}; // class pass_slp_vectorize
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_slp_vectorize (gcc::context *ctxt)
+{
+ return new pass_slp_vectorize (ctxt);
+}
+
/* Increase alignment of global arrays to improve vectorization potential.
TODO:
@@ -272,23 +288,40 @@ gate_increase_alignment (void)
}
-struct simple_ipa_opt_pass pass_ipa_increase_alignment =
+namespace {
+
+const pass_data pass_data_ipa_increase_alignment =
{
- {
- SIMPLE_IPA_PASS,
- "increase_alignment", /* name */
- OPTGROUP_LOOP
- | OPTGROUP_VEC, /* optinfo_flags */
- gate_increase_alignment, /* gate */
- increase_alignment, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_OPT, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ SIMPLE_IPA_PASS, /* type */
+ "increase_alignment", /* name */
+ OPTGROUP_LOOP | OPTGROUP_VEC, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IPA_OPT, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_ipa_increase_alignment : public simple_ipa_opt_pass
+{
+public:
+ pass_ipa_increase_alignment(gcc::context *ctxt)
+ : simple_ipa_opt_pass(pass_data_ipa_increase_alignment, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_increase_alignment (); }
+ unsigned int execute () { return increase_alignment (); }
+
+}; // class pass_ipa_increase_alignment
+
+} // anon namespace
+
+simple_ipa_opt_pass *
+make_pass_ipa_increase_alignment (gcc::context *ctxt)
+{
+ return new pass_ipa_increase_alignment (ctxt);
+}
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index ca9d8bdb305..ff82591f5f4 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -9584,25 +9584,43 @@ gate_vrp (void)
return flag_tree_vrp != 0;
}
-struct gimple_opt_pass pass_vrp =
-{
- {
- GIMPLE_PASS,
- "vrp", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_vrp, /* gate */
- execute_vrp, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_VRP, /* tv_id */
- PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_cleanup_cfg
- | TODO_update_ssa
+namespace {
+
+const pass_data pass_data_vrp =
+{
+ GIMPLE_PASS, /* type */
+ "vrp", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_VRP, /* tv_id */
+ PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_cleanup_cfg | TODO_update_ssa
| TODO_verify_ssa
- | TODO_verify_flow /* todo_flags_finish */
- }
+ | TODO_verify_flow ), /* todo_flags_finish */
};
+
+class pass_vrp : public gimple_opt_pass
+{
+public:
+ pass_vrp(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_vrp, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_vrp (ctxt_); }
+ bool gate () { return gate_vrp (); }
+ unsigned int execute () { return execute_vrp (); }
+
+}; // class pass_vrp
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_vrp (gcc::context *ctxt)
+{
+ return new pass_vrp (ctxt);
+}
diff --git a/gcc/tree.c b/gcc/tree.c
index c9f47d26260..a1c0deab21e 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5505,26 +5505,43 @@ free_lang_data (void)
}
-struct simple_ipa_opt_pass pass_ipa_free_lang_data =
-{
- {
- SIMPLE_IPA_PASS,
- "*free_lang_data", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- free_lang_data, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_FREE_LANG_DATA, /* 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_ipa_free_lang_data =
+{
+ SIMPLE_IPA_PASS, /* type */
+ "*free_lang_data", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_IPA_FREE_LANG_DATA, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+class pass_ipa_free_lang_data : public simple_ipa_opt_pass
+{
+public:
+ pass_ipa_free_lang_data(gcc::context *ctxt)
+ : simple_ipa_opt_pass(pass_data_ipa_free_lang_data, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return free_lang_data (); }
+
+}; // class pass_ipa_free_lang_data
+
+} // anon namespace
+
+simple_ipa_opt_pass *
+make_pass_ipa_free_lang_data (gcc::context *ctxt)
+{
+ return new pass_ipa_free_lang_data (ctxt);
+}
+
/* The backbone of is_attribute_p(). ATTR_LEN is the string length of
ATTR_NAME. Also used internally by remove_attribute(). */
bool
diff --git a/gcc/tsan.c b/gcc/tsan.c
index d218eed5a1b..b9171c803aa 100644
--- a/gcc/tsan.c
+++ b/gcc/tsan.c
@@ -733,48 +733,85 @@ tsan_finish_file (void)
/* The pass descriptor. */
-struct gimple_opt_pass pass_tsan =
+namespace {
+
+const pass_data pass_data_tsan =
{
- {
- GIMPLE_PASS,
- "tsan", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- tsan_gate, /* gate */
- tsan_pass, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_ssa | PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_all | TODO_update_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "tsan", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ ( PROP_ssa | PROP_cfg ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_all | TODO_update_ssa ), /* todo_flags_finish */
};
+class pass_tsan : public gimple_opt_pass
+{
+public:
+ pass_tsan(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_tsan, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_tsan (ctxt_); }
+ bool gate () { return tsan_gate (); }
+ unsigned int execute () { return tsan_pass (); }
+
+}; // class pass_tsan
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_tsan (gcc::context *ctxt)
+{
+ return new pass_tsan (ctxt);
+}
+
static bool
tsan_gate_O0 (void)
{
return flag_tsan != 0 && !optimize;
}
-struct gimple_opt_pass pass_tsan_O0 =
+namespace {
+
+const pass_data pass_data_tsan_O0 =
{
- {
- GIMPLE_PASS,
- "tsan0", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- tsan_gate_O0, /* gate */
- tsan_pass, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_ssa | PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_all | TODO_update_ssa /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "tsan0", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ ( PROP_ssa | PROP_cfg ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_all | TODO_update_ssa ), /* todo_flags_finish */
};
+
+class pass_tsan_O0 : public gimple_opt_pass
+{
+public:
+ pass_tsan_O0(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_tsan_O0, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return tsan_gate_O0 (); }
+ unsigned int execute () { return tsan_pass (); }
+
+}; // class pass_tsan_O0
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_tsan_O0 (gcc::context *ctxt)
+{
+ return new pass_tsan_O0 (ctxt);
+}
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 8108413ea72..d82d2621fc6 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -10218,23 +10218,40 @@ gate_handle_var_tracking (void)
-struct rtl_opt_pass pass_variable_tracking =
-{
- {
- RTL_PASS,
- "vartrack", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_var_tracking, /* gate */
- variable_tracking_main, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_VAR_TRACKING, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_rtl_sharing
- | TODO_verify_flow /* todo_flags_finish */
- }
+namespace {
+
+const pass_data pass_data_variable_tracking =
+{
+ RTL_PASS, /* type */
+ "vartrack", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_VAR_TRACKING, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_rtl_sharing | TODO_verify_flow ), /* todo_flags_finish */
};
+
+class pass_variable_tracking : public rtl_opt_pass
+{
+public:
+ pass_variable_tracking(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_variable_tracking, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_var_tracking (); }
+ unsigned int execute () { return variable_tracking_main (); }
+
+}; // class pass_variable_tracking
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_variable_tracking (gcc::context *ctxt)
+{
+ return new pass_variable_tracking (ctxt);
+}
diff --git a/gcc/web.c b/gcc/web.c
index df4c84fd774..90c18a81401 100644
--- a/gcc/web.c
+++ b/gcc/web.c
@@ -449,22 +449,40 @@ web_main (void)
return 0;
}
-struct rtl_opt_pass pass_web =
+namespace {
+
+const pass_data pass_data_web =
{
- {
- RTL_PASS,
- "web", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_handle_web, /* gate */
- web_main, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_WEB, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "web", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_WEB, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */
};
+
+class pass_web : public rtl_opt_pass
+{
+public:
+ pass_web(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_web, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_handle_web (); }
+ unsigned int execute () { return web_main (); }
+
+}; // class pass_web
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_web (gcc::context *ctxt)
+{
+ return new pass_web (ctxt);
+}