diff options
146 files changed, 769 insertions, 552 deletions
diff --git a/gcc/adjust-alignment.cc b/gcc/adjust-alignment.cc index 2db41e8..5c5f8f4 100644 --- a/gcc/adjust-alignment.cc +++ b/gcc/adjust-alignment.cc @@ -50,7 +50,7 @@ public: : gimple_opt_pass (pass_data_adjust_alignment, ctxt) {} - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_adjust_alignment } // anon namespace diff --git a/gcc/asan.cc b/gcc/asan.cc index 15b2cf8..8276f12 100644 --- a/gcc/asan.cc +++ b/gcc/asan.cc @@ -4222,9 +4222,15 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_asan (m_ctxt); } - virtual bool gate (function *) { return gate_asan () || gate_hwasan (); } - virtual unsigned int execute (function *) { return asan_instrument (); } + opt_pass * clone () final override { return new pass_asan (m_ctxt); } + bool gate (function *) final override + { + return gate_asan () || gate_hwasan (); + } + unsigned int execute (function *) final override + { + return asan_instrument (); + } }; // class pass_asan @@ -4259,11 +4265,14 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return !optimize && (gate_asan () || gate_hwasan ()); } - virtual unsigned int execute (function *) { return asan_instrument (); } + unsigned int execute (function *) final override + { + return asan_instrument (); + } }; // class pass_asan_O0 diff --git a/gcc/auto-inc-dec.cc b/gcc/auto-inc-dec.cc index 85fe9d1..481e7af 100644 --- a/gcc/auto-inc-dec.cc +++ b/gcc/auto-inc-dec.cc @@ -1692,7 +1692,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { if (!AUTO_INC_DEC) return false; @@ -1701,7 +1701,7 @@ public: } - unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_inc_dec diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc index 2b34b80..6533722 100644 --- a/gcc/auto-profile.cc +++ b/gcc/auto-profile.cc @@ -1752,13 +1752,13 @@ public: } /* opt_pass methods: */ - virtual bool - gate (function *) + bool + gate (function *) final override { return flag_auto_profile; } - virtual unsigned int - execute (function *) + unsigned int + execute (function *) final override { return autofdo::auto_profile (); } diff --git a/gcc/bb-reorder.cc b/gcc/bb-reorder.cc index 6600f44..5cd4825 100644 --- a/gcc/bb-reorder.cc +++ b/gcc/bb-reorder.cc @@ -2633,7 +2633,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { if (targetm.cannot_modify_jumps_p ()) return false; @@ -2641,7 +2641,7 @@ public: && (flag_reorder_blocks || flag_reorder_blocks_and_partition)); } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_reorder_blocks @@ -2794,8 +2794,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *); + bool gate (function *) final override; + unsigned int execute (function *) final override; }; // class pass_duplicate_computed_gotos @@ -2937,8 +2937,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *); + bool gate (function *) final override; + unsigned int execute (function *) final override; }; // class pass_partition_blocks diff --git a/gcc/cfgcleanup.cc b/gcc/cfgcleanup.cc index 335af49..18047da 100644 --- a/gcc/cfgcleanup.cc +++ b/gcc/cfgcleanup.cc @@ -3227,7 +3227,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_jump @@ -3274,11 +3274,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return flag_thread_jumps && flag_expensive_optimizations; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_jump_after_combine @@ -3322,7 +3322,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { cleanup_cfg (flag_crossjumping ? CLEANUP_CROSSJUMP : 0); return 0; diff --git a/gcc/cfgexpand.cc b/gcc/cfgexpand.cc index bb33c1b..1d7f6b2 100644 --- a/gcc/cfgexpand.cc +++ b/gcc/cfgexpand.cc @@ -6573,7 +6573,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_expand diff --git a/gcc/cfgrtl.cc b/gcc/cfgrtl.cc index afbdbfe..a05c338 100644 --- a/gcc/cfgrtl.cc +++ b/gcc/cfgrtl.cc @@ -483,7 +483,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_free_cfg @@ -3698,7 +3698,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { cfg_layout_initialize (0); return 0; @@ -3737,7 +3737,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_outof_cfg_layout_mode diff --git a/gcc/cgraphbuild.cc b/gcc/cgraphbuild.cc index fdd17aa..bae4459 100644 --- a/gcc/cgraphbuild.cc +++ b/gcc/cgraphbuild.cc @@ -290,7 +290,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_build_cgraph_edges @@ -484,8 +484,11 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_rebuild_cgraph_edges (m_ctxt); } - virtual unsigned int execute (function *) + opt_pass * clone () final override + { + return new pass_rebuild_cgraph_edges (m_ctxt); + } + unsigned int execute (function *) final override { return cgraph_edge::rebuild_edges (); } @@ -524,10 +527,10 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { + opt_pass * clone () final override { return new pass_remove_cgraph_callee_edges (m_ctxt); } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_remove_cgraph_callee_edges diff --git a/gcc/combine-stack-adj.cc b/gcc/combine-stack-adj.cc index e8ba271..e76d60a 100644 --- a/gcc/combine-stack-adj.cc +++ b/gcc/combine-stack-adj.cc @@ -823,8 +823,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) + bool gate (function *) final override; + unsigned int execute (function *) final override { return rest_of_handle_stack_adjustments (); } diff --git a/gcc/combine.cc b/gcc/combine.cc index 9a34ef8..a830527 100644 --- a/gcc/combine.cc +++ b/gcc/combine.cc @@ -15015,8 +15015,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return (optimize > 0); } - virtual unsigned int execute (function *) + bool gate (function *) final override { return (optimize > 0); } + unsigned int execute (function *) final override { return rest_of_handle_combine (); } diff --git a/gcc/compare-elim.cc b/gcc/compare-elim.cc index 985c0c9..e869d9d 100644 --- a/gcc/compare-elim.cc +++ b/gcc/compare-elim.cc @@ -954,7 +954,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { /* Setting this target hook value is how a backend indicates the need. */ if (targetm.flags_regnum == INVALID_REGNUM) @@ -962,7 +962,7 @@ public: return flag_compare_elim_after_reload; } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return execute_compare_elim_after_reload (); } diff --git a/gcc/config/i386/i386-features.cc b/gcc/config/i386/i386-features.cc index 8908e42..be38586 100644 --- a/gcc/config/i386/i386-features.cc +++ b/gcc/config/i386/i386-features.cc @@ -1880,13 +1880,13 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return TARGET_AVX && TARGET_VZEROUPPER && flag_expensive_optimizations && !optimize_size; } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return rest_of_handle_insert_vzeroupper (); } @@ -1915,23 +1915,23 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return ((!timode_p || TARGET_64BIT) && TARGET_STV && TARGET_SSE2 && optimize > 1); } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return convert_scalars_to_vector (timode_p); } - opt_pass *clone () + opt_pass *clone () final override { return new pass_stv (m_ctxt); } - void set_pass_param (unsigned int n, bool param) + void set_pass_param (unsigned int n, bool param) final override { gcc_assert (n == 0); timode_p = param; @@ -2142,14 +2142,14 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { need_endbr = (flag_cf_protection & CF_BRANCH) != 0; patchable_area_size = crtl->patch_area_size - crtl->patch_area_entry; return need_endbr || patchable_area_size; } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { timevar_push (TV_MACH_DEP); rest_of_insert_endbr_and_patchable_area (need_endbr, @@ -2406,7 +2406,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return (TARGET_AVX && TARGET_SSE_PARTIAL_REG_DEPENDENCY @@ -2415,7 +2415,7 @@ public: && optimize_function_for_speed_p (cfun)); } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return remove_partial_avx_dependency (); } diff --git a/gcc/coroutine-passes.cc b/gcc/coroutine-passes.cc index 7b9a97a..21ac946 100644 --- a/gcc/coroutine-passes.cc +++ b/gcc/coroutine-passes.cc @@ -213,9 +213,9 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_coroutines; }; + bool gate (function *) final override { return flag_coroutines; }; - virtual unsigned int execute (function *f ATTRIBUTE_UNUSED) + unsigned int execute (function *f ATTRIBUTE_UNUSED) final override { return execute_lower_coro_builtins (); } @@ -511,12 +511,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *f) + bool gate (function *f) final override { return flag_coroutines && f->coroutine_component; } - virtual unsigned int execute (function *f ATTRIBUTE_UNUSED) + unsigned int execute (function *f ATTRIBUTE_UNUSED) final override { return execute_early_expand_coro_ifns (); } diff --git a/gcc/cprop.cc b/gcc/cprop.cc index cf01c2d..580f811 100644 --- a/gcc/cprop.cc +++ b/gcc/cprop.cc @@ -1953,15 +1953,18 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_rtl_cprop (m_ctxt); } - virtual bool gate (function *fun) + opt_pass * clone () final override { return new pass_rtl_cprop (m_ctxt); } + bool gate (function *fun) final override { return optimize > 0 && flag_gcse && !fun->calls_setjmp && dbg_cnt (cprop); } - virtual unsigned int execute (function *) { return execute_rtl_cprop (); } + unsigned int execute (function *) final override + { + return execute_rtl_cprop (); + } }; // class pass_rtl_cprop @@ -7571,8 +7571,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return optimize > 0; } - virtual unsigned int execute (function *) { return rest_of_handle_cse (); } + bool gate (function *) final override { return optimize > 0; } + unsigned int execute (function *) final override + { + return rest_of_handle_cse (); + } }; // class pass_cse @@ -7642,12 +7645,15 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return optimize > 0 && flag_rerun_cse_after_loop; } - virtual unsigned int execute (function *) { return rest_of_handle_cse2 (); } + unsigned int execute (function *) final override + { + return rest_of_handle_cse2 (); + } }; // class pass_cse2 @@ -7715,12 +7721,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return optimize > 0 && flag_rerun_cse_after_global_opts; } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return rest_of_handle_cse_after_global_opts (); } @@ -849,12 +849,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return optimize > 1 && flag_dce && dbg_cnt (dce_ud); } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return rest_of_handle_ud_dce (); } @@ -1280,12 +1280,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return optimize > 0 && flag_dce && dbg_cnt (dce_fast); } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return rest_of_handle_fast_dce (); } diff --git a/gcc/df-core.cc b/gcc/df-core.cc index e3a56bf..b53464c 100644 --- a/gcc/df-core.cc +++ b/gcc/df-core.cc @@ -741,8 +741,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return optimize > 0; } - virtual unsigned int execute (function *) + bool gate (function *) final override { return optimize > 0; } + unsigned int execute (function *) final override { return rest_of_handle_df_initialize (); } @@ -781,8 +781,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return optimize == 0; } - virtual unsigned int execute (function *) + bool gate (function *) final override { return optimize == 0; } + unsigned int execute (function *) final override { return rest_of_handle_df_initialize (); } @@ -848,7 +848,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return rest_of_handle_df_finish (); } @@ -3755,12 +3755,15 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return optimize > 0 && flag_dse && dbg_cnt (dse1); } - virtual unsigned int execute (function *) { return rest_of_handle_dse (); } + unsigned int execute (function *) final override + { + return rest_of_handle_dse (); + } }; // class pass_rtl_dse1 @@ -3795,12 +3798,15 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return optimize > 0 && flag_dse && dbg_cnt (dse2); } - virtual unsigned int execute (function *) { return rest_of_handle_dse (); } + unsigned int execute (function *) final override + { + return rest_of_handle_dse (); + } }; // class pass_rtl_dse2 diff --git a/gcc/dwarf2cfi.cc b/gcc/dwarf2cfi.cc index ab7c5cc..bef3165 100644 --- a/gcc/dwarf2cfi.cc +++ b/gcc/dwarf2cfi.cc @@ -3788,8 +3788,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) { return execute_dwarf2_frame (); } + bool gate (function *) final override; + unsigned int execute (function *) final override + { + return execute_dwarf2_frame (); + } }; // class pass_dwarf2_frame diff --git a/gcc/early-remat.cc b/gcc/early-remat.cc index 2738892..5c36829 100644 --- a/gcc/early-remat.cc +++ b/gcc/early-remat.cc @@ -2615,12 +2615,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return optimize > 1 && NUM_POLY_INT_COEFFS > 1; } - virtual unsigned int execute (function *f) + unsigned int execute (function *f) final override { auto_sbitmap selected_modes (NUM_MACHINE_MODES); bitmap_clear (selected_modes); diff --git a/gcc/except.cc b/gcc/except.cc index b94de42..7d7ce40 100644 --- a/gcc/except.cc +++ b/gcc/except.cc @@ -2047,7 +2047,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return set_nothrow_function_flags (); } @@ -2722,8 +2722,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) + bool gate (function *) final override; + unsigned int execute (function *) final override { int ret = convert_to_eh_region_ranges (); maybe_add_nop_after_section_switch (); diff --git a/gcc/final.cc b/gcc/final.cc index c5427d2..0352786 100644 --- a/gcc/final.cc +++ b/gcc/final.cc @@ -804,7 +804,10 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) { return compute_alignments (); } + unsigned int execute (function *) final override + { + return compute_alignments (); + } }; // class pass_compute_alignments @@ -4356,7 +4359,10 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) { return rest_of_handle_final (); } + unsigned int execute (function *) final override + { + return rest_of_handle_final (); + } }; // class pass_final @@ -4400,7 +4406,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return rest_of_handle_shorten_branches (); } @@ -4575,7 +4581,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return rest_of_clean_state (); } diff --git a/gcc/function.cc b/gcc/function.cc index ad0096a..0c3e4ff 100644 --- a/gcc/function.cc +++ b/gcc/function.cc @@ -2029,7 +2029,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return instantiate_virtual_regs (); } @@ -6516,7 +6516,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return rest_of_handle_check_leaf_regs (); } @@ -6617,7 +6617,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return rest_of_handle_thread_prologue_and_epilogue (); } @@ -6655,7 +6655,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_zero_call_used_regs @@ -6926,7 +6926,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_match_asm_constraints diff --git a/gcc/fwprop.cc b/gcc/fwprop.cc index d12fc2f..fc652ab 100644 --- a/gcc/fwprop.cc +++ b/gcc/fwprop.cc @@ -1029,8 +1029,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return gate_fwprop (); } - virtual unsigned int execute (function *) { return fwprop (false); } + bool gate (function *) final override { return gate_fwprop (); } + unsigned int execute (function *) final override { return fwprop (false); } }; // class pass_rtl_fwprop @@ -1065,8 +1065,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return gate_fwprop (); } - virtual unsigned int execute (function *) { return fwprop (true); } + bool gate (function *) final override { return gate_fwprop (); } + unsigned int execute (function *) final override { return fwprop (true); } }; // class pass_rtl_fwprop_addr diff --git a/gcc/gcse.cc b/gcc/gcse.cc index b673531..f06278a 100644 --- a/gcc/gcse.cc +++ b/gcc/gcse.cc @@ -4049,8 +4049,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) { return execute_rtl_pre (); } + bool gate (function *) final override; + unsigned int execute (function *) final override + { + return execute_rtl_pre (); + } }; // class pass_rtl_pre @@ -4099,8 +4102,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) { return execute_rtl_hoist (); } + bool gate (function *) final override; + unsigned int execute (function *) final override + { + return execute_rtl_hoist (); + } }; // class pass_rtl_hoist diff --git a/gcc/gimple-harden-conditionals.cc b/gcc/gimple-harden-conditionals.cc index 79c0a57..4ca6776 100644 --- a/gcc/gimple-harden-conditionals.cc +++ b/gcc/gimple-harden-conditionals.cc @@ -71,11 +71,15 @@ public: pass_harden_compares (gcc::context *ctxt) : gimple_opt_pass (pass_data_harden_compares, ctxt) {} - opt_pass *clone () { return new pass_harden_compares (m_ctxt); } - virtual bool gate (function *) { + opt_pass *clone () final override + { + return new pass_harden_compares (m_ctxt); + } + bool gate (function *) final override + { return flag_harden_compares; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; /* Define a pass to harden conditionals in branches. This pass must @@ -102,11 +106,15 @@ public: pass_harden_conditional_branches (gcc::context *ctxt) : gimple_opt_pass (pass_data_harden_conditional_branches, ctxt) {} - opt_pass *clone () { return new pass_harden_conditional_branches (m_ctxt); } - virtual bool gate (function *) { + opt_pass *clone () final override + { + return new pass_harden_conditional_branches (m_ctxt); + } + bool gate (function *) final override + { return flag_harden_conditional_branches; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; } diff --git a/gcc/gimple-if-to-switch.cc b/gcc/gimple-if-to-switch.cc index ca276d7..70daae2 100644 --- a/gcc/gimple-if-to-switch.cc +++ b/gcc/gimple-if-to-switch.cc @@ -480,13 +480,13 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return (jump_table_cluster::is_enabled () || bit_test_cluster::is_enabled ()); } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_if_to_switch diff --git a/gcc/gimple-isel.cc b/gcc/gimple-isel.cc index 44d086d..aa9c129 100644 --- a/gcc/gimple-isel.cc +++ b/gcc/gimple-isel.cc @@ -355,12 +355,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return true; } - virtual unsigned int execute (function *fun) + unsigned int execute (function *fun) final override { return gimple_expand_vec_exprs (fun); } diff --git a/gcc/gimple-laddress.cc b/gcc/gimple-laddress.cc index 13c7858..11754da 100644 --- a/gcc/gimple-laddress.cc +++ b/gcc/gimple-laddress.cc @@ -66,9 +66,9 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_laddress (m_ctxt); } - virtual bool gate (function *) { return optimize != 0; } - virtual unsigned int execute (function *); + opt_pass * clone () final override { return new pass_laddress (m_ctxt); } + bool gate (function *) final override { return optimize != 0; } + unsigned int execute (function *) final override; }; // class pass_laddress diff --git a/gcc/gimple-loop-interchange.cc b/gcc/gimple-loop-interchange.cc index d5d690b..71772b6 100644 --- a/gcc/gimple-loop-interchange.cc +++ b/gcc/gimple-loop-interchange.cc @@ -1705,9 +1705,9 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_linterchange (m_ctxt); } - virtual bool gate (function *) { return flag_loop_interchange; } - virtual unsigned int execute (function *); + opt_pass * clone () final override { return new pass_linterchange (m_ctxt); } + bool gate (function *) final override { return flag_loop_interchange; } + unsigned int execute (function *) final override; }; // class pass_linterchange diff --git a/gcc/gimple-loop-jam.cc b/gcc/gimple-loop-jam.cc index e33dd90..9b18b52 100644 --- a/gcc/gimple-loop-jam.cc +++ b/gcc/gimple-loop-jam.cc @@ -641,8 +641,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_unroll_jam != 0; } - virtual unsigned int execute (function *); + bool gate (function *) final override { return flag_unroll_jam != 0; } + unsigned int execute (function *) final override; }; diff --git a/gcc/gimple-loop-versioning.cc b/gcc/gimple-loop-versioning.cc index ab02bdd..6bcf6eb 100644 --- a/gcc/gimple-loop-versioning.cc +++ b/gcc/gimple-loop-versioning.cc @@ -1782,8 +1782,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_version_loops_for_strides; } - virtual unsigned int execute (function *); + bool gate (function *) final override + { + return flag_version_loops_for_strides; + } + unsigned int execute (function *) final override; }; unsigned int diff --git a/gcc/gimple-low.cc b/gcc/gimple-low.cc index 2ec19d5..4cd27dd 100644 --- a/gcc/gimple-low.cc +++ b/gcc/gimple-low.cc @@ -192,7 +192,10 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) { return lower_function_body (); } + unsigned int execute (function *) final override + { + return lower_function_body (); + } }; // class pass_lower_cf diff --git a/gcc/gimple-ssa-backprop.cc b/gcc/gimple-ssa-backprop.cc index 74f9811..55986dd 100644 --- a/gcc/gimple-ssa-backprop.cc +++ b/gcc/gimple-ssa-backprop.cc @@ -945,9 +945,9 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_backprop (m_ctxt); } - virtual bool gate (function *) { return flag_ssa_backprop; } - virtual unsigned int execute (function *); + opt_pass * clone () final override { return new pass_backprop (m_ctxt); } + bool gate (function *) final override { return flag_ssa_backprop; } + unsigned int execute (function *) final override; }; // class pass_backprop diff --git a/gcc/gimple-ssa-evrp.cc b/gcc/gimple-ssa-evrp.cc index 20388ed..793a3ea 100644 --- a/gcc/gimple-ssa-evrp.cc +++ b/gcc/gimple-ssa-evrp.cc @@ -377,12 +377,12 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_early_vrp (m_ctxt); } - virtual bool gate (function *) + opt_pass * clone () final override { return new pass_early_vrp (m_ctxt); } + bool gate (function *) final override { return flag_tree_vrp != 0; } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return execute_early_vrp (); } }; // class pass_vrp diff --git a/gcc/gimple-ssa-isolate-paths.cc b/gcc/gimple-ssa-isolate-paths.cc index cc0ed97..87ecd19 100644 --- a/gcc/gimple-ssa-isolate-paths.cc +++ b/gcc/gimple-ssa-isolate-paths.cc @@ -969,8 +969,11 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_isolate_erroneous_paths (m_ctxt); } - virtual bool gate (function *) + opt_pass * clone () final override + { + return new pass_isolate_erroneous_paths (m_ctxt); + } + bool gate (function *) final override { /* If we do not have a suitable builtin function for the trap statement, then do not perform the optimization. */ @@ -979,7 +982,7 @@ public: || warn_null_dereference); } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return gimple_ssa_isolate_erroneous_paths (); } diff --git a/gcc/gimple-ssa-nonnull-compare.cc b/gcc/gimple-ssa-nonnull-compare.cc index cc52b91..f9ce8c7 100644 --- a/gcc/gimple-ssa-nonnull-compare.cc +++ b/gcc/gimple-ssa-nonnull-compare.cc @@ -126,9 +126,9 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return warn_nonnull_compare; } + bool gate (function *) final override { return warn_nonnull_compare; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_warn_nonnull_compare diff --git a/gcc/gimple-ssa-split-paths.cc b/gcc/gimple-ssa-split-paths.cc index 6abe1d5..f2e43e5 100644 --- a/gcc/gimple-ssa-split-paths.cc +++ b/gcc/gimple-ssa-split-paths.cc @@ -579,9 +579,12 @@ class pass_split_paths : public gimple_opt_pass : gimple_opt_pass (pass_data_split_paths, ctxt) {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_split_paths (m_ctxt); } - virtual bool gate (function *) { return gate_split_paths (); } - virtual unsigned int execute (function *) { return execute_split_paths (); } + opt_pass * clone () final override { return new pass_split_paths (m_ctxt); } + bool gate (function *) final override { return gate_split_paths (); } + unsigned int execute (function *) final override + { + return execute_split_paths (); + } }; // class pass_split_paths diff --git a/gcc/gimple-ssa-store-merging.cc b/gcc/gimple-ssa-store-merging.cc index b952ce5..0640168 100644 --- a/gcc/gimple-ssa-store-merging.cc +++ b/gcc/gimple-ssa-store-merging.cc @@ -1037,12 +1037,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return flag_expensive_optimizations && optimize && BITS_PER_UNIT == 8; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_optimize_bswap @@ -2433,8 +2433,8 @@ public: /* Pass not supported for PDP-endian, nor for insane hosts or target character sizes where native_{encode,interpret}_expr doesn't work properly. */ - virtual bool - gate (function *) + bool + gate (function *) final override { return flag_store_merging && BYTES_BIG_ENDIAN == WORDS_BIG_ENDIAN @@ -2442,7 +2442,7 @@ public: && BITS_PER_UNIT == 8; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; private: hash_map<tree_operand_hash, class imm_store_chain_info *> m_stores; diff --git a/gcc/gimple-ssa-strength-reduction.cc b/gcc/gimple-ssa-strength-reduction.cc index dad73d3..2b559e9 100644 --- a/gcc/gimple-ssa-strength-reduction.cc +++ b/gcc/gimple-ssa-strength-reduction.cc @@ -4002,8 +4002,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tree_slsr; } - virtual unsigned int execute (function *); + bool gate (function *) final override { return flag_tree_slsr; } + unsigned int execute (function *) final override; }; // class pass_strength_reduction diff --git a/gcc/gimple-ssa-warn-access.cc b/gcc/gimple-ssa-warn-access.cc index eb9297a..04aa849 100644 --- a/gcc/gimple-ssa-warn-access.cc +++ b/gcc/gimple-ssa-warn-access.cc @@ -2075,13 +2075,13 @@ class pass_waccess : public gimple_opt_pass ~pass_waccess (); - opt_pass *clone (); + opt_pass *clone () final override; - virtual bool gate (function *); + bool gate (function *) final override; - void set_pass_param (unsigned, bool); + void set_pass_param (unsigned, bool) final override; - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; private: /* Not copyable or assignable. */ diff --git a/gcc/gimple-ssa-warn-alloca.cc b/gcc/gimple-ssa-warn-alloca.cc index 273b88e..83a241a 100644 --- a/gcc/gimple-ssa-warn-alloca.cc +++ b/gcc/gimple-ssa-warn-alloca.cc @@ -58,8 +58,8 @@ public: pass_walloca (gcc::context *ctxt) : gimple_opt_pass(pass_data_walloca, ctxt), xlimit_certain_p (false) {} - opt_pass *clone () { return new pass_walloca (m_ctxt); } - void set_pass_param (unsigned int n, bool param) + opt_pass *clone () final override { return new pass_walloca (m_ctxt); } + void set_pass_param (unsigned int n, bool param) final override { gcc_assert (n == 0); // Set to true to enable only warnings for alloca calls that @@ -69,8 +69,8 @@ public: // the "may be too large" kind. xlimit_certain_p = param; } - virtual bool gate (function *); - virtual unsigned int execute (function *); + bool gate (function *) final override; + unsigned int execute (function *) final override; private: // Set to TRUE the first time we run this pass on a function. diff --git a/gcc/gimple-ssa-warn-restrict.cc b/gcc/gimple-ssa-warn-restrict.cc index 734cdd7..6b6097a 100644 --- a/gcc/gimple-ssa-warn-restrict.cc +++ b/gcc/gimple-ssa-warn-restrict.cc @@ -64,8 +64,8 @@ class pass_wrestrict : public gimple_opt_pass public: pass_wrestrict (gcc::context *); - virtual bool gate (function *); - virtual unsigned int execute (function *); + bool gate (function *) final override; + unsigned int execute (function *) final override; void check_call (gimple *); diff --git a/gcc/gimple-warn-recursion.cc b/gcc/gimple-warn-recursion.cc index 91a3cdb..9b04899 100644 --- a/gcc/gimple-warn-recursion.cc +++ b/gcc/gimple-warn-recursion.cc @@ -52,9 +52,9 @@ public: pass_warn_recursion (gcc::context *); private: - virtual bool gate (function *) { return warn_infinite_recursion; } + bool gate (function *) final override { return warn_infinite_recursion; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; bool find_function_exit (basic_block); diff --git a/gcc/graphite.cc b/gcc/graphite.cc index ab8683b..a88b13c 100644 --- a/gcc/graphite.cc +++ b/gcc/graphite.cc @@ -574,7 +574,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return gate_graphite_transforms (); } + bool gate (function *) final override { return gate_graphite_transforms (); } }; // class pass_graphite @@ -609,8 +609,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return gate_graphite_transforms (); } - virtual unsigned int execute (function *fun) { return graphite_transforms (fun); } + bool gate (function *) final override { return gate_graphite_transforms (); } + unsigned int execute (function *fun) final override + { + return graphite_transforms (fun); + } }; // class pass_graphite_transforms diff --git a/gcc/ifcvt.cc b/gcc/ifcvt.cc index e007b17..25aff38 100644 --- a/gcc/ifcvt.cc +++ b/gcc/ifcvt.cc @@ -5934,12 +5934,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return (optimize > 0) && dbg_cnt (if_conversion); } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return rest_of_handle_if_conversion (); } @@ -5981,13 +5981,13 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return optimize > 0 && flag_if_conversion && dbg_cnt (if_after_combine); } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { if_convert (true); return 0; @@ -6027,13 +6027,13 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return optimize > 0 && flag_if_conversion2 && dbg_cnt (if_after_reload); } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { if_convert (true); return 0; diff --git a/gcc/init-regs.cc b/gcc/init-regs.cc index 220ef70..652befe 100644 --- a/gcc/init-regs.cc +++ b/gcc/init-regs.cc @@ -153,8 +153,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return optimize > 0; } - virtual unsigned int execute (function *) + bool gate (function *) final override { return optimize > 0; } + unsigned int execute (function *) final override { initialize_uninitialized_regs (); return 0; diff --git a/gcc/ipa-comdats.cc b/gcc/ipa-comdats.cc index 566faf3..da79206 100644 --- a/gcc/ipa-comdats.cc +++ b/gcc/ipa-comdats.cc @@ -420,8 +420,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) { return ipa_comdats (); } + bool gate (function *) final override; + unsigned int execute (function *) final override { return ipa_comdats (); } }; // class pass_ipa_comdats diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc index f26bfcc..18d2559 100644 --- a/gcc/ipa-cp.cc +++ b/gcc/ipa-cp.cc @@ -6657,14 +6657,14 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { /* FIXME: We should remove the optimize check after we ensure we never run IPA passes when not optimizing. */ return (flag_ipa_cp && optimize) || in_lto_p; } - virtual unsigned int execute (function *) { return ipcp_driver (); } + unsigned int execute (function *) final override { return ipcp_driver (); } }; // class pass_ipa_cp diff --git a/gcc/ipa-devirt.cc b/gcc/ipa-devirt.cc index 9f1442d..412ca14 100644 --- a/gcc/ipa-devirt.cc +++ b/gcc/ipa-devirt.cc @@ -3969,7 +3969,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { /* In LTO, always run the IPA passes and decide on function basis if the pass is enabled. */ @@ -3982,7 +3982,7 @@ public: && optimize); } - virtual unsigned int execute (function *) { return ipa_devirt (); } + unsigned int execute (function *) final override { return ipa_devirt (); } }; // class pass_ipa_devirt @@ -4361,12 +4361,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return (in_lto_p || flag_lto); } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return 0; } diff --git a/gcc/ipa-fnsummary.cc b/gcc/ipa-fnsummary.cc index c956445..e2a8668 100644 --- a/gcc/ipa-fnsummary.cc +++ b/gcc/ipa-fnsummary.cc @@ -4846,8 +4846,11 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_local_fn_summary (m_ctxt); } - virtual unsigned int execute (function *) + opt_pass * clone () final override + { + return new pass_local_fn_summary (m_ctxt); + } + unsigned int execute (function *) final override { return compute_fn_summary_for_current (); } @@ -4889,14 +4892,17 @@ public: {} /* opt_pass methods: */ - opt_pass *clone () { return new pass_ipa_free_fn_summary (m_ctxt); } - void set_pass_param (unsigned int n, bool param) + opt_pass *clone () final override + { + return new pass_ipa_free_fn_summary (m_ctxt); + } + void set_pass_param (unsigned int n, bool param) final override { gcc_assert (n == 0); small_p = param; } - virtual bool gate (function *) { return true; } - virtual unsigned int execute (function *) + bool gate (function *) final override { return true; } + unsigned int execute (function *) final override { ipa_free_fn_summary (); /* Free ipa-prop structures if they are no longer needed. */ @@ -4950,7 +4956,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) { return 0; } + unsigned int execute (function *) final override { return 0; } }; // class pass_ipa_fn_summary diff --git a/gcc/ipa-free-lang-data.cc b/gcc/ipa-free-lang-data.cc index f99f7be..ccdbf84 100644 --- a/gcc/ipa-free-lang-data.cc +++ b/gcc/ipa-free-lang-data.cc @@ -1173,7 +1173,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) { return free_lang_data (); } + unsigned int execute (function *) final override { return free_lang_data (); } }; // class pass_ipa_free_lang_data diff --git a/gcc/ipa-icf.cc b/gcc/ipa-icf.cc index 6528a7a..65baa84 100644 --- a/gcc/ipa-icf.cc +++ b/gcc/ipa-icf.cc @@ -3638,12 +3638,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return in_lto_p || flag_ipa_icf_variables || flag_ipa_icf_functions; } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return ipa_icf_driver(); } diff --git a/gcc/ipa-inline.cc b/gcc/ipa-inline.cc index 22a009b..1496919 100644 --- a/gcc/ipa-inline.cc +++ b/gcc/ipa-inline.cc @@ -3100,7 +3100,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_early_inline @@ -3150,7 +3150,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) { return ipa_inline (); } + unsigned int execute (function *) final override { return ipa_inline (); } }; // class pass_ipa_inline diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc index c053f8b..0d9abac 100644 --- a/gcc/ipa-modref.cc +++ b/gcc/ipa-modref.cc @@ -3508,15 +3508,15 @@ class pass_modref : public gimple_opt_pass : gimple_opt_pass (pass_data_modref, ctxt) {} /* opt_pass methods: */ - opt_pass *clone () + opt_pass *clone () final override { return new pass_modref (m_ctxt); } - virtual bool gate (function *) + bool gate (function *) final override { return flag_ipa_modref; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; /* Encode TT to the output block OB using the summary streaming API. */ @@ -4170,12 +4170,12 @@ public: {} /* opt_pass methods: */ - opt_pass *clone () { return new pass_ipa_modref (m_ctxt); } - virtual bool gate (function *) + opt_pass *clone () final override { return new pass_ipa_modref (m_ctxt); } + bool gate (function *) final override { return true; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; diff --git a/gcc/ipa-profile.cc b/gcc/ipa-profile.cc index 8763b38..e0acc5d 100644 --- a/gcc/ipa-profile.cc +++ b/gcc/ipa-profile.cc @@ -1053,8 +1053,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_ipa_profile || in_lto_p; } - virtual unsigned int execute (function *) { return ipa_profile (); } + bool gate (function *) final override { return flag_ipa_profile || in_lto_p; } + unsigned int execute (function *) final override { return ipa_profile (); } }; // class pass_ipa_profile diff --git a/gcc/ipa-pure-const.cc b/gcc/ipa-pure-const.cc index 6f8006a..572a6da 100644 --- a/gcc/ipa-pure-const.cc +++ b/gcc/ipa-pure-const.cc @@ -168,8 +168,8 @@ public: pass_ipa_pure_const(gcc::context *ctxt); /* opt_pass methods: */ - bool gate (function *) { return gate_pure_const (); } - unsigned int execute (function *fun); + bool gate (function *) final override { return gate_pure_const (); } + unsigned int execute (function *fun) final override; void register_hooks (void); @@ -2154,9 +2154,12 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_local_pure_const (m_ctxt); } - virtual bool gate (function *) { return gate_pure_const (); } - virtual unsigned int execute (function *); + opt_pass * clone () final override + { + return new pass_local_pure_const (m_ctxt); + } + bool gate (function *) final override { return gate_pure_const (); } + unsigned int execute (function *) final override; }; // class pass_local_pure_const @@ -2270,8 +2273,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return warn_suggest_attribute_noreturn; } - virtual unsigned int execute (function *fun) + bool gate (function *) final override + { + return warn_suggest_attribute_noreturn; + } + unsigned int execute (function *fun) final override { if (!TREE_THIS_VOLATILE (current_function_decl) && EDGE_COUNT (EXIT_BLOCK_PTR_FOR_FN (fun)->preds) == 0) @@ -2316,9 +2322,9 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_nothrow (m_ctxt); } - virtual bool gate (function *) { return optimize; } - virtual unsigned int execute (function *); + opt_pass * clone () final override { return new pass_nothrow (m_ctxt); } + bool gate (function *) final override { return optimize; } + unsigned int execute (function *) final override; }; // class pass_nothrow diff --git a/gcc/ipa-reference.cc b/gcc/ipa-reference.cc index 40b0209e..bd6ee0d 100644 --- a/gcc/ipa-reference.cc +++ b/gcc/ipa-reference.cc @@ -1299,14 +1299,14 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return ((in_lto_p || flag_ipa_reference) /* Don't bother doing anything if the program has errors. */ && !seen_error ()); } - virtual unsigned int execute (function *) { return propagate (); } + unsigned int execute (function *) final override { return propagate (); } }; // class pass_ipa_reference diff --git a/gcc/ipa-split.cc b/gcc/ipa-split.cc index 60021ba..1673461 100644 --- a/gcc/ipa-split.cc +++ b/gcc/ipa-split.cc @@ -1915,8 +1915,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) + bool gate (function *) final override; + unsigned int execute (function *) final override { return execute_split_functions (); } @@ -1974,8 +1974,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) + bool gate (function *) final override; + unsigned int execute (function *) final override { return execute_feedback_split_functions (); } diff --git a/gcc/ipa-sra.cc b/gcc/ipa-sra.cc index 96b020f..2237ac6 100644 --- a/gcc/ipa-sra.cc +++ b/gcc/ipa-sra.cc @@ -4049,14 +4049,17 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { /* TODO: We should remove the optimize check after we ensure we never run IPA passes when not optimizing. */ return (flag_ipa_sra && optimize); } - virtual unsigned int execute (function *) { return ipa_sra_analysis (); } + unsigned int execute (function *) final override + { + return ipa_sra_analysis (); + } }; // class pass_ipa_sra diff --git a/gcc/ipa-visibility.cc b/gcc/ipa-visibility.cc index e95a0dd..8a27e7b 100644 --- a/gcc/ipa-visibility.cc +++ b/gcc/ipa-visibility.cc @@ -959,12 +959,12 @@ public: /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { /* Do not re-run on ltrans stage. */ return !flag_ltrans; } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return whole_program_function_and_variable_visibility (); } @@ -988,7 +988,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return function_and_variable_visibility (flag_whole_program && !flag_lto); } @@ -1342,8 +1342,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) { return ipa_cdtor_merge (); } + bool gate (function *) final override; + unsigned int execute (function *) final override + { + return ipa_cdtor_merge (); + } }; // class pass_ipa_cdtor_merge @@ -1565,7 +1568,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) { return ipa_single_use (); } + unsigned int execute (function *) final override { return ipa_single_use (); } }; // class pass_ipa_single_use @@ -6074,11 +6074,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return !targetm.no_register_allocation; } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { ira (dump_file); return 0; @@ -6117,11 +6117,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return !targetm.no_register_allocation; } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { do_reload (); return 0; diff --git a/gcc/jump.cc b/gcc/jump.cc index 332f868..e620716 100644 --- a/gcc/jump.cc +++ b/gcc/jump.cc @@ -182,7 +182,10 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) { return cleanup_barriers (); } + unsigned int execute (function *) final override + { + return cleanup_barriers (); + } }; // class pass_cleanup_barriers diff --git a/gcc/loop-init.cc b/gcc/loop-init.cc index 1e4f6cf..648aa29 100644 --- a/gcc/loop-init.cc +++ b/gcc/loop-init.cc @@ -357,7 +357,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); + bool gate (function *) final override; }; // class pass_loop2 @@ -429,7 +429,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) { return rtl_loop_init (); } + unsigned int execute (function *) final override { return rtl_loop_init (); } }; // class pass_rtl_loop_init @@ -467,7 +467,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_rtl_loop_done @@ -523,8 +523,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_move_loop_invariants; } - virtual unsigned int execute (function *fun) + bool gate (function *) final override { return flag_move_loop_invariants; } + unsigned int execute (function *fun) final override { if (number_of_loops (fun) > 1) move_loop_invariants (); @@ -565,12 +565,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return (flag_unroll_loops || flag_unroll_all_loops || cfun->has_unroll); } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_rtl_unroll_loops @@ -625,8 +625,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *); + bool gate (function *) final override; + unsigned int execute (function *) final override; }; // class pass_rtl_doloop diff --git a/gcc/lower-subreg.cc b/gcc/lower-subreg.cc index d30bbee..03e9326 100644 --- a/gcc/lower-subreg.cc +++ b/gcc/lower-subreg.cc @@ -1769,8 +1769,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_split_wide_types != 0; } - virtual unsigned int execute (function *) + bool gate (function *) final override { return flag_split_wide_types != 0; } + unsigned int execute (function *) final override { decompose_multiword_subregs (false); return 0; @@ -1811,9 +1811,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_split_wide_types - && flag_split_wide_types_early; } - virtual unsigned int execute (function *) + bool gate (function *) final override + { + return flag_split_wide_types && flag_split_wide_types_early; + } + unsigned int execute (function *) final override { decompose_multiword_subregs (true); return 0; @@ -1854,8 +1856,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_split_wide_types; } - virtual unsigned int execute (function *) + bool gate (function *) final override { return flag_split_wide_types; } + unsigned int execute (function *) final override { decompose_multiword_subregs (true); return 0; diff --git a/gcc/mode-switching.cc b/gcc/mode-switching.cc index 6e3f1dc..b0f6e7c 100644 --- a/gcc/mode-switching.cc +++ b/gcc/mode-switching.cc @@ -893,8 +893,8 @@ public: /* opt_pass methods: */ /* The epiphany backend creates a second instance of this pass, so we need a clone method. */ - opt_pass * clone () { return new pass_mode_switching (m_ctxt); } - virtual bool gate (function *) + opt_pass * clone () final override { return new pass_mode_switching (m_ctxt); } + bool gate (function *) final override { #ifdef OPTIMIZE_MODE_SWITCHING return true; @@ -903,7 +903,7 @@ public: #endif } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { #ifdef OPTIMIZE_MODE_SWITCHING optimize_mode_switching (); diff --git a/gcc/modulo-sched.cc b/gcc/modulo-sched.cc index 2c95c09..162de19 100644 --- a/gcc/modulo-sched.cc +++ b/gcc/modulo-sched.cc @@ -3338,12 +3338,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return (optimize > 0 && flag_modulo_sched); } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_sms diff --git a/gcc/multiple_target.cc b/gcc/multiple_target.cc index 7fe02fb..3e2d268 100644 --- a/gcc/multiple_target.cc +++ b/gcc/multiple_target.cc @@ -526,8 +526,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) { return ipa_target_clone (); } + bool gate (function *) final override; + unsigned int execute (function *) final override + { + return ipa_target_clone (); + } }; bool diff --git a/gcc/omp-expand.cc b/gcc/omp-expand.cc index 2572957..1023c56 100644 --- a/gcc/omp-expand.cc +++ b/gcc/omp-expand.cc @@ -10625,7 +10625,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { bool gate = ((flag_openacc != 0 || flag_openmp != 0 || flag_openmp_simd != 0) @@ -10672,12 +10672,18 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *fun) + bool gate (function *fun) final override { return !(fun->curr_properties & PROP_gimple_eomp); } - virtual unsigned int execute (function *) { return execute_expand_omp (); } - opt_pass * clone () { return new pass_expand_omp_ssa (m_ctxt); } + unsigned int execute (function *) final override + { + return execute_expand_omp (); + } + opt_pass * clone () final override + { + return new pass_expand_omp_ssa (m_ctxt); + } }; // class pass_expand_omp_ssa diff --git a/gcc/omp-low.cc b/gcc/omp-low.cc index f976e3a..b9d5529f 100644 --- a/gcc/omp-low.cc +++ b/gcc/omp-low.cc @@ -14697,7 +14697,10 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) { return execute_lower_omp (); } + unsigned int execute (function *) final override + { + return execute_lower_omp (); + } }; // class pass_lower_omp @@ -15005,11 +15008,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return flag_openacc || flag_openmp || flag_openmp_simd; } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return diagnose_omp_structured_block_errors (); } diff --git a/gcc/omp-oacc-kernels-decompose.cc b/gcc/omp-oacc-kernels-decompose.cc index ec9b0fa..524060e 100644 --- a/gcc/omp-oacc-kernels-decompose.cc +++ b/gcc/omp-oacc-kernels-decompose.cc @@ -1615,12 +1615,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return (flag_openacc && param_openacc_kernels == OPENACC_KERNELS_DECOMPOSE); } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return omp_oacc_kernels_decompose (); } diff --git a/gcc/omp-oacc-neuter-broadcast.cc b/gcc/omp-oacc-neuter-broadcast.cc index 81e3223..b617779 100644 --- a/gcc/omp-oacc-neuter-broadcast.cc +++ b/gcc/omp-oacc-neuter-broadcast.cc @@ -1945,7 +1945,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *fun) + bool gate (function *fun) final override { if (!flag_openacc) return false; @@ -1961,7 +1961,7 @@ public: return true; } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return execute_omp_oacc_neuter_broadcast (); } diff --git a/gcc/omp-offload.cc b/gcc/omp-offload.cc index fcbe6cf..3a89119 100644 --- a/gcc/omp-offload.cc +++ b/gcc/omp-offload.cc @@ -2450,9 +2450,9 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_openacc; }; + bool gate (function *) final override { return flag_openacc; }; - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return execute_oacc_loop_designation (); } @@ -2480,9 +2480,9 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_openacc; }; + bool gate (function *) final override { return flag_openacc; }; - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return execute_oacc_device_lower (); } @@ -2714,13 +2714,13 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *fun) + bool gate (function *fun) final override { return (!(fun->curr_properties & PROP_gimple_lomp_dev) || (flag_openmp && cgraph_node::get (fun->decl)->calls_declare_variant_alt)); } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return execute_omp_device_lower (); } @@ -2760,7 +2760,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *fun) + bool gate (function *fun) final override { #ifdef ACCEL_COMPILER return offloading_function_p (fun->decl); @@ -2770,7 +2770,7 @@ public: #endif } - virtual unsigned execute (function *); + unsigned execute (function *) final override; }; /* Callback for walk_gimple_stmt used to scan for link var operands. */ diff --git a/gcc/omp-simd-clone.cc b/gcc/omp-simd-clone.cc index 04fe03c..32649bc 100644 --- a/gcc/omp-simd-clone.cc +++ b/gcc/omp-simd-clone.cc @@ -1819,8 +1819,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) { return ipa_omp_simd_clone (); } + bool gate (function *) final override; + unsigned int execute (function *) final override + { + return ipa_omp_simd_clone (); + } }; bool diff --git a/gcc/passes.cc b/gcc/passes.cc index 36e5b4a..78a07f8 100644 --- a/gcc/passes.cc +++ b/gcc/passes.cc @@ -417,13 +417,13 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { /* Don't bother doing anything if the program has errors. */ return (!seen_error () && !in_lto_p); } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return execute_build_ssa_passes (); } @@ -451,7 +451,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { /* Don't bother doing anything if the program has errors. */ return (!seen_error () && !in_lto_p); @@ -480,7 +480,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { /* Don't bother doing anything if the program has errors. */ return (!seen_error () && !in_lto_p); @@ -531,7 +531,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return (optimize >= 1 /* Don't bother doing anything if the program has errors. */ @@ -571,7 +571,10 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return optimize >= 1 && !optimize_debug; } + bool gate (function *) final override + { + return optimize >= 1 && !optimize_debug; + } }; // class pass_all_optimizations @@ -606,7 +609,10 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return optimize >= 1 && optimize_debug; } + bool gate (function *) final override + { + return optimize >= 1 && optimize_debug; + } }; // class pass_all_optimizations_g @@ -641,7 +647,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { /* Early return if there were errors. We can run afoul of our consistency checks, and there's not really much point in fixing them. */ @@ -681,7 +687,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return reload_completed; } + bool gate (function *) final override { return reload_completed; } }; // class pass_postreload @@ -716,7 +722,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return reload_completed || targetm.no_register_allocation; } @@ -756,15 +762,15 @@ public: { } - virtual bool - gate (function *fun) + bool + gate (function *fun) final override { return flag_tree_slp_vectorize && (fun->pending_TODOs & PENDING_TODO_force_next_scalar_cleanup); } - virtual unsigned int - execute (function *fun) + unsigned int + execute (function *fun) final override { fun->pending_TODOs &= ~PENDING_TODO_force_next_scalar_cleanup; return 0; diff --git a/gcc/postreload-gcse.cc b/gcc/postreload-gcse.cc index fc63f0b..1c795b4 100644 --- a/gcc/postreload-gcse.cc +++ b/gcc/postreload-gcse.cc @@ -1447,13 +1447,16 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *fun) + bool gate (function *fun) final override { return (optimize > 0 && flag_gcse_after_reload && optimize_function_for_speed_p (fun)); } - virtual unsigned int execute (function *) { return rest_of_handle_gcse2 (); } + unsigned int execute (function *) final override + { + return rest_of_handle_gcse2 (); + } }; // class pass_gcse2 diff --git a/gcc/postreload.cc b/gcc/postreload.cc index 4a67d0d..d1c99fe 100644 --- a/gcc/postreload.cc +++ b/gcc/postreload.cc @@ -2339,9 +2339,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return (optimize > 0 && reload_completed); } + bool gate (function *) final override + { + return (optimize > 0 && reload_completed); + } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_postreload_cse diff --git a/gcc/predict.cc b/gcc/predict.cc index 62da149..b36caa3 100644 --- a/gcc/predict.cc +++ b/gcc/predict.cc @@ -4078,8 +4078,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_guess_branch_prob; } - virtual unsigned int execute (function *); + bool gate (function *) final override { return flag_guess_branch_prob; } + unsigned int execute (function *) final override; }; // class pass_profile @@ -4232,14 +4232,17 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_strip_predict_hints (m_ctxt); } - void set_pass_param (unsigned int n, bool param) + opt_pass * clone () final override + { + return new pass_strip_predict_hints (m_ctxt); + } + void set_pass_param (unsigned int n, bool param) final override { gcc_assert (n == 0); early_p = param; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; private: bool early_p; diff --git a/gcc/recog.cc b/gcc/recog.cc index cd2410a..dac172b 100644 --- a/gcc/recog.cc +++ b/gcc/recog.cc @@ -4358,9 +4358,12 @@ public: /* opt_pass methods: */ /* The epiphany backend creates a second instance of this pass, so we need a clone method. */ - opt_pass * clone () { return new pass_peephole2 (m_ctxt); } - virtual bool gate (function *) { return (optimize > 0 && flag_peephole2); } - virtual unsigned int execute (function *) + opt_pass * clone () final override { return new pass_peephole2 (m_ctxt); } + bool gate (function *) final override + { + return (optimize > 0 && flag_peephole2); + } + unsigned int execute (function *) final override { return rest_of_handle_peephole2 (); } @@ -4400,8 +4403,11 @@ public: /* opt_pass methods: */ /* The epiphany backend creates a second instance of this pass, so we need a clone method. */ - opt_pass * clone () { return new pass_split_all_insns (m_ctxt); } - virtual unsigned int execute (function *) + opt_pass * clone () final override + { + return new pass_split_all_insns (m_ctxt); + } + unsigned int execute (function *) final override { split_all_insns (); return 0; @@ -4440,13 +4446,13 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { /* If optimizing, then go ahead and split insns now. */ return optimize > 0; } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { split_all_insns (); return 0; @@ -4495,12 +4501,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return enable_split_before_sched2 (); } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { split_all_insns (); return 0; @@ -4539,8 +4545,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) + bool gate (function *) final override; + unsigned int execute (function *) final override { split_all_insns (); return 0; @@ -4598,7 +4604,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { /* The placement of the splitting that we do for shorten_branches depends on whether regstack is used by the target or not. */ @@ -4609,7 +4615,7 @@ public: #endif } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return split_all_insns_noflow (); } @@ -1403,8 +1403,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return (optimize > 0 && flag_ree); } - virtual unsigned int execute (function *) { return rest_of_handle_ree (); } + bool gate (function *) final override { return (optimize > 0 && flag_ree); } + unsigned int execute (function *) final override + { + return rest_of_handle_ree (); + } }; // class pass_ree diff --git a/gcc/reg-stack.cc b/gcc/reg-stack.cc index 5afeadf..fd03250 100644 --- a/gcc/reg-stack.cc +++ b/gcc/reg-stack.cc @@ -3413,7 +3413,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { #ifdef STACK_REGS return true; @@ -3468,7 +3468,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return rest_of_handle_stack_regs (); } diff --git a/gcc/regcprop.cc b/gcc/regcprop.cc index eacc59f..ce9d32a 100644 --- a/gcc/regcprop.cc +++ b/gcc/regcprop.cc @@ -1293,12 +1293,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return (optimize > 0 && (flag_cprop_registers)); } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_cprop_hardreg diff --git a/gcc/reginfo.cc b/gcc/reginfo.cc index 2ab7bbb..705779d 100644 --- a/gcc/reginfo.cc +++ b/gcc/reginfo.cc @@ -953,7 +953,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) { return reginfo_init (); } + unsigned int execute (function *) final override { return reginfo_init (); } }; // class pass_reginfo_init diff --git a/gcc/regrename.cc b/gcc/regrename.cc index f651351..b15eb80 100644 --- a/gcc/regrename.cc +++ b/gcc/regrename.cc @@ -2012,12 +2012,15 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return (optimize > 0 && (flag_rename_registers)); } - virtual unsigned int execute (function *) { return regrename_optimize (); } + unsigned int execute (function *) final override + { + return regrename_optimize (); + } }; // class pass_regrename diff --git a/gcc/reorg.cc b/gcc/reorg.cc index 7624f51..07b2045 100644 --- a/gcc/reorg.cc +++ b/gcc/reorg.cc @@ -3866,8 +3866,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) + bool gate (function *) final override; + unsigned int execute (function *) final override { return rest_of_handle_delay_slots (); } @@ -3917,12 +3917,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return targetm.machine_dependent_reorg != 0; } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { targetm.machine_dependent_reorg (); return 0; diff --git a/gcc/sancov.cc b/gcc/sancov.cc index 9c10252..052fa4e 100644 --- a/gcc/sancov.cc +++ b/gcc/sancov.cc @@ -308,17 +308,17 @@ public: static const pass_data data; opt_pass * - clone () + clone () final override { return new pass_sancov<O0> (m_ctxt); } - virtual bool - gate (function *fun) + bool + gate (function *fun) final override { return sanitize_coverage_p (fun->decl) && (!O0 || !optimize); } - virtual unsigned int - execute (function *fun) + unsigned int + execute (function *fun) final override { return sancov_pass (fun); } diff --git a/gcc/sanopt.cc b/gcc/sanopt.cc index 2b05553..e9d188d 100644 --- a/gcc/sanopt.cc +++ b/gcc/sanopt.cc @@ -942,7 +942,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { /* SANITIZE_RETURN is handled in the front-end. When trapping, SANITIZE_UNREACHABLE is handled by builtin_decl_unreachable. */ @@ -951,7 +951,7 @@ public: mask |= SANITIZE_UNREACHABLE; return flag_sanitize & ~mask; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_sanopt diff --git a/gcc/sched-rgn.cc b/gcc/sched-rgn.cc index a0dfdb7..0dc2a8f 100644 --- a/gcc/sched-rgn.cc +++ b/gcc/sched-rgn.cc @@ -3779,7 +3779,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { #ifdef INSN_SCHEDULING return flag_live_range_shrinkage; @@ -3788,7 +3788,7 @@ public: #endif } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return rest_of_handle_live_range_shrinkage (); } @@ -3826,8 +3826,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) { return rest_of_handle_sched (); } + bool gate (function *) final override; + unsigned int execute (function *) final override + { + return rest_of_handle_sched (); + } }; // class pass_sched @@ -3872,8 +3875,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) + bool gate (function *) final override; + unsigned int execute (function *) final override { return rest_of_handle_sched2 (); } @@ -3922,8 +3925,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) + bool gate (function *) final override; + unsigned int execute (function *) final override { return rest_of_handle_sched_fusion (); } diff --git a/gcc/stack-ptr-mod.cc b/gcc/stack-ptr-mod.cc index b14bef9..4ccbb1c 100644 --- a/gcc/stack-ptr-mod.cc +++ b/gcc/stack-ptr-mod.cc @@ -71,7 +71,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_stack_ptr_mod diff --git a/gcc/store-motion.cc b/gcc/store-motion.cc index 0f70870..b61c068 100644 --- a/gcc/store-motion.cc +++ b/gcc/store-motion.cc @@ -1243,8 +1243,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) + bool gate (function *) final override; + unsigned int execute (function *) final override { return execute_rtl_store_motion (); } diff --git a/gcc/tracer.cc b/gcc/tracer.cc index 4d054fe..6451784 100644 --- a/gcc/tracer.cc +++ b/gcc/tracer.cc @@ -424,12 +424,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return (optimize > 0 && flag_tracer && flag_reorder_blocks); } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_tracer diff --git a/gcc/trans-mem.cc b/gcc/trans-mem.cc index ae2921f..131dce0 100644 --- a/gcc/trans-mem.cc +++ b/gcc/trans-mem.cc @@ -864,8 +864,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tm; } - virtual unsigned int execute (function *) { return diagnose_tm_blocks (); } + bool gate (function *) final override { return flag_tm; } + unsigned int execute (function *) final override + { + return diagnose_tm_blocks (); + } }; // class pass_diagnose_tm_blocks @@ -1850,8 +1853,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tm; } - virtual unsigned int execute (function *) { return execute_lower_tm (); } + bool gate (function *) final override { return flag_tm; } + unsigned int execute (function *) final override + { + return execute_lower_tm (); + } }; // class pass_lower_tm @@ -2144,7 +2150,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return gate_tm_init (); } + bool gate (function *) final override { return gate_tm_init (); } }; // class pass_tm_init @@ -3162,7 +3168,10 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) { return execute_tm_mark (); } + unsigned int execute (function *) final override + { + return execute_tm_mark (); + } }; // class pass_tm_mark @@ -3324,7 +3333,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_tm_edges @@ -4085,8 +4094,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tm && optimize > 0; } - virtual unsigned int execute (function *) { return execute_tm_memopt (); } + bool gate (function *) final override { return flag_tm && optimize > 0; } + unsigned int execute (function *) final override + { + return execute_tm_memopt (); + } }; // class pass_tm_memopt @@ -5667,8 +5679,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tm; } - virtual unsigned int execute (function *) { return ipa_tm_execute (); } + bool gate (function *) final override { return flag_tm; } + unsigned int execute (function *) final override { return ipa_tm_execute (); } }; // class pass_ipa_tm diff --git a/gcc/tree-call-cdce.cc b/gcc/tree-call-cdce.cc index 83991fe..feb61f3 100644 --- a/gcc/tree-call-cdce.cc +++ b/gcc/tree-call-cdce.cc @@ -1171,7 +1171,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { /* The limit constants used in the implementation assume IEEE floating point format. Other formats @@ -1179,7 +1179,7 @@ public: return flag_tree_builtin_call_dce != 0; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_call_cdce diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc index 734fddd..bfcb142 100644 --- a/gcc/tree-cfg.cc +++ b/gcc/tree-cfg.cc @@ -407,7 +407,10 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) { return execute_build_cfg (); } + unsigned int execute (function *) final override + { + return execute_build_cfg (); + } }; // class pass_build_cfg @@ -9209,9 +9212,15 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) { return split_critical_edges (); } + unsigned int execute (function *) final override + { + return split_critical_edges (); + } - opt_pass * clone () { return new pass_split_crit_edges (m_ctxt); } + opt_pass * clone () final override + { + return new pass_split_crit_edges (m_ctxt); + } }; // class pass_split_crit_edges } // anon namespace @@ -9468,7 +9477,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_warn_function_return @@ -9674,8 +9683,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_warn_unused_result; } - virtual unsigned int execute (function *) + bool gate (function *) final override { return flag_warn_unused_result; } + unsigned int execute (function *) final override { do_warn_unused_result (gimple_body (current_function_decl)); return 0; @@ -9884,8 +9893,11 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_fixup_cfg (m_ctxt); } - virtual unsigned int execute (function *) { return execute_fixup_cfg (); } + opt_pass * clone () final override { return new pass_fixup_cfg (m_ctxt); } + unsigned int execute (function *) final override + { + return execute_fixup_cfg (); + } }; // class pass_fixup_cfg diff --git a/gcc/tree-cfgcleanup.cc b/gcc/tree-cfgcleanup.cc index 893619e..a6d0bf2 100644 --- a/gcc/tree-cfgcleanup.cc +++ b/gcc/tree-cfgcleanup.cc @@ -1406,8 +1406,8 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_merge_phi (m_ctxt); } - virtual unsigned int execute (function *); + opt_pass * clone () final override { return new pass_merge_phi (m_ctxt); } + unsigned int execute (function *) final override; }; // class pass_merge_phi @@ -1584,7 +1584,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return execute_cleanup_cfg_post_optimizing (); } diff --git a/gcc/tree-complex.cc b/gcc/tree-complex.cc index f722057..61950a0 100644 --- a/gcc/tree-complex.cc +++ b/gcc/tree-complex.cc @@ -1915,8 +1915,11 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_lower_complex (m_ctxt); } - virtual unsigned int execute (function *) { return tree_lower_complex (); } + opt_pass * clone () final override { return new pass_lower_complex (m_ctxt); } + unsigned int execute (function *) final override + { + return tree_lower_complex (); + } }; // class pass_lower_complex @@ -1952,14 +1955,17 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *fun) + bool gate (function *fun) final override { /* With errors, normal optimization passes are not run. If we don't lower complex operations at all, rtl expansion will abort. */ return !(fun->curr_properties & PROP_gimple_lcx); } - virtual unsigned int execute (function *) { return tree_lower_complex (); } + unsigned int execute (function *) final override + { + return tree_lower_complex (); + } }; // class pass_lower_complex_O0 diff --git a/gcc/tree-eh.cc b/gcc/tree-eh.cc index c37a584..076ecd3e 100644 --- a/gcc/tree-eh.cc +++ b/gcc/tree-eh.cc @@ -2176,7 +2176,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_lower_eh @@ -3295,8 +3295,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_exceptions != 0; } - virtual unsigned int execute (function *) + bool gate (function *) final override { return flag_exceptions != 0; } + unsigned int execute (function *) final override { refactor_eh_r (gimple_body (current_function_decl)); return 0; @@ -3497,8 +3497,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_exceptions != 0; } - virtual unsigned int execute (function *); + bool gate (function *) final override { return flag_exceptions != 0; } + unsigned int execute (function *) final override; }; // class pass_lower_resx @@ -3922,8 +3922,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *fun) { return fun->eh->region_tree != NULL; } - virtual unsigned int execute (function *); + bool gate (function *fun) final override + { + return fun->eh->region_tree != NULL; + } + unsigned int execute (function *) final override; }; // class pass_lower_eh_dispatch @@ -4859,13 +4862,13 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_cleanup_eh (m_ctxt); } - virtual bool gate (function *fun) + opt_pass * clone () final override { return new pass_cleanup_eh (m_ctxt); } + bool gate (function *fun) final override { return fun->eh != NULL && fun->eh->region_tree != NULL; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_cleanup_eh diff --git a/gcc/tree-emutls.cc b/gcc/tree-emutls.cc index 5f68703..b5aa307 100644 --- a/gcc/tree-emutls.cc +++ b/gcc/tree-emutls.cc @@ -838,13 +838,16 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { /* If the target supports TLS natively, we need do nothing here. */ return !targetm.have_tls; } - virtual unsigned int execute (function *) { return ipa_lower_emutls (); } + unsigned int execute (function *) final override + { + return ipa_lower_emutls (); + } }; // class pass_ipa_lower_emutls diff --git a/gcc/tree-if-conv.cc b/gcc/tree-if-conv.cc index 2245b6b..3c659f6 100644 --- a/gcc/tree-if-conv.cc +++ b/gcc/tree-if-conv.cc @@ -3424,8 +3424,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *); + bool gate (function *) final override; + unsigned int execute (function *) final override; }; // class pass_if_conversion diff --git a/gcc/tree-into-ssa.cc b/gcc/tree-into-ssa.cc index 22c2e5b..46df57a 100644 --- a/gcc/tree-into-ssa.cc +++ b/gcc/tree-into-ssa.cc @@ -2403,13 +2403,13 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *fun) + bool gate (function *fun) final override { /* Do nothing for funcions that was produced already in SSA form. */ return !(fun->curr_properties & PROP_ssa); } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_build_ssa diff --git a/gcc/tree-loop-distribution.cc b/gcc/tree-loop-distribution.cc index 086b59c..18b97fc 100644 --- a/gcc/tree-loop-distribution.cc +++ b/gcc/tree-loop-distribution.cc @@ -3897,13 +3897,13 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return flag_tree_loop_distribution || flag_tree_loop_distribute_patterns; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_loop_distribution diff --git a/gcc/tree-nrv.cc b/gcc/tree-nrv.cc index b96d5b8..1faa481 100644 --- a/gcc/tree-nrv.cc +++ b/gcc/tree-nrv.cc @@ -125,9 +125,9 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return optimize > 0; } + bool gate (function *) final override { return optimize > 0; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_nrv @@ -344,7 +344,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_return_slot diff --git a/gcc/tree-object-size.cc b/gcc/tree-object-size.cc index 12bc086..4eb454a 100644 --- a/gcc/tree-object-size.cc +++ b/gcc/tree-object-size.cc @@ -2124,8 +2124,8 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_object_sizes (m_ctxt); } - virtual unsigned int execute (function *fun) + opt_pass * clone () final override { return new pass_object_sizes (m_ctxt); } + unsigned int execute (function *fun) final override { return object_sizes_execute (fun, false); } @@ -2164,7 +2164,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *fun) + unsigned int execute (function *fun) final override { return object_sizes_execute (fun, true); } diff --git a/gcc/tree-parloops.cc b/gcc/tree-parloops.cc index da10696..2c3ef43 100644 --- a/gcc/tree-parloops.cc +++ b/gcc/tree-parloops.cc @@ -4173,16 +4173,19 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { if (oacc_kernels_p) return flag_openacc; else return flag_tree_parallelize_loops > 1; } - virtual unsigned int execute (function *); - opt_pass * clone () { return new pass_parallelize_loops (m_ctxt); } - void set_pass_param (unsigned int n, bool param) + unsigned int execute (function *) final override; + opt_pass * clone () final override + { + return new pass_parallelize_loops (m_ctxt); + } + void set_pass_param (unsigned int n, bool param) final override { gcc_assert (n == 0); oacc_kernels_p = param; diff --git a/gcc/tree-predcom.cc b/gcc/tree-predcom.cc index fb45725..5d923fb 100644 --- a/gcc/tree-predcom.cc +++ b/gcc/tree-predcom.cc @@ -3514,8 +3514,8 @@ public: {} /* opt_pass methods: */ - virtual bool - gate (function *) + bool + gate (function *) final override { if (flag_predictive_commoning != 0) return true; @@ -3529,8 +3529,8 @@ public: return false; } - virtual unsigned int - execute (function *fun) + unsigned int + execute (function *fun) final override { bool allow_unroll_p = flag_predictive_commoning != 0; return run_tree_predictive_commoning (fun, allow_unroll_p); diff --git a/gcc/tree-profile.cc b/gcc/tree-profile.cc index 97aab88..2beb492 100644 --- a/gcc/tree-profile.cc +++ b/gcc/tree-profile.cc @@ -884,8 +884,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) { return tree_profiling (); } + bool gate (function *) final override; + unsigned int execute (function *) final override { return tree_profiling (); } }; // class pass_ipa_tree_profile diff --git a/gcc/tree-sra.cc b/gcc/tree-sra.cc index 081c51b..461c8e0 100644 --- a/gcc/tree-sra.cc +++ b/gcc/tree-sra.cc @@ -4743,8 +4743,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return gate_intra_sra (); } - virtual unsigned int execute (function *) { return early_intra_sra (); } + bool gate (function *) final override { return gate_intra_sra (); } + unsigned int execute (function *) final override + { + return early_intra_sra (); + } }; // class pass_sra_early @@ -4779,8 +4782,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return gate_intra_sra (); } - virtual unsigned int execute (function *) { return late_intra_sra (); } + bool gate (function *) final override { return gate_intra_sra (); } + unsigned int execute (function *) final override { return late_intra_sra (); } }; // class pass_sra diff --git a/gcc/tree-ssa-ccp.cc b/gcc/tree-ssa-ccp.cc index 58e0fac..85c0460 100644 --- a/gcc/tree-ssa-ccp.cc +++ b/gcc/tree-ssa-ccp.cc @@ -2994,14 +2994,17 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_ccp (m_ctxt); } - void set_pass_param (unsigned int n, bool param) + opt_pass * clone () final override { return new pass_ccp (m_ctxt); } + void set_pass_param (unsigned int n, bool param) final override { gcc_assert (n == 0); nonzero_p = param; } - virtual bool gate (function *) { return flag_tree_ccp != 0; } - virtual unsigned int execute (function *) { return do_ssa_ccp (nonzero_p); } + bool gate (function *) final override { return flag_tree_ccp != 0; } + unsigned int execute (function *) final override + { + return do_ssa_ccp (nonzero_p); + } private: /* Determines whether the pass instance records nonzero bits. */ @@ -4202,8 +4205,8 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_fold_builtins (m_ctxt); } - virtual unsigned int execute (function *); + opt_pass * clone () final override { return new pass_fold_builtins (m_ctxt); } + unsigned int execute (function *) final override; }; // class pass_fold_builtins @@ -4553,9 +4556,9 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_post_ipa_warn (m_ctxt); } - virtual bool gate (function *) { return warn_nonnull != 0; } - virtual unsigned int execute (function *); + opt_pass * clone () final override { return new pass_post_ipa_warn (m_ctxt); } + bool gate (function *) final override { return warn_nonnull != 0; } + unsigned int execute (function *) final override; }; // class pass_fold_builtins diff --git a/gcc/tree-ssa-copy.cc b/gcc/tree-ssa-copy.cc index 050a6d1..782ceb5 100644 --- a/gcc/tree-ssa-copy.cc +++ b/gcc/tree-ssa-copy.cc @@ -642,9 +642,12 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_copy_prop (m_ctxt); } - virtual bool gate (function *) { return flag_tree_copy_prop != 0; } - virtual unsigned int execute (function *) { return execute_copy_prop (); } + opt_pass * clone () final override { return new pass_copy_prop (m_ctxt); } + bool gate (function *) final override { return flag_tree_copy_prop != 0; } + unsigned int execute (function *) final override + { + return execute_copy_prop (); + } }; // class pass_copy_prop diff --git a/gcc/tree-ssa-dce.cc b/gcc/tree-ssa-dce.cc index a6b2840..5df6492 100644 --- a/gcc/tree-ssa-dce.cc +++ b/gcc/tree-ssa-dce.cc @@ -1974,9 +1974,9 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_dce (m_ctxt); } - virtual bool gate (function *) { return flag_tree_dce != 0; } - virtual unsigned int execute (function *) { return tree_ssa_dce (); } + opt_pass * clone () final override { return new pass_dce (m_ctxt); } + bool gate (function *) final override { return flag_tree_dce != 0; } + unsigned int execute (function *) final override { return tree_ssa_dce (); } }; // class pass_dce @@ -2011,14 +2011,14 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_cd_dce (m_ctxt); } - void set_pass_param (unsigned n, bool param) + opt_pass * clone () final override { return new pass_cd_dce (m_ctxt); } + void set_pass_param (unsigned n, bool param) final override { gcc_assert (n == 0); update_address_taken_p = param; } - virtual bool gate (function *) { return flag_tree_dce != 0; } - virtual unsigned int execute (function *) + bool gate (function *) final override { return flag_tree_dce != 0; } + unsigned int execute (function *) final override { return (tree_ssa_cd_dce () | (update_address_taken_p ? TODO_update_address_taken : 0)); diff --git a/gcc/tree-ssa-dom.cc b/gcc/tree-ssa-dom.cc index 208b0a0..e282123 100644 --- a/gcc/tree-ssa-dom.cc +++ b/gcc/tree-ssa-dom.cc @@ -728,14 +728,14 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_dominator (m_ctxt); } - void set_pass_param (unsigned int n, bool param) + opt_pass * clone () final override { return new pass_dominator (m_ctxt); } + void set_pass_param (unsigned int n, bool param) final override { gcc_assert (n == 0); may_peel_loop_headers_p = param; } - virtual bool gate (function *) { return flag_tree_dom != 0; } - virtual unsigned int execute (function *); + bool gate (function *) final override { return flag_tree_dom != 0; } + unsigned int execute (function *) final override; private: /* This flag is used to prevent loops from being peeled repeatedly in jump diff --git a/gcc/tree-ssa-dse.cc b/gcc/tree-ssa-dse.cc index ea50de7..62efafe 100644 --- a/gcc/tree-ssa-dse.cc +++ b/gcc/tree-ssa-dse.cc @@ -1491,9 +1491,9 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_dse (m_ctxt); } - virtual bool gate (function *) { return flag_tree_dse != 0; } - virtual unsigned int execute (function *); + opt_pass * clone () final override { return new pass_dse (m_ctxt); } + bool gate (function *) final override { return flag_tree_dse != 0; } + unsigned int execute (function *) final override; }; // class pass_dse diff --git a/gcc/tree-ssa-forwprop.cc b/gcc/tree-ssa-forwprop.cc index c387e84..69567ab 100644 --- a/gcc/tree-ssa-forwprop.cc +++ b/gcc/tree-ssa-forwprop.cc @@ -3266,9 +3266,9 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_forwprop (m_ctxt); } - virtual bool gate (function *) { return flag_tree_forwprop; } - virtual unsigned int execute (function *); + opt_pass * clone () final override { return new pass_forwprop (m_ctxt); } + bool gate (function *) final override { return flag_tree_forwprop; } + unsigned int execute (function *) final override; }; // class pass_forwprop diff --git a/gcc/tree-ssa-ifcombine.cc b/gcc/tree-ssa-ifcombine.cc index 88a9f06..80c41c4 100644 --- a/gcc/tree-ssa-ifcombine.cc +++ b/gcc/tree-ssa-ifcombine.cc @@ -829,7 +829,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_tree_ifcombine diff --git a/gcc/tree-ssa-loop-ch.cc b/gcc/tree-ssa-loop-ch.cc index 26d96c0..843a436 100644 --- a/gcc/tree-ssa-loop-ch.cc +++ b/gcc/tree-ssa-loop-ch.cc @@ -311,12 +311,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tree_ch != 0; } + bool gate (function *) final override { return flag_tree_ch != 0; } /* Initialize and finalize loop structures, copying headers inbetween. */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; - opt_pass * clone () { return new pass_ch (m_ctxt); } + opt_pass * clone () final override { return new pass_ch (m_ctxt); } protected: /* ch_base method: */ @@ -347,14 +347,14 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *fun) + bool gate (function *fun) final override { return flag_tree_ch != 0 && (flag_tree_loop_vectorize != 0 || fun->has_force_vectorize_loops); } /* Just copy headers, no initialization/finalization of loop structures. */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; protected: /* ch_base method: */ diff --git a/gcc/tree-ssa-loop-im.cc b/gcc/tree-ssa-loop-im.cc index bfd6126..2ea8150 100644 --- a/gcc/tree-ssa-loop-im.cc +++ b/gcc/tree-ssa-loop-im.cc @@ -3600,9 +3600,9 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_lim (m_ctxt); } - virtual bool gate (function *) { return flag_tree_loop_im != 0; } - virtual unsigned int execute (function *); + opt_pass * clone () final override { return new pass_lim (m_ctxt); } + bool gate (function *) final override { return flag_tree_loop_im != 0; } + unsigned int execute (function *) final override; }; // class pass_lim diff --git a/gcc/tree-ssa-loop-ivcanon.cc b/gcc/tree-ssa-loop-ivcanon.cc index 6a38b77..766bffa 100644 --- a/gcc/tree-ssa-loop-ivcanon.cc +++ b/gcc/tree-ssa-loop-ivcanon.cc @@ -1538,8 +1538,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tree_loop_ivcanon != 0; } - virtual unsigned int execute (function *fun); + bool gate (function *) final override { return flag_tree_loop_ivcanon != 0; } + unsigned int execute (function *fun) final override; }; // class pass_iv_canon @@ -1585,7 +1585,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_complete_unroll @@ -1643,8 +1643,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return optimize >= 2; } - virtual unsigned int execute (function *); + bool gate (function *) final override { return optimize >= 2; } + unsigned int execute (function *) final override; }; // class pass_complete_unrolli diff --git a/gcc/tree-ssa-loop-prefetch.cc b/gcc/tree-ssa-loop-prefetch.cc index aebd7c9..8f190ae 100644 --- a/gcc/tree-ssa-loop-prefetch.cc +++ b/gcc/tree-ssa-loop-prefetch.cc @@ -2069,8 +2069,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_prefetch_loop_arrays > 0; } - virtual unsigned int execute (function *); + bool gate (function *) final override + { + return flag_prefetch_loop_arrays > 0; + } + unsigned int execute (function *) final override; }; // class pass_loop_prefetch diff --git a/gcc/tree-ssa-loop-split.cc b/gcc/tree-ssa-loop-split.cc index b93ee4c..d61bad5 100644 --- a/gcc/tree-ssa-loop-split.cc +++ b/gcc/tree-ssa-loop-split.cc @@ -1724,8 +1724,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_split_loops != 0; } - virtual unsigned int execute (function *); + bool gate (function *) final override { return flag_split_loops != 0; } + unsigned int execute (function *) final override; }; // class pass_loop_split diff --git a/gcc/tree-ssa-loop-unswitch.cc b/gcc/tree-ssa-loop-unswitch.cc index 50b66c1..afae982 100644 --- a/gcc/tree-ssa-loop-unswitch.cc +++ b/gcc/tree-ssa-loop-unswitch.cc @@ -1614,8 +1614,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_unswitch_loops != 0; } - virtual unsigned int execute (function *); + bool gate (function *) final override { return flag_unswitch_loops != 0; } + unsigned int execute (function *) final override; }; // class pass_tree_unswitch diff --git a/gcc/tree-ssa-loop.cc b/gcc/tree-ssa-loop.cc index 73aa466..1c058b0 100644 --- a/gcc/tree-ssa-loop.cc +++ b/gcc/tree-ssa-loop.cc @@ -67,9 +67,9 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tree_loop_optimize; } + bool gate (function *) final override { return flag_tree_loop_optimize; } - virtual unsigned int execute (function *fn); + unsigned int execute (function *fn) final override; }; // class pass_fix_loops unsigned int @@ -134,7 +134,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *fn) { return gate_loop (fn); } + bool gate (function *fn) final override { return gate_loop (fn); } }; // class pass_tree_loop @@ -189,7 +189,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *fn) { return gate_oacc_kernels (fn); } + bool gate (function *fn) final override { return gate_oacc_kernels (fn); } }; // class pass_oacc_kernels @@ -226,7 +226,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return (optimize && flag_openacc @@ -303,7 +303,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *fn) { return !gate_loop (fn); } + bool gate (function *fn) final override { return !gate_loop (fn); } }; // class pass_tree_no_loop @@ -341,7 +341,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_tree_loop_init @@ -395,8 +395,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tree_scev_cprop; } - virtual unsigned int execute (function *); + bool gate (function *) final override { return flag_tree_scev_cprop; } + unsigned int execute (function *) final override; }; // class pass_scev_cprop @@ -446,8 +446,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_ivopts != 0; } - virtual unsigned int execute (function *); + bool gate (function *) final override { return flag_ivopts != 0; } + unsigned int execute (function *) final override; }; // class pass_iv_optimize @@ -503,7 +503,10 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *) { return tree_ssa_loop_done (); } + unsigned int execute (function *) final override + { + return tree_ssa_loop_done (); + } }; // class pass_tree_loop_done diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc index ce1df01..fe9f37b 100644 --- a/gcc/tree-ssa-math-opts.cc +++ b/gcc/tree-ssa-math-opts.cc @@ -920,8 +920,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return optimize && flag_reciprocal_math; } - virtual unsigned int execute (function *); + bool gate (function *) final override + { + return optimize && flag_reciprocal_math; + } + unsigned int execute (function *) final override; }; // class pass_cse_reciprocals @@ -2249,14 +2252,14 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { /* We no longer require either sincos or cexp, since powi expansion piggybacks on this pass. */ return optimize; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_cse_sincos @@ -4892,12 +4895,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return flag_expensive_optimizations && optimize; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_optimize_widening_mul diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc index e61d973..7efcc07 100644 --- a/gcc/tree-ssa-phiopt.cc +++ b/gcc/tree-ssa-phiopt.cc @@ -3960,14 +3960,14 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_phiopt (m_ctxt); } - void set_pass_param (unsigned n, bool param) + opt_pass * clone () final override { return new pass_phiopt (m_ctxt); } + void set_pass_param (unsigned n, bool param) final override { gcc_assert (n == 0); early_p = param; } - virtual bool gate (function *) { return flag_ssa_phiopt; } - virtual unsigned int execute (function *) + bool gate (function *) final override { return flag_ssa_phiopt; } + unsigned int execute (function *) final override { return tree_ssa_phiopt_worker (false, !early_p ? gate_hoist_loads () : false, @@ -4009,8 +4009,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tree_cselim; } - virtual unsigned int execute (function *) { return tree_ssa_cs_elim (); } + bool gate (function *) final override { return flag_tree_cselim; } + unsigned int execute (function *) final override + { + return tree_ssa_cs_elim (); + } }; // class pass_cselim diff --git a/gcc/tree-ssa-phiprop.cc b/gcc/tree-ssa-phiprop.cc index 7bbfc8c..965f1d1 100644 --- a/gcc/tree-ssa-phiprop.cc +++ b/gcc/tree-ssa-phiprop.cc @@ -476,8 +476,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tree_phiprop; } - virtual unsigned int execute (function *); + bool gate (function *) final override { return flag_tree_phiprop; } + unsigned int execute (function *) final override; }; // class pass_phiprop diff --git a/gcc/tree-ssa-pre.cc b/gcc/tree-ssa-pre.cc index 09a5e20..e029bd3 100644 --- a/gcc/tree-ssa-pre.cc +++ b/gcc/tree-ssa-pre.cc @@ -4339,9 +4339,9 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return flag_tree_pre != 0 || flag_code_hoisting != 0; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_pre diff --git a/gcc/tree-ssa-reassoc.cc b/gcc/tree-ssa-reassoc.cc index 406523b..e13e2cb 100644 --- a/gcc/tree-ssa-reassoc.cc +++ b/gcc/tree-ssa-reassoc.cc @@ -7132,15 +7132,15 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_reassoc (m_ctxt); } - void set_pass_param (unsigned int n, bool param) + opt_pass * clone () final override { return new pass_reassoc (m_ctxt); } + void set_pass_param (unsigned int n, bool param) final override { gcc_assert (n == 0); insert_powi_p = param; bias_loop_carried_phi_ranks_p = !param; } - virtual bool gate (function *) { return flag_tree_reassoc != 0; } - virtual unsigned int execute (function *) + bool gate (function *) final override { return flag_tree_reassoc != 0; } + unsigned int execute (function *) final override { return execute_reassoc (insert_powi_p, bias_loop_carried_phi_ranks_p); } diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc index 776dccb..ee5b95c 100644 --- a/gcc/tree-ssa-sccvn.cc +++ b/gcc/tree-ssa-sccvn.cc @@ -8295,17 +8295,17 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_fre (m_ctxt); } - void set_pass_param (unsigned int n, bool param) + opt_pass * clone () final override { return new pass_fre (m_ctxt); } + void set_pass_param (unsigned int n, bool param) final override { gcc_assert (n == 0); may_iterate = param; } - virtual bool gate (function *) + bool gate (function *) final override { return flag_tree_fre != 0 && (may_iterate || optimize > 1); } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; private: bool may_iterate; diff --git a/gcc/tree-ssa-sink.cc b/gcc/tree-ssa-sink.cc index bb50cbc..2e744d6 100644 --- a/gcc/tree-ssa-sink.cc +++ b/gcc/tree-ssa-sink.cc @@ -828,10 +828,10 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tree_sink != 0; } - virtual unsigned int execute (function *); - opt_pass *clone (void) { return new pass_sink_code (m_ctxt); } - void set_pass_param (unsigned n, bool param) + bool gate (function *) final override { return flag_tree_sink != 0; } + unsigned int execute (function *) final override; + opt_pass *clone (void) final override { return new pass_sink_code (m_ctxt); } + void set_pass_param (unsigned n, bool param) final override { gcc_assert (n == 0); unsplit_edges = param; diff --git a/gcc/tree-ssa-strlen.cc b/gcc/tree-ssa-strlen.cc index 1d4c0f7..2cceba6 100644 --- a/gcc/tree-ssa-strlen.cc +++ b/gcc/tree-ssa-strlen.cc @@ -5962,8 +5962,8 @@ public: : gimple_opt_pass (pass_data_warn_printf, ctxt) {} - virtual bool gate (function *); - virtual unsigned int execute (function *fun) + bool gate (function *) final override; + unsigned int execute (function *fun) final override { return printf_strlen_execute (fun, true); } @@ -5999,10 +5999,10 @@ public: : gimple_opt_pass (pass_data_strlen, ctxt) {} - opt_pass * clone () { return new pass_strlen (m_ctxt); } + opt_pass * clone () final override { return new pass_strlen (m_ctxt); } - virtual bool gate (function *); - virtual unsigned int execute (function *fun) + bool gate (function *) final override; + unsigned int execute (function *fun) final override { return printf_strlen_execute (fun, false); } diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc index 581bdcf..dcf13d9 100644 --- a/gcc/tree-ssa-structalias.cc +++ b/gcc/tree-ssa-structalias.cc @@ -8085,7 +8085,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tree_pta; } + bool gate (function *) final override { return flag_tree_pta; } }; // class pass_build_alias @@ -8123,7 +8123,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tree_pta; } + bool gate (function *) final override { return flag_tree_pta; } }; // class pass_build_ealias @@ -8737,7 +8737,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return (optimize && flag_ipa_pta @@ -8745,9 +8745,12 @@ public: && !seen_error ()); } - opt_pass * clone () { return new pass_ipa_pta (m_ctxt); } + opt_pass * clone () final override { return new pass_ipa_pta (m_ctxt); } - virtual unsigned int execute (function *) { return ipa_pta_execute (); } + unsigned int execute (function *) final override + { + return ipa_pta_execute (); + } }; // class pass_ipa_pta diff --git a/gcc/tree-ssa-uncprop.cc b/gcc/tree-ssa-uncprop.cc index aea7d69..510f831 100644 --- a/gcc/tree-ssa-uncprop.cc +++ b/gcc/tree-ssa-uncprop.cc @@ -453,9 +453,9 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_uncprop (m_ctxt); } - virtual bool gate (function *) { return flag_tree_dom != 0; } - virtual unsigned int execute (function *); + opt_pass * clone () final override { return new pass_uncprop (m_ctxt); } + bool gate (function *) final override { return flag_tree_dom != 0; } + unsigned int execute (function *) final override; }; // class pass_uncprop diff --git a/gcc/tree-ssa-uninit.cc b/gcc/tree-ssa-uninit.cc index f326f17..06a1982 100644 --- a/gcc/tree-ssa-uninit.cc +++ b/gcc/tree-ssa-uninit.cc @@ -1320,9 +1320,12 @@ public: {} /* opt_pass methods: */ - opt_pass *clone () { return new pass_late_warn_uninitialized (m_ctxt); } - virtual bool gate (function *) { return gate_warn_uninitialized (); } - virtual unsigned int execute (function *); + opt_pass *clone () final override + { + return new pass_late_warn_uninitialized (m_ctxt); + } + bool gate (function *) final override { return gate_warn_uninitialized (); } + unsigned int execute (function *) final override; }; // class pass_late_warn_uninitialized @@ -1462,8 +1465,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return gate_warn_uninitialized (); } - virtual unsigned int execute (function *fun) + bool gate (function *) final override { return gate_warn_uninitialized (); } + unsigned int execute (function *fun) final override { return execute_early_warn_uninitialized (fun); } diff --git a/gcc/tree-ssanames.cc b/gcc/tree-ssanames.cc index 05536cd..bc22ece 100644 --- a/gcc/tree-ssanames.cc +++ b/gcc/tree-ssanames.cc @@ -920,7 +920,7 @@ public: {} /* opt_pass methods: */ - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_release_ssa_names diff --git a/gcc/tree-stdarg.cc b/gcc/tree-stdarg.cc index 9038cd4..ed4c8d8 100644 --- a/gcc/tree-stdarg.cc +++ b/gcc/tree-stdarg.cc @@ -1126,7 +1126,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { /* Always run this pass, in order to expand va_arg internal_fns. We also need to do that if fun->stdarg == 0, because a va_arg may also @@ -1135,7 +1135,7 @@ public: return true; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_stdarg @@ -1185,12 +1185,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return (cfun->curr_properties & PROP_gimple_lva) == 0; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_lower_vaarg diff --git a/gcc/tree-switch-conversion.cc b/gcc/tree-switch-conversion.cc index 990f5e1..5291fb8 100644 --- a/gcc/tree-switch-conversion.cc +++ b/gcc/tree-switch-conversion.cc @@ -2427,8 +2427,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tree_switch_conversion != 0; } - virtual unsigned int execute (function *); + bool gate (function *) final override + { + return flag_tree_switch_conversion != 0; + } + unsigned int execute (function *) final override; }; // class pass_convert_switch @@ -2506,18 +2509,18 @@ public: static const pass_data data; opt_pass * - clone () + clone () final override { return new pass_lower_switch<O0> (m_ctxt); } - virtual bool - gate (function *) + bool + gate (function *) final override { return !O0 || !optimize; } - virtual unsigned int execute (function *fun); + unsigned int execute (function *fun) final override; }; // class pass_lower_switch template <bool O0> diff --git a/gcc/tree-tailcall.cc b/gcc/tree-tailcall.cc index 5a3466e..6745d57 100644 --- a/gcc/tree-tailcall.cc +++ b/gcc/tree-tailcall.cc @@ -1261,9 +1261,12 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_tail_recursion (m_ctxt); } - virtual bool gate (function *) { return gate_tail_calls (); } - virtual unsigned int execute (function *) + opt_pass * clone () final override + { + return new pass_tail_recursion (m_ctxt); + } + bool gate (function *) final override { return gate_tail_calls (); } + unsigned int execute (function *) final override { return tree_optimize_tail_calls_1 (false); } @@ -1301,8 +1304,11 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return gate_tail_calls (); } - virtual unsigned int execute (function *) { return execute_tail_calls (); } + bool gate (function *) final override { return gate_tail_calls (); } + unsigned int execute (function *) final override + { + return execute_tail_calls (); + } }; // class pass_tail_calls diff --git a/gcc/tree-vect-generic.cc b/gcc/tree-vect-generic.cc index 92aba5d..3501295 100644 --- a/gcc/tree-vect-generic.cc +++ b/gcc/tree-vect-generic.cc @@ -2418,12 +2418,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *fun) + bool gate (function *fun) final override { return !(fun->curr_properties & PROP_gimple_lvec); } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return expand_vector_operations (); } @@ -2462,8 +2462,11 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_lower_vector_ssa (m_ctxt); } - virtual unsigned int execute (function *) + opt_pass * clone () final override + { + return new pass_lower_vector_ssa (m_ctxt); + } + unsigned int execute (function *) final override { return expand_vector_operations (); } diff --git a/gcc/tree-vectorizer.cc b/gcc/tree-vectorizer.cc index a63fa39..53dc452 100644 --- a/gcc/tree-vectorizer.cc +++ b/gcc/tree-vectorizer.cc @@ -1193,12 +1193,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *fun) + bool gate (function *fun) final override { return flag_tree_loop_vectorize || fun->has_force_vectorize_loops; } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_vectorize @@ -1405,9 +1405,12 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_simduid_cleanup (m_ctxt); } - virtual bool gate (function *fun) { return fun->has_simduid_loops; } - virtual unsigned int execute (function *); + opt_pass * clone () final override + { + return new pass_simduid_cleanup (m_ctxt); + } + bool gate (function *fun) final override { return fun->has_simduid_loops; } + unsigned int execute (function *) final override; }; // class pass_simduid_cleanup @@ -1463,9 +1466,9 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_slp_vectorize (m_ctxt); } - virtual bool gate (function *) { return flag_tree_slp_vectorize != 0; } - virtual unsigned int execute (function *); + opt_pass * clone () final override { return new pass_slp_vectorize (m_ctxt); } + bool gate (function *) final override { return flag_tree_slp_vectorize != 0; } + unsigned int execute (function *) final override; }; // class pass_slp_vectorize @@ -1696,12 +1699,15 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return flag_section_anchors && flag_tree_loop_vectorize; } - virtual unsigned int execute (function *) { return increase_alignment (); } + unsigned int execute (function *) final override + { + return increase_alignment (); + } }; // class pass_ipa_increase_alignment diff --git a/gcc/tree-vrp.cc b/gcc/tree-vrp.cc index 30022da..ef7978d 100644 --- a/gcc/tree-vrp.cc +++ b/gcc/tree-vrp.cc @@ -4398,14 +4398,14 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_vrp (m_ctxt); } - void set_pass_param (unsigned int n, bool param) + opt_pass * clone () final override { return new pass_vrp (m_ctxt); } + void set_pass_param (unsigned int n, bool param) final override { gcc_assert (n == 0); warn_array_bounds_p = param; } - virtual bool gate (function *) { return flag_tree_vrp != 0; } - virtual unsigned int execute (function *fun) + bool gate (function *) final override { return flag_tree_vrp != 0; } + unsigned int execute (function *fun) final override { if ((my_pass == 1 && param_vrp1_mode == VRP_MODE_RANGER) || (my_pass == 2 && param_vrp2_mode == VRP_MODE_RANGER)) diff --git a/gcc/tsan.cc b/gcc/tsan.cc index 02e8ac7..79d4582 100644 --- a/gcc/tsan.cc +++ b/gcc/tsan.cc @@ -909,13 +909,13 @@ public: {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_tsan (m_ctxt); } - virtual bool gate (function *) + opt_pass * clone () final override { return new pass_tsan (m_ctxt); } + bool gate (function *) final override { return sanitize_flags_p (SANITIZE_THREAD); } - virtual unsigned int execute (function *) { return tsan_pass (); } + unsigned int execute (function *) final override { return tsan_pass (); } }; // class pass_tsan @@ -950,12 +950,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return (sanitize_flags_p (SANITIZE_THREAD) && !optimize); } - virtual unsigned int execute (function *) { return tsan_pass (); } + unsigned int execute (function *) final override { return tsan_pass (); } }; // class pass_tsan_O0 diff --git a/gcc/ubsan.cc b/gcc/ubsan.cc index b6c4301..e51d1e4 100644 --- a/gcc/ubsan.cc +++ b/gcc/ubsan.cc @@ -2348,7 +2348,7 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return sanitize_flags_p ((SANITIZE_NULL | SANITIZE_SI_OVERFLOW | SANITIZE_BOOL | SANITIZE_ENUM @@ -2360,7 +2360,7 @@ public: | SANITIZE_BUILTIN)); } - virtual unsigned int execute (function *); + unsigned int execute (function *) final override; }; // class pass_ubsan diff --git a/gcc/var-tracking.cc b/gcc/var-tracking.cc index 7c3ad0a..235981d 100644 --- a/gcc/var-tracking.cc +++ b/gcc/var-tracking.cc @@ -10592,12 +10592,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) + bool gate (function *) final override { return (flag_var_tracking && !targetm.delay_vartrack); } - virtual unsigned int execute (function *) + unsigned int execute (function *) final override { return variable_tracking_main (); } diff --git a/gcc/vtable-verify.cc b/gcc/vtable-verify.cc index 48f9987..24894e7 100644 --- a/gcc/vtable-verify.cc +++ b/gcc/vtable-verify.cc @@ -818,8 +818,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return (flag_vtable_verify); } - virtual unsigned int execute (function *); + bool gate (function *) final override { return (flag_vtable_verify); } + unsigned int execute (function *) final override; }; // class pass_vtable_verify @@ -323,8 +323,8 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return (optimize > 0 && flag_web); } - virtual unsigned int execute (function *); + bool gate (function *) final override { return (optimize > 0 && flag_web); } + unsigned int execute (function *) final override; }; // class pass_web |