* [PATCH 00/10] Add 'final' and 'override' where missing
@ 2022-05-23 19:28 David Malcolm
2022-05-23 19:28 ` [PATCH 01/10] Add 'final' and 'override' to opt_pass vfunc impls David Malcolm
` (10 more replies)
0 siblings, 11 replies; 39+ messages in thread
From: David Malcolm @ 2022-05-23 19:28 UTC (permalink / raw)
To: gcc-patches
With C++11 we can add "final" and "override" to the decls of vfuncs
in derived classes, which documents to both human and automated readers
of the code that a decl is intended to override a vfunc in a base class,
and can help catch mistakes where we intended to override a vfunc, but
messed up the prototypes.
The following patch kit adds "final" and "override" specifiers to the
decls of vfunc implementations throughout the source tree.
I added "final override" everywhere where this was possible, or just
"override" for the places where the overridden vfunc gets further
overridden.
I also removed "virtual" from such decls, since this isn't required
when overriding an existing vfunc, and the "final override" better
implies the intent of the code.
I temporarily hacked -Werror=suggest-override into the Makefile whilst
I was creating the patches, but I skipped the following:
(a) gcc/d/dmd/ ...since these sources are copied from an upstream
(b) gcc/go/gofrontend/ ...likewise
(c) gcc/range.op.cc: as I believe this code is under heavy development
(d) target-specific passes other than i386 (for ease of testing); I can
do these in a followup, if desired.
I didn't attempt to add -Wsuggest-override into our compile flags
"properly".
No functional changes intended.
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
I split them up into separate patches by topic for ease of review, and
for ease of writing the ChangeLog entries.
Worth an update to https://gcc.gnu.org/codingconventions.html ?
OK for trunk?
Dave
David Malcolm (10):
Add 'final' and 'override' to opt_pass vfunc impls
Add 'final' and 'override' on dom_walker vfunc impls
expr.cc: use final/override on op_by_pieces_d vfuncs
tree-switch-conversion.h: use final/override for cluster vfunc impls
d: add 'final' and 'override' to gcc/d/*.cc 'visit' impls
ipa: add 'final' and 'override' to call_summary_base vfunc impls
value-relation.h: add 'final' and 'override' to relation_oracle vfunc
impls
i386: add 'final' and 'override' to scalar_chain vfunc impls
tree-vect-slp-patterns.cc: add 'final' and 'override' to
vect_pattern::build impls
Add 'final' and 'override' in various places
gcc/adjust-alignment.cc | 2 +-
gcc/asan.cc | 19 ++++++---
gcc/auto-inc-dec.cc | 4 +-
gcc/auto-profile.cc | 8 ++--
gcc/bb-reorder.cc | 12 +++---
gcc/cfgcleanup.cc | 8 ++--
gcc/cfgexpand.cc | 2 +-
gcc/cfgrtl.cc | 6 +--
gcc/cgraphbuild.cc | 13 +++---
gcc/combine-stack-adj.cc | 4 +-
gcc/combine.cc | 4 +-
gcc/compare-elim.cc | 6 +--
gcc/config/i386/i386-features.cc | 20 ++++-----
gcc/config/i386/i386-features.h | 16 +++----
gcc/coroutine-passes.cc | 8 ++--
gcc/cp/cxx-pretty-print.h | 38 ++++++++---------
gcc/cp/module.cc | 4 +-
gcc/cprop.cc | 9 ++--
gcc/cse.cc | 18 +++++---
gcc/d/decl.cc | 36 ++++++++--------
gcc/d/expr.cc | 2 +-
gcc/d/toir.cc | 64 ++++++++++++++--------------
gcc/d/typeinfo.cc | 34 +++++++--------
gcc/d/types.cc | 30 ++++++-------
gcc/dce.cc | 8 ++--
gcc/df-core.cc | 10 ++---
gcc/dse.cc | 14 ++++--
gcc/dwarf2cfi.cc | 7 ++-
gcc/early-remat.cc | 4 +-
gcc/except.cc | 6 +--
gcc/expr.cc | 14 +++---
gcc/final.cc | 14 ++++--
gcc/function.cc | 10 ++---
gcc/fwprop.cc | 8 ++--
gcc/gcse.cc | 14 ++++--
gcc/genmatch.cc | 22 +++++-----
gcc/gensupport.cc | 2 +-
gcc/gimple-harden-conditionals.cc | 20 ++++++---
gcc/gimple-if-to-switch.cc | 4 +-
gcc/gimple-isel.cc | 4 +-
gcc/gimple-laddress.cc | 6 +--
gcc/gimple-loop-interchange.cc | 6 +--
gcc/gimple-loop-jam.cc | 4 +-
gcc/gimple-loop-versioning.cc | 7 ++-
gcc/gimple-low.cc | 5 ++-
gcc/gimple-range-cache.h | 4 +-
gcc/gimple-ssa-backprop.cc | 6 +--
gcc/gimple-ssa-evrp.cc | 6 +--
gcc/gimple-ssa-isolate-paths.cc | 9 ++--
gcc/gimple-ssa-nonnull-compare.cc | 4 +-
gcc/gimple-ssa-split-paths.cc | 9 ++--
gcc/gimple-ssa-store-merging.cc | 10 ++---
gcc/gimple-ssa-strength-reduction.cc | 6 +--
gcc/gimple-ssa-warn-access.cc | 8 ++--
gcc/gimple-ssa-warn-alloca.cc | 8 ++--
gcc/gimple-ssa-warn-restrict.cc | 4 +-
gcc/gimple-warn-recursion.cc | 4 +-
gcc/graphite.cc | 9 ++--
gcc/ifcvt.cc | 12 +++---
gcc/init-regs.cc | 4 +-
gcc/ipa-comdats.cc | 4 +-
gcc/ipa-cp.cc | 10 ++---
gcc/ipa-devirt.cc | 8 ++--
gcc/ipa-fnsummary.cc | 20 ++++++---
gcc/ipa-fnsummary.h | 21 ++++-----
gcc/ipa-free-lang-data.cc | 2 +-
gcc/ipa-icf-gimple.h | 6 ++-
gcc/ipa-icf.cc | 4 +-
gcc/ipa-icf.h | 36 +++++++++-------
gcc/ipa-inline.cc | 4 +-
gcc/ipa-modref.cc | 48 ++++++++++-----------
gcc/ipa-param-manipulation.cc | 8 ++--
gcc/ipa-profile.cc | 10 ++---
gcc/ipa-prop.cc | 4 +-
gcc/ipa-prop.h | 26 +++++------
gcc/ipa-pure-const.cc | 34 +++++++++------
gcc/ipa-reference.cc | 14 +++---
gcc/ipa-split.cc | 8 ++--
gcc/ipa-sra.cc | 21 +++++----
gcc/ipa-visibility.cc | 6 +--
gcc/ipa.cc | 9 ++--
gcc/ira.cc | 8 ++--
gcc/jump.cc | 5 ++-
gcc/loop-init.cc | 18 ++++----
gcc/lower-subreg.cc | 16 ++++---
gcc/lto/lto-dump.cc | 8 ++--
gcc/mode-switching.cc | 6 +--
gcc/modulo-sched.cc | 4 +-
gcc/multiple_target.cc | 7 ++-
gcc/omp-expand.cc | 14 ++++--
gcc/omp-low.cc | 9 ++--
gcc/omp-oacc-kernels-decompose.cc | 4 +-
gcc/omp-oacc-neuter-broadcast.cc | 4 +-
gcc/omp-offload.cc | 16 +++----
gcc/omp-simd-clone.cc | 7 ++-
gcc/passes.cc | 34 +++++++++------
gcc/postreload-gcse.cc | 7 ++-
gcc/postreload.cc | 7 ++-
gcc/predict.cc | 13 +++---
gcc/read-md.h | 2 +-
gcc/read-rtl-function.cc | 6 +--
gcc/recog.cc | 32 ++++++++------
gcc/ree.cc | 7 ++-
gcc/reg-stack.cc | 4 +-
gcc/regcprop.cc | 4 +-
gcc/reginfo.cc | 2 +-
gcc/regrename.cc | 7 ++-
gcc/reorg.cc | 8 ++--
gcc/rtl-ssa/blocks.cc | 4 +-
gcc/sancov.cc | 10 ++---
gcc/sanopt.cc | 4 +-
gcc/sched-rgn.cc | 19 +++++----
gcc/stack-ptr-mod.cc | 2 +-
gcc/store-motion.cc | 4 +-
gcc/symbol-summary.h | 8 ++--
gcc/symtab-thunks.cc | 8 ++--
gcc/tracer.cc | 4 +-
gcc/trans-mem.cc | 34 ++++++++++-----
gcc/tree-call-cdce.cc | 4 +-
gcc/tree-cfg.cc | 28 ++++++++----
gcc/tree-cfgcleanup.cc | 6 +--
gcc/tree-complex.cc | 14 ++++--
gcc/tree-eh.cc | 23 +++++-----
gcc/tree-emutls.cc | 7 ++-
gcc/tree-if-conv.cc | 4 +-
gcc/tree-into-ssa.cc | 14 +++---
gcc/tree-loop-distribution.cc | 4 +-
gcc/tree-nrv.cc | 6 +--
gcc/tree-object-size.cc | 6 +--
gcc/tree-parloops.cc | 11 +++--
gcc/tree-predcom.cc | 8 ++--
gcc/tree-profile.cc | 4 +-
gcc/tree-sra.cc | 11 +++--
gcc/tree-ssa-ccp.cc | 21 +++++----
gcc/tree-ssa-copy.cc | 9 ++--
gcc/tree-ssa-dce.cc | 14 +++---
gcc/tree-ssa-dom.cc | 12 +++---
gcc/tree-ssa-dse.cc | 6 +--
gcc/tree-ssa-forwprop.cc | 6 +--
gcc/tree-ssa-ifcombine.cc | 2 +-
gcc/tree-ssa-loop-ch.cc | 14 +++---
gcc/tree-ssa-loop-im.cc | 6 +--
gcc/tree-ssa-loop-ivcanon.cc | 10 ++---
gcc/tree-ssa-loop-prefetch.cc | 7 ++-
gcc/tree-ssa-loop-split.cc | 4 +-
gcc/tree-ssa-loop-unswitch.cc | 4 +-
gcc/tree-ssa-loop.cc | 27 ++++++------
gcc/tree-ssa-math-opts.cc | 17 +++++---
gcc/tree-ssa-phiopt.cc | 19 +++++----
gcc/tree-ssa-phiprop.cc | 4 +-
gcc/tree-ssa-pre.cc | 4 +-
gcc/tree-ssa-propagate.cc | 4 +-
gcc/tree-ssa-reassoc.cc | 8 ++--
gcc/tree-ssa-sccvn.cc | 16 +++----
gcc/tree-ssa-sink.cc | 8 ++--
gcc/tree-ssa-strlen.cc | 14 +++---
gcc/tree-ssa-structalias.cc | 13 +++---
gcc/tree-ssa-uncprop.cc | 10 ++---
gcc/tree-ssa-uninit.cc | 13 +++---
gcc/tree-ssanames.cc | 2 +-
gcc/tree-stdarg.cc | 8 ++--
gcc/tree-switch-conversion.cc | 15 ++++---
gcc/tree-switch-conversion.h | 32 +++++++-------
gcc/tree-tailcall.cc | 16 ++++---
gcc/tree-vect-generic.cc | 11 +++--
gcc/tree-vect-slp-patterns.cc | 12 +++---
gcc/tree-vectorizer.cc | 26 ++++++-----
gcc/tree-vrp.cc | 8 ++--
gcc/tsan.cc | 10 ++---
gcc/ubsan.cc | 4 +-
gcc/value-relation.h | 38 +++++++++--------
gcc/var-tracking.cc | 4 +-
gcc/vtable-verify.cc | 4 +-
gcc/web.cc | 4 +-
174 files changed, 1082 insertions(+), 852 deletions(-)
--
2.26.3
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 01/10] Add 'final' and 'override' to opt_pass vfunc impls
2022-05-23 19:28 [PATCH 00/10] Add 'final' and 'override' where missing David Malcolm
@ 2022-05-23 19:28 ` David Malcolm
2022-06-13 18:22 ` PING: " David Malcolm
2022-05-23 19:28 ` [PATCH 02/10] Add 'final' and 'override' on dom_walker " David Malcolm
` (9 subsequent siblings)
10 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-05-23 19:28 UTC (permalink / raw)
To: gcc-patches
gcc/ChangeLog:
* adjust-alignment.cc: Add "final" and "override" to opt_pass
vfunc implementations, removing redundant "virtual" as
appropriate.
* asan.cc: Likewise.
* auto-inc-dec.cc: Likewise.
* auto-profile.cc: Likewise.
* bb-reorder.cc: Likewise.
* cfgcleanup.cc: Likewise.
* cfgexpand.cc: Likewise.
* cfgrtl.cc: Likewise.
* cgraphbuild.cc: Likewise.
* combine-stack-adj.cc: Likewise.
* combine.cc: Likewise.
* compare-elim.cc: Likewise.
* config/i386/i386-features.cc: Likewise.
* coroutine-passes.cc: Likewise.
* cprop.cc: Likewise.
* cse.cc: Likewise.
* dce.cc: Likewise.
* df-core.cc: Likewise.
* dse.cc: Likewise.
* dwarf2cfi.cc: Likewise.
* early-remat.cc: Likewise.
* except.cc: Likewise.
* final.cc: Likewise.
* function.cc: Likewise.
* fwprop.cc: Likewise.
* gcse.cc: Likewise.
* gimple-harden-conditionals.cc: Likewise.
* gimple-if-to-switch.cc: Likewise.
* gimple-isel.cc: Likewise.
* gimple-laddress.cc: Likewise.
* gimple-loop-interchange.cc: Likewise.
* gimple-loop-jam.cc: Likewise.
* gimple-loop-versioning.cc: Likewise.
* gimple-low.cc: Likewise.
* gimple-ssa-backprop.cc: Likewise.
* gimple-ssa-evrp.cc: Likewise.
* gimple-ssa-isolate-paths.cc: Likewise.
* gimple-ssa-nonnull-compare.cc: Likewise.
* gimple-ssa-split-paths.cc: Likewise.
* gimple-ssa-store-merging.cc: Likewise.
* gimple-ssa-strength-reduction.cc: Likewise.
* gimple-ssa-warn-access.cc: Likewise.
* gimple-ssa-warn-alloca.cc: Likewise.
* gimple-ssa-warn-restrict.cc: Likewise.
* gimple-warn-recursion.cc: Likewise.
* graphite.cc: Likewise.
* ifcvt.cc: Likewise.
* init-regs.cc: Likewise.
* ipa-comdats.cc: Likewise.
* ipa-cp.cc: Likewise.
* ipa-devirt.cc: Likewise.
* ipa-fnsummary.cc: Likewise.
* ipa-free-lang-data.cc: Likewise.
* ipa-icf.cc: Likewise.
* ipa-inline.cc: Likewise.
* ipa-modref.cc: Likewise.
* ipa-profile.cc: Likewise.
* ipa-pure-const.cc: Likewise.
* ipa-reference.cc: Likewise.
* ipa-split.cc: Likewise.
* ipa-sra.cc: Likewise.
* ipa-visibility.cc: Likewise.
* ipa.cc: Likewise.
* ira.cc: Likewise.
* jump.cc: Likewise.
* loop-init.cc: Likewise.
* lower-subreg.cc: Likewise.
* mode-switching.cc: Likewise.
* modulo-sched.cc: Likewise.
* multiple_target.cc: Likewise.
* omp-expand.cc: Likewise.
* omp-low.cc: Likewise.
* omp-oacc-kernels-decompose.cc: Likewise.
* omp-oacc-neuter-broadcast.cc: Likewise.
* omp-offload.cc: Likewise.
* omp-simd-clone.cc: Likewise.
* passes.cc: Likewise.
* postreload-gcse.cc: Likewise.
* postreload.cc: Likewise.
* predict.cc: Likewise.
* recog.cc: Likewise.
* ree.cc: Likewise.
* reg-stack.cc: Likewise.
* regcprop.cc: Likewise.
* reginfo.cc: Likewise.
* regrename.cc: Likewise.
* reorg.cc: Likewise.
* sancov.cc: Likewise.
* sanopt.cc: Likewise.
* sched-rgn.cc: Likewise.
* stack-ptr-mod.cc: Likewise.
* store-motion.cc: Likewise.
* tracer.cc: Likewise.
* trans-mem.cc: Likewise.
* tree-call-cdce.cc: Likewise.
* tree-cfg.cc: Likewise.
* tree-cfgcleanup.cc: Likewise.
* tree-complex.cc: Likewise.
* tree-eh.cc: Likewise.
* tree-emutls.cc: Likewise.
* tree-if-conv.cc: Likewise.
* tree-into-ssa.cc: Likewise.
* tree-loop-distribution.cc: Likewise.
* tree-nrv.cc: Likewise.
* tree-object-size.cc: Likewise.
* tree-parloops.cc: Likewise.
* tree-predcom.cc: Likewise.
* tree-profile.cc: Likewise.
* tree-sra.cc: Likewise.
* tree-ssa-ccp.cc: Likewise.
* tree-ssa-copy.cc: Likewise.
* tree-ssa-dce.cc: Likewise.
* tree-ssa-dom.cc: Likewise.
* tree-ssa-dse.cc: Likewise.
* tree-ssa-forwprop.cc: Likewise.
* tree-ssa-ifcombine.cc: Likewise.
* tree-ssa-loop-ch.cc: Likewise.
* tree-ssa-loop-im.cc: Likewise.
* tree-ssa-loop-ivcanon.cc: Likewise.
* tree-ssa-loop-prefetch.cc: Likewise.
* tree-ssa-loop-split.cc: Likewise.
* tree-ssa-loop-unswitch.cc: Likewise.
* tree-ssa-loop.cc: Likewise.
* tree-ssa-math-opts.cc: Likewise.
* tree-ssa-phiopt.cc: Likewise.
* tree-ssa-phiprop.cc: Likewise.
* tree-ssa-pre.cc: Likewise.
* tree-ssa-reassoc.cc: Likewise.
* tree-ssa-sccvn.cc: Likewise.
* tree-ssa-sink.cc: Likewise.
* tree-ssa-strlen.cc: Likewise.
* tree-ssa-structalias.cc: Likewise.
* tree-ssa-uncprop.cc: Likewise.
* tree-ssa-uninit.cc: Likewise.
* tree-ssanames.cc: Likewise.
* tree-stdarg.cc: Likewise.
* tree-switch-conversion.cc: Likewise.
* tree-tailcall.cc: Likewise.
* tree-vect-generic.cc: Likewise.
* tree-vectorizer.cc: Likewise.
* tree-vrp.cc: Likewise.
* tsan.cc: Likewise.
* ubsan.cc: Likewise.
* var-tracking.cc: Likewise.
* vtable-verify.cc: Likewise.
* web.cc: Likewise.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
---
gcc/adjust-alignment.cc | 2 +-
gcc/asan.cc | 19 ++++++++++++----
gcc/auto-inc-dec.cc | 4 ++--
gcc/auto-profile.cc | 8 +++----
gcc/bb-reorder.cc | 12 +++++-----
gcc/cfgcleanup.cc | 8 +++----
gcc/cfgexpand.cc | 2 +-
gcc/cfgrtl.cc | 6 ++---
gcc/cgraphbuild.cc | 13 +++++++----
gcc/combine-stack-adj.cc | 4 ++--
gcc/combine.cc | 4 ++--
gcc/compare-elim.cc | 4 ++--
gcc/config/i386/i386-features.cc | 20 ++++++++--------
gcc/coroutine-passes.cc | 8 +++----
gcc/cprop.cc | 9 +++++---
gcc/cse.cc | 18 ++++++++++-----
gcc/dce.cc | 8 +++----
gcc/df-core.cc | 10 ++++----
gcc/dse.cc | 14 ++++++++----
gcc/dwarf2cfi.cc | 7 ++++--
gcc/early-remat.cc | 4 ++--
gcc/except.cc | 6 ++---
gcc/final.cc | 14 ++++++++----
gcc/function.cc | 10 ++++----
gcc/fwprop.cc | 8 +++----
gcc/gcse.cc | 14 ++++++++----
gcc/gimple-harden-conditionals.cc | 20 +++++++++++-----
gcc/gimple-if-to-switch.cc | 4 ++--
gcc/gimple-isel.cc | 4 ++--
gcc/gimple-laddress.cc | 6 ++---
gcc/gimple-loop-interchange.cc | 6 ++---
gcc/gimple-loop-jam.cc | 4 ++--
gcc/gimple-loop-versioning.cc | 7 ++++--
gcc/gimple-low.cc | 5 +++-
gcc/gimple-ssa-backprop.cc | 6 ++---
gcc/gimple-ssa-evrp.cc | 6 ++---
gcc/gimple-ssa-isolate-paths.cc | 9 +++++---
gcc/gimple-ssa-nonnull-compare.cc | 4 ++--
gcc/gimple-ssa-split-paths.cc | 9 +++++---
gcc/gimple-ssa-store-merging.cc | 10 ++++----
gcc/gimple-ssa-strength-reduction.cc | 4 ++--
gcc/gimple-ssa-warn-access.cc | 8 +++----
gcc/gimple-ssa-warn-alloca.cc | 8 +++----
gcc/gimple-ssa-warn-restrict.cc | 4 ++--
gcc/gimple-warn-recursion.cc | 4 ++--
gcc/graphite.cc | 9 +++++---
gcc/ifcvt.cc | 12 +++++-----
gcc/init-regs.cc | 4 ++--
gcc/ipa-comdats.cc | 4 ++--
gcc/ipa-cp.cc | 4 ++--
gcc/ipa-devirt.cc | 8 +++----
gcc/ipa-fnsummary.cc | 20 ++++++++++------
gcc/ipa-free-lang-data.cc | 2 +-
gcc/ipa-icf.cc | 4 ++--
gcc/ipa-inline.cc | 4 ++--
gcc/ipa-modref.cc | 12 +++++-----
gcc/ipa-profile.cc | 4 ++--
gcc/ipa-pure-const.cc | 26 +++++++++++++--------
gcc/ipa-reference.cc | 4 ++--
gcc/ipa-split.cc | 8 +++----
gcc/ipa-sra.cc | 7 ++++--
gcc/ipa-visibility.cc | 6 ++---
gcc/ipa.cc | 9 +++++---
gcc/ira.cc | 8 +++----
gcc/jump.cc | 5 +++-
gcc/loop-init.cc | 18 +++++++--------
gcc/lower-subreg.cc | 16 +++++++------
gcc/mode-switching.cc | 6 ++---
gcc/modulo-sched.cc | 4 ++--
gcc/multiple_target.cc | 7 ++++--
gcc/omp-expand.cc | 14 ++++++++----
gcc/omp-low.cc | 9 +++++---
gcc/omp-oacc-kernels-decompose.cc | 4 ++--
gcc/omp-oacc-neuter-broadcast.cc | 4 ++--
gcc/omp-offload.cc | 16 ++++++-------
gcc/omp-simd-clone.cc | 7 ++++--
gcc/passes.cc | 34 ++++++++++++++++------------
gcc/postreload-gcse.cc | 7 ++++--
gcc/postreload.cc | 7 ++++--
gcc/predict.cc | 13 +++++++----
gcc/recog.cc | 32 +++++++++++++++-----------
gcc/ree.cc | 7 ++++--
gcc/reg-stack.cc | 4 ++--
gcc/regcprop.cc | 4 ++--
gcc/reginfo.cc | 2 +-
gcc/regrename.cc | 7 ++++--
gcc/reorg.cc | 8 +++----
gcc/sancov.cc | 10 ++++----
gcc/sanopt.cc | 4 ++--
gcc/sched-rgn.cc | 19 +++++++++-------
gcc/stack-ptr-mod.cc | 2 +-
gcc/store-motion.cc | 4 ++--
gcc/tracer.cc | 4 ++--
gcc/trans-mem.cc | 34 +++++++++++++++++++---------
gcc/tree-call-cdce.cc | 4 ++--
gcc/tree-cfg.cc | 28 ++++++++++++++++-------
gcc/tree-cfgcleanup.cc | 6 ++---
gcc/tree-complex.cc | 14 ++++++++----
gcc/tree-eh.cc | 23 +++++++++++--------
gcc/tree-emutls.cc | 7 ++++--
gcc/tree-if-conv.cc | 4 ++--
gcc/tree-into-ssa.cc | 4 ++--
gcc/tree-loop-distribution.cc | 4 ++--
gcc/tree-nrv.cc | 6 ++---
gcc/tree-object-size.cc | 6 ++---
gcc/tree-parloops.cc | 11 +++++----
gcc/tree-predcom.cc | 8 +++----
gcc/tree-profile.cc | 4 ++--
gcc/tree-sra.cc | 11 +++++----
gcc/tree-ssa-ccp.cc | 21 +++++++++--------
gcc/tree-ssa-copy.cc | 9 +++++---
gcc/tree-ssa-dce.cc | 14 ++++++------
gcc/tree-ssa-dom.cc | 8 +++----
gcc/tree-ssa-dse.cc | 6 ++---
gcc/tree-ssa-forwprop.cc | 6 ++---
gcc/tree-ssa-ifcombine.cc | 2 +-
gcc/tree-ssa-loop-ch.cc | 10 ++++----
gcc/tree-ssa-loop-im.cc | 6 ++---
gcc/tree-ssa-loop-ivcanon.cc | 10 ++++----
gcc/tree-ssa-loop-prefetch.cc | 7 ++++--
gcc/tree-ssa-loop-split.cc | 4 ++--
gcc/tree-ssa-loop-unswitch.cc | 4 ++--
gcc/tree-ssa-loop.cc | 27 ++++++++++++----------
gcc/tree-ssa-math-opts.cc | 15 +++++++-----
gcc/tree-ssa-phiopt.cc | 15 +++++++-----
gcc/tree-ssa-phiprop.cc | 4 ++--
gcc/tree-ssa-pre.cc | 4 ++--
gcc/tree-ssa-reassoc.cc | 8 +++----
gcc/tree-ssa-sccvn.cc | 8 +++----
gcc/tree-ssa-sink.cc | 8 +++----
gcc/tree-ssa-strlen.cc | 10 ++++----
gcc/tree-ssa-structalias.cc | 13 +++++++----
gcc/tree-ssa-uncprop.cc | 6 ++---
gcc/tree-ssa-uninit.cc | 13 +++++++----
gcc/tree-ssanames.cc | 2 +-
gcc/tree-stdarg.cc | 8 +++----
gcc/tree-switch-conversion.cc | 15 +++++++-----
gcc/tree-tailcall.cc | 16 +++++++++----
gcc/tree-vect-generic.cc | 11 +++++----
gcc/tree-vectorizer.cc | 26 +++++++++++++--------
gcc/tree-vrp.cc | 8 +++----
gcc/tsan.cc | 10 ++++----
gcc/ubsan.cc | 4 ++--
gcc/var-tracking.cc | 4 ++--
gcc/vtable-verify.cc | 4 ++--
gcc/web.cc | 4 ++--
146 files changed, 769 insertions(+), 552 deletions(-)
diff --git a/gcc/adjust-alignment.cc b/gcc/adjust-alignment.cc
index 2db41e8b4c8..5c5f8f4e5c0 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 4b583e54efd..5df333555ea 100644
--- a/gcc/asan.cc
+++ b/gcc/asan.cc
@@ -4209,9 +4209,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
@@ -4246,11 +4252,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 85fe9d14950..481e7af6895 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 2b34b80b82d..6533722817f 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 d20ccb83aa6..bdbe2e9ea7a 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 335af4911bb..18047da7b24 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 bb33c1b939e..1d7f6b260d0 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 06be46d75df..9a4651f61a3 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 fdd17aa5a2d..bae44591a29 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 e8ba2717063..e76d60a8f7e 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 9a34ef847aa..a8305273e44 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 985c0c92182..e869d9d3249 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 6fe41c3c24f..24e8336689c 100644
--- a/gcc/config/i386/i386-features.cc
+++ b/gcc/config/i386/i386-features.cc
@@ -1873,13 +1873,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 ();
}
@@ -1908,23 +1908,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;
@@ -2135,14 +2135,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,
@@ -2399,7 +2399,7 @@ public:
{}
/* opt_pass methods: */
- virtual bool gate (function *)
+ bool gate (function *) final override
{
return (TARGET_AVX
&& TARGET_SSE_PARTIAL_REG_DEPENDENCY
@@ -2408,7 +2408,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 7b9a97af5a2..21ac9469805 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 cf01c2d79a9..580f811545d 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
diff --git a/gcc/cse.cc b/gcc/cse.cc
index a18b599d324..b13afd4ba72 100644
--- a/gcc/cse.cc
+++ b/gcc/cse.cc
@@ -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 ();
}
diff --git a/gcc/dce.cc b/gcc/dce.cc
index 6676cbcd429..64aa0aa471d 100644
--- a/gcc/dce.cc
+++ b/gcc/dce.cc
@@ -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 a901b84878f..97b2bbf6d2b 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 ();
}
diff --git a/gcc/dse.cc b/gcc/dse.cc
index 30c11cee034..83c572f6220 100644
--- a/gcc/dse.cc
+++ b/gcc/dse.cc
@@ -3747,12 +3747,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
@@ -3787,12 +3790,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 ab7c5cc5b27..bef3165e691 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 2738892b4e7..5c368293c35 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 b94de425557..7d7ce40c846 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 a9868861bd2..81e21cb8db6 100644
--- a/gcc/final.cc
+++ b/gcc/final.cc
@@ -808,7 +808,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
@@ -4360,7 +4363,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
@@ -4404,7 +4410,7 @@ public:
{}
/* opt_pass methods: */
- virtual unsigned int execute (function *)
+ unsigned int execute (function *) final override
{
return rest_of_handle_shorten_branches ();
}
@@ -4579,7 +4585,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 ad0096a43ef..0c3e4fffb05 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 d12fc2f34ac..fc652ab9a1f 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 b67353143a2..f06278a5534 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 79c0a5784ba..4ca6776fca7 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 5dcfe5b77e0..c89aef34381 100644
--- a/gcc/gimple-if-to-switch.cc
+++ b/gcc/gimple-if-to-switch.cc
@@ -478,13 +478,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 44d086d8b28..aa9c1290735 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 13c7858e161..11754dac5c3 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 53adc02acc2..5f59730be4c 100644
--- a/gcc/gimple-loop-interchange.cc
+++ b/gcc/gimple-loop-interchange.cc
@@ -1703,9 +1703,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 e33dd9091df..9b18b52a54c 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 ab02bdd4b15..6bcf6eba691 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 2ec19d5657d..4cd27dd19b0 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 74f98111256..55986ddbfe3 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 20388ed5431..793a3ea1f19 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 cc0ed9760a0..87ecd19ef4a 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 cc52b914258..f9ce8c7a083 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 6abe1d51400..f2e43e52c95 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 b952ce57917..0640168bcc4 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 dad73d31874..2b559e96fc8 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 9357a4e576a..1f70cbdb884 100644
--- a/gcc/gimple-ssa-warn-access.cc
+++ b/gcc/gimple-ssa-warn-access.cc
@@ -2069,13 +2069,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 273b88ec141..83a241a3a4b 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 b678e806da3..2a1afcbb0fc 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 91a3cdbacd4..9b04899cf78 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 ab8683b5b41..a88b13c0219 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 b983e87389f..28b153cf2ae 100644
--- a/gcc/ifcvt.cc
+++ b/gcc/ifcvt.cc
@@ -5933,12 +5933,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 ();
}
@@ -5980,13 +5980,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;
@@ -6026,13 +6026,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 220ef705997..652befefdaa 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 566faf3cc1f..da792065ed3 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 152fe7244f7..38a21b17e39 100644
--- a/gcc/ipa-cp.cc
+++ b/gcc/ipa-cp.cc
@@ -6659,14 +6659,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 9f1442dc3cc..412ca14f66b 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 b12e7a1124d..832794fd5dc 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 f99f7be1c58..ccdbf849c25 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 765ae746745..a8a162268ee 100644
--- a/gcc/ipa-icf.cc
+++ b/gcc/ipa-icf.cc
@@ -3637,12 +3637,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 22a009b7435..14969198cde 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 556816ab429..7c1f974bc7a 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 b74d77f2c95..496f292acba 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 2b4950a5969..0e55fc4bfc5 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 67e0c85a95e..b5a2350ce72 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 60021bad13c..16734617d03 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 261a720858f..4f705a3febf 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 e95a0dd252f..8a27e7bcdfd 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);
}
diff --git a/gcc/ipa.cc b/gcc/ipa.cc
index f53f15f5f0a..c01dca17bec 100644
--- a/gcc/ipa.cc
+++ b/gcc/ipa.cc
@@ -1343,8 +1343,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
@@ -1566,7 +1569,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
diff --git a/gcc/ira.cc b/gcc/ira.cc
index e3b3c549120..42c9cead9f8 100644
--- a/gcc/ira.cc
+++ b/gcc/ira.cc
@@ -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 332f86878e1..e6207169be0 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 1e4f6cfd7fb..648aa290916 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 d30bbeeabda..03e9326c663 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 6e3f1dc65e2..b0f6e7cedd4 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 1e1fa7055a2..f78d791cb01 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 7fe02fb55c8..3e2d26882c8 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 9fcc67a3448..3d48e1df175 100644
--- a/gcc/omp-expand.cc
+++ b/gcc/omp-expand.cc
@@ -10574,7 +10574,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)
@@ -10621,12 +10621,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 c83af6c3865..e00788f0ea1 100644
--- a/gcc/omp-low.cc
+++ b/gcc/omp-low.cc
@@ -14594,7 +14594,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
@@ -14902,11 +14905,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 ec9b0faab0a..524060e2fca 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 81e3223a94c..b6177794cde 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 ad4e772015e..9de04fc520c 100644
--- a/gcc/omp-offload.cc
+++ b/gcc/omp-offload.cc
@@ -2449,9 +2449,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 ();
}
@@ -2479,9 +2479,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 ();
}
@@ -2713,13 +2713,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 ();
}
@@ -2759,7 +2759,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);
@@ -2769,7 +2769,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 04fe03cde5f..32649bc3f9a 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 36e5b4ac45f..78a07f8691a 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 fc63f0b5c77..1c795b43ca3 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 4a67d0d437a..d1c99fe6dc9 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 5734e4c8516..fb9fa514fbc 100644
--- a/gcc/predict.cc
+++ b/gcc/predict.cc
@@ -4079,8 +4079,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
@@ -4233,14 +4233,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 cd2410ab2ae..dac172bc7c0 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 ();
}
diff --git a/gcc/ree.cc b/gcc/ree.cc
index de4f18e8a4d..da64ef679b7 100644
--- a/gcc/ree.cc
+++ b/gcc/ree.cc
@@ -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 5afeadf8c49..fd032501ad9 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 1fdc36713cd..8fcf9d529dd 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 2ab7bbb7353..705779d5c18 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 10271e1b17d..021a822cb79 100644
--- a/gcc/regrename.cc
+++ b/gcc/regrename.cc
@@ -2013,12 +2013,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 7624f514906..07b2045986c 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 9c1025200b4..052fa4ef881 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 125e0c936e7..7aebc6f39dc 100644
--- a/gcc/sanopt.cc
+++ b/gcc/sanopt.cc
@@ -942,8 +942,8 @@ public:
{}
/* opt_pass methods: */
- virtual bool gate (function *) { return flag_sanitize; }
- virtual unsigned int execute (function *);
+ bool gate (function *) final override { return flag_sanitize; }
+ unsigned int execute (function *) final override;
}; // class pass_sanopt
diff --git a/gcc/sched-rgn.cc b/gcc/sched-rgn.cc
index a0dfdb7881f..0dc2a8f2851 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 b14bef98c49..4ccbb1cace3 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 0f708700a14..b61c0686844 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 4d054fe8fc8..64517846dc4 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 ae2921f808e..131dce05476 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 83991fe373e..feb61f362cf 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 19ba09facce..37e89adf10e 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
@@ -9200,9 +9203,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
@@ -9459,7 +9468,7 @@ public:
{}
/* opt_pass methods: */
- virtual unsigned int execute (function *);
+ unsigned int execute (function *) final override;
}; // class pass_warn_function_return
@@ -9665,8 +9674,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;
@@ -9875,8 +9884,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 893619eaaa4..a6d0bf2c40a 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 f722057bfec..61950a0f099 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 c37a5845343..076ecd3ec9a 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 5f68703822c..b5aa307f60d 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 4531ca58bdf..480fea0e7c2 100644
--- a/gcc/tree-if-conv.cc
+++ b/gcc/tree-if-conv.cc
@@ -3408,8 +3408,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 22c2e5b7982..46df57ae0e1 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 db6e9096a86..ec44c450cae 100644
--- a/gcc/tree-loop-distribution.cc
+++ b/gcc/tree-loop-distribution.cc
@@ -3896,13 +3896,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 b96d5b86f27..1faa481a8c9 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 5ca87ae3504..bc3d7dd9bfa 100644
--- a/gcc/tree-object-size.cc
+++ b/gcc/tree-object-size.cc
@@ -2122,8 +2122,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);
}
@@ -2162,7 +2162,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 da1069683a3..2c3ef436ab7 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 fb457250bbd..5d923fba170 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 97aab8801d0..2beb49241f2 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 081c51b58a4..461c8e0b0f4 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 81c97676625..579a966cc9b 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. */
@@ -4199,8 +4202,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
@@ -4550,9 +4553,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 050a6d11434..782ceb500cc 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 a6b284018d4..5df64922594 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 9a843217553..97e17ca68e4 100644
--- a/gcc/tree-ssa-dom.cc
+++ b/gcc/tree-ssa-dom.cc
@@ -793,14 +793,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 881a2d0f98d..1c1fdb7e75b 100644
--- a/gcc/tree-ssa-dse.cc
+++ b/gcc/tree-ssa-dse.cc
@@ -1455,9 +1455,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 0917202b74c..6f09642172d 100644
--- a/gcc/tree-ssa-forwprop.cc
+++ b/gcc/tree-ssa-forwprop.cc
@@ -3330,9 +3330,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 88a9f062dcd..80c41c45489 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 2f5a390404c..9ab63d1fa0c 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 6d9316eed1f..c0893f1927c 100644
--- a/gcc/tree-ssa-loop-im.cc
+++ b/gcc/tree-ssa-loop-im.cc
@@ -3597,9 +3597,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 2ee00a3f843..e52397235a1 100644
--- a/gcc/tree-ssa-loop-ivcanon.cc
+++ b/gcc/tree-ssa-loop-ivcanon.cc
@@ -1539,8 +1539,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
@@ -1586,7 +1586,7 @@ public:
{}
/* opt_pass methods: */
- virtual unsigned int execute (function *);
+ unsigned int execute (function *) final override;
}; // class pass_complete_unroll
@@ -1644,8 +1644,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 aebd7c9206f..8f190ae469b 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 b93ee4c8769..d61bad5ba47 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 2927f308234..3b6486f305a 100644
--- a/gcc/tree-ssa-loop-unswitch.cc
+++ b/gcc/tree-ssa-loop-unswitch.cc
@@ -1035,8 +1035,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 73aa46627b4..1c058b08c2f 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 ce1df01f629..fe9f37b4cd4 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 8c9c46d41f1..162ca7098cd 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 7bbfc8c002a..965f1d1c4eb 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 09a5e2055ca..e029bd36da3 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 406523b5d2f..e13e2cb308d 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 ed68557f0b2..18392e031b8 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 8ce4403ddc8..7f653a988f4 100644
--- a/gcc/tree-ssa-sink.cc
+++ b/gcc/tree-ssa-sink.cc
@@ -829,10 +829,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 1d4c0f78fbf..2cceba6f7af 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 581bdcf5652..dcf13d939bd 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 aea7d69584f..510f8319d8c 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 b48fcf1a8ba..087f0dc965d 100644
--- a/gcc/tree-ssa-uninit.cc
+++ b/gcc/tree-ssa-uninit.cc
@@ -1317,9 +1317,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
@@ -1459,8 +1462,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 05536cd2f74..bc22ece636a 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 9038cd43aaa..ed4c8d8c775 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 50a17927f39..17a31f7a63c 100644
--- a/gcc/tree-switch-conversion.cc
+++ b/gcc/tree-switch-conversion.cc
@@ -2428,8 +2428,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
@@ -2507,18 +2510,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 5a3466e5d53..6745d57580b 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 d99e3207fbe..d974fd1b7fe 100644
--- a/gcc/tree-vect-generic.cc
+++ b/gcc/tree-vect-generic.cc
@@ -2415,12 +2415,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 ();
}
@@ -2459,8 +2459,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 a63fa391273..53dc4520963 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 0784d658567..da0a6d5a8b6 100644
--- a/gcc/tree-vrp.cc
+++ b/gcc/tree-vrp.cc
@@ -4402,14 +4402,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 02e8ac7cf79..79d4582acd1 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 6c058142c37..18c75b471f4 100644
--- a/gcc/ubsan.cc
+++ b/gcc/ubsan.cc
@@ -2329,7 +2329,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
@@ -2341,7 +2341,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 7c3ad0a55bd..235981d100f 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 48f9987082e..24894e7f108 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
diff --git a/gcc/web.cc b/gcc/web.cc
index a5874a98825..bd0ec94f1f4 100644
--- a/gcc/web.cc
+++ b/gcc/web.cc
@@ -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
--
2.26.3
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 02/10] Add 'final' and 'override' on dom_walker vfunc impls
2022-05-23 19:28 [PATCH 00/10] Add 'final' and 'override' where missing David Malcolm
2022-05-23 19:28 ` [PATCH 01/10] Add 'final' and 'override' to opt_pass vfunc impls David Malcolm
@ 2022-05-23 19:28 ` David Malcolm
2022-06-13 18:23 ` PING " David Malcolm
2022-05-23 19:28 ` [PATCH 03/10] expr.cc: use final/override on op_by_pieces_d vfuncs David Malcolm
` (8 subsequent siblings)
10 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-05-23 19:28 UTC (permalink / raw)
To: gcc-patches
gcc/ChangeLog:
* compare-elim.cc: Add "final" and "override" to dom_walker vfunc
implementations, removing redundant "virtual" as appropriate.
* gimple-ssa-strength-reduction.cc: Likewise.
* ipa-prop.cc: Likewise.
* rtl-ssa/blocks.cc: Likewise.
* tree-into-ssa.cc: Likewise.
* tree-ssa-dom.cc: Likewise.
* tree-ssa-math-opts.cc: Likewise.
* tree-ssa-phiopt.cc: Likewise.
* tree-ssa-propagate.cc: Likewise.
* tree-ssa-sccvn.cc: Likewise.
* tree-ssa-strlen.cc: Likewise.
* tree-ssa-uncprop.cc: Likewise.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
---
gcc/compare-elim.cc | 2 +-
gcc/gimple-ssa-strength-reduction.cc | 2 +-
gcc/ipa-prop.cc | 4 ++--
gcc/rtl-ssa/blocks.cc | 4 ++--
gcc/tree-into-ssa.cc | 10 +++++-----
gcc/tree-ssa-dom.cc | 4 ++--
gcc/tree-ssa-math-opts.cc | 2 +-
gcc/tree-ssa-phiopt.cc | 4 ++--
gcc/tree-ssa-propagate.cc | 4 ++--
gcc/tree-ssa-sccvn.cc | 4 ++--
gcc/tree-ssa-strlen.cc | 4 ++--
gcc/tree-ssa-uncprop.cc | 4 ++--
12 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/gcc/compare-elim.cc b/gcc/compare-elim.cc
index e869d9d3249..4a23202f8ff 100644
--- a/gcc/compare-elim.cc
+++ b/gcc/compare-elim.cc
@@ -283,7 +283,7 @@ public:
find_comparison_dom_walker (cdi_direction direction)
: dom_walker (direction) {}
- virtual edge before_dom_children (basic_block);
+ edge before_dom_children (basic_block) final override;
};
/* Return true if conforming COMPARE with EH_NOTE is redundant with comparison
diff --git a/gcc/gimple-ssa-strength-reduction.cc b/gcc/gimple-ssa-strength-reduction.cc
index 2b559e96fc8..fb2bb9f4e74 100644
--- a/gcc/gimple-ssa-strength-reduction.cc
+++ b/gcc/gimple-ssa-strength-reduction.cc
@@ -1729,7 +1729,7 @@ class find_candidates_dom_walker : public dom_walker
public:
find_candidates_dom_walker (cdi_direction direction)
: dom_walker (direction) {}
- virtual edge before_dom_children (basic_block);
+ edge before_dom_children (basic_block) final override;
};
/* Find strength-reduction candidates in block BB. */
diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc
index c6c745f84a0..03f0ba2ec75 100644
--- a/gcc/ipa-prop.cc
+++ b/gcc/ipa-prop.cc
@@ -3004,7 +3004,7 @@ public:
analysis_dom_walker (struct ipa_func_body_info *fbi)
: dom_walker (CDI_DOMINATORS), m_fbi (fbi) {}
- virtual edge before_dom_children (basic_block);
+ edge before_dom_children (basic_block) final override;
private:
struct ipa_func_body_info *m_fbi;
@@ -5653,7 +5653,7 @@ public:
: dom_walker (CDI_DOMINATORS), m_fbi (fbi), m_descriptors (descs),
m_aggval (av), m_something_changed (sc) {}
- virtual edge before_dom_children (basic_block);
+ edge before_dom_children (basic_block) final override;
bool cleanup_eh ()
{ return gimple_purge_all_dead_eh_edges (m_need_eh_cleanup); }
diff --git a/gcc/rtl-ssa/blocks.cc b/gcc/rtl-ssa/blocks.cc
index 959fad8f829..6b03dd03747 100644
--- a/gcc/rtl-ssa/blocks.cc
+++ b/gcc/rtl-ssa/blocks.cc
@@ -85,8 +85,8 @@ class function_info::bb_walker : public dom_walker
{
public:
bb_walker (function_info *, build_info &);
- virtual edge before_dom_children (basic_block);
- virtual void after_dom_children (basic_block);
+ edge before_dom_children (basic_block) final override;
+ void after_dom_children (basic_block) final override;
private:
// Information about the function we're building.
diff --git a/gcc/tree-into-ssa.cc b/gcc/tree-into-ssa.cc
index 46df57ae0e1..9631d8c6556 100644
--- a/gcc/tree-into-ssa.cc
+++ b/gcc/tree-into-ssa.cc
@@ -1462,8 +1462,8 @@ public:
rewrite_dom_walker (cdi_direction direction)
: dom_walker (direction, ALL_BLOCKS, NULL) {}
- virtual edge before_dom_children (basic_block);
- virtual void after_dom_children (basic_block);
+ edge before_dom_children (basic_block) final override;
+ void after_dom_children (basic_block) final override;
};
/* SSA Rewriting Step 1. Initialization, create a block local stack
@@ -2148,8 +2148,8 @@ public:
rewrite_update_dom_walker (cdi_direction direction)
: dom_walker (direction, ALL_BLOCKS, NULL) {}
- virtual edge before_dom_children (basic_block);
- virtual void after_dom_children (basic_block);
+ edge before_dom_children (basic_block) final override;
+ void after_dom_children (basic_block) final override;
};
/* Initialization of block data structures for the incremental SSA
@@ -2300,7 +2300,7 @@ public:
mark_def_dom_walker (cdi_direction direction);
~mark_def_dom_walker ();
- virtual edge before_dom_children (basic_block);
+ edge before_dom_children (basic_block) final override;
private:
/* Notice that this bitmap is indexed using variable UIDs, so it must be
diff --git a/gcc/tree-ssa-dom.cc b/gcc/tree-ssa-dom.cc
index 97e17ca68e4..1a44b10756f 100644
--- a/gcc/tree-ssa-dom.cc
+++ b/gcc/tree-ssa-dom.cc
@@ -737,8 +737,8 @@ public:
m_threader = threader;
}
- virtual edge before_dom_children (basic_block);
- virtual void after_dom_children (basic_block);
+ edge before_dom_children (basic_block) final override;
+ void after_dom_children (basic_block) final override;
private:
diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc
index fe9f37b4cd4..a4492c96419 100644
--- a/gcc/tree-ssa-math-opts.cc
+++ b/gcc/tree-ssa-math-opts.cc
@@ -4918,7 +4918,7 @@ public:
/* The actual actions performed in the walk. */
- virtual void after_dom_children (basic_block);
+ void after_dom_children (basic_block) final override;
/* Set of results of chains of multiply and add statement combinations that
were not transformed into FMAs because of active deferring. */
diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
index 162ca7098cd..d17c49468db 100644
--- a/gcc/tree-ssa-phiopt.cc
+++ b/gcc/tree-ssa-phiopt.cc
@@ -2978,8 +2978,8 @@ public:
: dom_walker (direction), m_nontrapping (ps), m_seen_refs (128)
{}
- virtual edge before_dom_children (basic_block);
- virtual void after_dom_children (basic_block);
+ edge before_dom_children (basic_block) final override;
+ void after_dom_children (basic_block) final override;
private:
diff --git a/gcc/tree-ssa-propagate.cc b/gcc/tree-ssa-propagate.cc
index c10ffd91766..d2d32517a8c 100644
--- a/gcc/tree-ssa-propagate.cc
+++ b/gcc/tree-ssa-propagate.cc
@@ -679,8 +679,8 @@ public:
BITMAP_FREE (need_eh_cleanup);
}
- virtual edge before_dom_children (basic_block);
- virtual void after_dom_children (basic_block bb)
+ edge before_dom_children (basic_block) final override;
+ void after_dom_children (basic_block bb) final override
{
substitute_and_fold_engine->post_fold_bb (bb);
}
diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc
index 18392e031b8..7407591e98c 100644
--- a/gcc/tree-ssa-sccvn.cc
+++ b/gcc/tree-ssa-sccvn.cc
@@ -2493,8 +2493,8 @@ public:
eliminate_dom_walker (cdi_direction, bitmap);
~eliminate_dom_walker ();
- virtual edge before_dom_children (basic_block);
- virtual void after_dom_children (basic_block);
+ edge before_dom_children (basic_block) final override;
+ void after_dom_children (basic_block) final override;
virtual tree eliminate_avail (basic_block, tree op);
virtual void eliminate_push_avail (basic_block, tree op);
diff --git a/gcc/tree-ssa-strlen.cc b/gcc/tree-ssa-strlen.cc
index 2cceba6f7af..7b3e3899ea2 100644
--- a/gcc/tree-ssa-strlen.cc
+++ b/gcc/tree-ssa-strlen.cc
@@ -243,8 +243,8 @@ public:
~strlen_pass ();
- virtual edge before_dom_children (basic_block);
- virtual void after_dom_children (basic_block);
+ edge before_dom_children (basic_block) final override;
+ void after_dom_children (basic_block) final override;
bool check_and_optimize_stmt (bool *cleanup_eh);
bool check_and_optimize_call (bool *zero_write);
diff --git a/gcc/tree-ssa-uncprop.cc b/gcc/tree-ssa-uncprop.cc
index 510f8319d8c..900bf336e2e 100644
--- a/gcc/tree-ssa-uncprop.cc
+++ b/gcc/tree-ssa-uncprop.cc
@@ -298,8 +298,8 @@ class uncprop_dom_walker : public dom_walker
public:
uncprop_dom_walker (cdi_direction direction) : dom_walker (direction) {}
- virtual edge before_dom_children (basic_block);
- virtual void after_dom_children (basic_block);
+ edge before_dom_children (basic_block) final override;
+ void after_dom_children (basic_block) final override;
private:
--
2.26.3
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 03/10] expr.cc: use final/override on op_by_pieces_d vfuncs
2022-05-23 19:28 [PATCH 00/10] Add 'final' and 'override' where missing David Malcolm
2022-05-23 19:28 ` [PATCH 01/10] Add 'final' and 'override' to opt_pass vfunc impls David Malcolm
2022-05-23 19:28 ` [PATCH 02/10] Add 'final' and 'override' on dom_walker " David Malcolm
@ 2022-05-23 19:28 ` David Malcolm
2022-06-13 18:25 ` PING: " David Malcolm
2022-05-23 19:28 ` [PATCH 04/10] tree-switch-conversion.h: use final/override for cluster vfunc impls David Malcolm
` (7 subsequent siblings)
10 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-05-23 19:28 UTC (permalink / raw)
To: gcc-patches
gcc/ChangeLog:
* expr.cc: Add "final" and "override" to op_by_pieces_d vfunc
implementations as appropriate.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
---
gcc/expr.cc | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/gcc/expr.cc b/gcc/expr.cc
index 7197996cec7..ce58728862a 100644
--- a/gcc/expr.cc
+++ b/gcc/expr.cc
@@ -1357,8 +1357,8 @@ op_by_pieces_d::run ()
class move_by_pieces_d : public op_by_pieces_d
{
insn_gen_fn m_gen_fun;
- void generate (rtx, rtx, machine_mode);
- bool prepare_mode (machine_mode, unsigned int);
+ void generate (rtx, rtx, machine_mode) final override;
+ bool prepare_mode (machine_mode, unsigned int) final override;
public:
move_by_pieces_d (rtx to, rtx from, unsigned HOST_WIDE_INT len,
@@ -1453,8 +1453,8 @@ move_by_pieces (rtx to, rtx from, unsigned HOST_WIDE_INT len,
class store_by_pieces_d : public op_by_pieces_d
{
insn_gen_fn m_gen_fun;
- void generate (rtx, rtx, machine_mode);
- bool prepare_mode (machine_mode, unsigned int);
+ void generate (rtx, rtx, machine_mode) final override;
+ bool prepare_mode (machine_mode, unsigned int) final override;
public:
store_by_pieces_d (rtx to, by_pieces_constfn cfn, void *cfn_data,
@@ -1650,9 +1650,9 @@ class compare_by_pieces_d : public op_by_pieces_d
rtx m_accumulator;
int m_count, m_batch;
- void generate (rtx, rtx, machine_mode);
- bool prepare_mode (machine_mode, unsigned int);
- void finish_mode (machine_mode);
+ void generate (rtx, rtx, machine_mode) final override;
+ bool prepare_mode (machine_mode, unsigned int) final override;
+ void finish_mode (machine_mode) final override;
public:
compare_by_pieces_d (rtx op0, rtx op1, by_pieces_constfn op1_cfn,
void *op1_cfn_data, HOST_WIDE_INT len, int align,
--
2.26.3
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 04/10] tree-switch-conversion.h: use final/override for cluster vfunc impls
2022-05-23 19:28 [PATCH 00/10] Add 'final' and 'override' where missing David Malcolm
` (2 preceding siblings ...)
2022-05-23 19:28 ` [PATCH 03/10] expr.cc: use final/override on op_by_pieces_d vfuncs David Malcolm
@ 2022-05-23 19:28 ` David Malcolm
2022-06-13 18:26 ` PING " David Malcolm
2022-05-23 19:28 ` [PATCH 05/10] d: add 'final' and 'override' to gcc/d/*.cc 'visit' impls David Malcolm
` (6 subsequent siblings)
10 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-05-23 19:28 UTC (permalink / raw)
To: gcc-patches
gcc/ChangeLog:
* tree-switch-conversion.h: Add "final" and "override" to cluster
vfunc implementations as appropriate.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
---
gcc/tree-switch-conversion.h | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/gcc/tree-switch-conversion.h b/gcc/tree-switch-conversion.h
index 2b677d9f7e9..d22515eb296 100644
--- a/gcc/tree-switch-conversion.h
+++ b/gcc/tree-switch-conversion.h
@@ -130,19 +130,19 @@ public:
{}
cluster_type
- get_type ()
+ get_type () final override
{
return SIMPLE_CASE;
}
tree
- get_low ()
+ get_low () final override
{
return m_low;
}
tree
- get_high ()
+ get_high () final override
{
return m_high;
}
@@ -153,13 +153,13 @@ public:
}
void
- debug ()
+ debug () final override
{
dump (stderr);
}
void
- dump (FILE *f, bool details ATTRIBUTE_UNUSED = false)
+ dump (FILE *f, bool details ATTRIBUTE_UNUSED = false) final override
{
PRINT_CASE (f, get_low ());
if (get_low () != get_high ())
@@ -170,12 +170,12 @@ public:
fprintf (f, " ");
}
- void emit (tree, tree, tree, basic_block, location_t)
+ void emit (tree, tree, tree, basic_block, location_t) final override
{
gcc_unreachable ();
}
- bool is_single_value_p ()
+ bool is_single_value_p () final override
{
return tree_int_cst_equal (get_low (), get_high ());
}
@@ -224,24 +224,24 @@ public:
~group_cluster ();
tree
- get_low ()
+ get_low () final override
{
return m_cases[0]->get_low ();
}
tree
- get_high ()
+ get_high () final override
{
return m_cases[m_cases.length () - 1]->get_high ();
}
void
- debug ()
+ debug () final override
{
dump (stderr);
}
- void dump (FILE *f, bool details = false);
+ void dump (FILE *f, bool details = false) final override;
/* List of simple clusters handled by the group. */
vec<simple_cluster *> m_cases;
@@ -261,13 +261,14 @@ public:
{}
cluster_type
- get_type ()
+ get_type () final override
{
return JUMP_TABLE;
}
void emit (tree index_expr, tree index_type,
- tree default_label_expr, basic_block default_bb, location_t loc);
+ tree default_label_expr, basic_block default_bb, location_t loc)
+ final override;
/* Find jump tables of given CLUSTERS, where all members of the vector
are of type simple_cluster. New clusters are returned. */
@@ -366,7 +367,7 @@ public:
{}
cluster_type
- get_type ()
+ get_type () final override
{
return BIT_TEST;
}
@@ -388,7 +389,8 @@ public:
There *MUST* be max_case_bit_tests or less unique case
node targets. */
void emit (tree index_expr, tree index_type,
- tree default_label_expr, basic_block default_bb, location_t loc);
+ tree default_label_expr, basic_block default_bb, location_t loc)
+ final override;
/* Find bit tests of given CLUSTERS, where all members of the vector
are of type simple_cluster. New clusters are returned. */
--
2.26.3
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 05/10] d: add 'final' and 'override' to gcc/d/*.cc 'visit' impls
2022-05-23 19:28 [PATCH 00/10] Add 'final' and 'override' where missing David Malcolm
` (3 preceding siblings ...)
2022-05-23 19:28 ` [PATCH 04/10] tree-switch-conversion.h: use final/override for cluster vfunc impls David Malcolm
@ 2022-05-23 19:28 ` David Malcolm
2022-05-24 12:56 ` Iain Buclaw
2022-05-23 19:28 ` [PATCH 06/10] ipa: add 'final' and 'override' to call_summary_base vfunc impls David Malcolm
` (5 subsequent siblings)
10 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-05-23 19:28 UTC (permalink / raw)
To: gcc-patches
gcc/d/ChangeLog:
* decl.cc: Add "final" and "override" to all "visit" vfunc decls
as appropriate.
* expr.cc: Likewise.
* toir.cc: Likewise.
* typeinfo.cc: Likewise.
* types.cc: Likewise.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
---
gcc/d/decl.cc | 36 +++++++++++++-------------
gcc/d/expr.cc | 2 +-
gcc/d/toir.cc | 64 +++++++++++++++++++++++------------------------
gcc/d/typeinfo.cc | 34 ++++++++++++-------------
gcc/d/types.cc | 30 +++++++++++-----------
5 files changed, 83 insertions(+), 83 deletions(-)
diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
index f5c21078aad..5d850065bf0 100644
--- a/gcc/d/decl.cc
+++ b/gcc/d/decl.cc
@@ -149,13 +149,13 @@ public:
/* This should be overridden by each declaration class. */
- void visit (Dsymbol *)
+ void visit (Dsymbol *) final override
{
}
/* Compile a D module, and all members of it. */
- void visit (Module *d)
+ void visit (Module *d) final override
{
if (d->semanticRun >= PASS::obj)
return;
@@ -166,7 +166,7 @@ public:
/* Write the imported symbol to debug. */
- void visit (Import *d)
+ void visit (Import *d) final override
{
if (d->semanticRun >= PASS::obj)
return;
@@ -218,7 +218,7 @@ public:
/* Expand any local variables found in tuples. */
- void visit (TupleDeclaration *d)
+ void visit (TupleDeclaration *d) final override
{
for (size_t i = 0; i < d->objects->length; i++)
{
@@ -234,7 +234,7 @@ public:
/* Walk over all declarations in the attribute scope. */
- void visit (AttribDeclaration *d)
+ void visit (AttribDeclaration *d) final override
{
Dsymbols *ds = d->include (NULL);
@@ -248,7 +248,7 @@ public:
/* Pragmas are a way to pass special information to the compiler and to add
vendor specific extensions to D. */
- void visit (PragmaDeclaration *d)
+ void visit (PragmaDeclaration *d) final override
{
if (d->ident == Identifier::idPool ("lib")
|| d->ident == Identifier::idPool ("startaddress"))
@@ -266,7 +266,7 @@ public:
/* Conditional compilation is the process of selecting which code to compile
and which code to not compile. Look for version conditions that may */
- void visit (ConditionalDeclaration *d)
+ void visit (ConditionalDeclaration *d) final override
{
bool old_condition = this->in_version_unittest_;
@@ -284,7 +284,7 @@ public:
/* Walk over all members in the namespace scope. */
- void visit (Nspace *d)
+ void visit (Nspace *d) final override
{
if (isError (d) || !d->members)
return;
@@ -298,7 +298,7 @@ public:
voldemort type, then it's members must be compiled before the parent
function finishes. */
- void visit (TemplateDeclaration *d)
+ void visit (TemplateDeclaration *d) final override
{
/* Type cannot be directly named outside of the scope it's declared in, so
the only way it can be escaped is if the function has auto return. */
@@ -329,7 +329,7 @@ public:
/* Walk over all members in the instantiated template. */
- void visit (TemplateInstance *d)
+ void visit (TemplateInstance *d) final override
{
if (isError (d)|| !d->members)
return;
@@ -343,7 +343,7 @@ public:
/* Walk over all members in the mixin template scope. */
- void visit (TemplateMixin *d)
+ void visit (TemplateMixin *d) final override
{
if (isError (d)|| !d->members)
return;
@@ -355,7 +355,7 @@ public:
/* Write out compiler generated TypeInfo, initializer and functions for the
given struct declaration, walking over all static members. */
- void visit (StructDeclaration *d)
+ void visit (StructDeclaration *d) final override
{
if (d->semanticRun >= PASS::obj)
return;
@@ -470,7 +470,7 @@ public:
/* Write out compiler generated TypeInfo, initializer and vtables for the
given class declaration, walking over all static members. */
- void visit (ClassDeclaration *d)
+ void visit (ClassDeclaration *d) final override
{
if (d->semanticRun >= PASS::obj)
return;
@@ -544,7 +544,7 @@ public:
/* Write out compiler generated TypeInfo and vtables for the given interface
declaration, walking over all static members. */
- void visit (InterfaceDeclaration *d)
+ void visit (InterfaceDeclaration *d) final override
{
if (d->semanticRun >= PASS::obj)
return;
@@ -587,7 +587,7 @@ public:
/* Write out compiler generated TypeInfo and initializer for the given
enum declaration. */
- void visit (EnumDeclaration *d)
+ void visit (EnumDeclaration *d) final override
{
if (d->semanticRun >= PASS::obj)
return;
@@ -626,7 +626,7 @@ public:
/* Finish up a variable declaration and push it into the current scope.
This can either be a static, local or manifest constant. */
- void visit (VarDeclaration *d)
+ void visit (VarDeclaration *d) final override
{
if (d->semanticRun >= PASS::obj)
return;
@@ -753,7 +753,7 @@ public:
/* Generate and compile a static TypeInfo declaration, but only if it is
needed in the current compilation. */
- void visit (TypeInfoDeclaration *d)
+ void visit (TypeInfoDeclaration *d) final override
{
if (d->semanticRun >= PASS::obj)
return;
@@ -770,7 +770,7 @@ public:
/* Finish up a function declaration and compile it all the way
down to assembler language output. */
- void visit (FuncDeclaration *d)
+ void visit (FuncDeclaration *d) final override
{
/* Already generated the function. */
if (d->semanticRun >= PASS::obj)
diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc
index 7f5e683a676..c259e7df6d5 100644
--- a/gcc/d/expr.cc
+++ b/gcc/d/expr.cc
@@ -2556,7 +2556,7 @@ public:
/* Build a tuple literal. Just an argument list that may have
side effects that need evaluation. */
- void visit (TupleExp *e)
+ void visit (TupleExp *e) final override
{
tree result = NULL_TREE;
diff --git a/gcc/d/toir.cc b/gcc/d/toir.cc
index d20c5c3b927..50d44156cca 100644
--- a/gcc/d/toir.cc
+++ b/gcc/d/toir.cc
@@ -534,7 +534,7 @@ public:
/* This should be overridden by each statement class. */
- void visit (Statement *)
+ void visit (Statement *) final override
{
gcc_unreachable ();
}
@@ -543,13 +543,13 @@ public:
try/catch/finally. At this point, this statement is just an empty
placeholder. Maybe the frontend shouldn't leak these. */
- void visit (ScopeGuardStatement *)
+ void visit (ScopeGuardStatement *) final override
{
}
/* If statements provide simple conditional execution of statements. */
- void visit (IfStatement *s)
+ void visit (IfStatement *s) final override
{
this->start_scope (level_cond);
@@ -588,7 +588,7 @@ public:
here would be the place to do it. For now, all pragmas are handled
by the frontend. */
- void visit (PragmaStatement *)
+ void visit (PragmaStatement *) final override
{
}
@@ -596,7 +596,7 @@ public:
This visitor is not strictly required other than to enforce that
these kinds of statements never reach here. */
- void visit (WhileStatement *)
+ void visit (WhileStatement *) final override
{
gcc_unreachable ();
}
@@ -604,7 +604,7 @@ public:
/* Do while statments implement simple loops. The body is executed, then
the condition is evaluated. */
- void visit (DoStatement *s)
+ void visit (DoStatement *s) final override
{
tree lbreak = this->push_break_label (s);
@@ -633,7 +633,7 @@ public:
/* For statements implement loops with initialization, test, and
increment clauses. */
- void visit (ForStatement *s)
+ void visit (ForStatement *s) final override
{
tree lbreak = this->push_break_label (s);
this->start_scope (level_loop);
@@ -674,7 +674,7 @@ public:
This visitor is not strictly required other than to enforce that
these kinds of statements never reach here. */
- void visit (ForeachStatement *)
+ void visit (ForeachStatement *) final override
{
gcc_unreachable ();
}
@@ -683,7 +683,7 @@ public:
loops. This visitor is not strictly required other than to enforce that
these kinds of statements never reach here. */
- void visit (ForeachRangeStatement *)
+ void visit (ForeachRangeStatement *) final override
{
gcc_unreachable ();
}
@@ -691,7 +691,7 @@ public:
/* Jump to the associated exit label for the current loop. If IDENT
for the Statement is not null, then the label is user defined. */
- void visit (BreakStatement *s)
+ void visit (BreakStatement *s) final override
{
if (s->ident)
{
@@ -710,7 +710,7 @@ public:
/* Jump to the associated continue label for the current loop. If IDENT
for the Statement is not null, then the label is user defined. */
- void visit (ContinueStatement *s)
+ void visit (ContinueStatement *s) final override
{
if (s->ident)
{
@@ -726,7 +726,7 @@ public:
/* A goto statement jumps to the statement identified by the given label. */
- void visit (GotoStatement *s)
+ void visit (GotoStatement *s) final override
{
gcc_assert (s->label->statement != NULL);
gcc_assert (s->tf == s->label->statement->tf);
@@ -742,7 +742,7 @@ public:
/* Statements can be labeled. A label is an identifier that precedes
a statement. */
- void visit (LabelStatement *s)
+ void visit (LabelStatement *s) final override
{
LabelDsymbol *sym;
@@ -766,7 +766,7 @@ public:
/* A switch statement goes to one of a collection of case statements
depending on the value of the switch expression. */
- void visit (SwitchStatement *s)
+ void visit (SwitchStatement *s) final override
{
this->start_scope (level_switch);
tree lbreak = this->push_break_label (s);
@@ -855,7 +855,7 @@ public:
/* Declare the case label associated with the current SwitchStatement. */
- void visit (CaseStatement *s)
+ void visit (CaseStatement *s) final override
{
/* Emit the case label. */
tree label = this->define_label (s);
@@ -881,7 +881,7 @@ public:
/* Declare the default label associated with the current SwitchStatement. */
- void visit (DefaultStatement *s)
+ void visit (DefaultStatement *s) final override
{
/* Emit the default case label. */
tree label = this->define_label (s);
@@ -902,7 +902,7 @@ public:
/* Implements `goto default' by jumping to the label associated with
the DefaultStatement in a switch block. */
- void visit (GotoDefaultStatement *s)
+ void visit (GotoDefaultStatement *s) final override
{
tree label = this->lookup_label (s->sw->sdefault);
this->do_jump (label);
@@ -911,7 +911,7 @@ public:
/* Implements `goto case' by jumping to the label associated with the
CaseStatement in a switch block. */
- void visit (GotoCaseStatement *s)
+ void visit (GotoCaseStatement *s) final override
{
tree label = this->lookup_label (s->cs);
this->do_jump (label);
@@ -920,7 +920,7 @@ public:
/* Throw a SwitchError exception, called when a switch statement has
no DefaultStatement, yet none of the cases match. */
- void visit (SwitchErrorStatement *s)
+ void visit (SwitchErrorStatement *s) final override
{
/* A throw SwitchError statement gets turned into a library call.
The call is wrapped in the enclosed expression. */
@@ -931,7 +931,7 @@ public:
/* A return statement exits the current function and supplies its return
value, if the return type is not void. */
- void visit (ReturnStatement *s)
+ void visit (ReturnStatement *s) final override
{
if (s->exp == NULL || s->exp->type->toBasetype ()->ty == TY::Tvoid)
{
@@ -1044,7 +1044,7 @@ public:
/* Evaluate the enclosed expression, and add it to the statement list. */
- void visit (ExpStatement *s)
+ void visit (ExpStatement *s) final override
{
if (s->exp)
{
@@ -1056,7 +1056,7 @@ public:
/* Evaluate all enclosed statements. */
- void visit (CompoundStatement *s)
+ void visit (CompoundStatement *s) final override
{
if (s->statements == NULL)
return;
@@ -1074,7 +1074,7 @@ public:
These are compiled down as a `do ... while (0)', where each unrolled loop
is nested inside and given their own continue label to jump to. */
- void visit (UnrolledLoopStatement *s)
+ void visit (UnrolledLoopStatement *s) final override
{
if (s->statements == NULL)
return;
@@ -1105,7 +1105,7 @@ public:
/* Start a new scope and visit all nested statements, wrapping
them up into a BIND_EXPR at the end of the scope. */
- void visit (ScopeStatement *s)
+ void visit (ScopeStatement *s) final override
{
if (s->statement == NULL)
return;
@@ -1118,7 +1118,7 @@ public:
/* A with statement is a way to simplify repeated references to the same
object, where the handle is either a class or struct instance. */
- void visit (WithStatement *s)
+ void visit (WithStatement *s) final override
{
this->start_scope (level_with);
@@ -1143,7 +1143,7 @@ public:
thrown is a class type, but does not check if it is derived from
Object. Foreign objects are not currently supported at run-time. */
- void visit (ThrowStatement *s)
+ void visit (ThrowStatement *s) final override
{
ClassDeclaration *cd = s->exp->type->toBasetype ()->isClassHandle ();
InterfaceDeclaration *id = cd->isInterfaceDeclaration ();
@@ -1174,7 +1174,7 @@ public:
handling generated by the frontend. This is also used to implement
`scope (failure)' statements. */
- void visit (TryCatchStatement *s)
+ void visit (TryCatchStatement *s) final override
{
this->start_scope (level_try);
if (s->_body)
@@ -1263,7 +1263,7 @@ public:
handling generated by the frontend. This is also used to implement
`scope (exit)' statements. */
- void visit (TryFinallyStatement *s)
+ void visit (TryFinallyStatement *s) final override
{
this->start_scope (level_try);
if (s->_body)
@@ -1285,7 +1285,7 @@ public:
This visitor is not strictly required other than to enforce that
these kinds of statements never reach here. */
- void visit (SynchronizedStatement *)
+ void visit (SynchronizedStatement *) final override
{
gcc_unreachable ();
}
@@ -1294,7 +1294,7 @@ public:
an assembly parser for each supported target. Instead we leverage
GCC extended assembler using the GccAsmStatement class. */
- void visit (AsmStatement *)
+ void visit (AsmStatement *) final override
{
sorry ("D inline assembler statements are not supported in GDC.");
}
@@ -1302,7 +1302,7 @@ public:
/* Build a GCC extended assembler expression, whose components are
an INSN string, some OUTPUTS, some INPUTS, and some CLOBBERS. */
- void visit (GccAsmStatement *s)
+ void visit (GccAsmStatement *s) final override
{
StringExp *insn = s->insn->toStringExp ();
tree outputs = NULL_TREE;
@@ -1454,7 +1454,7 @@ public:
/* Import symbols from another module. */
- void visit (ImportStatement *s)
+ void visit (ImportStatement *s) final override
{
if (s->imports == NULL)
return;
diff --git a/gcc/d/typeinfo.cc b/gcc/d/typeinfo.cc
index 668b7b3c8e1..a31762fe270 100644
--- a/gcc/d/typeinfo.cc
+++ b/gcc/d/typeinfo.cc
@@ -556,7 +556,7 @@ public:
void **__vptr;
void *__monitor; */
- void visit (TypeInfoDeclaration *)
+ void visit (TypeInfoDeclaration *) final override
{
/* The vtable for TypeInfo. */
this->layout_base (Type::dtypeinfo);
@@ -567,7 +567,7 @@ public:
void *__monitor;
TypeInfo base; */
- void visit (TypeInfoConstDeclaration *d)
+ void visit (TypeInfoConstDeclaration *d) final override
{
Type *tm = d->tinfo->mutableOf ();
tm = tm->merge2 ();
@@ -584,7 +584,7 @@ public:
void *__monitor;
TypeInfo base; */
- void visit (TypeInfoInvariantDeclaration *d)
+ void visit (TypeInfoInvariantDeclaration *d) final override
{
Type *tm = d->tinfo->mutableOf ();
tm = tm->merge2 ();
@@ -601,7 +601,7 @@ public:
void *__monitor;
TypeInfo base; */
- void visit (TypeInfoSharedDeclaration *d)
+ void visit (TypeInfoSharedDeclaration *d) final override
{
Type *tm = d->tinfo->unSharedOf ();
tm = tm->merge2 ();
@@ -618,7 +618,7 @@ public:
void *__monitor;
TypeInfo base; */
- void visit (TypeInfoWildDeclaration *d)
+ void visit (TypeInfoWildDeclaration *d) final override
{
Type *tm = d->tinfo->mutableOf ();
tm = tm->merge2 ();
@@ -637,7 +637,7 @@ public:
string name;
void[] m_init; */
- void visit (TypeInfoEnumDeclaration *d)
+ void visit (TypeInfoEnumDeclaration *d) final override
{
TypeEnum *ti = d->tinfo->isTypeEnum ();
EnumDeclaration *ed = ti->sym;
@@ -669,7 +669,7 @@ public:
void *__monitor;
TypeInfo m_next; */
- void visit (TypeInfoPointerDeclaration *d)
+ void visit (TypeInfoPointerDeclaration *d) final override
{
TypePointer *ti = d->tinfo->isTypePointer ();
@@ -685,7 +685,7 @@ public:
void *__monitor;
TypeInfo value; */
- void visit (TypeInfoArrayDeclaration *d)
+ void visit (TypeInfoArrayDeclaration *d) final override
{
TypeDArray *ti = d->tinfo->isTypeDArray ();
@@ -702,7 +702,7 @@ public:
TypeInfo value;
size_t len; */
- void visit (TypeInfoStaticArrayDeclaration *d)
+ void visit (TypeInfoStaticArrayDeclaration *d) final override
{
TypeSArray *ti = d->tinfo->isTypeSArray ();
@@ -722,7 +722,7 @@ public:
TypeInfo value;
TypeInfo key; */
- void visit (TypeInfoAssociativeArrayDeclaration *d)
+ void visit (TypeInfoAssociativeArrayDeclaration *d) final override
{
TypeAArray *ti = d->tinfo->isTypeAArray ();
@@ -741,7 +741,7 @@ public:
void *__monitor;
TypeInfo base; */
- void visit (TypeInfoVectorDeclaration *d)
+ void visit (TypeInfoVectorDeclaration *d) final override
{
TypeVector *ti = d->tinfo->isTypeVector ();
@@ -758,7 +758,7 @@ public:
TypeInfo next;
string deco; */
- void visit (TypeInfoFunctionDeclaration *d)
+ void visit (TypeInfoFunctionDeclaration *d) final override
{
TypeFunction *ti = d->tinfo->isTypeFunction ();
gcc_assert (ti->deco != NULL);
@@ -779,7 +779,7 @@ public:
TypeInfo next;
string deco; */
- void visit (TypeInfoDelegateDeclaration *d)
+ void visit (TypeInfoDelegateDeclaration *d) final override
{
TypeDelegate *ti = d->tinfo->isTypeDelegate ();
gcc_assert (ti->deco != NULL);
@@ -813,7 +813,7 @@ public:
Information relating to interfaces, and their vtables are laid out
immediately after the named fields, if there is anything to write. */
- void visit (TypeInfoClassDeclaration *d)
+ void visit (TypeInfoClassDeclaration *d) final override
{
TypeClass *ti = d->tinfo->isTypeClass ();
ClassDeclaration *cd = ti->sym;
@@ -1004,7 +1004,7 @@ public:
void *__monitor;
TypeInfo_Class info; */
- void visit (TypeInfoInterfaceDeclaration *d)
+ void visit (TypeInfoInterfaceDeclaration *d) final override
{
TypeClass *ti = d->tinfo->isTypeClass ();
@@ -1034,7 +1034,7 @@ public:
uint m_align;
immutable(void)* xgetRTInfo; */
- void visit (TypeInfoStructDeclaration *d)
+ void visit (TypeInfoStructDeclaration *d) final override
{
TypeStruct *ti = d->tinfo->isTypeStruct ();
StructDeclaration *sd = ti->sym;
@@ -1119,7 +1119,7 @@ public:
void *__monitor;
TypeInfo[] elements; */
- void visit (TypeInfoTupleDeclaration *d)
+ void visit (TypeInfoTupleDeclaration *d) final override
{
TypeTuple *ti = d->tinfo->isTypeTuple ();
diff --git a/gcc/d/types.cc b/gcc/d/types.cc
index c54049dfb98..b17b15359c8 100644
--- a/gcc/d/types.cc
+++ b/gcc/d/types.cc
@@ -665,7 +665,7 @@ public:
/* This should be overridden by each type class. */
- void visit (Type *)
+ void visit (Type *) final override
{
gcc_unreachable ();
}
@@ -673,21 +673,21 @@ public:
/* Type assigned to erroneous expressions or constructs that
failed during the semantic stage. */
- void visit (TypeError *t)
+ void visit (TypeError *t) final override
{
t->ctype = error_mark_node;
}
/* Type assigned to generic nullable types. */
- void visit (TypeNull *t)
+ void visit (TypeNull *t) final override
{
t->ctype = ptr_type_node;
}
/* Bottom type used for functions that never return. */
- void visit (TypeNoreturn *t)
+ void visit (TypeNoreturn *t) final override
{
t->ctype = noreturn_type_node;
TYPE_NAME (t->ctype) = get_identifier (t->toChars ());
@@ -695,7 +695,7 @@ public:
/* Basic Data Types. */
- void visit (TypeBasic *t)
+ void visit (TypeBasic *t) final override
{
/* [type/basic-data-types]
@@ -761,7 +761,7 @@ public:
/* Build a simple pointer to data type, analogous to C pointers. */
- void visit (TypePointer *t)
+ void visit (TypePointer *t) final override
{
t->ctype = build_pointer_type (build_ctype (t->next));
}
@@ -769,7 +769,7 @@ public:
/* Build a dynamic array type, consisting of a length and a pointer
to the array data. */
- void visit (TypeDArray *t)
+ void visit (TypeDArray *t) final override
{
/* In [abi/arrays], dynamic array layout is:
.length array dimension.
@@ -787,7 +787,7 @@ public:
/* Build a static array type, distinguished from dynamic arrays by
having a length fixed at compile-time, analogous to C arrays. */
- void visit (TypeSArray *t)
+ void visit (TypeSArray *t) final override
{
if (t->dim->isConst () && t->dim->type->isintegral ())
{
@@ -804,7 +804,7 @@ public:
/* Build a vector type, a fixed array of floating or integer types. */
- void visit (TypeVector *t)
+ void visit (TypeVector *t) final override
{
int nunits = t->basetype->isTypeSArray ()->dim->toUInteger ();
tree inner = build_ctype (t->elementType ());
@@ -821,7 +821,7 @@ public:
/* Build an associative array type, distinguished from arrays by having an
index that's not necessarily an integer, and can be sparsely populated. */
- void visit (TypeAArray *t)
+ void visit (TypeAArray *t) final override
{
/* In [abi/associative-arrays], associative arrays are a struct that only
consist of a pointer to an opaque, implementation defined type. */
@@ -835,7 +835,7 @@ public:
/* Build type for a function declaration, which consists of a return type,
and a list of parameter types, and a linkage attribute. */
- void visit (TypeFunction *t)
+ void visit (TypeFunction *t) final override
{
tree fnparams = NULL_TREE;
tree fntype;
@@ -925,7 +925,7 @@ public:
reference and a pointer to a non-static member function, or a pointer
to a closure and a pointer to a nested function. */
- void visit (TypeDelegate *t)
+ void visit (TypeDelegate *t) final override
{
/* In [abi/delegates], delegate layout is:
.ptr context pointer.
@@ -952,7 +952,7 @@ public:
/* Build a named enum type, a distinct value whose values are restrict to
a group of constants of the same underlying base type. */
- void visit (TypeEnum *t)
+ void visit (TypeEnum *t) final override
{
tree basetype = (t->sym->memtype)
? build_ctype (t->sym->memtype) : void_type_node;
@@ -1067,7 +1067,7 @@ public:
/* Build a struct or union type. Layout should be exactly represented
as an equivalent C struct, except for non-POD or nested structs. */
- void visit (TypeStruct *t)
+ void visit (TypeStruct *t) final override
{
/* Merge types in the back-end if the front-end did not itself do so. */
tree deco = get_identifier (d_mangle_decl (t->sym));
@@ -1123,7 +1123,7 @@ public:
/* Build a class type. Whereas structs are value types, classes are
reference types, with all the object-orientated features. */
- void visit (TypeClass *t)
+ void visit (TypeClass *t) final override
{
/* Merge types in the back-end if the front-end did not itself do so. */
tree deco = get_identifier (d_mangle_decl (t->sym));
--
2.26.3
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 06/10] ipa: add 'final' and 'override' to call_summary_base vfunc impls
2022-05-23 19:28 [PATCH 00/10] Add 'final' and 'override' where missing David Malcolm
` (4 preceding siblings ...)
2022-05-23 19:28 ` [PATCH 05/10] d: add 'final' and 'override' to gcc/d/*.cc 'visit' impls David Malcolm
@ 2022-05-23 19:28 ` David Malcolm
2022-05-24 7:36 ` Martin Liška
2022-05-23 19:28 ` [PATCH 07/10] value-relation.h: add 'final' and 'override' to relation_oracle " David Malcolm
` (4 subsequent siblings)
10 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-05-23 19:28 UTC (permalink / raw)
To: gcc-patches
gcc/ChangeLog:
* ipa-cp.cc: Add "final" and "override" to call_summary_base vfunc
implementations, removing redundant "virtual" as appropriate.
* ipa-fnsummary.h: Likewise.
* ipa-modref.cc: Likewise.
* ipa-param-manipulation.cc: Likewise.
* ipa-profile.cc: Likewise.
* ipa-prop.h: Likewise.
* ipa-pure-const.cc: Likewise.
* ipa-reference.cc: Likewise.
* ipa-sra.cc: Likewise.
* symbol-summary.h: Likewise.
* symtab-thunks.cc: Likewise.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
---
gcc/ipa-cp.cc | 6 +++---
gcc/ipa-fnsummary.h | 21 ++++++++++----------
gcc/ipa-modref.cc | 36 +++++++++++++++++------------------
gcc/ipa-param-manipulation.cc | 8 ++++----
gcc/ipa-profile.cc | 6 +++---
gcc/ipa-prop.h | 26 ++++++++++++-------------
gcc/ipa-pure-const.cc | 8 ++++----
gcc/ipa-reference.cc | 10 +++++-----
gcc/ipa-sra.cc | 14 +++++++-------
gcc/symbol-summary.h | 8 ++++----
gcc/symtab-thunks.cc | 8 ++++----
11 files changed, 76 insertions(+), 75 deletions(-)
diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc
index 38a21b17e39..bb2d611cbcd 100644
--- a/gcc/ipa-cp.cc
+++ b/gcc/ipa-cp.cc
@@ -4190,9 +4190,9 @@ public:
m_initialize_when_cloning = true;
}
- virtual void duplicate (cgraph_edge *src_edge, cgraph_edge *dst_edge,
- edge_clone_summary *src_data,
- edge_clone_summary *dst_data);
+ void duplicate (cgraph_edge *src_edge, cgraph_edge *dst_edge,
+ edge_clone_summary *src_data,
+ edge_clone_summary *dst_data) final override;
};
/* Edge duplication hook. */
diff --git a/gcc/ipa-fnsummary.h b/gcc/ipa-fnsummary.h
index e1f1d1b839c..941fea6de0d 100644
--- a/gcc/ipa-fnsummary.h
+++ b/gcc/ipa-fnsummary.h
@@ -236,14 +236,15 @@ public:
/* Remove ipa_fn_summary for all callees of NODE. */
void remove_callees (cgraph_node *node);
- virtual void insert (cgraph_node *, ipa_fn_summary *);
- virtual void remove (cgraph_node *node, ipa_fn_summary *)
+ void insert (cgraph_node *, ipa_fn_summary *) final override;
+ void remove (cgraph_node *node, ipa_fn_summary *) final override
{
remove_callees (node);
}
- virtual void duplicate (cgraph_node *src, cgraph_node *dst,
- ipa_fn_summary *src_data, ipa_fn_summary *dst_data);
+ void duplicate (cgraph_node *src, cgraph_node *dst,
+ ipa_fn_summary *src_data, ipa_fn_summary *dst_data)
+ final override;
};
extern GTY(()) fast_function_summary <ipa_fn_summary *, va_gc>
@@ -259,9 +260,9 @@ public:
disable_insertion_hook ();
}
- virtual void duplicate (cgraph_node *, cgraph_node *,
- ipa_size_summary *src_data,
- ipa_size_summary *dst_data)
+ void duplicate (cgraph_node *, cgraph_node *,
+ ipa_size_summary *src_data,
+ ipa_size_summary *dst_data) final override
{
*dst_data = *src_data;
}
@@ -311,9 +312,9 @@ public:
fast_call_summary <ipa_call_summary *, va_heap> (symtab) {}
/* Hook that is called by summary when an edge is duplicated. */
- virtual void duplicate (cgraph_edge *src, cgraph_edge *dst,
- ipa_call_summary *src_data,
- ipa_call_summary *dst_data);
+ void duplicate (cgraph_edge *src, cgraph_edge *dst,
+ ipa_call_summary *src_data,
+ ipa_call_summary *dst_data) final override;
};
/* Estimated execution times, code sizes and other information about the
diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc
index 7c1f974bc7a..0d9abacf0a6 100644
--- a/gcc/ipa-modref.cc
+++ b/gcc/ipa-modref.cc
@@ -119,10 +119,10 @@ public:
fnspec_summaries_t (symbol_table *symtab)
: call_summary <fnspec_summary *> (symtab) {}
/* Hook that is called by summary when an edge is duplicated. */
- virtual void duplicate (cgraph_edge *,
- cgraph_edge *,
- fnspec_summary *src,
- fnspec_summary *dst)
+ void duplicate (cgraph_edge *,
+ cgraph_edge *,
+ fnspec_summary *src,
+ fnspec_summary *dst) final override
{
dst->fnspec = xstrdup (src->fnspec);
}
@@ -194,10 +194,10 @@ public:
escape_summaries_t (symbol_table *symtab)
: call_summary <escape_summary *> (symtab) {}
/* Hook that is called by summary when an edge is duplicated. */
- virtual void duplicate (cgraph_edge *,
- cgraph_edge *,
- escape_summary *src,
- escape_summary *dst)
+ void duplicate (cgraph_edge *,
+ cgraph_edge *,
+ escape_summary *src,
+ escape_summary *dst) final override
{
dst->esc = src->esc.copy ();
}
@@ -217,11 +217,11 @@ class GTY((user)) modref_summaries
public:
modref_summaries (symbol_table *symtab)
: fast_function_summary <modref_summary *, va_gc> (symtab) {}
- virtual void insert (cgraph_node *, modref_summary *state);
- virtual void duplicate (cgraph_node *src_node,
- cgraph_node *dst_node,
- modref_summary *src_data,
- modref_summary *dst_data);
+ void insert (cgraph_node *, modref_summary *state) final override;
+ void duplicate (cgraph_node *src_node,
+ cgraph_node *dst_node,
+ modref_summary *src_data,
+ modref_summary *dst_data) final override;
static modref_summaries *create_ggc (symbol_table *symtab)
{
return new (ggc_alloc_no_dtor<modref_summaries> ())
@@ -241,11 +241,11 @@ public:
modref_summaries_lto (symbol_table *symtab)
: fast_function_summary <modref_summary_lto *, va_gc> (symtab),
propagated (false) {}
- virtual void insert (cgraph_node *, modref_summary_lto *state);
- virtual void duplicate (cgraph_node *src_node,
- cgraph_node *dst_node,
- modref_summary_lto *src_data,
- modref_summary_lto *dst_data);
+ void insert (cgraph_node *, modref_summary_lto *state) final override;
+ void duplicate (cgraph_node *src_node,
+ cgraph_node *dst_node,
+ modref_summary_lto *src_data,
+ modref_summary_lto *dst_data) final override;
static modref_summaries_lto *create_ggc (symbol_table *symtab)
{
return new (ggc_alloc_no_dtor<modref_summaries_lto> ())
diff --git a/gcc/ipa-param-manipulation.cc b/gcc/ipa-param-manipulation.cc
index 38328c3e8d0..23a8cb84d48 100644
--- a/gcc/ipa-param-manipulation.cc
+++ b/gcc/ipa-param-manipulation.cc
@@ -114,10 +114,10 @@ class ipa_edge_modification_sum
/* Hook that is called by summary when an edge is duplicated. */
- virtual void duplicate (cgraph_edge *,
- cgraph_edge *,
- ipa_edge_modification_info *old_info,
- ipa_edge_modification_info *new_info)
+ void duplicate (cgraph_edge *,
+ cgraph_edge *,
+ ipa_edge_modification_info *old_info,
+ ipa_edge_modification_info *new_info) final override
{
new_info->index_map.safe_splice (old_info->index_map);
new_info->pass_through_map.safe_splice (old_info->pass_through_map);
diff --git a/gcc/ipa-profile.cc b/gcc/ipa-profile.cc
index 496f292acba..e0acc5d0188 100644
--- a/gcc/ipa-profile.cc
+++ b/gcc/ipa-profile.cc
@@ -198,9 +198,9 @@ public:
{}
/* Duplicate info when an edge is cloned. */
- virtual void duplicate (cgraph_edge *, cgraph_edge *,
- speculative_call_summary *old_sum,
- speculative_call_summary *new_sum);
+ void duplicate (cgraph_edge *, cgraph_edge *,
+ speculative_call_summary *old_sum,
+ speculative_call_summary *new_sum) final override;
};
static ipa_profile_call_summaries *call_sums = NULL;
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index b22dfb5315c..8811e0ea987 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -1004,10 +1004,10 @@ public:
}
/* Hook that is called by summary when a node is duplicated. */
- virtual void duplicate (cgraph_node *node,
- cgraph_node *node2,
- ipa_node_params *data,
- ipa_node_params *data2);
+ void duplicate (cgraph_node *node,
+ cgraph_node *node2,
+ ipa_node_params *data,
+ ipa_node_params *data2) final override;
};
/* Summary to manange ipa_edge_args structures. */
@@ -1024,12 +1024,12 @@ class GTY((user)) ipa_edge_args_sum_t : public call_summary <ipa_edge_args *>
}
/* Hook that is called by summary when an edge is removed. */
- virtual void remove (cgraph_edge *cs, ipa_edge_args *args);
+ void remove (cgraph_edge *cs, ipa_edge_args *args) final override;
/* Hook that is called by summary when an edge is duplicated. */
- virtual void duplicate (cgraph_edge *src,
- cgraph_edge *dst,
- ipa_edge_args *old_args,
- ipa_edge_args *new_args);
+ void duplicate (cgraph_edge *src,
+ cgraph_edge *dst,
+ ipa_edge_args *old_args,
+ ipa_edge_args *new_args) final override;
};
/* Function summary where the parameter infos are actually stored. */
@@ -1055,10 +1055,10 @@ public:
return summary;
}
/* Hook that is called by summary when a node is duplicated. */
- virtual void duplicate (cgraph_node *node,
- cgraph_node *node2,
- ipcp_transformation *data,
- ipcp_transformation *data2);
+ void duplicate (cgraph_node *node,
+ cgraph_node *node2,
+ ipcp_transformation *data,
+ ipcp_transformation *data2) final override;
};
/* Function summary where the IPA CP transformations are actually stored. */
diff --git a/gcc/ipa-pure-const.cc b/gcc/ipa-pure-const.cc
index 0e55fc4bfc5..572a6da274f 100644
--- a/gcc/ipa-pure-const.cc
+++ b/gcc/ipa-pure-const.cc
@@ -137,10 +137,10 @@ public:
funct_state_summary_t (symbol_table *symtab):
fast_function_summary <funct_state_d *, va_heap> (symtab) {}
- virtual void insert (cgraph_node *, funct_state_d *state);
- virtual void duplicate (cgraph_node *src_node, cgraph_node *dst_node,
- funct_state_d *src_data,
- funct_state_d *dst_data);
+ void insert (cgraph_node *, funct_state_d *state) final override;
+ void duplicate (cgraph_node *src_node, cgraph_node *dst_node,
+ funct_state_d *src_data,
+ funct_state_d *dst_data) final override;
};
static funct_state_summary_t *funct_state_summaries = NULL;
diff --git a/gcc/ipa-reference.cc b/gcc/ipa-reference.cc
index b5a2350ce72..bd6ee0d8c57 100644
--- a/gcc/ipa-reference.cc
+++ b/gcc/ipa-reference.cc
@@ -133,11 +133,11 @@ public:
ipa_ref_opt_summary_t (symbol_table *symtab):
fast_function_summary <ipa_reference_optimization_summary_d *, va_heap> (symtab) {}
- virtual void remove (cgraph_node *src_node,
- ipa_reference_optimization_summary_d *data);
- virtual void duplicate (cgraph_node *src_node, cgraph_node *dst_node,
- ipa_reference_optimization_summary_d *src_data,
- ipa_reference_optimization_summary_d *dst_data);
+ void remove (cgraph_node *src_node,
+ ipa_reference_optimization_summary_d *data) final override;
+ void duplicate (cgraph_node *src_node, cgraph_node *dst_node,
+ ipa_reference_optimization_summary_d *src_data,
+ ipa_reference_optimization_summary_d *dst_data) final override;
};
static ipa_ref_opt_summary_t *ipa_ref_opt_sum_summaries = NULL;
diff --git a/gcc/ipa-sra.cc b/gcc/ipa-sra.cc
index 4f705a3febf..2237ac6d92f 100644
--- a/gcc/ipa-sra.cc
+++ b/gcc/ipa-sra.cc
@@ -376,10 +376,10 @@ public:
ipa_sra_function_summaries (symbol_table *table, bool ggc):
function_summary<isra_func_summary *> (table, ggc) { }
- virtual void duplicate (cgraph_node *, cgraph_node *,
- isra_func_summary *old_sum,
- isra_func_summary *new_sum);
- virtual void insert (cgraph_node *, isra_func_summary *);
+ void duplicate (cgraph_node *, cgraph_node *,
+ isra_func_summary *old_sum,
+ isra_func_summary *new_sum) final override;
+ void insert (cgraph_node *, isra_func_summary *) final override;
};
/* Hook that is called by summary when a node is duplicated. */
@@ -458,9 +458,9 @@ public:
call_summary<isra_call_summary *> (table) { }
/* Duplicate info when an edge is cloned. */
- virtual void duplicate (cgraph_edge *, cgraph_edge *,
- isra_call_summary *old_sum,
- isra_call_summary *new_sum);
+ void duplicate (cgraph_edge *, cgraph_edge *,
+ isra_call_summary *old_sum,
+ isra_call_summary *new_sum) final override;
};
static ipa_sra_call_summaries *call_sums;
diff --git a/gcc/symbol-summary.h b/gcc/symbol-summary.h
index c54d3084cc4..45fa250e3f9 100644
--- a/gcc/symbol-summary.h
+++ b/gcc/symbol-summary.h
@@ -248,7 +248,7 @@ protected:
private:
/* Indication if we use ggc summary. */
- virtual bool is_ggc ()
+ bool is_ggc () final override
{
return m_ggc;
}
@@ -439,7 +439,7 @@ public:
void *data);
private:
- virtual bool is_ggc ();
+ bool is_ggc () final override;
/* Summary is stored in the vector. */
vec <T *, V> *m_vector;
@@ -744,7 +744,7 @@ protected:
private:
/* Indication if we use ggc summary. */
- virtual bool is_ggc ()
+ bool is_ggc () final override
{
return m_ggc;
}
@@ -910,7 +910,7 @@ public:
void *data);
private:
- virtual bool is_ggc ();
+ bool is_ggc () final override;
/* Summary is stored in the vector. */
vec <T *, V> *m_vector;
diff --git a/gcc/symtab-thunks.cc b/gcc/symtab-thunks.cc
index 73f810dc217..b1d9c5ddb53 100644
--- a/gcc/symtab-thunks.cc
+++ b/gcc/symtab-thunks.cc
@@ -71,10 +71,10 @@ public:
function_summary<thunk_info *> (table, ggc) { }
/* Hook that is called by summary when a node is duplicated. */
- virtual void duplicate (cgraph_node *node,
- cgraph_node *node2,
- thunk_info *data,
- thunk_info *data2);
+ void duplicate (cgraph_node *node,
+ cgraph_node *node2,
+ thunk_info *data,
+ thunk_info *data2) final override;
};
/* Duplication hook. */
--
2.26.3
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 07/10] value-relation.h: add 'final' and 'override' to relation_oracle vfunc impls
2022-05-23 19:28 [PATCH 00/10] Add 'final' and 'override' where missing David Malcolm
` (5 preceding siblings ...)
2022-05-23 19:28 ` [PATCH 06/10] ipa: add 'final' and 'override' to call_summary_base vfunc impls David Malcolm
@ 2022-05-23 19:28 ` David Malcolm
2022-06-13 18:28 ` PING " David Malcolm
2022-05-23 19:28 ` [PATCH 08/10] i386: add 'final' and 'override' to scalar_chain " David Malcolm
` (3 subsequent siblings)
10 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-05-23 19:28 UTC (permalink / raw)
To: gcc-patches
gcc/ChangeLog:
* value-relation.h: Add "final" and "override" to relation_oracle
vfunc implementations as appropriate.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
---
gcc/value-relation.h | 38 +++++++++++++++++++++-----------------
1 file changed, 21 insertions(+), 17 deletions(-)
diff --git a/gcc/value-relation.h b/gcc/value-relation.h
index 19762d8ce2b..478729be0bf 100644
--- a/gcc/value-relation.h
+++ b/gcc/value-relation.h
@@ -130,14 +130,15 @@ public:
equiv_oracle ();
~equiv_oracle ();
- const_bitmap equiv_set (tree ssa, basic_block bb);
+ const_bitmap equiv_set (tree ssa, basic_block bb) final override;
void register_relation (basic_block bb, relation_kind k, tree ssa1,
- tree ssa2);
+ tree ssa2) override;
- relation_kind query_relation (basic_block, tree, tree);
- relation_kind query_relation (basic_block, const_bitmap, const_bitmap);
- void dump (FILE *f, basic_block bb) const;
- void dump (FILE *f) const;
+ relation_kind query_relation (basic_block, tree, tree) override;
+ relation_kind query_relation (basic_block, const_bitmap, const_bitmap)
+ override;
+ void dump (FILE *f, basic_block bb) const override;
+ void dump (FILE *f) const override;
protected:
bitmap_obstack m_bitmaps;
@@ -185,14 +186,16 @@ public:
dom_oracle ();
~dom_oracle ();
- void register_relation (basic_block bb, relation_kind k, tree op1, tree op2);
+ void register_relation (basic_block bb, relation_kind k, tree op1, tree op2)
+ final override;
- relation_kind query_relation (basic_block bb, tree ssa1, tree ssa2);
+ relation_kind query_relation (basic_block bb, tree ssa1, tree ssa2)
+ final override;
relation_kind query_relation (basic_block bb, const_bitmap b1,
- const_bitmap b2);
+ const_bitmap b2) final override;
- void dump (FILE *f, basic_block bb) const;
- void dump (FILE *f) const;
+ void dump (FILE *f, basic_block bb) const final override;
+ void dump (FILE *f) const final override;
private:
bitmap m_tmp, m_tmp2;
bitmap m_relation_set; // Index by ssa-name. True if a relation exists
@@ -229,15 +232,16 @@ class path_oracle : public relation_oracle
public:
path_oracle (relation_oracle *oracle = NULL);
~path_oracle ();
- const_bitmap equiv_set (tree, basic_block);
- void register_relation (basic_block, relation_kind, tree, tree);
+ const_bitmap equiv_set (tree, basic_block) final override;
+ void register_relation (basic_block, relation_kind, tree, tree) final override;
void killing_def (tree);
- relation_kind query_relation (basic_block, tree, tree);
- relation_kind query_relation (basic_block, const_bitmap, const_bitmap);
+ relation_kind query_relation (basic_block, tree, tree) final override;
+ relation_kind query_relation (basic_block, const_bitmap, const_bitmap)
+ final override;
void reset_path ();
void set_root_oracle (relation_oracle *oracle) { m_root = oracle; }
- void dump (FILE *, basic_block) const;
- void dump (FILE *) const;
+ void dump (FILE *, basic_block) const final override;
+ void dump (FILE *) const final override;
private:
void register_equiv (basic_block bb, tree ssa1, tree ssa2);
equiv_chain m_equiv;
--
2.26.3
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 08/10] i386: add 'final' and 'override' to scalar_chain vfunc impls
2022-05-23 19:28 [PATCH 00/10] Add 'final' and 'override' where missing David Malcolm
` (6 preceding siblings ...)
2022-05-23 19:28 ` [PATCH 07/10] value-relation.h: add 'final' and 'override' to relation_oracle " David Malcolm
@ 2022-05-23 19:28 ` David Malcolm
2022-06-13 18:30 ` PING: " David Malcolm
2022-05-23 19:28 ` [PATCH 09/10] tree-vect-slp-patterns.cc: add 'final' and 'override' to vect_pattern::build impls David Malcolm
` (2 subsequent siblings)
10 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-05-23 19:28 UTC (permalink / raw)
To: gcc-patches
gcc/ChangeLog:
* config/i386/i386-features.h: Add "final" and "override" to
scalar_chain vfunc implementations as appropriate.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
---
gcc/config/i386/i386-features.h | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/gcc/config/i386/i386-features.h b/gcc/config/i386/i386-features.h
index 5c307607ae5..f46a6d95b74 100644
--- a/gcc/config/i386/i386-features.h
+++ b/gcc/config/i386/i386-features.h
@@ -169,18 +169,18 @@ class general_scalar_chain : public scalar_chain
public:
general_scalar_chain (enum machine_mode smode_, enum machine_mode vmode_);
~general_scalar_chain ();
- int compute_convert_gain ();
+ int compute_convert_gain () final override;
private:
hash_map<rtx, rtx> defs_map;
bitmap insns_conv;
unsigned n_sse_to_integer;
unsigned n_integer_to_sse;
- void mark_dual_mode_def (df_ref def);
- void convert_insn (rtx_insn *insn);
+ void mark_dual_mode_def (df_ref def) final override;
+ void convert_insn (rtx_insn *insn) final override;
void convert_op (rtx *op, rtx_insn *insn);
void convert_reg (rtx_insn *insn, rtx dst, rtx src);
void make_vector_copies (rtx_insn *, rtx);
- void convert_registers ();
+ void convert_registers () final override;
int vector_const_cost (rtx exp);
};
@@ -190,14 +190,14 @@ class timode_scalar_chain : public scalar_chain
timode_scalar_chain () : scalar_chain (TImode, V1TImode) {}
/* Convert from TImode to V1TImode is always faster. */
- int compute_convert_gain () { return 1; }
+ int compute_convert_gain () final override { return 1; }
private:
- void mark_dual_mode_def (df_ref def);
+ void mark_dual_mode_def (df_ref def) final override;
void fix_debug_reg_uses (rtx reg);
- void convert_insn (rtx_insn *insn);
+ void convert_insn (rtx_insn *insn) final override;
/* We don't convert registers to difference size. */
- void convert_registers () {}
+ void convert_registers () final override {}
};
} // anon namespace
--
2.26.3
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 09/10] tree-vect-slp-patterns.cc: add 'final' and 'override' to vect_pattern::build impls
2022-05-23 19:28 [PATCH 00/10] Add 'final' and 'override' where missing David Malcolm
` (7 preceding siblings ...)
2022-05-23 19:28 ` [PATCH 08/10] i386: add 'final' and 'override' to scalar_chain " David Malcolm
@ 2022-05-23 19:28 ` David Malcolm
2022-05-24 6:44 ` Richard Biener
2022-05-23 19:28 ` [PATCH 10/10] Add 'final' and 'override' in various places David Malcolm
2022-05-25 3:29 ` [PATCH 00/10] Add 'final' and 'override' where missing Eric Gallager
10 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-05-23 19:28 UTC (permalink / raw)
To: gcc-patches
gcc/ChangeLog:
* tree-vect-slp-patterns.cc: Add "final" and "override" to
vect_pattern::build impls as appropriate.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
---
gcc/tree-vect-slp-patterns.cc | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/tree-vect-slp-patterns.cc b/gcc/tree-vect-slp-patterns.cc
index a6b0d106d5f..e6a6db8beba 100644
--- a/gcc/tree-vect-slp-patterns.cc
+++ b/gcc/tree-vect-slp-patterns.cc
@@ -492,7 +492,7 @@ class complex_pattern : public vect_pattern
}
public:
- void build (vec_info *);
+ void build (vec_info *) override;
static internal_fn
matches (complex_operation_t op, slp_tree_to_load_perm_map_t *, slp_tree *,
@@ -595,7 +595,7 @@ class complex_add_pattern : public complex_pattern
}
public:
- void build (vec_info *);
+ void build (vec_info *) final override;
static internal_fn
matches (complex_operation_t op, slp_tree_to_load_perm_map_t *,
slp_compat_nodes_map_t *, slp_tree *, vec<slp_tree> *);
@@ -977,7 +977,7 @@ class complex_mul_pattern : public complex_pattern
}
public:
- void build (vec_info *);
+ void build (vec_info *) final override;
static internal_fn
matches (complex_operation_t op, slp_tree_to_load_perm_map_t *,
slp_compat_nodes_map_t *, slp_tree *, vec<slp_tree> *);
@@ -1204,7 +1204,7 @@ class complex_fms_pattern : public complex_pattern
}
public:
- void build (vec_info *);
+ void build (vec_info *) final override;
static internal_fn
matches (complex_operation_t op, slp_tree_to_load_perm_map_t *,
slp_compat_nodes_map_t *, slp_tree *, vec<slp_tree> *);
@@ -1380,7 +1380,7 @@ class complex_operations_pattern : public complex_pattern
}
public:
- void build (vec_info *);
+ void build (vec_info *) final override;
static internal_fn
matches (complex_operation_t op, slp_tree_to_load_perm_map_t *,
slp_compat_nodes_map_t *, slp_tree *, vec<slp_tree> *);
@@ -1446,7 +1446,7 @@ class addsub_pattern : public vect_pattern
addsub_pattern (slp_tree *node, internal_fn ifn)
: vect_pattern (node, NULL, ifn) {};
- void build (vec_info *);
+ void build (vec_info *) final override;
static vect_pattern*
recognize (slp_tree_to_load_perm_map_t *, slp_compat_nodes_map_t *,
--
2.26.3
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 10/10] Add 'final' and 'override' in various places
2022-05-23 19:28 [PATCH 00/10] Add 'final' and 'override' where missing David Malcolm
` (8 preceding siblings ...)
2022-05-23 19:28 ` [PATCH 09/10] tree-vect-slp-patterns.cc: add 'final' and 'override' to vect_pattern::build impls David Malcolm
@ 2022-05-23 19:28 ` David Malcolm
2022-06-13 18:30 ` PING " David Malcolm
2022-05-25 3:29 ` [PATCH 00/10] Add 'final' and 'override' where missing Eric Gallager
10 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-05-23 19:28 UTC (permalink / raw)
To: gcc-patches
gcc/cp/ChangeLog:
* cxx-pretty-print.h: Add "final" and "override" to various vfunc
implementations, removing redundant "virtual" as appropriate.
* module.cc: Likewise.
gcc/ChangeLog:
* genmatch.cc: Add "final" and "override" to various vfunc
implementations, removing redundant "virtual" as appropriate.
* gensupport.cc: Likewise.
* gimple-range-cache.h: Likewise.
* ipa-icf-gimple.h: Likewise.
* ipa-icf.h: Likewise.
* read-md.h: Likewise.
* read-rtl-function.cc: Likewise.
* tree-ssa-loop-ch.cc: Likewise.
* tree-ssa-sccvn.cc: Likewise.
gcc/lto/ChangeLog:
* lto-dump.cc: Add "final" and "override" to various vfunc
implementations, removing redundant "virtual" as appropriate.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
---
gcc/cp/cxx-pretty-print.h | 38 +++++++++++++++++++-------------------
gcc/cp/module.cc | 4 ++--
gcc/genmatch.cc | 22 +++++++++++-----------
gcc/gensupport.cc | 2 +-
gcc/gimple-range-cache.h | 4 ++--
gcc/ipa-icf-gimple.h | 6 ++++--
gcc/ipa-icf.h | 36 ++++++++++++++++++++----------------
gcc/lto/lto-dump.cc | 8 ++++----
gcc/read-md.h | 2 +-
gcc/read-rtl-function.cc | 6 +++---
gcc/tree-ssa-loop-ch.cc | 4 ++--
gcc/tree-ssa-sccvn.cc | 4 ++--
12 files changed, 71 insertions(+), 65 deletions(-)
diff --git a/gcc/cp/cxx-pretty-print.h b/gcc/cp/cxx-pretty-print.h
index 5080f70a8e4..593bd91d4f7 100644
--- a/gcc/cp/cxx-pretty-print.h
+++ b/gcc/cp/cxx-pretty-print.h
@@ -36,25 +36,25 @@ public:
pretty_printer *clone () const override;
- void constant (tree);
- void id_expression (tree);
- void primary_expression (tree);
- void postfix_expression (tree);
- void unary_expression (tree);
- void multiplicative_expression (tree);
- void conditional_expression (tree);
- void assignment_expression (tree);
- void expression (tree);
- void type_id (tree);
- void statement (tree);
- void declaration (tree);
- void declaration_specifiers (tree);
- void simple_type_specifier (tree);
- void function_specifier (tree);
- void declarator (tree);
- void direct_declarator (tree);
- void abstract_declarator (tree);
- void direct_abstract_declarator (tree);
+ void constant (tree) final override;
+ void id_expression (tree) final override;
+ void primary_expression (tree) final override;
+ void postfix_expression (tree) final override;
+ void unary_expression (tree) final override;
+ void multiplicative_expression (tree) final override;
+ void conditional_expression (tree) final override;
+ void assignment_expression (tree) final override;
+ void expression (tree) final override;
+ void type_id (tree) final override;
+ void statement (tree) final override;
+ void declaration (tree) final override;
+ void declaration_specifiers (tree) final override;
+ void simple_type_specifier (tree) final override;
+ void function_specifier (tree) final override;
+ void declarator (tree) final override;
+ void direct_declarator (tree) final override;
+ void abstract_declarator (tree) final override;
+ void direct_abstract_declarator (tree) final override;
/* This is the enclosing scope of the entity being pretty-printed. */
tree enclosing_scope;
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index d1dc73724d1..e93151c98c2 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -1483,10 +1483,10 @@ private:
protected:
using allocator::grow;
- virtual char *grow (char *, unsigned needed);
+ char *grow (char *, unsigned needed) final override;
#if MAPPED_WRITING
using allocator::shrink;
- virtual void shrink (char *);
+ void shrink (char *) final override;
#endif
public:
diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc
index 2b84b849330..a0b22c50ae3 100644
--- a/gcc/genmatch.cc
+++ b/gcc/genmatch.cc
@@ -723,9 +723,9 @@ public:
bool force_leaf;
/* If non-zero, the group for optional handling. */
unsigned char opt_grp;
- virtual void gen_transform (FILE *f, int, const char *, bool, int,
- const char *, capture_info *,
- dt_operand ** = 0, int = 0);
+ void gen_transform (FILE *f, int, const char *, bool, int,
+ const char *, capture_info *,
+ dt_operand ** = 0, int = 0) override;
};
/* An operator that is represented by native C code. This is always
@@ -757,9 +757,9 @@ public:
unsigned nr_stmts;
/* The identifier replacement vector. */
vec<id_tab> ids;
- virtual void gen_transform (FILE *f, int, const char *, bool, int,
- const char *, capture_info *,
- dt_operand ** = 0, int = 0);
+ void gen_transform (FILE *f, int, const char *, bool, int,
+ const char *, capture_info *,
+ dt_operand ** = 0, int = 0) final override;
};
/* A wrapper around another operand that captures its value. */
@@ -778,9 +778,9 @@ public:
bool value_match;
/* The captured value. */
operand *what;
- virtual void gen_transform (FILE *f, int, const char *, bool, int,
- const char *, capture_info *,
- dt_operand ** = 0, int = 0);
+ void gen_transform (FILE *f, int, const char *, bool, int,
+ const char *, capture_info *,
+ dt_operand ** = 0, int = 0) final override;
};
/* if expression. */
@@ -1655,7 +1655,7 @@ public:
: dt_node (type, parent_), op (op_), match_dop (match_dop_),
pos (pos_), value_match (false), for_id (current_id) {}
- void gen (FILE *, int, bool, int);
+ void gen (FILE *, int, bool, int) final override;
unsigned gen_predicate (FILE *, int, const char *, bool);
unsigned gen_match_op (FILE *, int, const char *, bool);
@@ -1681,7 +1681,7 @@ public:
indexes (indexes_), info (NULL) {}
void gen_1 (FILE *, int, bool, operand *);
- void gen (FILE *f, int, bool, int);
+ void gen (FILE *f, int, bool, int) final override;
};
template<>
diff --git a/gcc/gensupport.cc b/gcc/gensupport.cc
index 42680499d86..8fcacf8f9d2 100644
--- a/gcc/gensupport.cc
+++ b/gcc/gensupport.cc
@@ -2310,7 +2310,7 @@ class gen_reader : public rtx_reader
{
public:
gen_reader () : rtx_reader (false) {}
- void handle_unknown_directive (file_location, const char *);
+ void handle_unknown_directive (file_location, const char *) final override;
};
void
diff --git a/gcc/gimple-range-cache.h b/gcc/gimple-range-cache.h
index 555fe32513f..d768f418f0d 100644
--- a/gcc/gimple-range-cache.h
+++ b/gcc/gimple-range-cache.h
@@ -77,8 +77,8 @@ public:
ranger_cache (int not_executable_flag, bool use_imm_uses);
~ranger_cache ();
- virtual bool range_of_expr (irange &r, tree name, gimple *stmt);
- virtual bool range_on_edge (irange &r, edge e, tree expr);
+ bool range_of_expr (irange &r, tree name, gimple *stmt) final override;
+ bool range_on_edge (irange &r, edge e, tree expr) final override;
bool block_range (irange &r, basic_block bb, tree name, bool calc = true);
bool get_global_range (irange &r, tree name) const;
diff --git a/gcc/ipa-icf-gimple.h b/gcc/ipa-icf-gimple.h
index 1545e4a5905..8f498b31eef 100644
--- a/gcc/ipa-icf-gimple.h
+++ b/gcc/ipa-icf-gimple.h
@@ -282,11 +282,13 @@ private:
public:
/* Return true if two operands are equal. The flags fields can be used
to specify OEP flags described above. */
- virtual bool operand_equal_p (const_tree, const_tree, unsigned int flags);
+ bool operand_equal_p (const_tree, const_tree, unsigned int flags)
+ final override;
/* Generate a hash value for an expression. This can be used iteratively
by passing a previous result as the HSTATE argument. */
- virtual void hash_operand (const_tree, inchash::hash &, unsigned flags);
+ void hash_operand (const_tree, inchash::hash &, unsigned flags)
+ final override;
void hash_operand (const_tree, inchash::hash &, unsigned flags,
operand_access_type access);
};
diff --git a/gcc/ipa-icf.h b/gcc/ipa-icf.h
index dbae2cca02b..bb550923ad4 100644
--- a/gcc/ipa-icf.h
+++ b/gcc/ipa-icf.h
@@ -317,16 +317,18 @@ public:
~sem_function ();
- virtual void init (ipa_icf_gimple::func_checker *);
- virtual bool equals_wpa (sem_item *item,
- hash_map <symtab_node *, sem_item *> &ignored_nodes);
- virtual hashval_t get_hash (void);
- virtual bool equals (sem_item *item,
- hash_map <symtab_node *, sem_item *> &ignored_nodes);
- virtual bool merge (sem_item *alias_item);
+ void init (ipa_icf_gimple::func_checker *) final override;
+ bool equals_wpa (sem_item *item,
+ hash_map <symtab_node *, sem_item *> &ignored_nodes)
+ final override;
+ hashval_t get_hash (void) final override;
+ bool equals (sem_item *item,
+ hash_map <symtab_node *, sem_item *> &ignored_nodes)
+ final override;
+ bool merge (sem_item *alias_item) final override;
/* Dump symbol to FILE. */
- virtual void dump_to_file (FILE *file)
+ void dump_to_file (FILE *file) final override
{
gcc_assert (file);
dump_function_to_file (decl, file, TDF_DETAILS);
@@ -426,17 +428,19 @@ public:
sem_variable (varpool_node *_node, bitmap_obstack *stack);
/* Semantic variable initialization function. */
- virtual void init (ipa_icf_gimple::func_checker *);
+ void init (ipa_icf_gimple::func_checker *) final override;
- virtual hashval_t get_hash (void);
- virtual bool merge (sem_item *alias_item);
- virtual void dump_to_file (FILE *file);
- virtual bool equals (sem_item *item,
- hash_map <symtab_node *, sem_item *> &ignored_nodes);
+ hashval_t get_hash (void) final override;
+ bool merge (sem_item *alias_item) final override;
+ void dump_to_file (FILE *file) final override;
+ bool equals (sem_item *item,
+ hash_map <symtab_node *, sem_item *> &ignored_nodes)
+ final override;
/* Fast equality variable based on knowledge known in WPA. */
- virtual bool equals_wpa (sem_item *item,
- hash_map <symtab_node *, sem_item *> &ignored_nodes);
+ bool equals_wpa (sem_item *item,
+ hash_map <symtab_node *, sem_item *> &ignored_nodes)
+ final override;
/* Returns varpool_node. */
inline varpool_node *get_node (void)
diff --git a/gcc/lto/lto-dump.cc b/gcc/lto/lto-dump.cc
index 1fb3fb86fb5..f88486b5143 100644
--- a/gcc/lto/lto-dump.cc
+++ b/gcc/lto/lto-dump.cc
@@ -80,7 +80,7 @@ public:
virtual ~variable_entry ()
{}
- virtual size_t get_size () const
+ size_t get_size () const final override
{
varpool_node *vnode = dyn_cast<varpool_node *> (node);
if (DECL_SIZE (vnode->decl) && tree_fits_shwi_p (DECL_SIZE (vnode->decl)))
@@ -88,7 +88,7 @@ public:
return 0;
}
- virtual void dump ()
+ void dump () final override
{
symbol_entry :: dump ();
varpool_node *vnode = dyn_cast<varpool_node *> (node);
@@ -111,13 +111,13 @@ public:
virtual ~function_entry ()
{}
- virtual void dump ()
+ void dump () final override
{
symbol_entry :: dump ();
printf ("\n");
}
- virtual size_t get_size () const
+ size_t get_size () const final override
{
cgraph_node *cnode = dyn_cast<cgraph_node *> (node);
gcc_assert (cnode);
diff --git a/gcc/read-md.h b/gcc/read-md.h
index 34a64fa93a2..7d8cd4a8336 100644
--- a/gcc/read-md.h
+++ b/gcc/read-md.h
@@ -330,7 +330,7 @@ class noop_reader : public md_reader
noop_reader () : md_reader (false) {}
/* A dummy implementation which skips unknown directives. */
- void handle_unknown_directive (file_location, const char *);
+ void handle_unknown_directive (file_location, const char *) override;
};
/* An md_reader subclass that actually handles full hierarchical
diff --git a/gcc/read-rtl-function.cc b/gcc/read-rtl-function.cc
index eacbe4c1200..3bcff1540e7 100644
--- a/gcc/read-rtl-function.cc
+++ b/gcc/read-rtl-function.cc
@@ -188,7 +188,7 @@ class fixup_insn_uid : public operand_fixup
m_insn_uid (insn_uid)
{}
- void apply (function_reader *reader) const;
+ void apply (function_reader *reader) const final override;
private:
int m_insn_uid;
@@ -206,7 +206,7 @@ class fixup_note_insn_basic_block : public operand_fixup
m_bb_idx (bb_idx)
{}
- void apply (function_reader *reader) const;
+ void apply (function_reader *reader) const final override;
private:
int m_bb_idx;
@@ -225,7 +225,7 @@ class fixup_expr : public fixup
~fixup_expr () { free (m_desc); }
- void apply (function_reader *reader) const;
+ void apply (function_reader *reader) const final override;
private:
char *m_desc;
diff --git a/gcc/tree-ssa-loop-ch.cc b/gcc/tree-ssa-loop-ch.cc
index 9ab63d1fa0c..d1391940c2b 100644
--- a/gcc/tree-ssa-loop-ch.cc
+++ b/gcc/tree-ssa-loop-ch.cc
@@ -320,7 +320,7 @@ public:
protected:
/* ch_base method: */
- virtual bool process_loop_p (class loop *loop);
+ bool process_loop_p (class loop *loop) final override;
}; // class pass_ch
const pass_data pass_data_ch_vect =
@@ -358,7 +358,7 @@ public:
protected:
/* ch_base method: */
- virtual bool process_loop_p (class loop *loop);
+ bool process_loop_p (class loop *loop) final override;
}; // class pass_ch_vect
/* For all loops, copy the condition at the end of the loop body in front
diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc
index 7407591e98c..b2f35a5fb55 100644
--- a/gcc/tree-ssa-sccvn.cc
+++ b/gcc/tree-ssa-sccvn.cc
@@ -2534,9 +2534,9 @@ public:
: eliminate_dom_walker (CDI_DOMINATORS, NULL), entry (entry_),
m_avail_freelist (NULL) {}
- virtual tree eliminate_avail (basic_block, tree op);
+ tree eliminate_avail (basic_block, tree op) final override;
- virtual void eliminate_push_avail (basic_block, tree);
+ void eliminate_push_avail (basic_block, tree) final override;
basic_block entry;
/* Freelist of avail entries which are allocated from the vn_ssa_aux
--
2.26.3
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 09/10] tree-vect-slp-patterns.cc: add 'final' and 'override' to vect_pattern::build impls
2022-05-23 19:28 ` [PATCH 09/10] tree-vect-slp-patterns.cc: add 'final' and 'override' to vect_pattern::build impls David Malcolm
@ 2022-05-24 6:44 ` Richard Biener
0 siblings, 0 replies; 39+ messages in thread
From: Richard Biener @ 2022-05-24 6:44 UTC (permalink / raw)
To: David Malcolm; +Cc: GCC Patches
On Mon, May 23, 2022 at 9:36 PM David Malcolm via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> gcc/ChangeLog:
> * tree-vect-slp-patterns.cc: Add "final" and "override" to
> vect_pattern::build impls as appropriate.
OK.
> Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> ---
> gcc/tree-vect-slp-patterns.cc | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/gcc/tree-vect-slp-patterns.cc b/gcc/tree-vect-slp-patterns.cc
> index a6b0d106d5f..e6a6db8beba 100644
> --- a/gcc/tree-vect-slp-patterns.cc
> +++ b/gcc/tree-vect-slp-patterns.cc
> @@ -492,7 +492,7 @@ class complex_pattern : public vect_pattern
> }
>
> public:
> - void build (vec_info *);
> + void build (vec_info *) override;
>
> static internal_fn
> matches (complex_operation_t op, slp_tree_to_load_perm_map_t *, slp_tree *,
> @@ -595,7 +595,7 @@ class complex_add_pattern : public complex_pattern
> }
>
> public:
> - void build (vec_info *);
> + void build (vec_info *) final override;
> static internal_fn
> matches (complex_operation_t op, slp_tree_to_load_perm_map_t *,
> slp_compat_nodes_map_t *, slp_tree *, vec<slp_tree> *);
> @@ -977,7 +977,7 @@ class complex_mul_pattern : public complex_pattern
> }
>
> public:
> - void build (vec_info *);
> + void build (vec_info *) final override;
> static internal_fn
> matches (complex_operation_t op, slp_tree_to_load_perm_map_t *,
> slp_compat_nodes_map_t *, slp_tree *, vec<slp_tree> *);
> @@ -1204,7 +1204,7 @@ class complex_fms_pattern : public complex_pattern
> }
>
> public:
> - void build (vec_info *);
> + void build (vec_info *) final override;
> static internal_fn
> matches (complex_operation_t op, slp_tree_to_load_perm_map_t *,
> slp_compat_nodes_map_t *, slp_tree *, vec<slp_tree> *);
> @@ -1380,7 +1380,7 @@ class complex_operations_pattern : public complex_pattern
> }
>
> public:
> - void build (vec_info *);
> + void build (vec_info *) final override;
> static internal_fn
> matches (complex_operation_t op, slp_tree_to_load_perm_map_t *,
> slp_compat_nodes_map_t *, slp_tree *, vec<slp_tree> *);
> @@ -1446,7 +1446,7 @@ class addsub_pattern : public vect_pattern
> addsub_pattern (slp_tree *node, internal_fn ifn)
> : vect_pattern (node, NULL, ifn) {};
>
> - void build (vec_info *);
> + void build (vec_info *) final override;
>
> static vect_pattern*
> recognize (slp_tree_to_load_perm_map_t *, slp_compat_nodes_map_t *,
> --
> 2.26.3
>
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 06/10] ipa: add 'final' and 'override' to call_summary_base vfunc impls
2022-05-23 19:28 ` [PATCH 06/10] ipa: add 'final' and 'override' to call_summary_base vfunc impls David Malcolm
@ 2022-05-24 7:36 ` Martin Liška
0 siblings, 0 replies; 39+ messages in thread
From: Martin Liška @ 2022-05-24 7:36 UTC (permalink / raw)
To: David Malcolm, gcc-patches
On 5/23/22 21:28, David Malcolm via Gcc-patches wrote:
> gcc/ChangeLog:
> * ipa-cp.cc: Add "final" and "override" to call_summary_base vfunc
> implementations, removing redundant "virtual" as appropriate.
> * ipa-fnsummary.h: Likewise.
> * ipa-modref.cc: Likewise.
> * ipa-param-manipulation.cc: Likewise.
> * ipa-profile.cc: Likewise.
> * ipa-prop.h: Likewise.
> * ipa-pure-const.cc: Likewise.
> * ipa-reference.cc: Likewise.
> * ipa-sra.cc: Likewise.
> * symbol-summary.h: Likewise.
> * symtab-thunks.cc: Likewise.
>
> Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Ok.
Martin
> ---
> gcc/ipa-cp.cc | 6 +++---
> gcc/ipa-fnsummary.h | 21 ++++++++++----------
> gcc/ipa-modref.cc | 36 +++++++++++++++++------------------
> gcc/ipa-param-manipulation.cc | 8 ++++----
> gcc/ipa-profile.cc | 6 +++---
> gcc/ipa-prop.h | 26 ++++++++++++-------------
> gcc/ipa-pure-const.cc | 8 ++++----
> gcc/ipa-reference.cc | 10 +++++-----
> gcc/ipa-sra.cc | 14 +++++++-------
> gcc/symbol-summary.h | 8 ++++----
> gcc/symtab-thunks.cc | 8 ++++----
> 11 files changed, 76 insertions(+), 75 deletions(-)
>
> diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc
> index 38a21b17e39..bb2d611cbcd 100644
> --- a/gcc/ipa-cp.cc
> +++ b/gcc/ipa-cp.cc
> @@ -4190,9 +4190,9 @@ public:
> m_initialize_when_cloning = true;
> }
>
> - virtual void duplicate (cgraph_edge *src_edge, cgraph_edge *dst_edge,
> - edge_clone_summary *src_data,
> - edge_clone_summary *dst_data);
> + void duplicate (cgraph_edge *src_edge, cgraph_edge *dst_edge,
> + edge_clone_summary *src_data,
> + edge_clone_summary *dst_data) final override;
> };
>
> /* Edge duplication hook. */
> diff --git a/gcc/ipa-fnsummary.h b/gcc/ipa-fnsummary.h
> index e1f1d1b839c..941fea6de0d 100644
> --- a/gcc/ipa-fnsummary.h
> +++ b/gcc/ipa-fnsummary.h
> @@ -236,14 +236,15 @@ public:
> /* Remove ipa_fn_summary for all callees of NODE. */
> void remove_callees (cgraph_node *node);
>
> - virtual void insert (cgraph_node *, ipa_fn_summary *);
> - virtual void remove (cgraph_node *node, ipa_fn_summary *)
> + void insert (cgraph_node *, ipa_fn_summary *) final override;
> + void remove (cgraph_node *node, ipa_fn_summary *) final override
> {
> remove_callees (node);
> }
>
> - virtual void duplicate (cgraph_node *src, cgraph_node *dst,
> - ipa_fn_summary *src_data, ipa_fn_summary *dst_data);
> + void duplicate (cgraph_node *src, cgraph_node *dst,
> + ipa_fn_summary *src_data, ipa_fn_summary *dst_data)
> + final override;
> };
>
> extern GTY(()) fast_function_summary <ipa_fn_summary *, va_gc>
> @@ -259,9 +260,9 @@ public:
> disable_insertion_hook ();
> }
>
> - virtual void duplicate (cgraph_node *, cgraph_node *,
> - ipa_size_summary *src_data,
> - ipa_size_summary *dst_data)
> + void duplicate (cgraph_node *, cgraph_node *,
> + ipa_size_summary *src_data,
> + ipa_size_summary *dst_data) final override
> {
> *dst_data = *src_data;
> }
> @@ -311,9 +312,9 @@ public:
> fast_call_summary <ipa_call_summary *, va_heap> (symtab) {}
>
> /* Hook that is called by summary when an edge is duplicated. */
> - virtual void duplicate (cgraph_edge *src, cgraph_edge *dst,
> - ipa_call_summary *src_data,
> - ipa_call_summary *dst_data);
> + void duplicate (cgraph_edge *src, cgraph_edge *dst,
> + ipa_call_summary *src_data,
> + ipa_call_summary *dst_data) final override;
> };
>
> /* Estimated execution times, code sizes and other information about the
> diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc
> index 7c1f974bc7a..0d9abacf0a6 100644
> --- a/gcc/ipa-modref.cc
> +++ b/gcc/ipa-modref.cc
> @@ -119,10 +119,10 @@ public:
> fnspec_summaries_t (symbol_table *symtab)
> : call_summary <fnspec_summary *> (symtab) {}
> /* Hook that is called by summary when an edge is duplicated. */
> - virtual void duplicate (cgraph_edge *,
> - cgraph_edge *,
> - fnspec_summary *src,
> - fnspec_summary *dst)
> + void duplicate (cgraph_edge *,
> + cgraph_edge *,
> + fnspec_summary *src,
> + fnspec_summary *dst) final override
> {
> dst->fnspec = xstrdup (src->fnspec);
> }
> @@ -194,10 +194,10 @@ public:
> escape_summaries_t (symbol_table *symtab)
> : call_summary <escape_summary *> (symtab) {}
> /* Hook that is called by summary when an edge is duplicated. */
> - virtual void duplicate (cgraph_edge *,
> - cgraph_edge *,
> - escape_summary *src,
> - escape_summary *dst)
> + void duplicate (cgraph_edge *,
> + cgraph_edge *,
> + escape_summary *src,
> + escape_summary *dst) final override
> {
> dst->esc = src->esc.copy ();
> }
> @@ -217,11 +217,11 @@ class GTY((user)) modref_summaries
> public:
> modref_summaries (symbol_table *symtab)
> : fast_function_summary <modref_summary *, va_gc> (symtab) {}
> - virtual void insert (cgraph_node *, modref_summary *state);
> - virtual void duplicate (cgraph_node *src_node,
> - cgraph_node *dst_node,
> - modref_summary *src_data,
> - modref_summary *dst_data);
> + void insert (cgraph_node *, modref_summary *state) final override;
> + void duplicate (cgraph_node *src_node,
> + cgraph_node *dst_node,
> + modref_summary *src_data,
> + modref_summary *dst_data) final override;
> static modref_summaries *create_ggc (symbol_table *symtab)
> {
> return new (ggc_alloc_no_dtor<modref_summaries> ())
> @@ -241,11 +241,11 @@ public:
> modref_summaries_lto (symbol_table *symtab)
> : fast_function_summary <modref_summary_lto *, va_gc> (symtab),
> propagated (false) {}
> - virtual void insert (cgraph_node *, modref_summary_lto *state);
> - virtual void duplicate (cgraph_node *src_node,
> - cgraph_node *dst_node,
> - modref_summary_lto *src_data,
> - modref_summary_lto *dst_data);
> + void insert (cgraph_node *, modref_summary_lto *state) final override;
> + void duplicate (cgraph_node *src_node,
> + cgraph_node *dst_node,
> + modref_summary_lto *src_data,
> + modref_summary_lto *dst_data) final override;
> static modref_summaries_lto *create_ggc (symbol_table *symtab)
> {
> return new (ggc_alloc_no_dtor<modref_summaries_lto> ())
> diff --git a/gcc/ipa-param-manipulation.cc b/gcc/ipa-param-manipulation.cc
> index 38328c3e8d0..23a8cb84d48 100644
> --- a/gcc/ipa-param-manipulation.cc
> +++ b/gcc/ipa-param-manipulation.cc
> @@ -114,10 +114,10 @@ class ipa_edge_modification_sum
>
> /* Hook that is called by summary when an edge is duplicated. */
>
> - virtual void duplicate (cgraph_edge *,
> - cgraph_edge *,
> - ipa_edge_modification_info *old_info,
> - ipa_edge_modification_info *new_info)
> + void duplicate (cgraph_edge *,
> + cgraph_edge *,
> + ipa_edge_modification_info *old_info,
> + ipa_edge_modification_info *new_info) final override
> {
> new_info->index_map.safe_splice (old_info->index_map);
> new_info->pass_through_map.safe_splice (old_info->pass_through_map);
> diff --git a/gcc/ipa-profile.cc b/gcc/ipa-profile.cc
> index 496f292acba..e0acc5d0188 100644
> --- a/gcc/ipa-profile.cc
> +++ b/gcc/ipa-profile.cc
> @@ -198,9 +198,9 @@ public:
> {}
>
> /* Duplicate info when an edge is cloned. */
> - virtual void duplicate (cgraph_edge *, cgraph_edge *,
> - speculative_call_summary *old_sum,
> - speculative_call_summary *new_sum);
> + void duplicate (cgraph_edge *, cgraph_edge *,
> + speculative_call_summary *old_sum,
> + speculative_call_summary *new_sum) final override;
> };
>
> static ipa_profile_call_summaries *call_sums = NULL;
> diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
> index b22dfb5315c..8811e0ea987 100644
> --- a/gcc/ipa-prop.h
> +++ b/gcc/ipa-prop.h
> @@ -1004,10 +1004,10 @@ public:
> }
>
> /* Hook that is called by summary when a node is duplicated. */
> - virtual void duplicate (cgraph_node *node,
> - cgraph_node *node2,
> - ipa_node_params *data,
> - ipa_node_params *data2);
> + void duplicate (cgraph_node *node,
> + cgraph_node *node2,
> + ipa_node_params *data,
> + ipa_node_params *data2) final override;
> };
>
> /* Summary to manange ipa_edge_args structures. */
> @@ -1024,12 +1024,12 @@ class GTY((user)) ipa_edge_args_sum_t : public call_summary <ipa_edge_args *>
> }
>
> /* Hook that is called by summary when an edge is removed. */
> - virtual void remove (cgraph_edge *cs, ipa_edge_args *args);
> + void remove (cgraph_edge *cs, ipa_edge_args *args) final override;
> /* Hook that is called by summary when an edge is duplicated. */
> - virtual void duplicate (cgraph_edge *src,
> - cgraph_edge *dst,
> - ipa_edge_args *old_args,
> - ipa_edge_args *new_args);
> + void duplicate (cgraph_edge *src,
> + cgraph_edge *dst,
> + ipa_edge_args *old_args,
> + ipa_edge_args *new_args) final override;
> };
>
> /* Function summary where the parameter infos are actually stored. */
> @@ -1055,10 +1055,10 @@ public:
> return summary;
> }
> /* Hook that is called by summary when a node is duplicated. */
> - virtual void duplicate (cgraph_node *node,
> - cgraph_node *node2,
> - ipcp_transformation *data,
> - ipcp_transformation *data2);
> + void duplicate (cgraph_node *node,
> + cgraph_node *node2,
> + ipcp_transformation *data,
> + ipcp_transformation *data2) final override;
> };
>
> /* Function summary where the IPA CP transformations are actually stored. */
> diff --git a/gcc/ipa-pure-const.cc b/gcc/ipa-pure-const.cc
> index 0e55fc4bfc5..572a6da274f 100644
> --- a/gcc/ipa-pure-const.cc
> +++ b/gcc/ipa-pure-const.cc
> @@ -137,10 +137,10 @@ public:
> funct_state_summary_t (symbol_table *symtab):
> fast_function_summary <funct_state_d *, va_heap> (symtab) {}
>
> - virtual void insert (cgraph_node *, funct_state_d *state);
> - virtual void duplicate (cgraph_node *src_node, cgraph_node *dst_node,
> - funct_state_d *src_data,
> - funct_state_d *dst_data);
> + void insert (cgraph_node *, funct_state_d *state) final override;
> + void duplicate (cgraph_node *src_node, cgraph_node *dst_node,
> + funct_state_d *src_data,
> + funct_state_d *dst_data) final override;
> };
>
> static funct_state_summary_t *funct_state_summaries = NULL;
> diff --git a/gcc/ipa-reference.cc b/gcc/ipa-reference.cc
> index b5a2350ce72..bd6ee0d8c57 100644
> --- a/gcc/ipa-reference.cc
> +++ b/gcc/ipa-reference.cc
> @@ -133,11 +133,11 @@ public:
> ipa_ref_opt_summary_t (symbol_table *symtab):
> fast_function_summary <ipa_reference_optimization_summary_d *, va_heap> (symtab) {}
>
> - virtual void remove (cgraph_node *src_node,
> - ipa_reference_optimization_summary_d *data);
> - virtual void duplicate (cgraph_node *src_node, cgraph_node *dst_node,
> - ipa_reference_optimization_summary_d *src_data,
> - ipa_reference_optimization_summary_d *dst_data);
> + void remove (cgraph_node *src_node,
> + ipa_reference_optimization_summary_d *data) final override;
> + void duplicate (cgraph_node *src_node, cgraph_node *dst_node,
> + ipa_reference_optimization_summary_d *src_data,
> + ipa_reference_optimization_summary_d *dst_data) final override;
> };
>
> static ipa_ref_opt_summary_t *ipa_ref_opt_sum_summaries = NULL;
> diff --git a/gcc/ipa-sra.cc b/gcc/ipa-sra.cc
> index 4f705a3febf..2237ac6d92f 100644
> --- a/gcc/ipa-sra.cc
> +++ b/gcc/ipa-sra.cc
> @@ -376,10 +376,10 @@ public:
> ipa_sra_function_summaries (symbol_table *table, bool ggc):
> function_summary<isra_func_summary *> (table, ggc) { }
>
> - virtual void duplicate (cgraph_node *, cgraph_node *,
> - isra_func_summary *old_sum,
> - isra_func_summary *new_sum);
> - virtual void insert (cgraph_node *, isra_func_summary *);
> + void duplicate (cgraph_node *, cgraph_node *,
> + isra_func_summary *old_sum,
> + isra_func_summary *new_sum) final override;
> + void insert (cgraph_node *, isra_func_summary *) final override;
> };
>
> /* Hook that is called by summary when a node is duplicated. */
> @@ -458,9 +458,9 @@ public:
> call_summary<isra_call_summary *> (table) { }
>
> /* Duplicate info when an edge is cloned. */
> - virtual void duplicate (cgraph_edge *, cgraph_edge *,
> - isra_call_summary *old_sum,
> - isra_call_summary *new_sum);
> + void duplicate (cgraph_edge *, cgraph_edge *,
> + isra_call_summary *old_sum,
> + isra_call_summary *new_sum) final override;
> };
>
> static ipa_sra_call_summaries *call_sums;
> diff --git a/gcc/symbol-summary.h b/gcc/symbol-summary.h
> index c54d3084cc4..45fa250e3f9 100644
> --- a/gcc/symbol-summary.h
> +++ b/gcc/symbol-summary.h
> @@ -248,7 +248,7 @@ protected:
>
> private:
> /* Indication if we use ggc summary. */
> - virtual bool is_ggc ()
> + bool is_ggc () final override
> {
> return m_ggc;
> }
> @@ -439,7 +439,7 @@ public:
> void *data);
>
> private:
> - virtual bool is_ggc ();
> + bool is_ggc () final override;
>
> /* Summary is stored in the vector. */
> vec <T *, V> *m_vector;
> @@ -744,7 +744,7 @@ protected:
>
> private:
> /* Indication if we use ggc summary. */
> - virtual bool is_ggc ()
> + bool is_ggc () final override
> {
> return m_ggc;
> }
> @@ -910,7 +910,7 @@ public:
> void *data);
>
> private:
> - virtual bool is_ggc ();
> + bool is_ggc () final override;
>
> /* Summary is stored in the vector. */
> vec <T *, V> *m_vector;
> diff --git a/gcc/symtab-thunks.cc b/gcc/symtab-thunks.cc
> index 73f810dc217..b1d9c5ddb53 100644
> --- a/gcc/symtab-thunks.cc
> +++ b/gcc/symtab-thunks.cc
> @@ -71,10 +71,10 @@ public:
> function_summary<thunk_info *> (table, ggc) { }
>
> /* Hook that is called by summary when a node is duplicated. */
> - virtual void duplicate (cgraph_node *node,
> - cgraph_node *node2,
> - thunk_info *data,
> - thunk_info *data2);
> + void duplicate (cgraph_node *node,
> + cgraph_node *node2,
> + thunk_info *data,
> + thunk_info *data2) final override;
> };
>
> /* Duplication hook. */
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 05/10] d: add 'final' and 'override' to gcc/d/*.cc 'visit' impls
2022-05-23 19:28 ` [PATCH 05/10] d: add 'final' and 'override' to gcc/d/*.cc 'visit' impls David Malcolm
@ 2022-05-24 12:56 ` Iain Buclaw
2022-05-24 13:15 ` David Malcolm
0 siblings, 1 reply; 39+ messages in thread
From: Iain Buclaw @ 2022-05-24 12:56 UTC (permalink / raw)
To: David Malcolm, gcc-patches
Excerpts from David Malcolm via Gcc-patches's message of Mai 23, 2022 9:28 pm:
> gcc/d/ChangeLog:
> * decl.cc: Add "final" and "override" to all "visit" vfunc decls
> as appropriate.
> * expr.cc: Likewise.
> * toir.cc: Likewise.
> * typeinfo.cc: Likewise.
> * types.cc: Likewise.
>
> Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Thanks David!
Looks OK to me.
Iain.
> ---
> gcc/d/decl.cc | 36 +++++++++++++-------------
> gcc/d/expr.cc | 2 +-
> gcc/d/toir.cc | 64 +++++++++++++++++++++++------------------------
> gcc/d/typeinfo.cc | 34 ++++++++++++-------------
> gcc/d/types.cc | 30 +++++++++++-----------
> 5 files changed, 83 insertions(+), 83 deletions(-)
>
> diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
> index f5c21078aad..5d850065bf0 100644
> --- a/gcc/d/decl.cc
> +++ b/gcc/d/decl.cc
> @@ -149,13 +149,13 @@ public:
>
> /* This should be overridden by each declaration class. */
>
> - void visit (Dsymbol *)
> + void visit (Dsymbol *) final override
> {
> }
>
> /* Compile a D module, and all members of it. */
>
> - void visit (Module *d)
> + void visit (Module *d) final override
> {
> if (d->semanticRun >= PASS::obj)
> return;
> @@ -166,7 +166,7 @@ public:
>
> /* Write the imported symbol to debug. */
>
> - void visit (Import *d)
> + void visit (Import *d) final override
> {
> if (d->semanticRun >= PASS::obj)
> return;
> @@ -218,7 +218,7 @@ public:
>
> /* Expand any local variables found in tuples. */
>
> - void visit (TupleDeclaration *d)
> + void visit (TupleDeclaration *d) final override
> {
> for (size_t i = 0; i < d->objects->length; i++)
> {
> @@ -234,7 +234,7 @@ public:
>
> /* Walk over all declarations in the attribute scope. */
>
> - void visit (AttribDeclaration *d)
> + void visit (AttribDeclaration *d) final override
> {
> Dsymbols *ds = d->include (NULL);
>
> @@ -248,7 +248,7 @@ public:
> /* Pragmas are a way to pass special information to the compiler and to add
> vendor specific extensions to D. */
>
> - void visit (PragmaDeclaration *d)
> + void visit (PragmaDeclaration *d) final override
> {
> if (d->ident == Identifier::idPool ("lib")
> || d->ident == Identifier::idPool ("startaddress"))
> @@ -266,7 +266,7 @@ public:
> /* Conditional compilation is the process of selecting which code to compile
> and which code to not compile. Look for version conditions that may */
>
> - void visit (ConditionalDeclaration *d)
> + void visit (ConditionalDeclaration *d) final override
> {
> bool old_condition = this->in_version_unittest_;
>
> @@ -284,7 +284,7 @@ public:
>
> /* Walk over all members in the namespace scope. */
>
> - void visit (Nspace *d)
> + void visit (Nspace *d) final override
> {
> if (isError (d) || !d->members)
> return;
> @@ -298,7 +298,7 @@ public:
> voldemort type, then it's members must be compiled before the parent
> function finishes. */
>
> - void visit (TemplateDeclaration *d)
> + void visit (TemplateDeclaration *d) final override
> {
> /* Type cannot be directly named outside of the scope it's declared in, so
> the only way it can be escaped is if the function has auto return. */
> @@ -329,7 +329,7 @@ public:
>
> /* Walk over all members in the instantiated template. */
>
> - void visit (TemplateInstance *d)
> + void visit (TemplateInstance *d) final override
> {
> if (isError (d)|| !d->members)
> return;
> @@ -343,7 +343,7 @@ public:
>
> /* Walk over all members in the mixin template scope. */
>
> - void visit (TemplateMixin *d)
> + void visit (TemplateMixin *d) final override
> {
> if (isError (d)|| !d->members)
> return;
> @@ -355,7 +355,7 @@ public:
> /* Write out compiler generated TypeInfo, initializer and functions for the
> given struct declaration, walking over all static members. */
>
> - void visit (StructDeclaration *d)
> + void visit (StructDeclaration *d) final override
> {
> if (d->semanticRun >= PASS::obj)
> return;
> @@ -470,7 +470,7 @@ public:
> /* Write out compiler generated TypeInfo, initializer and vtables for the
> given class declaration, walking over all static members. */
>
> - void visit (ClassDeclaration *d)
> + void visit (ClassDeclaration *d) final override
> {
> if (d->semanticRun >= PASS::obj)
> return;
> @@ -544,7 +544,7 @@ public:
> /* Write out compiler generated TypeInfo and vtables for the given interface
> declaration, walking over all static members. */
>
> - void visit (InterfaceDeclaration *d)
> + void visit (InterfaceDeclaration *d) final override
> {
> if (d->semanticRun >= PASS::obj)
> return;
> @@ -587,7 +587,7 @@ public:
> /* Write out compiler generated TypeInfo and initializer for the given
> enum declaration. */
>
> - void visit (EnumDeclaration *d)
> + void visit (EnumDeclaration *d) final override
> {
> if (d->semanticRun >= PASS::obj)
> return;
> @@ -626,7 +626,7 @@ public:
> /* Finish up a variable declaration and push it into the current scope.
> This can either be a static, local or manifest constant. */
>
> - void visit (VarDeclaration *d)
> + void visit (VarDeclaration *d) final override
> {
> if (d->semanticRun >= PASS::obj)
> return;
> @@ -753,7 +753,7 @@ public:
> /* Generate and compile a static TypeInfo declaration, but only if it is
> needed in the current compilation. */
>
> - void visit (TypeInfoDeclaration *d)
> + void visit (TypeInfoDeclaration *d) final override
> {
> if (d->semanticRun >= PASS::obj)
> return;
> @@ -770,7 +770,7 @@ public:
> /* Finish up a function declaration and compile it all the way
> down to assembler language output. */
>
> - void visit (FuncDeclaration *d)
> + void visit (FuncDeclaration *d) final override
> {
> /* Already generated the function. */
> if (d->semanticRun >= PASS::obj)
> diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc
> index 7f5e683a676..c259e7df6d5 100644
> --- a/gcc/d/expr.cc
> +++ b/gcc/d/expr.cc
> @@ -2556,7 +2556,7 @@ public:
> /* Build a tuple literal. Just an argument list that may have
> side effects that need evaluation. */
>
> - void visit (TupleExp *e)
> + void visit (TupleExp *e) final override
> {
> tree result = NULL_TREE;
>
> diff --git a/gcc/d/toir.cc b/gcc/d/toir.cc
> index d20c5c3b927..50d44156cca 100644
> --- a/gcc/d/toir.cc
> +++ b/gcc/d/toir.cc
> @@ -534,7 +534,7 @@ public:
>
> /* This should be overridden by each statement class. */
>
> - void visit (Statement *)
> + void visit (Statement *) final override
> {
> gcc_unreachable ();
> }
> @@ -543,13 +543,13 @@ public:
> try/catch/finally. At this point, this statement is just an empty
> placeholder. Maybe the frontend shouldn't leak these. */
>
> - void visit (ScopeGuardStatement *)
> + void visit (ScopeGuardStatement *) final override
> {
> }
>
> /* If statements provide simple conditional execution of statements. */
>
> - void visit (IfStatement *s)
> + void visit (IfStatement *s) final override
> {
> this->start_scope (level_cond);
>
> @@ -588,7 +588,7 @@ public:
> here would be the place to do it. For now, all pragmas are handled
> by the frontend. */
>
> - void visit (PragmaStatement *)
> + void visit (PragmaStatement *) final override
> {
> }
>
> @@ -596,7 +596,7 @@ public:
> This visitor is not strictly required other than to enforce that
> these kinds of statements never reach here. */
>
> - void visit (WhileStatement *)
> + void visit (WhileStatement *) final override
> {
> gcc_unreachable ();
> }
> @@ -604,7 +604,7 @@ public:
> /* Do while statments implement simple loops. The body is executed, then
> the condition is evaluated. */
>
> - void visit (DoStatement *s)
> + void visit (DoStatement *s) final override
> {
> tree lbreak = this->push_break_label (s);
>
> @@ -633,7 +633,7 @@ public:
> /* For statements implement loops with initialization, test, and
> increment clauses. */
>
> - void visit (ForStatement *s)
> + void visit (ForStatement *s) final override
> {
> tree lbreak = this->push_break_label (s);
> this->start_scope (level_loop);
> @@ -674,7 +674,7 @@ public:
> This visitor is not strictly required other than to enforce that
> these kinds of statements never reach here. */
>
> - void visit (ForeachStatement *)
> + void visit (ForeachStatement *) final override
> {
> gcc_unreachable ();
> }
> @@ -683,7 +683,7 @@ public:
> loops. This visitor is not strictly required other than to enforce that
> these kinds of statements never reach here. */
>
> - void visit (ForeachRangeStatement *)
> + void visit (ForeachRangeStatement *) final override
> {
> gcc_unreachable ();
> }
> @@ -691,7 +691,7 @@ public:
> /* Jump to the associated exit label for the current loop. If IDENT
> for the Statement is not null, then the label is user defined. */
>
> - void visit (BreakStatement *s)
> + void visit (BreakStatement *s) final override
> {
> if (s->ident)
> {
> @@ -710,7 +710,7 @@ public:
> /* Jump to the associated continue label for the current loop. If IDENT
> for the Statement is not null, then the label is user defined. */
>
> - void visit (ContinueStatement *s)
> + void visit (ContinueStatement *s) final override
> {
> if (s->ident)
> {
> @@ -726,7 +726,7 @@ public:
>
> /* A goto statement jumps to the statement identified by the given label. */
>
> - void visit (GotoStatement *s)
> + void visit (GotoStatement *s) final override
> {
> gcc_assert (s->label->statement != NULL);
> gcc_assert (s->tf == s->label->statement->tf);
> @@ -742,7 +742,7 @@ public:
> /* Statements can be labeled. A label is an identifier that precedes
> a statement. */
>
> - void visit (LabelStatement *s)
> + void visit (LabelStatement *s) final override
> {
> LabelDsymbol *sym;
>
> @@ -766,7 +766,7 @@ public:
> /* A switch statement goes to one of a collection of case statements
> depending on the value of the switch expression. */
>
> - void visit (SwitchStatement *s)
> + void visit (SwitchStatement *s) final override
> {
> this->start_scope (level_switch);
> tree lbreak = this->push_break_label (s);
> @@ -855,7 +855,7 @@ public:
>
> /* Declare the case label associated with the current SwitchStatement. */
>
> - void visit (CaseStatement *s)
> + void visit (CaseStatement *s) final override
> {
> /* Emit the case label. */
> tree label = this->define_label (s);
> @@ -881,7 +881,7 @@ public:
>
> /* Declare the default label associated with the current SwitchStatement. */
>
> - void visit (DefaultStatement *s)
> + void visit (DefaultStatement *s) final override
> {
> /* Emit the default case label. */
> tree label = this->define_label (s);
> @@ -902,7 +902,7 @@ public:
> /* Implements `goto default' by jumping to the label associated with
> the DefaultStatement in a switch block. */
>
> - void visit (GotoDefaultStatement *s)
> + void visit (GotoDefaultStatement *s) final override
> {
> tree label = this->lookup_label (s->sw->sdefault);
> this->do_jump (label);
> @@ -911,7 +911,7 @@ public:
> /* Implements `goto case' by jumping to the label associated with the
> CaseStatement in a switch block. */
>
> - void visit (GotoCaseStatement *s)
> + void visit (GotoCaseStatement *s) final override
> {
> tree label = this->lookup_label (s->cs);
> this->do_jump (label);
> @@ -920,7 +920,7 @@ public:
> /* Throw a SwitchError exception, called when a switch statement has
> no DefaultStatement, yet none of the cases match. */
>
> - void visit (SwitchErrorStatement *s)
> + void visit (SwitchErrorStatement *s) final override
> {
> /* A throw SwitchError statement gets turned into a library call.
> The call is wrapped in the enclosed expression. */
> @@ -931,7 +931,7 @@ public:
> /* A return statement exits the current function and supplies its return
> value, if the return type is not void. */
>
> - void visit (ReturnStatement *s)
> + void visit (ReturnStatement *s) final override
> {
> if (s->exp == NULL || s->exp->type->toBasetype ()->ty == TY::Tvoid)
> {
> @@ -1044,7 +1044,7 @@ public:
>
> /* Evaluate the enclosed expression, and add it to the statement list. */
>
> - void visit (ExpStatement *s)
> + void visit (ExpStatement *s) final override
> {
> if (s->exp)
> {
> @@ -1056,7 +1056,7 @@ public:
>
> /* Evaluate all enclosed statements. */
>
> - void visit (CompoundStatement *s)
> + void visit (CompoundStatement *s) final override
> {
> if (s->statements == NULL)
> return;
> @@ -1074,7 +1074,7 @@ public:
> These are compiled down as a `do ... while (0)', where each unrolled loop
> is nested inside and given their own continue label to jump to. */
>
> - void visit (UnrolledLoopStatement *s)
> + void visit (UnrolledLoopStatement *s) final override
> {
> if (s->statements == NULL)
> return;
> @@ -1105,7 +1105,7 @@ public:
> /* Start a new scope and visit all nested statements, wrapping
> them up into a BIND_EXPR at the end of the scope. */
>
> - void visit (ScopeStatement *s)
> + void visit (ScopeStatement *s) final override
> {
> if (s->statement == NULL)
> return;
> @@ -1118,7 +1118,7 @@ public:
> /* A with statement is a way to simplify repeated references to the same
> object, where the handle is either a class or struct instance. */
>
> - void visit (WithStatement *s)
> + void visit (WithStatement *s) final override
> {
> this->start_scope (level_with);
>
> @@ -1143,7 +1143,7 @@ public:
> thrown is a class type, but does not check if it is derived from
> Object. Foreign objects are not currently supported at run-time. */
>
> - void visit (ThrowStatement *s)
> + void visit (ThrowStatement *s) final override
> {
> ClassDeclaration *cd = s->exp->type->toBasetype ()->isClassHandle ();
> InterfaceDeclaration *id = cd->isInterfaceDeclaration ();
> @@ -1174,7 +1174,7 @@ public:
> handling generated by the frontend. This is also used to implement
> `scope (failure)' statements. */
>
> - void visit (TryCatchStatement *s)
> + void visit (TryCatchStatement *s) final override
> {
> this->start_scope (level_try);
> if (s->_body)
> @@ -1263,7 +1263,7 @@ public:
> handling generated by the frontend. This is also used to implement
> `scope (exit)' statements. */
>
> - void visit (TryFinallyStatement *s)
> + void visit (TryFinallyStatement *s) final override
> {
> this->start_scope (level_try);
> if (s->_body)
> @@ -1285,7 +1285,7 @@ public:
> This visitor is not strictly required other than to enforce that
> these kinds of statements never reach here. */
>
> - void visit (SynchronizedStatement *)
> + void visit (SynchronizedStatement *) final override
> {
> gcc_unreachable ();
> }
> @@ -1294,7 +1294,7 @@ public:
> an assembly parser for each supported target. Instead we leverage
> GCC extended assembler using the GccAsmStatement class. */
>
> - void visit (AsmStatement *)
> + void visit (AsmStatement *) final override
> {
> sorry ("D inline assembler statements are not supported in GDC.");
> }
> @@ -1302,7 +1302,7 @@ public:
> /* Build a GCC extended assembler expression, whose components are
> an INSN string, some OUTPUTS, some INPUTS, and some CLOBBERS. */
>
> - void visit (GccAsmStatement *s)
> + void visit (GccAsmStatement *s) final override
> {
> StringExp *insn = s->insn->toStringExp ();
> tree outputs = NULL_TREE;
> @@ -1454,7 +1454,7 @@ public:
>
> /* Import symbols from another module. */
>
> - void visit (ImportStatement *s)
> + void visit (ImportStatement *s) final override
> {
> if (s->imports == NULL)
> return;
> diff --git a/gcc/d/typeinfo.cc b/gcc/d/typeinfo.cc
> index 668b7b3c8e1..a31762fe270 100644
> --- a/gcc/d/typeinfo.cc
> +++ b/gcc/d/typeinfo.cc
> @@ -556,7 +556,7 @@ public:
> void **__vptr;
> void *__monitor; */
>
> - void visit (TypeInfoDeclaration *)
> + void visit (TypeInfoDeclaration *) final override
> {
> /* The vtable for TypeInfo. */
> this->layout_base (Type::dtypeinfo);
> @@ -567,7 +567,7 @@ public:
> void *__monitor;
> TypeInfo base; */
>
> - void visit (TypeInfoConstDeclaration *d)
> + void visit (TypeInfoConstDeclaration *d) final override
> {
> Type *tm = d->tinfo->mutableOf ();
> tm = tm->merge2 ();
> @@ -584,7 +584,7 @@ public:
> void *__monitor;
> TypeInfo base; */
>
> - void visit (TypeInfoInvariantDeclaration *d)
> + void visit (TypeInfoInvariantDeclaration *d) final override
> {
> Type *tm = d->tinfo->mutableOf ();
> tm = tm->merge2 ();
> @@ -601,7 +601,7 @@ public:
> void *__monitor;
> TypeInfo base; */
>
> - void visit (TypeInfoSharedDeclaration *d)
> + void visit (TypeInfoSharedDeclaration *d) final override
> {
> Type *tm = d->tinfo->unSharedOf ();
> tm = tm->merge2 ();
> @@ -618,7 +618,7 @@ public:
> void *__monitor;
> TypeInfo base; */
>
> - void visit (TypeInfoWildDeclaration *d)
> + void visit (TypeInfoWildDeclaration *d) final override
> {
> Type *tm = d->tinfo->mutableOf ();
> tm = tm->merge2 ();
> @@ -637,7 +637,7 @@ public:
> string name;
> void[] m_init; */
>
> - void visit (TypeInfoEnumDeclaration *d)
> + void visit (TypeInfoEnumDeclaration *d) final override
> {
> TypeEnum *ti = d->tinfo->isTypeEnum ();
> EnumDeclaration *ed = ti->sym;
> @@ -669,7 +669,7 @@ public:
> void *__monitor;
> TypeInfo m_next; */
>
> - void visit (TypeInfoPointerDeclaration *d)
> + void visit (TypeInfoPointerDeclaration *d) final override
> {
> TypePointer *ti = d->tinfo->isTypePointer ();
>
> @@ -685,7 +685,7 @@ public:
> void *__monitor;
> TypeInfo value; */
>
> - void visit (TypeInfoArrayDeclaration *d)
> + void visit (TypeInfoArrayDeclaration *d) final override
> {
> TypeDArray *ti = d->tinfo->isTypeDArray ();
>
> @@ -702,7 +702,7 @@ public:
> TypeInfo value;
> size_t len; */
>
> - void visit (TypeInfoStaticArrayDeclaration *d)
> + void visit (TypeInfoStaticArrayDeclaration *d) final override
> {
> TypeSArray *ti = d->tinfo->isTypeSArray ();
>
> @@ -722,7 +722,7 @@ public:
> TypeInfo value;
> TypeInfo key; */
>
> - void visit (TypeInfoAssociativeArrayDeclaration *d)
> + void visit (TypeInfoAssociativeArrayDeclaration *d) final override
> {
> TypeAArray *ti = d->tinfo->isTypeAArray ();
>
> @@ -741,7 +741,7 @@ public:
> void *__monitor;
> TypeInfo base; */
>
> - void visit (TypeInfoVectorDeclaration *d)
> + void visit (TypeInfoVectorDeclaration *d) final override
> {
> TypeVector *ti = d->tinfo->isTypeVector ();
>
> @@ -758,7 +758,7 @@ public:
> TypeInfo next;
> string deco; */
>
> - void visit (TypeInfoFunctionDeclaration *d)
> + void visit (TypeInfoFunctionDeclaration *d) final override
> {
> TypeFunction *ti = d->tinfo->isTypeFunction ();
> gcc_assert (ti->deco != NULL);
> @@ -779,7 +779,7 @@ public:
> TypeInfo next;
> string deco; */
>
> - void visit (TypeInfoDelegateDeclaration *d)
> + void visit (TypeInfoDelegateDeclaration *d) final override
> {
> TypeDelegate *ti = d->tinfo->isTypeDelegate ();
> gcc_assert (ti->deco != NULL);
> @@ -813,7 +813,7 @@ public:
> Information relating to interfaces, and their vtables are laid out
> immediately after the named fields, if there is anything to write. */
>
> - void visit (TypeInfoClassDeclaration *d)
> + void visit (TypeInfoClassDeclaration *d) final override
> {
> TypeClass *ti = d->tinfo->isTypeClass ();
> ClassDeclaration *cd = ti->sym;
> @@ -1004,7 +1004,7 @@ public:
> void *__monitor;
> TypeInfo_Class info; */
>
> - void visit (TypeInfoInterfaceDeclaration *d)
> + void visit (TypeInfoInterfaceDeclaration *d) final override
> {
> TypeClass *ti = d->tinfo->isTypeClass ();
>
> @@ -1034,7 +1034,7 @@ public:
> uint m_align;
> immutable(void)* xgetRTInfo; */
>
> - void visit (TypeInfoStructDeclaration *d)
> + void visit (TypeInfoStructDeclaration *d) final override
> {
> TypeStruct *ti = d->tinfo->isTypeStruct ();
> StructDeclaration *sd = ti->sym;
> @@ -1119,7 +1119,7 @@ public:
> void *__monitor;
> TypeInfo[] elements; */
>
> - void visit (TypeInfoTupleDeclaration *d)
> + void visit (TypeInfoTupleDeclaration *d) final override
> {
> TypeTuple *ti = d->tinfo->isTypeTuple ();
>
> diff --git a/gcc/d/types.cc b/gcc/d/types.cc
> index c54049dfb98..b17b15359c8 100644
> --- a/gcc/d/types.cc
> +++ b/gcc/d/types.cc
> @@ -665,7 +665,7 @@ public:
>
> /* This should be overridden by each type class. */
>
> - void visit (Type *)
> + void visit (Type *) final override
> {
> gcc_unreachable ();
> }
> @@ -673,21 +673,21 @@ public:
> /* Type assigned to erroneous expressions or constructs that
> failed during the semantic stage. */
>
> - void visit (TypeError *t)
> + void visit (TypeError *t) final override
> {
> t->ctype = error_mark_node;
> }
>
> /* Type assigned to generic nullable types. */
>
> - void visit (TypeNull *t)
> + void visit (TypeNull *t) final override
> {
> t->ctype = ptr_type_node;
> }
>
> /* Bottom type used for functions that never return. */
>
> - void visit (TypeNoreturn *t)
> + void visit (TypeNoreturn *t) final override
> {
> t->ctype = noreturn_type_node;
> TYPE_NAME (t->ctype) = get_identifier (t->toChars ());
> @@ -695,7 +695,7 @@ public:
>
> /* Basic Data Types. */
>
> - void visit (TypeBasic *t)
> + void visit (TypeBasic *t) final override
> {
> /* [type/basic-data-types]
>
> @@ -761,7 +761,7 @@ public:
>
> /* Build a simple pointer to data type, analogous to C pointers. */
>
> - void visit (TypePointer *t)
> + void visit (TypePointer *t) final override
> {
> t->ctype = build_pointer_type (build_ctype (t->next));
> }
> @@ -769,7 +769,7 @@ public:
> /* Build a dynamic array type, consisting of a length and a pointer
> to the array data. */
>
> - void visit (TypeDArray *t)
> + void visit (TypeDArray *t) final override
> {
> /* In [abi/arrays], dynamic array layout is:
> .length array dimension.
> @@ -787,7 +787,7 @@ public:
> /* Build a static array type, distinguished from dynamic arrays by
> having a length fixed at compile-time, analogous to C arrays. */
>
> - void visit (TypeSArray *t)
> + void visit (TypeSArray *t) final override
> {
> if (t->dim->isConst () && t->dim->type->isintegral ())
> {
> @@ -804,7 +804,7 @@ public:
>
> /* Build a vector type, a fixed array of floating or integer types. */
>
> - void visit (TypeVector *t)
> + void visit (TypeVector *t) final override
> {
> int nunits = t->basetype->isTypeSArray ()->dim->toUInteger ();
> tree inner = build_ctype (t->elementType ());
> @@ -821,7 +821,7 @@ public:
> /* Build an associative array type, distinguished from arrays by having an
> index that's not necessarily an integer, and can be sparsely populated. */
>
> - void visit (TypeAArray *t)
> + void visit (TypeAArray *t) final override
> {
> /* In [abi/associative-arrays], associative arrays are a struct that only
> consist of a pointer to an opaque, implementation defined type. */
> @@ -835,7 +835,7 @@ public:
> /* Build type for a function declaration, which consists of a return type,
> and a list of parameter types, and a linkage attribute. */
>
> - void visit (TypeFunction *t)
> + void visit (TypeFunction *t) final override
> {
> tree fnparams = NULL_TREE;
> tree fntype;
> @@ -925,7 +925,7 @@ public:
> reference and a pointer to a non-static member function, or a pointer
> to a closure and a pointer to a nested function. */
>
> - void visit (TypeDelegate *t)
> + void visit (TypeDelegate *t) final override
> {
> /* In [abi/delegates], delegate layout is:
> .ptr context pointer.
> @@ -952,7 +952,7 @@ public:
> /* Build a named enum type, a distinct value whose values are restrict to
> a group of constants of the same underlying base type. */
>
> - void visit (TypeEnum *t)
> + void visit (TypeEnum *t) final override
> {
> tree basetype = (t->sym->memtype)
> ? build_ctype (t->sym->memtype) : void_type_node;
> @@ -1067,7 +1067,7 @@ public:
> /* Build a struct or union type. Layout should be exactly represented
> as an equivalent C struct, except for non-POD or nested structs. */
>
> - void visit (TypeStruct *t)
> + void visit (TypeStruct *t) final override
> {
> /* Merge types in the back-end if the front-end did not itself do so. */
> tree deco = get_identifier (d_mangle_decl (t->sym));
> @@ -1123,7 +1123,7 @@ public:
> /* Build a class type. Whereas structs are value types, classes are
> reference types, with all the object-orientated features. */
>
> - void visit (TypeClass *t)
> + void visit (TypeClass *t) final override
> {
> /* Merge types in the back-end if the front-end did not itself do so. */
> tree deco = get_identifier (d_mangle_decl (t->sym));
> --
> 2.26.3
>
>
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 05/10] d: add 'final' and 'override' to gcc/d/*.cc 'visit' impls
2022-05-24 12:56 ` Iain Buclaw
@ 2022-05-24 13:15 ` David Malcolm
2022-05-24 15:11 ` Iain Buclaw
0 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-05-24 13:15 UTC (permalink / raw)
To: Iain Buclaw, gcc-patches
On Tue, 2022-05-24 at 14:56 +0200, Iain Buclaw wrote:
> Excerpts from David Malcolm via Gcc-patches's message of Mai 23, 2022
> 9:28 pm:
> > gcc/d/ChangeLog:
> > * decl.cc: Add "final" and "override" to all "visit" vfunc
> > decls
> > as appropriate.
> > * expr.cc: Likewise.
> > * toir.cc: Likewise.
> > * typeinfo.cc: Likewise.
> > * types.cc: Likewise.
> >
> > Signed-off-by: David Malcolm <dmalcolm@redhat.com>
>
>
> Thanks David!
>
> Looks OK to me.
>
> Iain.
Thanks; I've pushed it to trunk as r13-736-g442cf0977a2993.
FWIW, to repeat something I said in the cover letter, I tried hacking -
Werror=suggest-override into the Makefile whilst I was creating the
patches, and IIRC there were a bunch of them in the gcc/d/dmd
subdirectory - but that code is copied from the D community upstream,
right?
So maybe if that D parser C++ code requires a C++11 compiler, perhaps
they might want to add "final" and "override" specifiers to it as
appropriate, to better document the intent of the decls?
Hope this is constructive
Dave
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 05/10] d: add 'final' and 'override' to gcc/d/*.cc 'visit' impls
2022-05-24 13:15 ` David Malcolm
@ 2022-05-24 15:11 ` Iain Buclaw
0 siblings, 0 replies; 39+ messages in thread
From: Iain Buclaw @ 2022-05-24 15:11 UTC (permalink / raw)
To: David Malcolm, gcc-patches
Excerpts from David Malcolm's message of Mai 24, 2022 3:15 pm:
> On Tue, 2022-05-24 at 14:56 +0200, Iain Buclaw wrote:
>> Excerpts from David Malcolm via Gcc-patches's message of Mai 23, 2022
>> 9:28 pm:
>> > gcc/d/ChangeLog:
>> > * decl.cc: Add "final" and "override" to all "visit" vfunc
>> > decls
>> > as appropriate.
>> > * expr.cc: Likewise.
>> > * toir.cc: Likewise.
>> > * typeinfo.cc: Likewise.
>> > * types.cc: Likewise.
>> >
>> > Signed-off-by: David Malcolm <dmalcolm@redhat.com>
>>
>>
>> Thanks David!
>>
>> Looks OK to me.
>>
>> Iain.
>
> Thanks; I've pushed it to trunk as r13-736-g442cf0977a2993.
>
> FWIW, to repeat something I said in the cover letter, I tried hacking -
> Werror=suggest-override into the Makefile whilst I was creating the
> patches, and IIRC there were a bunch of them in the gcc/d/dmd
> subdirectory - but that code is copied from the D community upstream,
> right?
> So maybe if that D parser C++ code requires a C++11 compiler, perhaps
> they might want to add "final" and "override" specifiers to it as
> appropriate, to better document the intent of the decls?
>
The D parser code is written in D, but most of it is marked
"extern(C++)" so that the code generator can interface with it. It is
already a hard requirement in D that all overriden method have the
"override" keyword, and "final" is already tacked on most places, so for
the most part it is already there, just hasn't been mirrored to the C++
interfaces in the headers.
I'll have a look into it.
Iain.
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 00/10] Add 'final' and 'override' where missing
2022-05-23 19:28 [PATCH 00/10] Add 'final' and 'override' where missing David Malcolm
` (9 preceding siblings ...)
2022-05-23 19:28 ` [PATCH 10/10] Add 'final' and 'override' in various places David Malcolm
@ 2022-05-25 3:29 ` Eric Gallager
10 siblings, 0 replies; 39+ messages in thread
From: Eric Gallager @ 2022-05-25 3:29 UTC (permalink / raw)
To: David Malcolm; +Cc: gcc-patches
On Mon, May 23, 2022 at 3:32 PM David Malcolm via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> With C++11 we can add "final" and "override" to the decls of vfuncs
> in derived classes, which documents to both human and automated readers
> of the code that a decl is intended to override a vfunc in a base class,
> and can help catch mistakes where we intended to override a vfunc, but
> messed up the prototypes.
>
> The following patch kit adds "final" and "override" specifiers to the
> decls of vfunc implementations throughout the source tree.
>
> I added "final override" everywhere where this was possible, or just
> "override" for the places where the overridden vfunc gets further
> overridden.
>
> I also removed "virtual" from such decls, since this isn't required
> when overriding an existing vfunc, and the "final override" better
> implies the intent of the code.
>
> I temporarily hacked -Werror=suggest-override into the Makefile whilst
> I was creating the patches, but I skipped the following:
>
> (a) gcc/d/dmd/ ...since these sources are copied from an upstream
> (b) gcc/go/gofrontend/ ...likewise
> (c) gcc/range.op.cc: as I believe this code is under heavy development
> (d) target-specific passes other than i386 (for ease of testing); I can
> do these in a followup, if desired.
>
> I didn't attempt to add -Wsuggest-override into our compile flags
> "properly".
Have you tried clang's -Winconsistent-missing-override flag for
comparison? I noticed some warnings from it when doing a build of gcc
trunk with clang just now.
>
> No functional changes intended.
>
> Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
>
> I split them up into separate patches by topic for ease of review, and
> for ease of writing the ChangeLog entries.
>
> Worth an update to https://gcc.gnu.org/codingconventions.html ?
>
> OK for trunk?
> Dave
>
> David Malcolm (10):
> Add 'final' and 'override' to opt_pass vfunc impls
> Add 'final' and 'override' on dom_walker vfunc impls
> expr.cc: use final/override on op_by_pieces_d vfuncs
> tree-switch-conversion.h: use final/override for cluster vfunc impls
> d: add 'final' and 'override' to gcc/d/*.cc 'visit' impls
> ipa: add 'final' and 'override' to call_summary_base vfunc impls
> value-relation.h: add 'final' and 'override' to relation_oracle vfunc
> impls
> i386: add 'final' and 'override' to scalar_chain vfunc impls
> tree-vect-slp-patterns.cc: add 'final' and 'override' to
> vect_pattern::build impls
> Add 'final' and 'override' in various places
>
> gcc/adjust-alignment.cc | 2 +-
> gcc/asan.cc | 19 ++++++---
> gcc/auto-inc-dec.cc | 4 +-
> gcc/auto-profile.cc | 8 ++--
> gcc/bb-reorder.cc | 12 +++---
> gcc/cfgcleanup.cc | 8 ++--
> gcc/cfgexpand.cc | 2 +-
> gcc/cfgrtl.cc | 6 +--
> gcc/cgraphbuild.cc | 13 +++---
> gcc/combine-stack-adj.cc | 4 +-
> gcc/combine.cc | 4 +-
> gcc/compare-elim.cc | 6 +--
> gcc/config/i386/i386-features.cc | 20 ++++-----
> gcc/config/i386/i386-features.h | 16 +++----
> gcc/coroutine-passes.cc | 8 ++--
> gcc/cp/cxx-pretty-print.h | 38 ++++++++---------
> gcc/cp/module.cc | 4 +-
> gcc/cprop.cc | 9 ++--
> gcc/cse.cc | 18 +++++---
> gcc/d/decl.cc | 36 ++++++++--------
> gcc/d/expr.cc | 2 +-
> gcc/d/toir.cc | 64 ++++++++++++++--------------
> gcc/d/typeinfo.cc | 34 +++++++--------
> gcc/d/types.cc | 30 ++++++-------
> gcc/dce.cc | 8 ++--
> gcc/df-core.cc | 10 ++---
> gcc/dse.cc | 14 ++++--
> gcc/dwarf2cfi.cc | 7 ++-
> gcc/early-remat.cc | 4 +-
> gcc/except.cc | 6 +--
> gcc/expr.cc | 14 +++---
> gcc/final.cc | 14 ++++--
> gcc/function.cc | 10 ++---
> gcc/fwprop.cc | 8 ++--
> gcc/gcse.cc | 14 ++++--
> gcc/genmatch.cc | 22 +++++-----
> gcc/gensupport.cc | 2 +-
> gcc/gimple-harden-conditionals.cc | 20 ++++++---
> gcc/gimple-if-to-switch.cc | 4 +-
> gcc/gimple-isel.cc | 4 +-
> gcc/gimple-laddress.cc | 6 +--
> gcc/gimple-loop-interchange.cc | 6 +--
> gcc/gimple-loop-jam.cc | 4 +-
> gcc/gimple-loop-versioning.cc | 7 ++-
> gcc/gimple-low.cc | 5 ++-
> gcc/gimple-range-cache.h | 4 +-
> gcc/gimple-ssa-backprop.cc | 6 +--
> gcc/gimple-ssa-evrp.cc | 6 +--
> gcc/gimple-ssa-isolate-paths.cc | 9 ++--
> gcc/gimple-ssa-nonnull-compare.cc | 4 +-
> gcc/gimple-ssa-split-paths.cc | 9 ++--
> gcc/gimple-ssa-store-merging.cc | 10 ++---
> gcc/gimple-ssa-strength-reduction.cc | 6 +--
> gcc/gimple-ssa-warn-access.cc | 8 ++--
> gcc/gimple-ssa-warn-alloca.cc | 8 ++--
> gcc/gimple-ssa-warn-restrict.cc | 4 +-
> gcc/gimple-warn-recursion.cc | 4 +-
> gcc/graphite.cc | 9 ++--
> gcc/ifcvt.cc | 12 +++---
> gcc/init-regs.cc | 4 +-
> gcc/ipa-comdats.cc | 4 +-
> gcc/ipa-cp.cc | 10 ++---
> gcc/ipa-devirt.cc | 8 ++--
> gcc/ipa-fnsummary.cc | 20 ++++++---
> gcc/ipa-fnsummary.h | 21 ++++-----
> gcc/ipa-free-lang-data.cc | 2 +-
> gcc/ipa-icf-gimple.h | 6 ++-
> gcc/ipa-icf.cc | 4 +-
> gcc/ipa-icf.h | 36 +++++++++-------
> gcc/ipa-inline.cc | 4 +-
> gcc/ipa-modref.cc | 48 ++++++++++-----------
> gcc/ipa-param-manipulation.cc | 8 ++--
> gcc/ipa-profile.cc | 10 ++---
> gcc/ipa-prop.cc | 4 +-
> gcc/ipa-prop.h | 26 +++++------
> gcc/ipa-pure-const.cc | 34 +++++++++------
> gcc/ipa-reference.cc | 14 +++---
> gcc/ipa-split.cc | 8 ++--
> gcc/ipa-sra.cc | 21 +++++----
> gcc/ipa-visibility.cc | 6 +--
> gcc/ipa.cc | 9 ++--
> gcc/ira.cc | 8 ++--
> gcc/jump.cc | 5 ++-
> gcc/loop-init.cc | 18 ++++----
> gcc/lower-subreg.cc | 16 ++++---
> gcc/lto/lto-dump.cc | 8 ++--
> gcc/mode-switching.cc | 6 +--
> gcc/modulo-sched.cc | 4 +-
> gcc/multiple_target.cc | 7 ++-
> gcc/omp-expand.cc | 14 ++++--
> gcc/omp-low.cc | 9 ++--
> gcc/omp-oacc-kernels-decompose.cc | 4 +-
> gcc/omp-oacc-neuter-broadcast.cc | 4 +-
> gcc/omp-offload.cc | 16 +++----
> gcc/omp-simd-clone.cc | 7 ++-
> gcc/passes.cc | 34 +++++++++------
> gcc/postreload-gcse.cc | 7 ++-
> gcc/postreload.cc | 7 ++-
> gcc/predict.cc | 13 +++---
> gcc/read-md.h | 2 +-
> gcc/read-rtl-function.cc | 6 +--
> gcc/recog.cc | 32 ++++++++------
> gcc/ree.cc | 7 ++-
> gcc/reg-stack.cc | 4 +-
> gcc/regcprop.cc | 4 +-
> gcc/reginfo.cc | 2 +-
> gcc/regrename.cc | 7 ++-
> gcc/reorg.cc | 8 ++--
> gcc/rtl-ssa/blocks.cc | 4 +-
> gcc/sancov.cc | 10 ++---
> gcc/sanopt.cc | 4 +-
> gcc/sched-rgn.cc | 19 +++++----
> gcc/stack-ptr-mod.cc | 2 +-
> gcc/store-motion.cc | 4 +-
> gcc/symbol-summary.h | 8 ++--
> gcc/symtab-thunks.cc | 8 ++--
> gcc/tracer.cc | 4 +-
> gcc/trans-mem.cc | 34 ++++++++++-----
> gcc/tree-call-cdce.cc | 4 +-
> gcc/tree-cfg.cc | 28 ++++++++----
> gcc/tree-cfgcleanup.cc | 6 +--
> gcc/tree-complex.cc | 14 ++++--
> gcc/tree-eh.cc | 23 +++++-----
> gcc/tree-emutls.cc | 7 ++-
> gcc/tree-if-conv.cc | 4 +-
> gcc/tree-into-ssa.cc | 14 +++---
> gcc/tree-loop-distribution.cc | 4 +-
> gcc/tree-nrv.cc | 6 +--
> gcc/tree-object-size.cc | 6 +--
> gcc/tree-parloops.cc | 11 +++--
> gcc/tree-predcom.cc | 8 ++--
> gcc/tree-profile.cc | 4 +-
> gcc/tree-sra.cc | 11 +++--
> gcc/tree-ssa-ccp.cc | 21 +++++----
> gcc/tree-ssa-copy.cc | 9 ++--
> gcc/tree-ssa-dce.cc | 14 +++---
> gcc/tree-ssa-dom.cc | 12 +++---
> gcc/tree-ssa-dse.cc | 6 +--
> gcc/tree-ssa-forwprop.cc | 6 +--
> gcc/tree-ssa-ifcombine.cc | 2 +-
> gcc/tree-ssa-loop-ch.cc | 14 +++---
> gcc/tree-ssa-loop-im.cc | 6 +--
> gcc/tree-ssa-loop-ivcanon.cc | 10 ++---
> gcc/tree-ssa-loop-prefetch.cc | 7 ++-
> gcc/tree-ssa-loop-split.cc | 4 +-
> gcc/tree-ssa-loop-unswitch.cc | 4 +-
> gcc/tree-ssa-loop.cc | 27 ++++++------
> gcc/tree-ssa-math-opts.cc | 17 +++++---
> gcc/tree-ssa-phiopt.cc | 19 +++++----
> gcc/tree-ssa-phiprop.cc | 4 +-
> gcc/tree-ssa-pre.cc | 4 +-
> gcc/tree-ssa-propagate.cc | 4 +-
> gcc/tree-ssa-reassoc.cc | 8 ++--
> gcc/tree-ssa-sccvn.cc | 16 +++----
> gcc/tree-ssa-sink.cc | 8 ++--
> gcc/tree-ssa-strlen.cc | 14 +++---
> gcc/tree-ssa-structalias.cc | 13 +++---
> gcc/tree-ssa-uncprop.cc | 10 ++---
> gcc/tree-ssa-uninit.cc | 13 +++---
> gcc/tree-ssanames.cc | 2 +-
> gcc/tree-stdarg.cc | 8 ++--
> gcc/tree-switch-conversion.cc | 15 ++++---
> gcc/tree-switch-conversion.h | 32 +++++++-------
> gcc/tree-tailcall.cc | 16 ++++---
> gcc/tree-vect-generic.cc | 11 +++--
> gcc/tree-vect-slp-patterns.cc | 12 +++---
> gcc/tree-vectorizer.cc | 26 ++++++-----
> gcc/tree-vrp.cc | 8 ++--
> gcc/tsan.cc | 10 ++---
> gcc/ubsan.cc | 4 +-
> gcc/value-relation.h | 38 +++++++++--------
> gcc/var-tracking.cc | 4 +-
> gcc/vtable-verify.cc | 4 +-
> gcc/web.cc | 4 +-
> 174 files changed, 1082 insertions(+), 852 deletions(-)
>
> --
> 2.26.3
>
^ permalink raw reply [flat|nested] 39+ messages in thread
* PING: Re: [PATCH 01/10] Add 'final' and 'override' to opt_pass vfunc impls
2022-05-23 19:28 ` [PATCH 01/10] Add 'final' and 'override' to opt_pass vfunc impls David Malcolm
@ 2022-06-13 18:22 ` David Malcolm
2022-06-24 18:08 ` PING^2: " David Malcolm
0 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-06-13 18:22 UTC (permalink / raw)
To: gcc-patches
Ping for this patch:
https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595444.html
OK for trunk?
Thanks
Dave
On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote:
> gcc/ChangeLog:
> * adjust-alignment.cc: Add "final" and "override" to opt_pass
> vfunc implementations, removing redundant "virtual" as
> appropriate.
> * asan.cc: Likewise.
> * auto-inc-dec.cc: Likewise.
> * auto-profile.cc: Likewise.
> * bb-reorder.cc: Likewise.
> * cfgcleanup.cc: Likewise.
> * cfgexpand.cc: Likewise.
> * cfgrtl.cc: Likewise.
> * cgraphbuild.cc: Likewise.
> * combine-stack-adj.cc: Likewise.
> * combine.cc: Likewise.
> * compare-elim.cc: Likewise.
> * config/i386/i386-features.cc: Likewise.
> * coroutine-passes.cc: Likewise.
> * cprop.cc: Likewise.
> * cse.cc: Likewise.
> * dce.cc: Likewise.
> * df-core.cc: Likewise.
> * dse.cc: Likewise.
> * dwarf2cfi.cc: Likewise.
> * early-remat.cc: Likewise.
> * except.cc: Likewise.
> * final.cc: Likewise.
> * function.cc: Likewise.
> * fwprop.cc: Likewise.
> * gcse.cc: Likewise.
> * gimple-harden-conditionals.cc: Likewise.
> * gimple-if-to-switch.cc: Likewise.
> * gimple-isel.cc: Likewise.
> * gimple-laddress.cc: Likewise.
> * gimple-loop-interchange.cc: Likewise.
> * gimple-loop-jam.cc: Likewise.
> * gimple-loop-versioning.cc: Likewise.
> * gimple-low.cc: Likewise.
> * gimple-ssa-backprop.cc: Likewise.
> * gimple-ssa-evrp.cc: Likewise.
> * gimple-ssa-isolate-paths.cc: Likewise.
> * gimple-ssa-nonnull-compare.cc: Likewise.
> * gimple-ssa-split-paths.cc: Likewise.
> * gimple-ssa-store-merging.cc: Likewise.
> * gimple-ssa-strength-reduction.cc: Likewise.
> * gimple-ssa-warn-access.cc: Likewise.
> * gimple-ssa-warn-alloca.cc: Likewise.
> * gimple-ssa-warn-restrict.cc: Likewise.
> * gimple-warn-recursion.cc: Likewise.
> * graphite.cc: Likewise.
> * ifcvt.cc: Likewise.
> * init-regs.cc: Likewise.
> * ipa-comdats.cc: Likewise.
> * ipa-cp.cc: Likewise.
> * ipa-devirt.cc: Likewise.
> * ipa-fnsummary.cc: Likewise.
> * ipa-free-lang-data.cc: Likewise.
> * ipa-icf.cc: Likewise.
> * ipa-inline.cc: Likewise.
> * ipa-modref.cc: Likewise.
> * ipa-profile.cc: Likewise.
> * ipa-pure-const.cc: Likewise.
> * ipa-reference.cc: Likewise.
> * ipa-split.cc: Likewise.
> * ipa-sra.cc: Likewise.
> * ipa-visibility.cc: Likewise.
> * ipa.cc: Likewise.
> * ira.cc: Likewise.
> * jump.cc: Likewise.
> * loop-init.cc: Likewise.
> * lower-subreg.cc: Likewise.
> * mode-switching.cc: Likewise.
> * modulo-sched.cc: Likewise.
> * multiple_target.cc: Likewise.
> * omp-expand.cc: Likewise.
> * omp-low.cc: Likewise.
> * omp-oacc-kernels-decompose.cc: Likewise.
> * omp-oacc-neuter-broadcast.cc: Likewise.
> * omp-offload.cc: Likewise.
> * omp-simd-clone.cc: Likewise.
> * passes.cc: Likewise.
> * postreload-gcse.cc: Likewise.
> * postreload.cc: Likewise.
> * predict.cc: Likewise.
> * recog.cc: Likewise.
> * ree.cc: Likewise.
> * reg-stack.cc: Likewise.
> * regcprop.cc: Likewise.
> * reginfo.cc: Likewise.
> * regrename.cc: Likewise.
> * reorg.cc: Likewise.
> * sancov.cc: Likewise.
> * sanopt.cc: Likewise.
> * sched-rgn.cc: Likewise.
> * stack-ptr-mod.cc: Likewise.
> * store-motion.cc: Likewise.
> * tracer.cc: Likewise.
> * trans-mem.cc: Likewise.
> * tree-call-cdce.cc: Likewise.
> * tree-cfg.cc: Likewise.
> * tree-cfgcleanup.cc: Likewise.
> * tree-complex.cc: Likewise.
> * tree-eh.cc: Likewise.
> * tree-emutls.cc: Likewise.
> * tree-if-conv.cc: Likewise.
> * tree-into-ssa.cc: Likewise.
> * tree-loop-distribution.cc: Likewise.
> * tree-nrv.cc: Likewise.
> * tree-object-size.cc: Likewise.
> * tree-parloops.cc: Likewise.
> * tree-predcom.cc: Likewise.
> * tree-profile.cc: Likewise.
> * tree-sra.cc: Likewise.
> * tree-ssa-ccp.cc: Likewise.
> * tree-ssa-copy.cc: Likewise.
> * tree-ssa-dce.cc: Likewise.
> * tree-ssa-dom.cc: Likewise.
> * tree-ssa-dse.cc: Likewise.
> * tree-ssa-forwprop.cc: Likewise.
> * tree-ssa-ifcombine.cc: Likewise.
> * tree-ssa-loop-ch.cc: Likewise.
> * tree-ssa-loop-im.cc: Likewise.
> * tree-ssa-loop-ivcanon.cc: Likewise.
> * tree-ssa-loop-prefetch.cc: Likewise.
> * tree-ssa-loop-split.cc: Likewise.
> * tree-ssa-loop-unswitch.cc: Likewise.
> * tree-ssa-loop.cc: Likewise.
> * tree-ssa-math-opts.cc: Likewise.
> * tree-ssa-phiopt.cc: Likewise.
> * tree-ssa-phiprop.cc: Likewise.
> * tree-ssa-pre.cc: Likewise.
> * tree-ssa-reassoc.cc: Likewise.
> * tree-ssa-sccvn.cc: Likewise.
> * tree-ssa-sink.cc: Likewise.
> * tree-ssa-strlen.cc: Likewise.
> * tree-ssa-structalias.cc: Likewise.
> * tree-ssa-uncprop.cc: Likewise.
> * tree-ssa-uninit.cc: Likewise.
> * tree-ssanames.cc: Likewise.
> * tree-stdarg.cc: Likewise.
> * tree-switch-conversion.cc: Likewise.
> * tree-tailcall.cc: Likewise.
> * tree-vect-generic.cc: Likewise.
> * tree-vectorizer.cc: Likewise.
> * tree-vrp.cc: Likewise.
> * tsan.cc: Likewise.
> * ubsan.cc: Likewise.
> * var-tracking.cc: Likewise.
> * vtable-verify.cc: Likewise.
> * web.cc: Likewise.
>
> Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> ---
> gcc/adjust-alignment.cc | 2 +-
> gcc/asan.cc | 19 ++++++++++++----
> gcc/auto-inc-dec.cc | 4 ++--
> gcc/auto-profile.cc | 8 +++----
> gcc/bb-reorder.cc | 12 +++++-----
> gcc/cfgcleanup.cc | 8 +++----
> gcc/cfgexpand.cc | 2 +-
> gcc/cfgrtl.cc | 6 ++---
> gcc/cgraphbuild.cc | 13 +++++++----
> gcc/combine-stack-adj.cc | 4 ++--
> gcc/combine.cc | 4 ++--
> gcc/compare-elim.cc | 4 ++--
> gcc/config/i386/i386-features.cc | 20 ++++++++--------
> gcc/coroutine-passes.cc | 8 +++----
> gcc/cprop.cc | 9 +++++---
> gcc/cse.cc | 18 ++++++++++-----
> gcc/dce.cc | 8 +++----
> gcc/df-core.cc | 10 ++++----
> gcc/dse.cc | 14 ++++++++----
> gcc/dwarf2cfi.cc | 7 ++++--
> gcc/early-remat.cc | 4 ++--
> gcc/except.cc | 6 ++---
> gcc/final.cc | 14 ++++++++----
> gcc/function.cc | 10 ++++----
> gcc/fwprop.cc | 8 +++----
> gcc/gcse.cc | 14 ++++++++----
> gcc/gimple-harden-conditionals.cc | 20 +++++++++++-----
> gcc/gimple-if-to-switch.cc | 4 ++--
> gcc/gimple-isel.cc | 4 ++--
> gcc/gimple-laddress.cc | 6 ++---
> gcc/gimple-loop-interchange.cc | 6 ++---
> gcc/gimple-loop-jam.cc | 4 ++--
> gcc/gimple-loop-versioning.cc | 7 ++++--
> gcc/gimple-low.cc | 5 +++-
> gcc/gimple-ssa-backprop.cc | 6 ++---
> gcc/gimple-ssa-evrp.cc | 6 ++---
> gcc/gimple-ssa-isolate-paths.cc | 9 +++++---
> gcc/gimple-ssa-nonnull-compare.cc | 4 ++--
> gcc/gimple-ssa-split-paths.cc | 9 +++++---
> gcc/gimple-ssa-store-merging.cc | 10 ++++----
> gcc/gimple-ssa-strength-reduction.cc | 4 ++--
> gcc/gimple-ssa-warn-access.cc | 8 +++----
> gcc/gimple-ssa-warn-alloca.cc | 8 +++----
> gcc/gimple-ssa-warn-restrict.cc | 4 ++--
> gcc/gimple-warn-recursion.cc | 4 ++--
> gcc/graphite.cc | 9 +++++---
> gcc/ifcvt.cc | 12 +++++-----
> gcc/init-regs.cc | 4 ++--
> gcc/ipa-comdats.cc | 4 ++--
> gcc/ipa-cp.cc | 4 ++--
> gcc/ipa-devirt.cc | 8 +++----
> gcc/ipa-fnsummary.cc | 20 ++++++++++------
> gcc/ipa-free-lang-data.cc | 2 +-
> gcc/ipa-icf.cc | 4 ++--
> gcc/ipa-inline.cc | 4 ++--
> gcc/ipa-modref.cc | 12 +++++-----
> gcc/ipa-profile.cc | 4 ++--
> gcc/ipa-pure-const.cc | 26 +++++++++++++--------
> gcc/ipa-reference.cc | 4 ++--
> gcc/ipa-split.cc | 8 +++----
> gcc/ipa-sra.cc | 7 ++++--
> gcc/ipa-visibility.cc | 6 ++---
> gcc/ipa.cc | 9 +++++---
> gcc/ira.cc | 8 +++----
> gcc/jump.cc | 5 +++-
> gcc/loop-init.cc | 18 +++++++--------
> gcc/lower-subreg.cc | 16 +++++++------
> gcc/mode-switching.cc | 6 ++---
> gcc/modulo-sched.cc | 4 ++--
> gcc/multiple_target.cc | 7 ++++--
> gcc/omp-expand.cc | 14 ++++++++----
> gcc/omp-low.cc | 9 +++++---
> gcc/omp-oacc-kernels-decompose.cc | 4 ++--
> gcc/omp-oacc-neuter-broadcast.cc | 4 ++--
> gcc/omp-offload.cc | 16 ++++++-------
> gcc/omp-simd-clone.cc | 7 ++++--
> gcc/passes.cc | 34 ++++++++++++++++------------
> gcc/postreload-gcse.cc | 7 ++++--
> gcc/postreload.cc | 7 ++++--
> gcc/predict.cc | 13 +++++++----
> gcc/recog.cc | 32 +++++++++++++++-----------
> gcc/ree.cc | 7 ++++--
> gcc/reg-stack.cc | 4 ++--
> gcc/regcprop.cc | 4 ++--
> gcc/reginfo.cc | 2 +-
> gcc/regrename.cc | 7 ++++--
> gcc/reorg.cc | 8 +++----
> gcc/sancov.cc | 10 ++++----
> gcc/sanopt.cc | 4 ++--
> gcc/sched-rgn.cc | 19 +++++++++-------
> gcc/stack-ptr-mod.cc | 2 +-
> gcc/store-motion.cc | 4 ++--
> gcc/tracer.cc | 4 ++--
> gcc/trans-mem.cc | 34 +++++++++++++++++++---------
> gcc/tree-call-cdce.cc | 4 ++--
> gcc/tree-cfg.cc | 28 ++++++++++++++++-------
> gcc/tree-cfgcleanup.cc | 6 ++---
> gcc/tree-complex.cc | 14 ++++++++----
> gcc/tree-eh.cc | 23 +++++++++++--------
> gcc/tree-emutls.cc | 7 ++++--
> gcc/tree-if-conv.cc | 4 ++--
> gcc/tree-into-ssa.cc | 4 ++--
> gcc/tree-loop-distribution.cc | 4 ++--
> gcc/tree-nrv.cc | 6 ++---
> gcc/tree-object-size.cc | 6 ++---
> gcc/tree-parloops.cc | 11 +++++----
> gcc/tree-predcom.cc | 8 +++----
> gcc/tree-profile.cc | 4 ++--
> gcc/tree-sra.cc | 11 +++++----
> gcc/tree-ssa-ccp.cc | 21 +++++++++--------
> gcc/tree-ssa-copy.cc | 9 +++++---
> gcc/tree-ssa-dce.cc | 14 ++++++------
> gcc/tree-ssa-dom.cc | 8 +++----
> gcc/tree-ssa-dse.cc | 6 ++---
> gcc/tree-ssa-forwprop.cc | 6 ++---
> gcc/tree-ssa-ifcombine.cc | 2 +-
> gcc/tree-ssa-loop-ch.cc | 10 ++++----
> gcc/tree-ssa-loop-im.cc | 6 ++---
> gcc/tree-ssa-loop-ivcanon.cc | 10 ++++----
> gcc/tree-ssa-loop-prefetch.cc | 7 ++++--
> gcc/tree-ssa-loop-split.cc | 4 ++--
> gcc/tree-ssa-loop-unswitch.cc | 4 ++--
> gcc/tree-ssa-loop.cc | 27 ++++++++++++----------
> gcc/tree-ssa-math-opts.cc | 15 +++++++-----
> gcc/tree-ssa-phiopt.cc | 15 +++++++-----
> gcc/tree-ssa-phiprop.cc | 4 ++--
> gcc/tree-ssa-pre.cc | 4 ++--
> gcc/tree-ssa-reassoc.cc | 8 +++----
> gcc/tree-ssa-sccvn.cc | 8 +++----
> gcc/tree-ssa-sink.cc | 8 +++----
> gcc/tree-ssa-strlen.cc | 10 ++++----
> gcc/tree-ssa-structalias.cc | 13 +++++++----
> gcc/tree-ssa-uncprop.cc | 6 ++---
> gcc/tree-ssa-uninit.cc | 13 +++++++----
> gcc/tree-ssanames.cc | 2 +-
> gcc/tree-stdarg.cc | 8 +++----
> gcc/tree-switch-conversion.cc | 15 +++++++-----
> gcc/tree-tailcall.cc | 16 +++++++++----
> gcc/tree-vect-generic.cc | 11 +++++----
> gcc/tree-vectorizer.cc | 26 +++++++++++++--------
> gcc/tree-vrp.cc | 8 +++----
> gcc/tsan.cc | 10 ++++----
> gcc/ubsan.cc | 4 ++--
> gcc/var-tracking.cc | 4 ++--
> gcc/vtable-verify.cc | 4 ++--
> gcc/web.cc | 4 ++--
> 146 files changed, 769 insertions(+), 552 deletions(-)
>
> diff --git a/gcc/adjust-alignment.cc b/gcc/adjust-alignment.cc
> index 2db41e8b4c8..5c5f8f4e5c0 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 4b583e54efd..5df333555ea 100644
> --- a/gcc/asan.cc
> +++ b/gcc/asan.cc
> @@ -4209,9 +4209,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
>
> @@ -4246,11 +4252,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 85fe9d14950..481e7af6895 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 2b34b80b82d..6533722817f 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 d20ccb83aa6..bdbe2e9ea7a 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 335af4911bb..18047da7b24 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 bb33c1b939e..1d7f6b260d0 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 06be46d75df..9a4651f61a3 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 fdd17aa5a2d..bae44591a29 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 e8ba2717063..e76d60a8f7e 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 9a34ef847aa..a8305273e44 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 985c0c92182..e869d9d3249 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 6fe41c3c24f..24e8336689c 100644
> --- a/gcc/config/i386/i386-features.cc
> +++ b/gcc/config/i386/i386-features.cc
> @@ -1873,13 +1873,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 ();
> }
> @@ -1908,23 +1908,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;
> @@ -2135,14 +2135,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,
> @@ -2399,7 +2399,7 @@ public:
> {}
>
> /* opt_pass methods: */
> - virtual bool gate (function *)
> + bool gate (function *) final override
> {
> return (TARGET_AVX
> && TARGET_SSE_PARTIAL_REG_DEPENDENCY
> @@ -2408,7 +2408,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 7b9a97af5a2..21ac9469805 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 cf01c2d79a9..580f811545d 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
>
> diff --git a/gcc/cse.cc b/gcc/cse.cc
> index a18b599d324..b13afd4ba72 100644
> --- a/gcc/cse.cc
> +++ b/gcc/cse.cc
> @@ -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 ();
> }
> diff --git a/gcc/dce.cc b/gcc/dce.cc
> index 6676cbcd429..64aa0aa471d 100644
> --- a/gcc/dce.cc
> +++ b/gcc/dce.cc
> @@ -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 a901b84878f..97b2bbf6d2b 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 ();
> }
> diff --git a/gcc/dse.cc b/gcc/dse.cc
> index 30c11cee034..83c572f6220 100644
> --- a/gcc/dse.cc
> +++ b/gcc/dse.cc
> @@ -3747,12 +3747,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
>
> @@ -3787,12 +3790,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 ab7c5cc5b27..bef3165e691 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 2738892b4e7..5c368293c35 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 b94de425557..7d7ce40c846 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 a9868861bd2..81e21cb8db6 100644
> --- a/gcc/final.cc
> +++ b/gcc/final.cc
> @@ -808,7 +808,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
>
> @@ -4360,7 +4363,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
>
> @@ -4404,7 +4410,7 @@ public:
> {}
>
> /* opt_pass methods: */
> - virtual unsigned int execute (function *)
> + unsigned int execute (function *) final override
> {
> return rest_of_handle_shorten_branches ();
> }
> @@ -4579,7 +4585,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 ad0096a43ef..0c3e4fffb05 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 d12fc2f34ac..fc652ab9a1f 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 b67353143a2..f06278a5534 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 79c0a5784ba..4ca6776fca7 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 5dcfe5b77e0..c89aef34381 100644
> --- a/gcc/gimple-if-to-switch.cc
> +++ b/gcc/gimple-if-to-switch.cc
> @@ -478,13 +478,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 44d086d8b28..aa9c1290735 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 13c7858e161..11754dac5c3 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 53adc02acc2..5f59730be4c 100644
> --- a/gcc/gimple-loop-interchange.cc
> +++ b/gcc/gimple-loop-interchange.cc
> @@ -1703,9 +1703,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 e33dd9091df..9b18b52a54c 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 ab02bdd4b15..6bcf6eba691 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 2ec19d5657d..4cd27dd19b0 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 74f98111256..55986ddbfe3 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 20388ed5431..793a3ea1f19 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 cc0ed9760a0..87ecd19ef4a 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 cc52b914258..f9ce8c7a083 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 6abe1d51400..f2e43e52c95 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 b952ce57917..0640168bcc4 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 dad73d31874..2b559e96fc8 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 9357a4e576a..1f70cbdb884 100644
> --- a/gcc/gimple-ssa-warn-access.cc
> +++ b/gcc/gimple-ssa-warn-access.cc
> @@ -2069,13 +2069,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 273b88ec141..83a241a3a4b 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 b678e806da3..2a1afcbb0fc 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 91a3cdbacd4..9b04899cf78 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 ab8683b5b41..a88b13c0219 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 b983e87389f..28b153cf2ae 100644
> --- a/gcc/ifcvt.cc
> +++ b/gcc/ifcvt.cc
> @@ -5933,12 +5933,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 ();
> }
> @@ -5980,13 +5980,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;
> @@ -6026,13 +6026,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 220ef705997..652befefdaa 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 566faf3cc1f..da792065ed3 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 152fe7244f7..38a21b17e39 100644
> --- a/gcc/ipa-cp.cc
> +++ b/gcc/ipa-cp.cc
> @@ -6659,14 +6659,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 9f1442dc3cc..412ca14f66b 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 b12e7a1124d..832794fd5dc 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 f99f7be1c58..ccdbf849c25 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 765ae746745..a8a162268ee 100644
> --- a/gcc/ipa-icf.cc
> +++ b/gcc/ipa-icf.cc
> @@ -3637,12 +3637,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 22a009b7435..14969198cde 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 556816ab429..7c1f974bc7a 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 b74d77f2c95..496f292acba 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 2b4950a5969..0e55fc4bfc5 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 67e0c85a95e..b5a2350ce72 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 60021bad13c..16734617d03 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 261a720858f..4f705a3febf 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 e95a0dd252f..8a27e7bcdfd 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);
> }
> diff --git a/gcc/ipa.cc b/gcc/ipa.cc
> index f53f15f5f0a..c01dca17bec 100644
> --- a/gcc/ipa.cc
> +++ b/gcc/ipa.cc
> @@ -1343,8 +1343,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
>
> @@ -1566,7 +1569,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
>
> diff --git a/gcc/ira.cc b/gcc/ira.cc
> index e3b3c549120..42c9cead9f8 100644
> --- a/gcc/ira.cc
> +++ b/gcc/ira.cc
> @@ -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 332f86878e1..e6207169be0 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 1e4f6cfd7fb..648aa290916 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 d30bbeeabda..03e9326c663 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 6e3f1dc65e2..b0f6e7cedd4 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 1e1fa7055a2..f78d791cb01 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 7fe02fb55c8..3e2d26882c8 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 9fcc67a3448..3d48e1df175 100644
> --- a/gcc/omp-expand.cc
> +++ b/gcc/omp-expand.cc
> @@ -10574,7 +10574,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)
> @@ -10621,12 +10621,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 c83af6c3865..e00788f0ea1 100644
> --- a/gcc/omp-low.cc
> +++ b/gcc/omp-low.cc
> @@ -14594,7 +14594,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
>
> @@ -14902,11 +14905,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 ec9b0faab0a..524060e2fca 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 81e3223a94c..b6177794cde 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 ad4e772015e..9de04fc520c 100644
> --- a/gcc/omp-offload.cc
> +++ b/gcc/omp-offload.cc
> @@ -2449,9 +2449,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 ();
> }
> @@ -2479,9 +2479,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 ();
> }
> @@ -2713,13 +2713,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 ();
> }
> @@ -2759,7 +2759,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);
> @@ -2769,7 +2769,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 04fe03cde5f..32649bc3f9a 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 36e5b4ac45f..78a07f8691a 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 fc63f0b5c77..1c795b43ca3 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 4a67d0d437a..d1c99fe6dc9 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 5734e4c8516..fb9fa514fbc 100644
> --- a/gcc/predict.cc
> +++ b/gcc/predict.cc
> @@ -4079,8 +4079,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
>
> @@ -4233,14 +4233,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 cd2410ab2ae..dac172bc7c0 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 ();
> }
> diff --git a/gcc/ree.cc b/gcc/ree.cc
> index de4f18e8a4d..da64ef679b7 100644
> --- a/gcc/ree.cc
> +++ b/gcc/ree.cc
> @@ -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 5afeadf8c49..fd032501ad9 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 1fdc36713cd..8fcf9d529dd 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 2ab7bbb7353..705779d5c18 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 10271e1b17d..021a822cb79 100644
> --- a/gcc/regrename.cc
> +++ b/gcc/regrename.cc
> @@ -2013,12 +2013,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 7624f514906..07b2045986c 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 9c1025200b4..052fa4ef881 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 125e0c936e7..7aebc6f39dc 100644
> --- a/gcc/sanopt.cc
> +++ b/gcc/sanopt.cc
> @@ -942,8 +942,8 @@ public:
> {}
>
> /* opt_pass methods: */
> - virtual bool gate (function *) { return flag_sanitize; }
> - virtual unsigned int execute (function *);
> + bool gate (function *) final override { return flag_sanitize; }
> + unsigned int execute (function *) final override;
>
> }; // class pass_sanopt
>
> diff --git a/gcc/sched-rgn.cc b/gcc/sched-rgn.cc
> index a0dfdb7881f..0dc2a8f2851 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 b14bef98c49..4ccbb1cace3 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 0f708700a14..b61c0686844 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 4d054fe8fc8..64517846dc4 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 ae2921f808e..131dce05476 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 83991fe373e..feb61f362cf 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 19ba09facce..37e89adf10e 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
>
> @@ -9200,9 +9203,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
> @@ -9459,7 +9468,7 @@ public:
> {}
>
> /* opt_pass methods: */
> - virtual unsigned int execute (function *);
> + unsigned int execute (function *) final override;
>
> }; // class pass_warn_function_return
>
> @@ -9665,8 +9674,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;
> @@ -9875,8 +9884,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 893619eaaa4..a6d0bf2c40a 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 f722057bfec..61950a0f099 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 c37a5845343..076ecd3ec9a 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 5f68703822c..b5aa307f60d 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 4531ca58bdf..480fea0e7c2 100644
> --- a/gcc/tree-if-conv.cc
> +++ b/gcc/tree-if-conv.cc
> @@ -3408,8 +3408,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 22c2e5b7982..46df57ae0e1 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 db6e9096a86..ec44c450cae 100644
> --- a/gcc/tree-loop-distribution.cc
> +++ b/gcc/tree-loop-distribution.cc
> @@ -3896,13 +3896,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 b96d5b86f27..1faa481a8c9 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 5ca87ae3504..bc3d7dd9bfa 100644
> --- a/gcc/tree-object-size.cc
> +++ b/gcc/tree-object-size.cc
> @@ -2122,8 +2122,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);
> }
> @@ -2162,7 +2162,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 da1069683a3..2c3ef436ab7 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 fb457250bbd..5d923fba170 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 97aab8801d0..2beb49241f2 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 081c51b58a4..461c8e0b0f4 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 81c97676625..579a966cc9b 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. */
> @@ -4199,8 +4202,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
>
> @@ -4550,9 +4553,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 050a6d11434..782ceb500cc 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 a6b284018d4..5df64922594 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 9a843217553..97e17ca68e4 100644
> --- a/gcc/tree-ssa-dom.cc
> +++ b/gcc/tree-ssa-dom.cc
> @@ -793,14 +793,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 881a2d0f98d..1c1fdb7e75b 100644
> --- a/gcc/tree-ssa-dse.cc
> +++ b/gcc/tree-ssa-dse.cc
> @@ -1455,9 +1455,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 0917202b74c..6f09642172d 100644
> --- a/gcc/tree-ssa-forwprop.cc
> +++ b/gcc/tree-ssa-forwprop.cc
> @@ -3330,9 +3330,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 88a9f062dcd..80c41c45489 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 2f5a390404c..9ab63d1fa0c 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 6d9316eed1f..c0893f1927c 100644
> --- a/gcc/tree-ssa-loop-im.cc
> +++ b/gcc/tree-ssa-loop-im.cc
> @@ -3597,9 +3597,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 2ee00a3f843..e52397235a1 100644
> --- a/gcc/tree-ssa-loop-ivcanon.cc
> +++ b/gcc/tree-ssa-loop-ivcanon.cc
> @@ -1539,8 +1539,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
>
> @@ -1586,7 +1586,7 @@ public:
> {}
>
> /* opt_pass methods: */
> - virtual unsigned int execute (function *);
> + unsigned int execute (function *) final override;
>
> }; // class pass_complete_unroll
>
> @@ -1644,8 +1644,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 aebd7c9206f..8f190ae469b 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 b93ee4c8769..d61bad5ba47 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 2927f308234..3b6486f305a 100644
> --- a/gcc/tree-ssa-loop-unswitch.cc
> +++ b/gcc/tree-ssa-loop-unswitch.cc
> @@ -1035,8 +1035,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 73aa46627b4..1c058b08c2f 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 ce1df01f629..fe9f37b4cd4 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 8c9c46d41f1..162ca7098cd 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 7bbfc8c002a..965f1d1c4eb 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 09a5e2055ca..e029bd36da3 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 406523b5d2f..e13e2cb308d 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 ed68557f0b2..18392e031b8 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 8ce4403ddc8..7f653a988f4 100644
> --- a/gcc/tree-ssa-sink.cc
> +++ b/gcc/tree-ssa-sink.cc
> @@ -829,10 +829,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 1d4c0f78fbf..2cceba6f7af 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 581bdcf5652..dcf13d939bd 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 aea7d69584f..510f8319d8c 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 b48fcf1a8ba..087f0dc965d 100644
> --- a/gcc/tree-ssa-uninit.cc
> +++ b/gcc/tree-ssa-uninit.cc
> @@ -1317,9 +1317,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
>
> @@ -1459,8 +1462,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 05536cd2f74..bc22ece636a 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 9038cd43aaa..ed4c8d8c775 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 50a17927f39..17a31f7a63c 100644
> --- a/gcc/tree-switch-conversion.cc
> +++ b/gcc/tree-switch-conversion.cc
> @@ -2428,8 +2428,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
>
> @@ -2507,18 +2510,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 5a3466e5d53..6745d57580b 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 d99e3207fbe..d974fd1b7fe 100644
> --- a/gcc/tree-vect-generic.cc
> +++ b/gcc/tree-vect-generic.cc
> @@ -2415,12 +2415,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 ();
> }
> @@ -2459,8 +2459,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 a63fa391273..53dc4520963 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 0784d658567..da0a6d5a8b6 100644
> --- a/gcc/tree-vrp.cc
> +++ b/gcc/tree-vrp.cc
> @@ -4402,14 +4402,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 02e8ac7cf79..79d4582acd1 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 6c058142c37..18c75b471f4 100644
> --- a/gcc/ubsan.cc
> +++ b/gcc/ubsan.cc
> @@ -2329,7 +2329,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
> @@ -2341,7 +2341,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 7c3ad0a55bd..235981d100f 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 48f9987082e..24894e7f108 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
>
> diff --git a/gcc/web.cc b/gcc/web.cc
> index a5874a98825..bd0ec94f1f4 100644
> --- a/gcc/web.cc
> +++ b/gcc/web.cc
> @@ -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
>
^ permalink raw reply [flat|nested] 39+ messages in thread
* PING Re: [PATCH 02/10] Add 'final' and 'override' on dom_walker vfunc impls
2022-05-23 19:28 ` [PATCH 02/10] Add 'final' and 'override' on dom_walker " David Malcolm
@ 2022-06-13 18:23 ` David Malcolm
2022-06-24 18:10 ` PING^2 " David Malcolm
0 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-06-13 18:23 UTC (permalink / raw)
To: gcc-patches
Ping for this patch:
https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595436.html
OK for tunk?
Thanks
Dave
On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote:
> gcc/ChangeLog:
> * compare-elim.cc: Add "final" and "override" to dom_walker
> vfunc
> implementations, removing redundant "virtual" as appropriate.
> * gimple-ssa-strength-reduction.cc: Likewise.
> * ipa-prop.cc: Likewise.
> * rtl-ssa/blocks.cc: Likewise.
> * tree-into-ssa.cc: Likewise.
> * tree-ssa-dom.cc: Likewise.
> * tree-ssa-math-opts.cc: Likewise.
> * tree-ssa-phiopt.cc: Likewise.
> * tree-ssa-propagate.cc: Likewise.
> * tree-ssa-sccvn.cc: Likewise.
> * tree-ssa-strlen.cc: Likewise.
> * tree-ssa-uncprop.cc: Likewise.
>
> Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> ---
> gcc/compare-elim.cc | 2 +-
> gcc/gimple-ssa-strength-reduction.cc | 2 +-
> gcc/ipa-prop.cc | 4 ++--
> gcc/rtl-ssa/blocks.cc | 4 ++--
> gcc/tree-into-ssa.cc | 10 +++++-----
> gcc/tree-ssa-dom.cc | 4 ++--
> gcc/tree-ssa-math-opts.cc | 2 +-
> gcc/tree-ssa-phiopt.cc | 4 ++--
> gcc/tree-ssa-propagate.cc | 4 ++--
> gcc/tree-ssa-sccvn.cc | 4 ++--
> gcc/tree-ssa-strlen.cc | 4 ++--
> gcc/tree-ssa-uncprop.cc | 4 ++--
> 12 files changed, 24 insertions(+), 24 deletions(-)
>
> diff --git a/gcc/compare-elim.cc b/gcc/compare-elim.cc
> index e869d9d3249..4a23202f8ff 100644
> --- a/gcc/compare-elim.cc
> +++ b/gcc/compare-elim.cc
> @@ -283,7 +283,7 @@ public:
> find_comparison_dom_walker (cdi_direction direction)
> : dom_walker (direction) {}
>
> - virtual edge before_dom_children (basic_block);
> + edge before_dom_children (basic_block) final override;
> };
>
> /* Return true if conforming COMPARE with EH_NOTE is redundant with
> comparison
> diff --git a/gcc/gimple-ssa-strength-reduction.cc b/gcc/gimple-ssa-
> strength-reduction.cc
> index 2b559e96fc8..fb2bb9f4e74 100644
> --- a/gcc/gimple-ssa-strength-reduction.cc
> +++ b/gcc/gimple-ssa-strength-reduction.cc
> @@ -1729,7 +1729,7 @@ class find_candidates_dom_walker : public
> dom_walker
> public:
> find_candidates_dom_walker (cdi_direction direction)
> : dom_walker (direction) {}
> - virtual edge before_dom_children (basic_block);
> + edge before_dom_children (basic_block) final override;
> };
>
> /* Find strength-reduction candidates in block BB. */
> diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc
> index c6c745f84a0..03f0ba2ec75 100644
> --- a/gcc/ipa-prop.cc
> +++ b/gcc/ipa-prop.cc
> @@ -3004,7 +3004,7 @@ public:
> analysis_dom_walker (struct ipa_func_body_info *fbi)
> : dom_walker (CDI_DOMINATORS), m_fbi (fbi) {}
>
> - virtual edge before_dom_children (basic_block);
> + edge before_dom_children (basic_block) final override;
>
> private:
> struct ipa_func_body_info *m_fbi;
> @@ -5653,7 +5653,7 @@ public:
> : dom_walker (CDI_DOMINATORS), m_fbi (fbi), m_descriptors (descs),
> m_aggval (av), m_something_changed (sc) {}
>
> - virtual edge before_dom_children (basic_block);
> + edge before_dom_children (basic_block) final override;
> bool cleanup_eh ()
> { return gimple_purge_all_dead_eh_edges (m_need_eh_cleanup); }
>
> diff --git a/gcc/rtl-ssa/blocks.cc b/gcc/rtl-ssa/blocks.cc
> index 959fad8f829..6b03dd03747 100644
> --- a/gcc/rtl-ssa/blocks.cc
> +++ b/gcc/rtl-ssa/blocks.cc
> @@ -85,8 +85,8 @@ class function_info::bb_walker : public dom_walker
> {
> public:
> bb_walker (function_info *, build_info &);
> - virtual edge before_dom_children (basic_block);
> - virtual void after_dom_children (basic_block);
> + edge before_dom_children (basic_block) final override;
> + void after_dom_children (basic_block) final override;
>
> private:
> // Information about the function we're building.
> diff --git a/gcc/tree-into-ssa.cc b/gcc/tree-into-ssa.cc
> index 46df57ae0e1..9631d8c6556 100644
> --- a/gcc/tree-into-ssa.cc
> +++ b/gcc/tree-into-ssa.cc
> @@ -1462,8 +1462,8 @@ public:
> rewrite_dom_walker (cdi_direction direction)
> : dom_walker (direction, ALL_BLOCKS, NULL) {}
>
> - virtual edge before_dom_children (basic_block);
> - virtual void after_dom_children (basic_block);
> + edge before_dom_children (basic_block) final override;
> + void after_dom_children (basic_block) final override;
> };
>
> /* SSA Rewriting Step 1. Initialization, create a block local stack
> @@ -2148,8 +2148,8 @@ public:
> rewrite_update_dom_walker (cdi_direction direction)
> : dom_walker (direction, ALL_BLOCKS, NULL) {}
>
> - virtual edge before_dom_children (basic_block);
> - virtual void after_dom_children (basic_block);
> + edge before_dom_children (basic_block) final override;
> + void after_dom_children (basic_block) final override;
> };
>
> /* Initialization of block data structures for the incremental SSA
> @@ -2300,7 +2300,7 @@ public:
> mark_def_dom_walker (cdi_direction direction);
> ~mark_def_dom_walker ();
>
> - virtual edge before_dom_children (basic_block);
> + edge before_dom_children (basic_block) final override;
>
> private:
> /* Notice that this bitmap is indexed using variable UIDs, so it
> must be
> diff --git a/gcc/tree-ssa-dom.cc b/gcc/tree-ssa-dom.cc
> index 97e17ca68e4..1a44b10756f 100644
> --- a/gcc/tree-ssa-dom.cc
> +++ b/gcc/tree-ssa-dom.cc
> @@ -737,8 +737,8 @@ public:
> m_threader = threader;
> }
>
> - virtual edge before_dom_children (basic_block);
> - virtual void after_dom_children (basic_block);
> + edge before_dom_children (basic_block) final override;
> + void after_dom_children (basic_block) final override;
>
> private:
>
> diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc
> index fe9f37b4cd4..a4492c96419 100644
> --- a/gcc/tree-ssa-math-opts.cc
> +++ b/gcc/tree-ssa-math-opts.cc
> @@ -4918,7 +4918,7 @@ public:
>
> /* The actual actions performed in the walk. */
>
> - virtual void after_dom_children (basic_block);
> + void after_dom_children (basic_block) final override;
>
> /* Set of results of chains of multiply and add statement
> combinations that
> were not transformed into FMAs because of active deferring. */
> diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
> index 162ca7098cd..d17c49468db 100644
> --- a/gcc/tree-ssa-phiopt.cc
> +++ b/gcc/tree-ssa-phiopt.cc
> @@ -2978,8 +2978,8 @@ public:
> : dom_walker (direction), m_nontrapping (ps), m_seen_refs (128)
> {}
>
> - virtual edge before_dom_children (basic_block);
> - virtual void after_dom_children (basic_block);
> + edge before_dom_children (basic_block) final override;
> + void after_dom_children (basic_block) final override;
>
> private:
>
> diff --git a/gcc/tree-ssa-propagate.cc b/gcc/tree-ssa-propagate.cc
> index c10ffd91766..d2d32517a8c 100644
> --- a/gcc/tree-ssa-propagate.cc
> +++ b/gcc/tree-ssa-propagate.cc
> @@ -679,8 +679,8 @@ public:
> BITMAP_FREE (need_eh_cleanup);
> }
>
> - virtual edge before_dom_children (basic_block);
> - virtual void after_dom_children (basic_block bb)
> + edge before_dom_children (basic_block) final override;
> + void after_dom_children (basic_block bb) final override
> {
> substitute_and_fold_engine->post_fold_bb (bb);
> }
> diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc
> index 18392e031b8..7407591e98c 100644
> --- a/gcc/tree-ssa-sccvn.cc
> +++ b/gcc/tree-ssa-sccvn.cc
> @@ -2493,8 +2493,8 @@ public:
> eliminate_dom_walker (cdi_direction, bitmap);
> ~eliminate_dom_walker ();
>
> - virtual edge before_dom_children (basic_block);
> - virtual void after_dom_children (basic_block);
> + edge before_dom_children (basic_block) final override;
> + void after_dom_children (basic_block) final override;
>
> virtual tree eliminate_avail (basic_block, tree op);
> virtual void eliminate_push_avail (basic_block, tree op);
> diff --git a/gcc/tree-ssa-strlen.cc b/gcc/tree-ssa-strlen.cc
> index 2cceba6f7af..7b3e3899ea2 100644
> --- a/gcc/tree-ssa-strlen.cc
> +++ b/gcc/tree-ssa-strlen.cc
> @@ -243,8 +243,8 @@ public:
>
> ~strlen_pass ();
>
> - virtual edge before_dom_children (basic_block);
> - virtual void after_dom_children (basic_block);
> + edge before_dom_children (basic_block) final override;
> + void after_dom_children (basic_block) final override;
>
> bool check_and_optimize_stmt (bool *cleanup_eh);
> bool check_and_optimize_call (bool *zero_write);
> diff --git a/gcc/tree-ssa-uncprop.cc b/gcc/tree-ssa-uncprop.cc
> index 510f8319d8c..900bf336e2e 100644
> --- a/gcc/tree-ssa-uncprop.cc
> +++ b/gcc/tree-ssa-uncprop.cc
> @@ -298,8 +298,8 @@ class uncprop_dom_walker : public dom_walker
> public:
> uncprop_dom_walker (cdi_direction direction) : dom_walker
> (direction) {}
>
> - virtual edge before_dom_children (basic_block);
> - virtual void after_dom_children (basic_block);
> + edge before_dom_children (basic_block) final override;
> + void after_dom_children (basic_block) final override;
>
> private:
>
^ permalink raw reply [flat|nested] 39+ messages in thread
* PING: Re: [PATCH 03/10] expr.cc: use final/override on op_by_pieces_d vfuncs
2022-05-23 19:28 ` [PATCH 03/10] expr.cc: use final/override on op_by_pieces_d vfuncs David Malcolm
@ 2022-06-13 18:25 ` David Malcolm
2022-06-24 18:12 ` PING^2 : " David Malcolm
0 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-06-13 18:25 UTC (permalink / raw)
To: gcc-patches
Ping on this patch:
https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595434.html
OK for trunk?
Thanks
Dave
On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote:
> gcc/ChangeLog:
> * expr.cc: Add "final" and "override" to op_by_pieces_d vfunc
> implementations as appropriate.
>
> Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> ---
> gcc/expr.cc | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/gcc/expr.cc b/gcc/expr.cc
> index 7197996cec7..ce58728862a 100644
> --- a/gcc/expr.cc
> +++ b/gcc/expr.cc
> @@ -1357,8 +1357,8 @@ op_by_pieces_d::run ()
> class move_by_pieces_d : public op_by_pieces_d
> {
> insn_gen_fn m_gen_fun;
> - void generate (rtx, rtx, machine_mode);
> - bool prepare_mode (machine_mode, unsigned int);
> + void generate (rtx, rtx, machine_mode) final override;
> + bool prepare_mode (machine_mode, unsigned int) final override;
>
> public:
> move_by_pieces_d (rtx to, rtx from, unsigned HOST_WIDE_INT len,
> @@ -1453,8 +1453,8 @@ move_by_pieces (rtx to, rtx from, unsigned
> HOST_WIDE_INT len,
> class store_by_pieces_d : public op_by_pieces_d
> {
> insn_gen_fn m_gen_fun;
> - void generate (rtx, rtx, machine_mode);
> - bool prepare_mode (machine_mode, unsigned int);
> + void generate (rtx, rtx, machine_mode) final override;
> + bool prepare_mode (machine_mode, unsigned int) final override;
>
> public:
> store_by_pieces_d (rtx to, by_pieces_constfn cfn, void *cfn_data,
> @@ -1650,9 +1650,9 @@ class compare_by_pieces_d : public op_by_pieces_d
> rtx m_accumulator;
> int m_count, m_batch;
>
> - void generate (rtx, rtx, machine_mode);
> - bool prepare_mode (machine_mode, unsigned int);
> - void finish_mode (machine_mode);
> + void generate (rtx, rtx, machine_mode) final override;
> + bool prepare_mode (machine_mode, unsigned int) final override;
> + void finish_mode (machine_mode) final override;
> public:
> compare_by_pieces_d (rtx op0, rtx op1, by_pieces_constfn op1_cfn,
> void *op1_cfn_data, HOST_WIDE_INT len, int
> align,
^ permalink raw reply [flat|nested] 39+ messages in thread
* PING Re: [PATCH 04/10] tree-switch-conversion.h: use final/override for cluster vfunc impls
2022-05-23 19:28 ` [PATCH 04/10] tree-switch-conversion.h: use final/override for cluster vfunc impls David Malcolm
@ 2022-06-13 18:26 ` David Malcolm
2022-06-24 18:14 ` PING^2 : " David Malcolm
0 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-06-13 18:26 UTC (permalink / raw)
To: gcc-patches
Ping for this patch:
https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595435.html
OK for trunk?
Thanks
Dave
On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote:
> gcc/ChangeLog:
> * tree-switch-conversion.h: Add "final" and "override" to
> cluster
> vfunc implementations as appropriate.
>
> Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> ---
> gcc/tree-switch-conversion.h | 32 +++++++++++++++++---------------
> 1 file changed, 17 insertions(+), 15 deletions(-)
>
> diff --git a/gcc/tree-switch-conversion.h b/gcc/tree-switch-
> conversion.h
> index 2b677d9f7e9..d22515eb296 100644
> --- a/gcc/tree-switch-conversion.h
> +++ b/gcc/tree-switch-conversion.h
> @@ -130,19 +130,19 @@ public:
> {}
>
> cluster_type
> - get_type ()
> + get_type () final override
> {
> return SIMPLE_CASE;
> }
>
> tree
> - get_low ()
> + get_low () final override
> {
> return m_low;
> }
>
> tree
> - get_high ()
> + get_high () final override
> {
> return m_high;
> }
> @@ -153,13 +153,13 @@ public:
> }
>
> void
> - debug ()
> + debug () final override
> {
> dump (stderr);
> }
>
> void
> - dump (FILE *f, bool details ATTRIBUTE_UNUSED = false)
> + dump (FILE *f, bool details ATTRIBUTE_UNUSED = false) final override
> {
> PRINT_CASE (f, get_low ());
> if (get_low () != get_high ())
> @@ -170,12 +170,12 @@ public:
> fprintf (f, " ");
> }
>
> - void emit (tree, tree, tree, basic_block, location_t)
> + void emit (tree, tree, tree, basic_block, location_t) final override
> {
> gcc_unreachable ();
> }
>
> - bool is_single_value_p ()
> + bool is_single_value_p () final override
> {
> return tree_int_cst_equal (get_low (), get_high ());
> }
> @@ -224,24 +224,24 @@ public:
> ~group_cluster ();
>
> tree
> - get_low ()
> + get_low () final override
> {
> return m_cases[0]->get_low ();
> }
>
> tree
> - get_high ()
> + get_high () final override
> {
> return m_cases[m_cases.length () - 1]->get_high ();
> }
>
> void
> - debug ()
> + debug () final override
> {
> dump (stderr);
> }
>
> - void dump (FILE *f, bool details = false);
> + void dump (FILE *f, bool details = false) final override;
>
> /* List of simple clusters handled by the group. */
> vec<simple_cluster *> m_cases;
> @@ -261,13 +261,14 @@ public:
> {}
>
> cluster_type
> - get_type ()
> + get_type () final override
> {
> return JUMP_TABLE;
> }
>
> void emit (tree index_expr, tree index_type,
> - tree default_label_expr, basic_block default_bb,
> location_t loc);
> + tree default_label_expr, basic_block default_bb,
> location_t loc)
> + final override;
>
> /* Find jump tables of given CLUSTERS, where all members of the
> vector
> are of type simple_cluster. New clusters are returned. */
> @@ -366,7 +367,7 @@ public:
> {}
>
> cluster_type
> - get_type ()
> + get_type () final override
> {
> return BIT_TEST;
> }
> @@ -388,7 +389,8 @@ public:
> There *MUST* be max_case_bit_tests or less unique case
> node targets. */
> void emit (tree index_expr, tree index_type,
> - tree default_label_expr, basic_block default_bb,
> location_t loc);
> + tree default_label_expr, basic_block default_bb,
> location_t loc)
> + final override;
>
> /* Find bit tests of given CLUSTERS, where all members of the vector
> are of type simple_cluster. New clusters are returned. */
^ permalink raw reply [flat|nested] 39+ messages in thread
* PING Re: [PATCH 07/10] value-relation.h: add 'final' and 'override' to relation_oracle vfunc impls
2022-05-23 19:28 ` [PATCH 07/10] value-relation.h: add 'final' and 'override' to relation_oracle " David Malcolm
@ 2022-06-13 18:28 ` David Malcolm
2022-06-14 0:45 ` Aldy Hernandez
0 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-06-13 18:28 UTC (permalink / raw)
To: gcc-patches, Andrew MacLeod, Aldy Hernandez
Ping re this patch:
https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595438.html
OK for trunk?
Thanks
Dave
On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote:
> gcc/ChangeLog:
> * value-relation.h: Add "final" and "override" to
> relation_oracle
> vfunc implementations as appropriate.
>
> Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> ---
> gcc/value-relation.h | 38 +++++++++++++++++++++-----------------
> 1 file changed, 21 insertions(+), 17 deletions(-)
>
> diff --git a/gcc/value-relation.h b/gcc/value-relation.h
> index 19762d8ce2b..478729be0bf 100644
> --- a/gcc/value-relation.h
> +++ b/gcc/value-relation.h
> @@ -130,14 +130,15 @@ public:
> equiv_oracle ();
> ~equiv_oracle ();
>
> - const_bitmap equiv_set (tree ssa, basic_block bb);
> + const_bitmap equiv_set (tree ssa, basic_block bb) final override;
> void register_relation (basic_block bb, relation_kind k, tree ssa1,
> - tree ssa2);
> + tree ssa2) override;
>
> - relation_kind query_relation (basic_block, tree, tree);
> - relation_kind query_relation (basic_block, const_bitmap,
> const_bitmap);
> - void dump (FILE *f, basic_block bb) const;
> - void dump (FILE *f) const;
> + relation_kind query_relation (basic_block, tree, tree) override;
> + relation_kind query_relation (basic_block, const_bitmap,
> const_bitmap)
> + override;
> + void dump (FILE *f, basic_block bb) const override;
> + void dump (FILE *f) const override;
>
> protected:
> bitmap_obstack m_bitmaps;
> @@ -185,14 +186,16 @@ public:
> dom_oracle ();
> ~dom_oracle ();
>
> - void register_relation (basic_block bb, relation_kind k, tree op1,
> tree op2);
> + void register_relation (basic_block bb, relation_kind k, tree op1,
> tree op2)
> + final override;
>
> - relation_kind query_relation (basic_block bb, tree ssa1, tree ssa2);
> + relation_kind query_relation (basic_block bb, tree ssa1, tree ssa2)
> + final override;
> relation_kind query_relation (basic_block bb, const_bitmap b1,
> - const_bitmap b2);
> + const_bitmap b2) final override;
>
> - void dump (FILE *f, basic_block bb) const;
> - void dump (FILE *f) const;
> + void dump (FILE *f, basic_block bb) const final override;
> + void dump (FILE *f) const final override;
> private:
> bitmap m_tmp, m_tmp2;
> bitmap m_relation_set; // Index by ssa-name. True if a relation
> exists
> @@ -229,15 +232,16 @@ class path_oracle : public relation_oracle
> public:
> path_oracle (relation_oracle *oracle = NULL);
> ~path_oracle ();
> - const_bitmap equiv_set (tree, basic_block);
> - void register_relation (basic_block, relation_kind, tree, tree);
> + const_bitmap equiv_set (tree, basic_block) final override;
> + void register_relation (basic_block, relation_kind, tree, tree)
> final override;
> void killing_def (tree);
> - relation_kind query_relation (basic_block, tree, tree);
> - relation_kind query_relation (basic_block, const_bitmap,
> const_bitmap);
> + relation_kind query_relation (basic_block, tree, tree) final
> override;
> + relation_kind query_relation (basic_block, const_bitmap,
> const_bitmap)
> + final override;
> void reset_path ();
> void set_root_oracle (relation_oracle *oracle) { m_root = oracle; }
> - void dump (FILE *, basic_block) const;
> - void dump (FILE *) const;
> + void dump (FILE *, basic_block) const final override;
> + void dump (FILE *) const final override;
> private:
> void register_equiv (basic_block bb, tree ssa1, tree ssa2);
> equiv_chain m_equiv;
^ permalink raw reply [flat|nested] 39+ messages in thread
* PING: Re: [PATCH 08/10] i386: add 'final' and 'override' to scalar_chain vfunc impls
2022-05-23 19:28 ` [PATCH 08/10] i386: add 'final' and 'override' to scalar_chain " David Malcolm
@ 2022-06-13 18:30 ` David Malcolm
2022-06-24 18:19 ` PING^2 : " David Malcolm
0 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-06-13 18:30 UTC (permalink / raw)
To: gcc-patches
Ping for this patch:
https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595440.html
OK for trunk?
Thanks
Dave
On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote:
> gcc/ChangeLog:
> * config/i386/i386-features.h: Add "final" and "override" to
> scalar_chain vfunc implementations as appropriate.
>
> Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> ---
> gcc/config/i386/i386-features.h | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/gcc/config/i386/i386-features.h b/gcc/config/i386/i386-
> features.h
> index 5c307607ae5..f46a6d95b74 100644
> --- a/gcc/config/i386/i386-features.h
> +++ b/gcc/config/i386/i386-features.h
> @@ -169,18 +169,18 @@ class general_scalar_chain : public scalar_chain
> public:
> general_scalar_chain (enum machine_mode smode_, enum machine_mode
> vmode_);
> ~general_scalar_chain ();
> - int compute_convert_gain ();
> + int compute_convert_gain () final override;
> private:
> hash_map<rtx, rtx> defs_map;
> bitmap insns_conv;
> unsigned n_sse_to_integer;
> unsigned n_integer_to_sse;
> - void mark_dual_mode_def (df_ref def);
> - void convert_insn (rtx_insn *insn);
> + void mark_dual_mode_def (df_ref def) final override;
> + void convert_insn (rtx_insn *insn) final override;
> void convert_op (rtx *op, rtx_insn *insn);
> void convert_reg (rtx_insn *insn, rtx dst, rtx src);
> void make_vector_copies (rtx_insn *, rtx);
> - void convert_registers ();
> + void convert_registers () final override;
> int vector_const_cost (rtx exp);
> };
>
> @@ -190,14 +190,14 @@ class timode_scalar_chain : public scalar_chain
> timode_scalar_chain () : scalar_chain (TImode, V1TImode) {}
>
> /* Convert from TImode to V1TImode is always faster. */
> - int compute_convert_gain () { return 1; }
> + int compute_convert_gain () final override { return 1; }
>
> private:
> - void mark_dual_mode_def (df_ref def);
> + void mark_dual_mode_def (df_ref def) final override;
> void fix_debug_reg_uses (rtx reg);
> - void convert_insn (rtx_insn *insn);
> + void convert_insn (rtx_insn *insn) final override;
> /* We don't convert registers to difference size. */
> - void convert_registers () {}
> + void convert_registers () final override {}
> };
>
> } // anon namespace
^ permalink raw reply [flat|nested] 39+ messages in thread
* PING Re: [PATCH 10/10] Add 'final' and 'override' in various places
2022-05-23 19:28 ` [PATCH 10/10] Add 'final' and 'override' in various places David Malcolm
@ 2022-06-13 18:30 ` David Malcolm
2022-06-24 18:20 ` PING^2: " David Malcolm
0 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-06-13 18:30 UTC (permalink / raw)
To: gcc-patches
Ping re this patch:
https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595443.html
OK for trunk?
Thanks
Dave
On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote:
> gcc/cp/ChangeLog:
> * cxx-pretty-print.h: Add "final" and "override" to various
> vfunc
> implementations, removing redundant "virtual" as appropriate.
> * module.cc: Likewise.
>
> gcc/ChangeLog:
> * genmatch.cc: Add "final" and "override" to various vfunc
> implementations, removing redundant "virtual" as appropriate.
> * gensupport.cc: Likewise.
> * gimple-range-cache.h: Likewise.
> * ipa-icf-gimple.h: Likewise.
> * ipa-icf.h: Likewise.
> * read-md.h: Likewise.
> * read-rtl-function.cc: Likewise.
> * tree-ssa-loop-ch.cc: Likewise.
> * tree-ssa-sccvn.cc: Likewise.
>
> gcc/lto/ChangeLog:
> * lto-dump.cc: Add "final" and "override" to various vfunc
> implementations, removing redundant "virtual" as appropriate.
>
> Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> ---
> gcc/cp/cxx-pretty-print.h | 38 +++++++++++++++++++-------------------
> gcc/cp/module.cc | 4 ++--
> gcc/genmatch.cc | 22 +++++++++++-----------
> gcc/gensupport.cc | 2 +-
> gcc/gimple-range-cache.h | 4 ++--
> gcc/ipa-icf-gimple.h | 6 ++++--
> gcc/ipa-icf.h | 36 ++++++++++++++++++++----------------
> gcc/lto/lto-dump.cc | 8 ++++----
> gcc/read-md.h | 2 +-
> gcc/read-rtl-function.cc | 6 +++---
> gcc/tree-ssa-loop-ch.cc | 4 ++--
> gcc/tree-ssa-sccvn.cc | 4 ++--
> 12 files changed, 71 insertions(+), 65 deletions(-)
>
> diff --git a/gcc/cp/cxx-pretty-print.h b/gcc/cp/cxx-pretty-print.h
> index 5080f70a8e4..593bd91d4f7 100644
> --- a/gcc/cp/cxx-pretty-print.h
> +++ b/gcc/cp/cxx-pretty-print.h
> @@ -36,25 +36,25 @@ public:
>
> pretty_printer *clone () const override;
>
> - void constant (tree);
> - void id_expression (tree);
> - void primary_expression (tree);
> - void postfix_expression (tree);
> - void unary_expression (tree);
> - void multiplicative_expression (tree);
> - void conditional_expression (tree);
> - void assignment_expression (tree);
> - void expression (tree);
> - void type_id (tree);
> - void statement (tree);
> - void declaration (tree);
> - void declaration_specifiers (tree);
> - void simple_type_specifier (tree);
> - void function_specifier (tree);
> - void declarator (tree);
> - void direct_declarator (tree);
> - void abstract_declarator (tree);
> - void direct_abstract_declarator (tree);
> + void constant (tree) final override;
> + void id_expression (tree) final override;
> + void primary_expression (tree) final override;
> + void postfix_expression (tree) final override;
> + void unary_expression (tree) final override;
> + void multiplicative_expression (tree) final override;
> + void conditional_expression (tree) final override;
> + void assignment_expression (tree) final override;
> + void expression (tree) final override;
> + void type_id (tree) final override;
> + void statement (tree) final override;
> + void declaration (tree) final override;
> + void declaration_specifiers (tree) final override;
> + void simple_type_specifier (tree) final override;
> + void function_specifier (tree) final override;
> + void declarator (tree) final override;
> + void direct_declarator (tree) final override;
> + void abstract_declarator (tree) final override;
> + void direct_abstract_declarator (tree) final override;
>
> /* This is the enclosing scope of the entity being pretty-printed.
> */
> tree enclosing_scope;
> diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
> index d1dc73724d1..e93151c98c2 100644
> --- a/gcc/cp/module.cc
> +++ b/gcc/cp/module.cc
> @@ -1483,10 +1483,10 @@ private:
>
> protected:
> using allocator::grow;
> - virtual char *grow (char *, unsigned needed);
> + char *grow (char *, unsigned needed) final override;
> #if MAPPED_WRITING
> using allocator::shrink;
> - virtual void shrink (char *);
> + void shrink (char *) final override;
> #endif
>
> public:
> diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc
> index 2b84b849330..a0b22c50ae3 100644
> --- a/gcc/genmatch.cc
> +++ b/gcc/genmatch.cc
> @@ -723,9 +723,9 @@ public:
> bool force_leaf;
> /* If non-zero, the group for optional handling. */
> unsigned char opt_grp;
> - virtual void gen_transform (FILE *f, int, const char *, bool, int,
> - const char *, capture_info *,
> - dt_operand ** = 0, int = 0);
> + void gen_transform (FILE *f, int, const char *, bool, int,
> + const char *, capture_info *,
> + dt_operand ** = 0, int = 0) override;
> };
>
> /* An operator that is represented by native C code. This is always
> @@ -757,9 +757,9 @@ public:
> unsigned nr_stmts;
> /* The identifier replacement vector. */
> vec<id_tab> ids;
> - virtual void gen_transform (FILE *f, int, const char *, bool, int,
> - const char *, capture_info *,
> - dt_operand ** = 0, int = 0);
> + void gen_transform (FILE *f, int, const char *, bool, int,
> + const char *, capture_info *,
> + dt_operand ** = 0, int = 0) final override;
> };
>
> /* A wrapper around another operand that captures its value. */
> @@ -778,9 +778,9 @@ public:
> bool value_match;
> /* The captured value. */
> operand *what;
> - virtual void gen_transform (FILE *f, int, const char *, bool, int,
> - const char *, capture_info *,
> - dt_operand ** = 0, int = 0);
> + void gen_transform (FILE *f, int, const char *, bool, int,
> + const char *, capture_info *,
> + dt_operand ** = 0, int = 0) final override;
> };
>
> /* if expression. */
> @@ -1655,7 +1655,7 @@ public:
> : dt_node (type, parent_), op (op_), match_dop (match_dop_),
> pos (pos_), value_match (false), for_id (current_id) {}
>
> - void gen (FILE *, int, bool, int);
> + void gen (FILE *, int, bool, int) final override;
> unsigned gen_predicate (FILE *, int, const char *, bool);
> unsigned gen_match_op (FILE *, int, const char *, bool);
>
> @@ -1681,7 +1681,7 @@ public:
> indexes (indexes_), info (NULL) {}
>
> void gen_1 (FILE *, int, bool, operand *);
> - void gen (FILE *f, int, bool, int);
> + void gen (FILE *f, int, bool, int) final override;
> };
>
> template<>
> diff --git a/gcc/gensupport.cc b/gcc/gensupport.cc
> index 42680499d86..8fcacf8f9d2 100644
> --- a/gcc/gensupport.cc
> +++ b/gcc/gensupport.cc
> @@ -2310,7 +2310,7 @@ class gen_reader : public rtx_reader
> {
> public:
> gen_reader () : rtx_reader (false) {}
> - void handle_unknown_directive (file_location, const char *);
> + void handle_unknown_directive (file_location, const char *) final
> override;
> };
>
> void
> diff --git a/gcc/gimple-range-cache.h b/gcc/gimple-range-cache.h
> index 555fe32513f..d768f418f0d 100644
> --- a/gcc/gimple-range-cache.h
> +++ b/gcc/gimple-range-cache.h
> @@ -77,8 +77,8 @@ public:
> ranger_cache (int not_executable_flag, bool use_imm_uses);
> ~ranger_cache ();
>
> - virtual bool range_of_expr (irange &r, tree name, gimple *stmt);
> - virtual bool range_on_edge (irange &r, edge e, tree expr);
> + bool range_of_expr (irange &r, tree name, gimple *stmt) final
> override;
> + bool range_on_edge (irange &r, edge e, tree expr) final override;
> bool block_range (irange &r, basic_block bb, tree name, bool calc =
> true);
>
> bool get_global_range (irange &r, tree name) const;
> diff --git a/gcc/ipa-icf-gimple.h b/gcc/ipa-icf-gimple.h
> index 1545e4a5905..8f498b31eef 100644
> --- a/gcc/ipa-icf-gimple.h
> +++ b/gcc/ipa-icf-gimple.h
> @@ -282,11 +282,13 @@ private:
> public:
> /* Return true if two operands are equal. The flags fields can be
> used
> to specify OEP flags described above. */
> - virtual bool operand_equal_p (const_tree, const_tree, unsigned int
> flags);
> + bool operand_equal_p (const_tree, const_tree, unsigned int flags)
> + final override;
>
> /* Generate a hash value for an expression. This can be used
> iteratively
> by passing a previous result as the HSTATE argument. */
> - virtual void hash_operand (const_tree, inchash::hash &, unsigned
> flags);
> + void hash_operand (const_tree, inchash::hash &, unsigned flags)
> + final override;
> void hash_operand (const_tree, inchash::hash &, unsigned flags,
> operand_access_type access);
> };
> diff --git a/gcc/ipa-icf.h b/gcc/ipa-icf.h
> index dbae2cca02b..bb550923ad4 100644
> --- a/gcc/ipa-icf.h
> +++ b/gcc/ipa-icf.h
> @@ -317,16 +317,18 @@ public:
>
> ~sem_function ();
>
> - virtual void init (ipa_icf_gimple::func_checker *);
> - virtual bool equals_wpa (sem_item *item,
> - hash_map <symtab_node *, sem_item *>
> &ignored_nodes);
> - virtual hashval_t get_hash (void);
> - virtual bool equals (sem_item *item,
> - hash_map <symtab_node *, sem_item *>
> &ignored_nodes);
> - virtual bool merge (sem_item *alias_item);
> + void init (ipa_icf_gimple::func_checker *) final override;
> + bool equals_wpa (sem_item *item,
> + hash_map <symtab_node *, sem_item *> &ignored_nodes)
> + final override;
> + hashval_t get_hash (void) final override;
> + bool equals (sem_item *item,
> + hash_map <symtab_node *, sem_item *> &ignored_nodes)
> + final override;
> + bool merge (sem_item *alias_item) final override;
>
> /* Dump symbol to FILE. */
> - virtual void dump_to_file (FILE *file)
> + void dump_to_file (FILE *file) final override
> {
> gcc_assert (file);
> dump_function_to_file (decl, file, TDF_DETAILS);
> @@ -426,17 +428,19 @@ public:
> sem_variable (varpool_node *_node, bitmap_obstack *stack);
>
> /* Semantic variable initialization function. */
> - virtual void init (ipa_icf_gimple::func_checker *);
> + void init (ipa_icf_gimple::func_checker *) final override;
>
> - virtual hashval_t get_hash (void);
> - virtual bool merge (sem_item *alias_item);
> - virtual void dump_to_file (FILE *file);
> - virtual bool equals (sem_item *item,
> - hash_map <symtab_node *, sem_item *>
> &ignored_nodes);
> + hashval_t get_hash (void) final override;
> + bool merge (sem_item *alias_item) final override;
> + void dump_to_file (FILE *file) final override;
> + bool equals (sem_item *item,
> + hash_map <symtab_node *, sem_item *> &ignored_nodes)
> + final override;
>
> /* Fast equality variable based on knowledge known in WPA. */
> - virtual bool equals_wpa (sem_item *item,
> - hash_map <symtab_node *, sem_item *>
> &ignored_nodes);
> + bool equals_wpa (sem_item *item,
> + hash_map <symtab_node *, sem_item *> &ignored_nodes)
> + final override;
>
> /* Returns varpool_node. */
> inline varpool_node *get_node (void)
> diff --git a/gcc/lto/lto-dump.cc b/gcc/lto/lto-dump.cc
> index 1fb3fb86fb5..f88486b5143 100644
> --- a/gcc/lto/lto-dump.cc
> +++ b/gcc/lto/lto-dump.cc
> @@ -80,7 +80,7 @@ public:
> virtual ~variable_entry ()
> {}
>
> - virtual size_t get_size () const
> + size_t get_size () const final override
> {
> varpool_node *vnode = dyn_cast<varpool_node *> (node);
> if (DECL_SIZE (vnode->decl) && tree_fits_shwi_p (DECL_SIZE (vnode-
> >decl)))
> @@ -88,7 +88,7 @@ public:
> return 0;
> }
>
> - virtual void dump ()
> + void dump () final override
> {
> symbol_entry :: dump ();
> varpool_node *vnode = dyn_cast<varpool_node *> (node);
> @@ -111,13 +111,13 @@ public:
> virtual ~function_entry ()
> {}
>
> - virtual void dump ()
> + void dump () final override
> {
> symbol_entry :: dump ();
> printf ("\n");
> }
>
> - virtual size_t get_size () const
> + size_t get_size () const final override
> {
> cgraph_node *cnode = dyn_cast<cgraph_node *> (node);
> gcc_assert (cnode);
> diff --git a/gcc/read-md.h b/gcc/read-md.h
> index 34a64fa93a2..7d8cd4a8336 100644
> --- a/gcc/read-md.h
> +++ b/gcc/read-md.h
> @@ -330,7 +330,7 @@ class noop_reader : public md_reader
> noop_reader () : md_reader (false) {}
>
> /* A dummy implementation which skips unknown directives. */
> - void handle_unknown_directive (file_location, const char *);
> + void handle_unknown_directive (file_location, const char *)
> override;
> };
>
> /* An md_reader subclass that actually handles full hierarchical
> diff --git a/gcc/read-rtl-function.cc b/gcc/read-rtl-function.cc
> index eacbe4c1200..3bcff1540e7 100644
> --- a/gcc/read-rtl-function.cc
> +++ b/gcc/read-rtl-function.cc
> @@ -188,7 +188,7 @@ class fixup_insn_uid : public operand_fixup
> m_insn_uid (insn_uid)
> {}
>
> - void apply (function_reader *reader) const;
> + void apply (function_reader *reader) const final override;
>
> private:
> int m_insn_uid;
> @@ -206,7 +206,7 @@ class fixup_note_insn_basic_block : public
> operand_fixup
> m_bb_idx (bb_idx)
> {}
>
> - void apply (function_reader *reader) const;
> + void apply (function_reader *reader) const final override;
>
> private:
> int m_bb_idx;
> @@ -225,7 +225,7 @@ class fixup_expr : public fixup
>
> ~fixup_expr () { free (m_desc); }
>
> - void apply (function_reader *reader) const;
> + void apply (function_reader *reader) const final override;
>
> private:
> char *m_desc;
> diff --git a/gcc/tree-ssa-loop-ch.cc b/gcc/tree-ssa-loop-ch.cc
> index 9ab63d1fa0c..d1391940c2b 100644
> --- a/gcc/tree-ssa-loop-ch.cc
> +++ b/gcc/tree-ssa-loop-ch.cc
> @@ -320,7 +320,7 @@ public:
>
> protected:
> /* ch_base method: */
> - virtual bool process_loop_p (class loop *loop);
> + bool process_loop_p (class loop *loop) final override;
> }; // class pass_ch
>
> const pass_data pass_data_ch_vect =
> @@ -358,7 +358,7 @@ public:
>
> protected:
> /* ch_base method: */
> - virtual bool process_loop_p (class loop *loop);
> + bool process_loop_p (class loop *loop) final override;
> }; // class pass_ch_vect
>
> /* For all loops, copy the condition at the end of the loop body in
> front
> diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc
> index 7407591e98c..b2f35a5fb55 100644
> --- a/gcc/tree-ssa-sccvn.cc
> +++ b/gcc/tree-ssa-sccvn.cc
> @@ -2534,9 +2534,9 @@ public:
> : eliminate_dom_walker (CDI_DOMINATORS, NULL), entry (entry_),
> m_avail_freelist (NULL) {}
>
> - virtual tree eliminate_avail (basic_block, tree op);
> + tree eliminate_avail (basic_block, tree op) final override;
>
> - virtual void eliminate_push_avail (basic_block, tree);
> + void eliminate_push_avail (basic_block, tree) final override;
>
> basic_block entry;
> /* Freelist of avail entries which are allocated from the vn_ssa_aux
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: PING Re: [PATCH 07/10] value-relation.h: add 'final' and 'override' to relation_oracle vfunc impls
2022-06-13 18:28 ` PING " David Malcolm
@ 2022-06-14 0:45 ` Aldy Hernandez
2022-06-14 1:24 ` David Malcolm
0 siblings, 1 reply; 39+ messages in thread
From: Aldy Hernandez @ 2022-06-14 0:45 UTC (permalink / raw)
To: David Malcolm; +Cc: gcc-patches, Andrew MacLeod
Final implies we can't further derive from the derived class, right? If so
we may want just override.
Andrew, what are your thoughts?
Thanks for doing this.
Aldy
On Mon, Jun 13, 2022, 14:28 David Malcolm <dmalcolm@redhat.com> wrote:
> Ping re this patch:
> https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595438.html
>
> OK for trunk?
>
> Thanks
> Dave
>
>
> On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote:
> > gcc/ChangeLog:
> > * value-relation.h: Add "final" and "override" to
> > relation_oracle
> > vfunc implementations as appropriate.
> >
> > Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> > ---
> > gcc/value-relation.h | 38 +++++++++++++++++++++-----------------
> > 1 file changed, 21 insertions(+), 17 deletions(-)
> >
> > diff --git a/gcc/value-relation.h b/gcc/value-relation.h
> > index 19762d8ce2b..478729be0bf 100644
> > --- a/gcc/value-relation.h
> > +++ b/gcc/value-relation.h
> > @@ -130,14 +130,15 @@ public:
> > equiv_oracle ();
> > ~equiv_oracle ();
> >
> > - const_bitmap equiv_set (tree ssa, basic_block bb);
> > + const_bitmap equiv_set (tree ssa, basic_block bb) final override;
> > void register_relation (basic_block bb, relation_kind k, tree ssa1,
> > - tree ssa2);
> > + tree ssa2) override;
> >
> > - relation_kind query_relation (basic_block, tree, tree);
> > - relation_kind query_relation (basic_block, const_bitmap,
> > const_bitmap);
> > - void dump (FILE *f, basic_block bb) const;
> > - void dump (FILE *f) const;
> > + relation_kind query_relation (basic_block, tree, tree) override;
> > + relation_kind query_relation (basic_block, const_bitmap,
> > const_bitmap)
> > + override;
> > + void dump (FILE *f, basic_block bb) const override;
> > + void dump (FILE *f) const override;
> >
> > protected:
> > bitmap_obstack m_bitmaps;
> > @@ -185,14 +186,16 @@ public:
> > dom_oracle ();
> > ~dom_oracle ();
> >
> > - void register_relation (basic_block bb, relation_kind k, tree op1,
> > tree op2);
> > + void register_relation (basic_block bb, relation_kind k, tree op1,
> > tree op2)
> > + final override;
> >
> > - relation_kind query_relation (basic_block bb, tree ssa1, tree ssa2);
> > + relation_kind query_relation (basic_block bb, tree ssa1, tree ssa2)
> > + final override;
> > relation_kind query_relation (basic_block bb, const_bitmap b1,
> > - const_bitmap b2);
> > + const_bitmap b2) final override;
> >
> > - void dump (FILE *f, basic_block bb) const;
> > - void dump (FILE *f) const;
> > + void dump (FILE *f, basic_block bb) const final override;
> > + void dump (FILE *f) const final override;
> > private:
> > bitmap m_tmp, m_tmp2;
> > bitmap m_relation_set; // Index by ssa-name. True if a relation
> > exists
> > @@ -229,15 +232,16 @@ class path_oracle : public relation_oracle
> > public:
> > path_oracle (relation_oracle *oracle = NULL);
> > ~path_oracle ();
> > - const_bitmap equiv_set (tree, basic_block);
> > - void register_relation (basic_block, relation_kind, tree, tree);
> > + const_bitmap equiv_set (tree, basic_block) final override;
> > + void register_relation (basic_block, relation_kind, tree, tree)
> > final override;
> > void killing_def (tree);
> > - relation_kind query_relation (basic_block, tree, tree);
> > - relation_kind query_relation (basic_block, const_bitmap,
> > const_bitmap);
> > + relation_kind query_relation (basic_block, tree, tree) final
> > override;
> > + relation_kind query_relation (basic_block, const_bitmap,
> > const_bitmap)
> > + final override;
> > void reset_path ();
> > void set_root_oracle (relation_oracle *oracle) { m_root = oracle; }
> > - void dump (FILE *, basic_block) const;
> > - void dump (FILE *) const;
> > + void dump (FILE *, basic_block) const final override;
> > + void dump (FILE *) const final override;
> > private:
> > void register_equiv (basic_block bb, tree ssa1, tree ssa2);
> > equiv_chain m_equiv;
>
>
>
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: PING Re: [PATCH 07/10] value-relation.h: add 'final' and 'override' to relation_oracle vfunc impls
2022-06-14 0:45 ` Aldy Hernandez
@ 2022-06-14 1:24 ` David Malcolm
2022-06-15 13:33 ` Andrew MacLeod
0 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-06-14 1:24 UTC (permalink / raw)
To: Aldy Hernandez; +Cc: gcc-patches, Andrew MacLeod
On Mon, 2022-06-13 at 20:45 -0400, Aldy Hernandez wrote:
> Final implies we can't further derive from the derived class, right?
"final" on a vfunc implies that nothing overrides that vfunc, but you
could still have further derived classes.
You can think of it as "nothing further overrides this vfunc", as both
a hint to the human reader, and an optimization hint to the compiler.
You can always just remove the "final" if you want to override it in
the future (unless the override is happening in a plugin, I suppose).
> If so
> we may want just override.
"override" is indeed probably more useful, in that it documents to
compilers and human readers that you intend this to override a vfunc.
FWIW I wrote the patch by using both "final" and "override", and then
dropping the "final" everywhere I needed to to get it to compile.
Dave
>
> Andrew, what are your thoughts?
>
> Thanks for doing this.
>
> Aldy
>
> On Mon, Jun 13, 2022, 14:28 David Malcolm <dmalcolm@redhat.com> wrote:
>
> > Ping re this patch:
> > https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595438.html
> >
> > OK for trunk?
> >
> > Thanks
> > Dave
> >
> >
> > On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote:
> > > gcc/ChangeLog:
> > > * value-relation.h: Add "final" and "override" to
> > > relation_oracle
> > > vfunc implementations as appropriate.
> > >
> > > Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> > > ---
> > > gcc/value-relation.h | 38 +++++++++++++++++++++-----------------
> > > 1 file changed, 21 insertions(+), 17 deletions(-)
> > >
> > > diff --git a/gcc/value-relation.h b/gcc/value-relation.h
> > > index 19762d8ce2b..478729be0bf 100644
> > > --- a/gcc/value-relation.h
> > > +++ b/gcc/value-relation.h
> > > @@ -130,14 +130,15 @@ public:
> > > equiv_oracle ();
> > > ~equiv_oracle ();
> > >
> > > - const_bitmap equiv_set (tree ssa, basic_block bb);
> > > + const_bitmap equiv_set (tree ssa, basic_block bb) final
> > > override;
> > > void register_relation (basic_block bb, relation_kind k, tree
> > > ssa1,
> > > - tree ssa2);
> > > + tree ssa2) override;
> > >
> > > - relation_kind query_relation (basic_block, tree, tree);
> > > - relation_kind query_relation (basic_block, const_bitmap,
> > > const_bitmap);
> > > - void dump (FILE *f, basic_block bb) const;
> > > - void dump (FILE *f) const;
> > > + relation_kind query_relation (basic_block, tree, tree) override;
> > > + relation_kind query_relation (basic_block, const_bitmap,
> > > const_bitmap)
> > > + override;
> > > + void dump (FILE *f, basic_block bb) const override;
> > > + void dump (FILE *f) const override;
> > >
> > > protected:
> > > bitmap_obstack m_bitmaps;
> > > @@ -185,14 +186,16 @@ public:
> > > dom_oracle ();
> > > ~dom_oracle ();
> > >
> > > - void register_relation (basic_block bb, relation_kind k, tree
> > > op1,
> > > tree op2);
> > > + void register_relation (basic_block bb, relation_kind k, tree
> > > op1,
> > > tree op2)
> > > + final override;
> > >
> > > - relation_kind query_relation (basic_block bb, tree ssa1, tree
> > > ssa2);
> > > + relation_kind query_relation (basic_block bb, tree ssa1, tree
> > > ssa2)
> > > + final override;
> > > relation_kind query_relation (basic_block bb, const_bitmap b1,
> > > - const_bitmap b2);
> > > + const_bitmap b2) final override;
> > >
> > > - void dump (FILE *f, basic_block bb) const;
> > > - void dump (FILE *f) const;
> > > + void dump (FILE *f, basic_block bb) const final override;
> > > + void dump (FILE *f) const final override;
> > > private:
> > > bitmap m_tmp, m_tmp2;
> > > bitmap m_relation_set; // Index by ssa-name. True if a relation
> > > exists
> > > @@ -229,15 +232,16 @@ class path_oracle : public relation_oracle
> > > public:
> > > path_oracle (relation_oracle *oracle = NULL);
> > > ~path_oracle ();
> > > - const_bitmap equiv_set (tree, basic_block);
> > > - void register_relation (basic_block, relation_kind, tree, tree);
> > > + const_bitmap equiv_set (tree, basic_block) final override;
> > > + void register_relation (basic_block, relation_kind, tree, tree)
> > > final override;
> > > void killing_def (tree);
> > > - relation_kind query_relation (basic_block, tree, tree);
> > > - relation_kind query_relation (basic_block, const_bitmap,
> > > const_bitmap);
> > > + relation_kind query_relation (basic_block, tree, tree) final
> > > override;
> > > + relation_kind query_relation (basic_block, const_bitmap,
> > > const_bitmap)
> > > + final override;
> > > void reset_path ();
> > > void set_root_oracle (relation_oracle *oracle) { m_root =
> > > oracle; }
> > > - void dump (FILE *, basic_block) const;
> > > - void dump (FILE *) const;
> > > + void dump (FILE *, basic_block) const final override;
> > > + void dump (FILE *) const final override;
> > > private:
> > > void register_equiv (basic_block bb, tree ssa1, tree ssa2);
> > > equiv_chain m_equiv;
> >
> >
> >
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: PING Re: [PATCH 07/10] value-relation.h: add 'final' and 'override' to relation_oracle vfunc impls
2022-06-14 1:24 ` David Malcolm
@ 2022-06-15 13:33 ` Andrew MacLeod
2022-06-15 21:58 ` David Malcolm
0 siblings, 1 reply; 39+ messages in thread
From: Andrew MacLeod @ 2022-06-15 13:33 UTC (permalink / raw)
To: David Malcolm, Aldy Hernandez; +Cc: gcc-patches
On 6/13/22 21:24, David Malcolm wrote:
> On Mon, 2022-06-13 at 20:45 -0400, Aldy Hernandez wrote:
>> Final implies we can't further derive from the derived class, right?
> "final" on a vfunc implies that nothing overrides that vfunc, but you
> could still have further derived classes.
>
> You can think of it as "nothing further overrides this vfunc", as both
> a hint to the human reader, and an optimization hint to the compiler.
>
> You can always just remove the "final" if you want to override it in
> the future (unless the override is happening in a plugin, I suppose).
>
>> If so
>> we may want just override.
> "override" is indeed probably more useful, in that it documents to
> compilers and human readers that you intend this to override a vfunc.
>
> FWIW I wrote the patch by using both "final" and "override", and then
> dropping the "final" everywhere I needed to to get it to compile.
>
> Dave
>
>
>> Andrew, what are your thoughts?
>>
>> Thanks for doing this.
OK by me.
Andrew
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: PING Re: [PATCH 07/10] value-relation.h: add 'final' and 'override' to relation_oracle vfunc impls
2022-06-15 13:33 ` Andrew MacLeod
@ 2022-06-15 21:58 ` David Malcolm
0 siblings, 0 replies; 39+ messages in thread
From: David Malcolm @ 2022-06-15 21:58 UTC (permalink / raw)
To: Andrew MacLeod, Aldy Hernandez; +Cc: gcc-patches
On Wed, 2022-06-15 at 09:33 -0400, Andrew MacLeod wrote:
> On 6/13/22 21:24, David Malcolm wrote:
> > On Mon, 2022-06-13 at 20:45 -0400, Aldy Hernandez wrote:
> > > Final implies we can't further derive from the derived class,
> > > right?
> > "final" on a vfunc implies that nothing overrides that vfunc, but you
> > could still have further derived classes.
> >
> > You can think of it as "nothing further overrides this vfunc", as
> > both
> > a hint to the human reader, and an optimization hint to the compiler.
> >
> > You can always just remove the "final" if you want to override it in
> > the future (unless the override is happening in a plugin, I suppose).
> >
> > > If so
> > > we may want just override.
> > "override" is indeed probably more useful, in that it documents to
> > compilers and human readers that you intend this to override a vfunc.
> >
> > FWIW I wrote the patch by using both "final" and "override", and then
> > dropping the "final" everywhere I needed to to get it to compile.
> >
> > Dave
> >
> >
> > > Andrew, what are your thoughts?
> > >
> > > Thanks for doing this.
>
> OK by me.
Thanks; I've pushed this to trunk as r13-1118-gb06b84dbca5a11, after
retesting (bootstrapped & regrtested again on x86_64-pc-linux-gnu).
FWIW, as noted in
https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595437.html
I tried hacking in -Werror=suggest-override to the Makefile, and there
were a bunch of places that it suggested could use "override" in
gcc/range.op.cc, but I decided not to touch that, because it seems to
be under heavy development by you (and also, frankly, out of laziness
on my part). So maybe you might want to look at adding those at some
point, to avoid snafus where you meant to override something, but got
the signature slightly wrong, etc.
Dave
^ permalink raw reply [flat|nested] 39+ messages in thread
* PING^2: Re: [PATCH 01/10] Add 'final' and 'override' to opt_pass vfunc impls
2022-06-13 18:22 ` PING: " David Malcolm
@ 2022-06-24 18:08 ` David Malcolm
2022-06-24 18:45 ` Jeff Law
0 siblings, 1 reply; 39+ messages in thread
From: David Malcolm @ 2022-06-24 18:08 UTC (permalink / raw)
To: gcc-patches
On Mon, 2022-06-13 at 14:22 -0400, David Malcolm wrote:
> Ping for this patch:
> https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595444.html
>
> OK for trunk?
>
> Thanks
> Dave
>
> On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote:
> > gcc/ChangeLog:
> > * adjust-alignment.cc: Add "final" and "override" to
> > opt_pass
> > vfunc implementations, removing redundant "virtual" as
> > appropriate.
> > * asan.cc: Likewise.
> > * auto-inc-dec.cc: Likewise.
> > * auto-profile.cc: Likewise.
> > * bb-reorder.cc: Likewise.
> > * cfgcleanup.cc: Likewise.
> > * cfgexpand.cc: Likewise.
> > * cfgrtl.cc: Likewise.
> > * cgraphbuild.cc: Likewise.
> > * combine-stack-adj.cc: Likewise.
> > * combine.cc: Likewise.
> > * compare-elim.cc: Likewise.
> > * config/i386/i386-features.cc: Likewise.
> > * coroutine-passes.cc: Likewise.
> > * cprop.cc: Likewise.
> > * cse.cc: Likewise.
> > * dce.cc: Likewise.
> > * df-core.cc: Likewise.
> > * dse.cc: Likewise.
> > * dwarf2cfi.cc: Likewise.
> > * early-remat.cc: Likewise.
> > * except.cc: Likewise.
> > * final.cc: Likewise.
> > * function.cc: Likewise.
> > * fwprop.cc: Likewise.
> > * gcse.cc: Likewise.
> > * gimple-harden-conditionals.cc: Likewise.
> > * gimple-if-to-switch.cc: Likewise.
> > * gimple-isel.cc: Likewise.
> > * gimple-laddress.cc: Likewise.
> > * gimple-loop-interchange.cc: Likewise.
> > * gimple-loop-jam.cc: Likewise.
> > * gimple-loop-versioning.cc: Likewise.
> > * gimple-low.cc: Likewise.
> > * gimple-ssa-backprop.cc: Likewise.
> > * gimple-ssa-evrp.cc: Likewise.
> > * gimple-ssa-isolate-paths.cc: Likewise.
> > * gimple-ssa-nonnull-compare.cc: Likewise.
> > * gimple-ssa-split-paths.cc: Likewise.
> > * gimple-ssa-store-merging.cc: Likewise.
> > * gimple-ssa-strength-reduction.cc: Likewise.
> > * gimple-ssa-warn-access.cc: Likewise.
> > * gimple-ssa-warn-alloca.cc: Likewise.
> > * gimple-ssa-warn-restrict.cc: Likewise.
> > * gimple-warn-recursion.cc: Likewise.
> > * graphite.cc: Likewise.
> > * ifcvt.cc: Likewise.
> > * init-regs.cc: Likewise.
> > * ipa-comdats.cc: Likewise.
> > * ipa-cp.cc: Likewise.
> > * ipa-devirt.cc: Likewise.
> > * ipa-fnsummary.cc: Likewise.
> > * ipa-free-lang-data.cc: Likewise.
> > * ipa-icf.cc: Likewise.
> > * ipa-inline.cc: Likewise.
> > * ipa-modref.cc: Likewise.
> > * ipa-profile.cc: Likewise.
> > * ipa-pure-const.cc: Likewise.
> > * ipa-reference.cc: Likewise.
> > * ipa-split.cc: Likewise.
> > * ipa-sra.cc: Likewise.
> > * ipa-visibility.cc: Likewise.
> > * ipa.cc: Likewise.
> > * ira.cc: Likewise.
> > * jump.cc: Likewise.
> > * loop-init.cc: Likewise.
> > * lower-subreg.cc: Likewise.
> > * mode-switching.cc: Likewise.
> > * modulo-sched.cc: Likewise.
> > * multiple_target.cc: Likewise.
> > * omp-expand.cc: Likewise.
> > * omp-low.cc: Likewise.
> > * omp-oacc-kernels-decompose.cc: Likewise.
> > * omp-oacc-neuter-broadcast.cc: Likewise.
> > * omp-offload.cc: Likewise.
> > * omp-simd-clone.cc: Likewise.
> > * passes.cc: Likewise.
> > * postreload-gcse.cc: Likewise.
> > * postreload.cc: Likewise.
> > * predict.cc: Likewise.
> > * recog.cc: Likewise.
> > * ree.cc: Likewise.
> > * reg-stack.cc: Likewise.
> > * regcprop.cc: Likewise.
> > * reginfo.cc: Likewise.
> > * regrename.cc: Likewise.
> > * reorg.cc: Likewise.
> > * sancov.cc: Likewise.
> > * sanopt.cc: Likewise.
> > * sched-rgn.cc: Likewise.
> > * stack-ptr-mod.cc: Likewise.
> > * store-motion.cc: Likewise.
> > * tracer.cc: Likewise.
> > * trans-mem.cc: Likewise.
> > * tree-call-cdce.cc: Likewise.
> > * tree-cfg.cc: Likewise.
> > * tree-cfgcleanup.cc: Likewise.
> > * tree-complex.cc: Likewise.
> > * tree-eh.cc: Likewise.
> > * tree-emutls.cc: Likewise.
> > * tree-if-conv.cc: Likewise.
> > * tree-into-ssa.cc: Likewise.
> > * tree-loop-distribution.cc: Likewise.
> > * tree-nrv.cc: Likewise.
> > * tree-object-size.cc: Likewise.
> > * tree-parloops.cc: Likewise.
> > * tree-predcom.cc: Likewise.
> > * tree-profile.cc: Likewise.
> > * tree-sra.cc: Likewise.
> > * tree-ssa-ccp.cc: Likewise.
> > * tree-ssa-copy.cc: Likewise.
> > * tree-ssa-dce.cc: Likewise.
> > * tree-ssa-dom.cc: Likewise.
> > * tree-ssa-dse.cc: Likewise.
> > * tree-ssa-forwprop.cc: Likewise.
> > * tree-ssa-ifcombine.cc: Likewise.
> > * tree-ssa-loop-ch.cc: Likewise.
> > * tree-ssa-loop-im.cc: Likewise.
> > * tree-ssa-loop-ivcanon.cc: Likewise.
> > * tree-ssa-loop-prefetch.cc: Likewise.
> > * tree-ssa-loop-split.cc: Likewise.
> > * tree-ssa-loop-unswitch.cc: Likewise.
> > * tree-ssa-loop.cc: Likewise.
> > * tree-ssa-math-opts.cc: Likewise.
> > * tree-ssa-phiopt.cc: Likewise.
> > * tree-ssa-phiprop.cc: Likewise.
> > * tree-ssa-pre.cc: Likewise.
> > * tree-ssa-reassoc.cc: Likewise.
> > * tree-ssa-sccvn.cc: Likewise.
> > * tree-ssa-sink.cc: Likewise.
> > * tree-ssa-strlen.cc: Likewise.
> > * tree-ssa-structalias.cc: Likewise.
> > * tree-ssa-uncprop.cc: Likewise.
> > * tree-ssa-uninit.cc: Likewise.
> > * tree-ssanames.cc: Likewise.
> > * tree-stdarg.cc: Likewise.
> > * tree-switch-conversion.cc: Likewise.
> > * tree-tailcall.cc: Likewise.
> > * tree-vect-generic.cc: Likewise.
> > * tree-vectorizer.cc: Likewise.
> > * tree-vrp.cc: Likewise.
> > * tsan.cc: Likewise.
> > * ubsan.cc: Likewise.
> > * var-tracking.cc: Likewise.
> > * vtable-verify.cc: Likewise.
> > * web.cc: Likewise.
> >
> > Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> > ---
> > gcc/adjust-alignment.cc | 2 +-
> > gcc/asan.cc | 19 ++++++++++++----
> > gcc/auto-inc-dec.cc | 4 ++--
> > gcc/auto-profile.cc | 8 +++----
> > gcc/bb-reorder.cc | 12 +++++-----
> > gcc/cfgcleanup.cc | 8 +++----
> > gcc/cfgexpand.cc | 2 +-
> > gcc/cfgrtl.cc | 6 ++---
> > gcc/cgraphbuild.cc | 13 +++++++----
> > gcc/combine-stack-adj.cc | 4 ++--
> > gcc/combine.cc | 4 ++--
> > gcc/compare-elim.cc | 4 ++--
> > gcc/config/i386/i386-features.cc | 20 ++++++++--------
> > gcc/coroutine-passes.cc | 8 +++----
> > gcc/cprop.cc | 9 +++++---
> > gcc/cse.cc | 18 ++++++++++-----
> > gcc/dce.cc | 8 +++----
> > gcc/df-core.cc | 10 ++++----
> > gcc/dse.cc | 14 ++++++++----
> > gcc/dwarf2cfi.cc | 7 ++++--
> > gcc/early-remat.cc | 4 ++--
> > gcc/except.cc | 6 ++---
> > gcc/final.cc | 14 ++++++++----
> > gcc/function.cc | 10 ++++----
> > gcc/fwprop.cc | 8 +++----
> > gcc/gcse.cc | 14 ++++++++----
> > gcc/gimple-harden-conditionals.cc | 20 +++++++++++-----
> > gcc/gimple-if-to-switch.cc | 4 ++--
> > gcc/gimple-isel.cc | 4 ++--
> > gcc/gimple-laddress.cc | 6 ++---
> > gcc/gimple-loop-interchange.cc | 6 ++---
> > gcc/gimple-loop-jam.cc | 4 ++--
> > gcc/gimple-loop-versioning.cc | 7 ++++--
> > gcc/gimple-low.cc | 5 +++-
> > gcc/gimple-ssa-backprop.cc | 6 ++---
> > gcc/gimple-ssa-evrp.cc | 6 ++---
> > gcc/gimple-ssa-isolate-paths.cc | 9 +++++---
> > gcc/gimple-ssa-nonnull-compare.cc | 4 ++--
> > gcc/gimple-ssa-split-paths.cc | 9 +++++---
> > gcc/gimple-ssa-store-merging.cc | 10 ++++----
> > gcc/gimple-ssa-strength-reduction.cc | 4 ++--
> > gcc/gimple-ssa-warn-access.cc | 8 +++----
> > gcc/gimple-ssa-warn-alloca.cc | 8 +++----
> > gcc/gimple-ssa-warn-restrict.cc | 4 ++--
> > gcc/gimple-warn-recursion.cc | 4 ++--
> > gcc/graphite.cc | 9 +++++---
> > gcc/ifcvt.cc | 12 +++++-----
> > gcc/init-regs.cc | 4 ++--
> > gcc/ipa-comdats.cc | 4 ++--
> > gcc/ipa-cp.cc | 4 ++--
> > gcc/ipa-devirt.cc | 8 +++----
> > gcc/ipa-fnsummary.cc | 20 ++++++++++------
> > gcc/ipa-free-lang-data.cc | 2 +-
> > gcc/ipa-icf.cc | 4 ++--
> > gcc/ipa-inline.cc | 4 ++--
> > gcc/ipa-modref.cc | 12 +++++-----
> > gcc/ipa-profile.cc | 4 ++--
> > gcc/ipa-pure-const.cc | 26 +++++++++++++--------
> > gcc/ipa-reference.cc | 4 ++--
> > gcc/ipa-split.cc | 8 +++----
> > gcc/ipa-sra.cc | 7 ++++--
> > gcc/ipa-visibility.cc | 6 ++---
> > gcc/ipa.cc | 9 +++++---
> > gcc/ira.cc | 8 +++----
> > gcc/jump.cc | 5 +++-
> > gcc/loop-init.cc | 18 +++++++--------
> > gcc/lower-subreg.cc | 16 +++++++------
> > gcc/mode-switching.cc | 6 ++---
> > gcc/modulo-sched.cc | 4 ++--
> > gcc/multiple_target.cc | 7 ++++--
> > gcc/omp-expand.cc | 14 ++++++++----
> > gcc/omp-low.cc | 9 +++++---
> > gcc/omp-oacc-kernels-decompose.cc | 4 ++--
> > gcc/omp-oacc-neuter-broadcast.cc | 4 ++--
> > gcc/omp-offload.cc | 16 ++++++-------
> > gcc/omp-simd-clone.cc | 7 ++++--
> > gcc/passes.cc | 34 ++++++++++++++++--------
> > ----
> > gcc/postreload-gcse.cc | 7 ++++--
> > gcc/postreload.cc | 7 ++++--
> > gcc/predict.cc | 13 +++++++----
> > gcc/recog.cc | 32 +++++++++++++++---------
> > --
> > gcc/ree.cc | 7 ++++--
> > gcc/reg-stack.cc | 4 ++--
> > gcc/regcprop.cc | 4 ++--
> > gcc/reginfo.cc | 2 +-
> > gcc/regrename.cc | 7 ++++--
> > gcc/reorg.cc | 8 +++----
> > gcc/sancov.cc | 10 ++++----
> > gcc/sanopt.cc | 4 ++--
> > gcc/sched-rgn.cc | 19 +++++++++-------
> > gcc/stack-ptr-mod.cc | 2 +-
> > gcc/store-motion.cc | 4 ++--
> > gcc/tracer.cc | 4 ++--
> > gcc/trans-mem.cc | 34 +++++++++++++++++++-----
> > ----
> > gcc/tree-call-cdce.cc | 4 ++--
> > gcc/tree-cfg.cc | 28 ++++++++++++++++-------
> > gcc/tree-cfgcleanup.cc | 6 ++---
> > gcc/tree-complex.cc | 14 ++++++++----
> > gcc/tree-eh.cc | 23 +++++++++++--------
> > gcc/tree-emutls.cc | 7 ++++--
> > gcc/tree-if-conv.cc | 4 ++--
> > gcc/tree-into-ssa.cc | 4 ++--
> > gcc/tree-loop-distribution.cc | 4 ++--
> > gcc/tree-nrv.cc | 6 ++---
> > gcc/tree-object-size.cc | 6 ++---
> > gcc/tree-parloops.cc | 11 +++++----
> > gcc/tree-predcom.cc | 8 +++----
> > gcc/tree-profile.cc | 4 ++--
> > gcc/tree-sra.cc | 11 +++++----
> > gcc/tree-ssa-ccp.cc | 21 +++++++++--------
> > gcc/tree-ssa-copy.cc | 9 +++++---
> > gcc/tree-ssa-dce.cc | 14 ++++++------
> > gcc/tree-ssa-dom.cc | 8 +++----
> > gcc/tree-ssa-dse.cc | 6 ++---
> > gcc/tree-ssa-forwprop.cc | 6 ++---
> > gcc/tree-ssa-ifcombine.cc | 2 +-
> > gcc/tree-ssa-loop-ch.cc | 10 ++++----
> > gcc/tree-ssa-loop-im.cc | 6 ++---
> > gcc/tree-ssa-loop-ivcanon.cc | 10 ++++----
> > gcc/tree-ssa-loop-prefetch.cc | 7 ++++--
> > gcc/tree-ssa-loop-split.cc | 4 ++--
> > gcc/tree-ssa-loop-unswitch.cc | 4 ++--
> > gcc/tree-ssa-loop.cc | 27 ++++++++++++----------
> > gcc/tree-ssa-math-opts.cc | 15 +++++++-----
> > gcc/tree-ssa-phiopt.cc | 15 +++++++-----
> > gcc/tree-ssa-phiprop.cc | 4 ++--
> > gcc/tree-ssa-pre.cc | 4 ++--
> > gcc/tree-ssa-reassoc.cc | 8 +++----
> > gcc/tree-ssa-sccvn.cc | 8 +++----
> > gcc/tree-ssa-sink.cc | 8 +++----
> > gcc/tree-ssa-strlen.cc | 10 ++++----
> > gcc/tree-ssa-structalias.cc | 13 +++++++----
> > gcc/tree-ssa-uncprop.cc | 6 ++---
> > gcc/tree-ssa-uninit.cc | 13 +++++++----
> > gcc/tree-ssanames.cc | 2 +-
> > gcc/tree-stdarg.cc | 8 +++----
> > gcc/tree-switch-conversion.cc | 15 +++++++-----
> > gcc/tree-tailcall.cc | 16 +++++++++----
> > gcc/tree-vect-generic.cc | 11 +++++----
> > gcc/tree-vectorizer.cc | 26 +++++++++++++--------
> > gcc/tree-vrp.cc | 8 +++----
> > gcc/tsan.cc | 10 ++++----
> > gcc/ubsan.cc | 4 ++--
> > gcc/var-tracking.cc | 4 ++--
> > gcc/vtable-verify.cc | 4 ++--
> > gcc/web.cc | 4 ++--
> > 146 files changed, 769 insertions(+), 552 deletions(-)
> >
> > diff --git a/gcc/adjust-alignment.cc b/gcc/adjust-alignment.cc
> > index 2db41e8b4c8..5c5f8f4e5c0 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 4b583e54efd..5df333555ea 100644
> > --- a/gcc/asan.cc
> > +++ b/gcc/asan.cc
> > @@ -4209,9 +4209,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
> >
> > @@ -4246,11 +4252,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 85fe9d14950..481e7af6895 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 2b34b80b82d..6533722817f 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 d20ccb83aa6..bdbe2e9ea7a 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 335af4911bb..18047da7b24 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 bb33c1b939e..1d7f6b260d0 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 06be46d75df..9a4651f61a3 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 fdd17aa5a2d..bae44591a29 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 e8ba2717063..e76d60a8f7e 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 9a34ef847aa..a8305273e44 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 985c0c92182..e869d9d3249 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 6fe41c3c24f..24e8336689c 100644
> > --- a/gcc/config/i386/i386-features.cc
> > +++ b/gcc/config/i386/i386-features.cc
> > @@ -1873,13 +1873,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 ();
> > }
> > @@ -1908,23 +1908,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;
> > @@ -2135,14 +2135,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,
> > @@ -2399,7 +2399,7 @@ public:
> > {}
> >
> > /* opt_pass methods: */
> > - virtual bool gate (function *)
> > + bool gate (function *) final override
> > {
> > return (TARGET_AVX
> > && TARGET_SSE_PARTIAL_REG_DEPENDENCY
> > @@ -2408,7 +2408,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 7b9a97af5a2..21ac9469805 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 cf01c2d79a9..580f811545d 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
> >
> > diff --git a/gcc/cse.cc b/gcc/cse.cc
> > index a18b599d324..b13afd4ba72 100644
> > --- a/gcc/cse.cc
> > +++ b/gcc/cse.cc
> > @@ -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 ();
> > }
> > diff --git a/gcc/dce.cc b/gcc/dce.cc
> > index 6676cbcd429..64aa0aa471d 100644
> > --- a/gcc/dce.cc
> > +++ b/gcc/dce.cc
> > @@ -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 a901b84878f..97b2bbf6d2b 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 ();
> > }
> > diff --git a/gcc/dse.cc b/gcc/dse.cc
> > index 30c11cee034..83c572f6220 100644
> > --- a/gcc/dse.cc
> > +++ b/gcc/dse.cc
> > @@ -3747,12 +3747,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
> >
> > @@ -3787,12 +3790,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 ab7c5cc5b27..bef3165e691 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 2738892b4e7..5c368293c35 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 b94de425557..7d7ce40c846 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 a9868861bd2..81e21cb8db6 100644
> > --- a/gcc/final.cc
> > +++ b/gcc/final.cc
> > @@ -808,7 +808,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
> >
> > @@ -4360,7 +4363,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
> >
> > @@ -4404,7 +4410,7 @@ public:
> > {}
> >
> > /* opt_pass methods: */
> > - virtual unsigned int execute (function *)
> > + unsigned int execute (function *) final override
> > {
> > return rest_of_handle_shorten_branches ();
> > }
> > @@ -4579,7 +4585,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 ad0096a43ef..0c3e4fffb05 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 d12fc2f34ac..fc652ab9a1f 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 b67353143a2..f06278a5534 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 79c0a5784ba..4ca6776fca7 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 5dcfe5b77e0..c89aef34381 100644
> > --- a/gcc/gimple-if-to-switch.cc
> > +++ b/gcc/gimple-if-to-switch.cc
> > @@ -478,13 +478,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 44d086d8b28..aa9c1290735 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 13c7858e161..11754dac5c3 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 53adc02acc2..5f59730be4c 100644
> > --- a/gcc/gimple-loop-interchange.cc
> > +++ b/gcc/gimple-loop-interchange.cc
> > @@ -1703,9 +1703,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 e33dd9091df..9b18b52a54c 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 ab02bdd4b15..6bcf6eba691 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 2ec19d5657d..4cd27dd19b0 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 74f98111256..55986ddbfe3 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 20388ed5431..793a3ea1f19 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 cc0ed9760a0..87ecd19ef4a 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 cc52b914258..f9ce8c7a083 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 6abe1d51400..f2e43e52c95 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 b952ce57917..0640168bcc4 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 dad73d31874..2b559e96fc8 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 9357a4e576a..1f70cbdb884 100644
> > --- a/gcc/gimple-ssa-warn-access.cc
> > +++ b/gcc/gimple-ssa-warn-access.cc
> > @@ -2069,13 +2069,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 273b88ec141..83a241a3a4b 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 b678e806da3..2a1afcbb0fc 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 91a3cdbacd4..9b04899cf78 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 ab8683b5b41..a88b13c0219 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 b983e87389f..28b153cf2ae 100644
> > --- a/gcc/ifcvt.cc
> > +++ b/gcc/ifcvt.cc
> > @@ -5933,12 +5933,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 ();
> > }
> > @@ -5980,13 +5980,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;
> > @@ -6026,13 +6026,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 220ef705997..652befefdaa 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 566faf3cc1f..da792065ed3 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 152fe7244f7..38a21b17e39 100644
> > --- a/gcc/ipa-cp.cc
> > +++ b/gcc/ipa-cp.cc
> > @@ -6659,14 +6659,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 9f1442dc3cc..412ca14f66b 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 b12e7a1124d..832794fd5dc 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 f99f7be1c58..ccdbf849c25 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 765ae746745..a8a162268ee 100644
> > --- a/gcc/ipa-icf.cc
> > +++ b/gcc/ipa-icf.cc
> > @@ -3637,12 +3637,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 22a009b7435..14969198cde 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 556816ab429..7c1f974bc7a 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 b74d77f2c95..496f292acba 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 2b4950a5969..0e55fc4bfc5 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 67e0c85a95e..b5a2350ce72 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 60021bad13c..16734617d03 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 261a720858f..4f705a3febf 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 e95a0dd252f..8a27e7bcdfd 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);
> > }
> > diff --git a/gcc/ipa.cc b/gcc/ipa.cc
> > index f53f15f5f0a..c01dca17bec 100644
> > --- a/gcc/ipa.cc
> > +++ b/gcc/ipa.cc
> > @@ -1343,8 +1343,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
> >
> > @@ -1566,7 +1569,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
> >
> > diff --git a/gcc/ira.cc b/gcc/ira.cc
> > index e3b3c549120..42c9cead9f8 100644
> > --- a/gcc/ira.cc
> > +++ b/gcc/ira.cc
> > @@ -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 332f86878e1..e6207169be0 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 1e4f6cfd7fb..648aa290916 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 d30bbeeabda..03e9326c663 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 6e3f1dc65e2..b0f6e7cedd4 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 1e1fa7055a2..f78d791cb01 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 7fe02fb55c8..3e2d26882c8 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 9fcc67a3448..3d48e1df175 100644
> > --- a/gcc/omp-expand.cc
> > +++ b/gcc/omp-expand.cc
> > @@ -10574,7 +10574,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)
> > @@ -10621,12 +10621,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 c83af6c3865..e00788f0ea1 100644
> > --- a/gcc/omp-low.cc
> > +++ b/gcc/omp-low.cc
> > @@ -14594,7 +14594,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
> >
> > @@ -14902,11 +14905,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 ec9b0faab0a..524060e2fca 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 81e3223a94c..b6177794cde 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 ad4e772015e..9de04fc520c 100644
> > --- a/gcc/omp-offload.cc
> > +++ b/gcc/omp-offload.cc
> > @@ -2449,9 +2449,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 ();
> > }
> > @@ -2479,9 +2479,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 ();
> > }
> > @@ -2713,13 +2713,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 ();
> > }
> > @@ -2759,7 +2759,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);
> > @@ -2769,7 +2769,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 04fe03cde5f..32649bc3f9a 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 36e5b4ac45f..78a07f8691a 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 fc63f0b5c77..1c795b43ca3 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 4a67d0d437a..d1c99fe6dc9 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 5734e4c8516..fb9fa514fbc 100644
> > --- a/gcc/predict.cc
> > +++ b/gcc/predict.cc
> > @@ -4079,8 +4079,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
> >
> > @@ -4233,14 +4233,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 cd2410ab2ae..dac172bc7c0 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 ();
> > }
> > diff --git a/gcc/ree.cc b/gcc/ree.cc
> > index de4f18e8a4d..da64ef679b7 100644
> > --- a/gcc/ree.cc
> > +++ b/gcc/ree.cc
> > @@ -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 5afeadf8c49..fd032501ad9 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 1fdc36713cd..8fcf9d529dd 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 2ab7bbb7353..705779d5c18 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 10271e1b17d..021a822cb79 100644
> > --- a/gcc/regrename.cc
> > +++ b/gcc/regrename.cc
> > @@ -2013,12 +2013,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 7624f514906..07b2045986c 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 9c1025200b4..052fa4ef881 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 125e0c936e7..7aebc6f39dc 100644
> > --- a/gcc/sanopt.cc
> > +++ b/gcc/sanopt.cc
> > @@ -942,8 +942,8 @@ public:
> > {}
> >
> > /* opt_pass methods: */
> > - virtual bool gate (function *) { return flag_sanitize; }
> > - virtual unsigned int execute (function *);
> > + bool gate (function *) final override { return flag_sanitize; }
> > + unsigned int execute (function *) final override;
> >
> > }; // class pass_sanopt
> >
> > diff --git a/gcc/sched-rgn.cc b/gcc/sched-rgn.cc
> > index a0dfdb7881f..0dc2a8f2851 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 b14bef98c49..4ccbb1cace3 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 0f708700a14..b61c0686844 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 4d054fe8fc8..64517846dc4 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 ae2921f808e..131dce05476 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 83991fe373e..feb61f362cf 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 19ba09facce..37e89adf10e 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
> >
> > @@ -9200,9 +9203,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
> > @@ -9459,7 +9468,7 @@ public:
> > {}
> >
> > /* opt_pass methods: */
> > - virtual unsigned int execute (function *);
> > + unsigned int execute (function *) final override;
> >
> > }; // class pass_warn_function_return
> >
> > @@ -9665,8 +9674,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;
> > @@ -9875,8 +9884,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 893619eaaa4..a6d0bf2c40a 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 f722057bfec..61950a0f099 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 c37a5845343..076ecd3ec9a 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 5f68703822c..b5aa307f60d 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 4531ca58bdf..480fea0e7c2 100644
> > --- a/gcc/tree-if-conv.cc
> > +++ b/gcc/tree-if-conv.cc
> > @@ -3408,8 +3408,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 22c2e5b7982..46df57ae0e1 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 db6e9096a86..ec44c450cae 100644
> > --- a/gcc/tree-loop-distribution.cc
> > +++ b/gcc/tree-loop-distribution.cc
> > @@ -3896,13 +3896,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 b96d5b86f27..1faa481a8c9 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 5ca87ae3504..bc3d7dd9bfa 100644
> > --- a/gcc/tree-object-size.cc
> > +++ b/gcc/tree-object-size.cc
> > @@ -2122,8 +2122,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);
> > }
> > @@ -2162,7 +2162,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 da1069683a3..2c3ef436ab7 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 fb457250bbd..5d923fba170 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 97aab8801d0..2beb49241f2 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 081c51b58a4..461c8e0b0f4 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 81c97676625..579a966cc9b 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.
> > */
> > @@ -4199,8 +4202,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
> >
> > @@ -4550,9 +4553,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 050a6d11434..782ceb500cc 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 a6b284018d4..5df64922594 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 9a843217553..97e17ca68e4 100644
> > --- a/gcc/tree-ssa-dom.cc
> > +++ b/gcc/tree-ssa-dom.cc
> > @@ -793,14 +793,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 881a2d0f98d..1c1fdb7e75b 100644
> > --- a/gcc/tree-ssa-dse.cc
> > +++ b/gcc/tree-ssa-dse.cc
> > @@ -1455,9 +1455,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 0917202b74c..6f09642172d 100644
> > --- a/gcc/tree-ssa-forwprop.cc
> > +++ b/gcc/tree-ssa-forwprop.cc
> > @@ -3330,9 +3330,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 88a9f062dcd..80c41c45489 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 2f5a390404c..9ab63d1fa0c 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 6d9316eed1f..c0893f1927c 100644
> > --- a/gcc/tree-ssa-loop-im.cc
> > +++ b/gcc/tree-ssa-loop-im.cc
> > @@ -3597,9 +3597,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 2ee00a3f843..e52397235a1 100644
> > --- a/gcc/tree-ssa-loop-ivcanon.cc
> > +++ b/gcc/tree-ssa-loop-ivcanon.cc
> > @@ -1539,8 +1539,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
> >
> > @@ -1586,7 +1586,7 @@ public:
> > {}
> >
> > /* opt_pass methods: */
> > - virtual unsigned int execute (function *);
> > + unsigned int execute (function *) final override;
> >
> > }; // class pass_complete_unroll
> >
> > @@ -1644,8 +1644,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 aebd7c9206f..8f190ae469b 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 b93ee4c8769..d61bad5ba47 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 2927f308234..3b6486f305a 100644
> > --- a/gcc/tree-ssa-loop-unswitch.cc
> > +++ b/gcc/tree-ssa-loop-unswitch.cc
> > @@ -1035,8 +1035,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 73aa46627b4..1c058b08c2f 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 ce1df01f629..fe9f37b4cd4 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 8c9c46d41f1..162ca7098cd 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 7bbfc8c002a..965f1d1c4eb 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 09a5e2055ca..e029bd36da3 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 406523b5d2f..e13e2cb308d 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 ed68557f0b2..18392e031b8 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 8ce4403ddc8..7f653a988f4 100644
> > --- a/gcc/tree-ssa-sink.cc
> > +++ b/gcc/tree-ssa-sink.cc
> > @@ -829,10 +829,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 1d4c0f78fbf..2cceba6f7af 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 581bdcf5652..dcf13d939bd 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 aea7d69584f..510f8319d8c 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 b48fcf1a8ba..087f0dc965d 100644
> > --- a/gcc/tree-ssa-uninit.cc
> > +++ b/gcc/tree-ssa-uninit.cc
> > @@ -1317,9 +1317,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
> >
> > @@ -1459,8 +1462,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 05536cd2f74..bc22ece636a 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 9038cd43aaa..ed4c8d8c775 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 50a17927f39..17a31f7a63c 100644
> > --- a/gcc/tree-switch-conversion.cc
> > +++ b/gcc/tree-switch-conversion.cc
> > @@ -2428,8 +2428,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
> >
> > @@ -2507,18 +2510,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 5a3466e5d53..6745d57580b 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 d99e3207fbe..d974fd1b7fe 100644
> > --- a/gcc/tree-vect-generic.cc
> > +++ b/gcc/tree-vect-generic.cc
> > @@ -2415,12 +2415,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 ();
> > }
> > @@ -2459,8 +2459,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 a63fa391273..53dc4520963 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 0784d658567..da0a6d5a8b6 100644
> > --- a/gcc/tree-vrp.cc
> > +++ b/gcc/tree-vrp.cc
> > @@ -4402,14 +4402,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 02e8ac7cf79..79d4582acd1 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 6c058142c37..18c75b471f4 100644
> > --- a/gcc/ubsan.cc
> > +++ b/gcc/ubsan.cc
> > @@ -2329,7 +2329,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
> > @@ -2341,7 +2341,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 7c3ad0a55bd..235981d100f 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 48f9987082e..24894e7f108 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
> >
> > diff --git a/gcc/web.cc b/gcc/web.cc
> > index a5874a98825..bd0ec94f1f4 100644
> > --- a/gcc/web.cc
> > +++ b/gcc/web.cc
> > @@ -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
> >
>
^ permalink raw reply [flat|nested] 39+ messages in thread
* PING^2 Re: [PATCH 02/10] Add 'final' and 'override' on dom_walker vfunc impls
2022-06-13 18:23 ` PING " David Malcolm
@ 2022-06-24 18:10 ` David Malcolm
0 siblings, 0 replies; 39+ messages in thread
From: David Malcolm @ 2022-06-24 18:10 UTC (permalink / raw)
To: gcc-patches
I'd like to ping this patch again:
https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595436.html
OK for trunk?
Thanks
Dave
On Mon, 2022-06-13 at 14:23 -0400, David Malcolm wrote:
> Ping for this patch:
> https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595436.html
>
> OK for tunk?
>
> Thanks
> Dave
>
> On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote:
> > gcc/ChangeLog:
> > * compare-elim.cc: Add "final" and "override" to dom_walker
> > vfunc
> > implementations, removing redundant "virtual" as appropriate.
> > * gimple-ssa-strength-reduction.cc: Likewise.
> > * ipa-prop.cc: Likewise.
> > * rtl-ssa/blocks.cc: Likewise.
> > * tree-into-ssa.cc: Likewise.
> > * tree-ssa-dom.cc: Likewise.
> > * tree-ssa-math-opts.cc: Likewise.
> > * tree-ssa-phiopt.cc: Likewise.
> > * tree-ssa-propagate.cc: Likewise.
> > * tree-ssa-sccvn.cc: Likewise.
> > * tree-ssa-strlen.cc: Likewise.
> > * tree-ssa-uncprop.cc: Likewise.
> >
> > Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> > ---
> > gcc/compare-elim.cc | 2 +-
> > gcc/gimple-ssa-strength-reduction.cc | 2 +-
> > gcc/ipa-prop.cc | 4 ++--
> > gcc/rtl-ssa/blocks.cc | 4 ++--
> > gcc/tree-into-ssa.cc | 10 +++++-----
> > gcc/tree-ssa-dom.cc | 4 ++--
> > gcc/tree-ssa-math-opts.cc | 2 +-
> > gcc/tree-ssa-phiopt.cc | 4 ++--
> > gcc/tree-ssa-propagate.cc | 4 ++--
> > gcc/tree-ssa-sccvn.cc | 4 ++--
> > gcc/tree-ssa-strlen.cc | 4 ++--
> > gcc/tree-ssa-uncprop.cc | 4 ++--
> > 12 files changed, 24 insertions(+), 24 deletions(-)
> >
> > diff --git a/gcc/compare-elim.cc b/gcc/compare-elim.cc
> > index e869d9d3249..4a23202f8ff 100644
> > --- a/gcc/compare-elim.cc
> > +++ b/gcc/compare-elim.cc
> > @@ -283,7 +283,7 @@ public:
> > find_comparison_dom_walker (cdi_direction direction)
> > : dom_walker (direction) {}
> >
> > - virtual edge before_dom_children (basic_block);
> > + edge before_dom_children (basic_block) final override;
> > };
> >
> > /* Return true if conforming COMPARE with EH_NOTE is redundant with
> > comparison
> > diff --git a/gcc/gimple-ssa-strength-reduction.cc b/gcc/gimple-ssa-
> > strength-reduction.cc
> > index 2b559e96fc8..fb2bb9f4e74 100644
> > --- a/gcc/gimple-ssa-strength-reduction.cc
> > +++ b/gcc/gimple-ssa-strength-reduction.cc
> > @@ -1729,7 +1729,7 @@ class find_candidates_dom_walker : public
> > dom_walker
> > public:
> > find_candidates_dom_walker (cdi_direction direction)
> > : dom_walker (direction) {}
> > - virtual edge before_dom_children (basic_block);
> > + edge before_dom_children (basic_block) final override;
> > };
> >
> > /* Find strength-reduction candidates in block BB. */
> > diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc
> > index c6c745f84a0..03f0ba2ec75 100644
> > --- a/gcc/ipa-prop.cc
> > +++ b/gcc/ipa-prop.cc
> > @@ -3004,7 +3004,7 @@ public:
> > analysis_dom_walker (struct ipa_func_body_info *fbi)
> > : dom_walker (CDI_DOMINATORS), m_fbi (fbi) {}
> >
> > - virtual edge before_dom_children (basic_block);
> > + edge before_dom_children (basic_block) final override;
> >
> > private:
> > struct ipa_func_body_info *m_fbi;
> > @@ -5653,7 +5653,7 @@ public:
> > : dom_walker (CDI_DOMINATORS), m_fbi (fbi), m_descriptors
> > (descs),
> > m_aggval (av), m_something_changed (sc) {}
> >
> > - virtual edge before_dom_children (basic_block);
> > + edge before_dom_children (basic_block) final override;
> > bool cleanup_eh ()
> > { return gimple_purge_all_dead_eh_edges (m_need_eh_cleanup); }
> >
> > diff --git a/gcc/rtl-ssa/blocks.cc b/gcc/rtl-ssa/blocks.cc
> > index 959fad8f829..6b03dd03747 100644
> > --- a/gcc/rtl-ssa/blocks.cc
> > +++ b/gcc/rtl-ssa/blocks.cc
> > @@ -85,8 +85,8 @@ class function_info::bb_walker : public dom_walker
> > {
> > public:
> > bb_walker (function_info *, build_info &);
> > - virtual edge before_dom_children (basic_block);
> > - virtual void after_dom_children (basic_block);
> > + edge before_dom_children (basic_block) final override;
> > + void after_dom_children (basic_block) final override;
> >
> > private:
> > // Information about the function we're building.
> > diff --git a/gcc/tree-into-ssa.cc b/gcc/tree-into-ssa.cc
> > index 46df57ae0e1..9631d8c6556 100644
> > --- a/gcc/tree-into-ssa.cc
> > +++ b/gcc/tree-into-ssa.cc
> > @@ -1462,8 +1462,8 @@ public:
> > rewrite_dom_walker (cdi_direction direction)
> > : dom_walker (direction, ALL_BLOCKS, NULL) {}
> >
> > - virtual edge before_dom_children (basic_block);
> > - virtual void after_dom_children (basic_block);
> > + edge before_dom_children (basic_block) final override;
> > + void after_dom_children (basic_block) final override;
> > };
> >
> > /* SSA Rewriting Step 1. Initialization, create a block local stack
> > @@ -2148,8 +2148,8 @@ public:
> > rewrite_update_dom_walker (cdi_direction direction)
> > : dom_walker (direction, ALL_BLOCKS, NULL) {}
> >
> > - virtual edge before_dom_children (basic_block);
> > - virtual void after_dom_children (basic_block);
> > + edge before_dom_children (basic_block) final override;
> > + void after_dom_children (basic_block) final override;
> > };
> >
> > /* Initialization of block data structures for the incremental SSA
> > @@ -2300,7 +2300,7 @@ public:
> > mark_def_dom_walker (cdi_direction direction);
> > ~mark_def_dom_walker ();
> >
> > - virtual edge before_dom_children (basic_block);
> > + edge before_dom_children (basic_block) final override;
> >
> > private:
> > /* Notice that this bitmap is indexed using variable UIDs, so it
> > must be
> > diff --git a/gcc/tree-ssa-dom.cc b/gcc/tree-ssa-dom.cc
> > index 97e17ca68e4..1a44b10756f 100644
> > --- a/gcc/tree-ssa-dom.cc
> > +++ b/gcc/tree-ssa-dom.cc
> > @@ -737,8 +737,8 @@ public:
> > m_threader = threader;
> > }
> >
> > - virtual edge before_dom_children (basic_block);
> > - virtual void after_dom_children (basic_block);
> > + edge before_dom_children (basic_block) final override;
> > + void after_dom_children (basic_block) final override;
> >
> > private:
> >
> > diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc
> > index fe9f37b4cd4..a4492c96419 100644
> > --- a/gcc/tree-ssa-math-opts.cc
> > +++ b/gcc/tree-ssa-math-opts.cc
> > @@ -4918,7 +4918,7 @@ public:
> >
> > /* The actual actions performed in the walk. */
> >
> > - virtual void after_dom_children (basic_block);
> > + void after_dom_children (basic_block) final override;
> >
> > /* Set of results of chains of multiply and add statement
> > combinations that
> > were not transformed into FMAs because of active deferring. */
> > diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
> > index 162ca7098cd..d17c49468db 100644
> > --- a/gcc/tree-ssa-phiopt.cc
> > +++ b/gcc/tree-ssa-phiopt.cc
> > @@ -2978,8 +2978,8 @@ public:
> > : dom_walker (direction), m_nontrapping (ps), m_seen_refs (128)
> > {}
> >
> > - virtual edge before_dom_children (basic_block);
> > - virtual void after_dom_children (basic_block);
> > + edge before_dom_children (basic_block) final override;
> > + void after_dom_children (basic_block) final override;
> >
> > private:
> >
> > diff --git a/gcc/tree-ssa-propagate.cc b/gcc/tree-ssa-propagate.cc
> > index c10ffd91766..d2d32517a8c 100644
> > --- a/gcc/tree-ssa-propagate.cc
> > +++ b/gcc/tree-ssa-propagate.cc
> > @@ -679,8 +679,8 @@ public:
> > BITMAP_FREE (need_eh_cleanup);
> > }
> >
> > - virtual edge before_dom_children (basic_block);
> > - virtual void after_dom_children (basic_block bb)
> > + edge before_dom_children (basic_block) final override;
> > + void after_dom_children (basic_block bb) final override
> > {
> > substitute_and_fold_engine->post_fold_bb (bb);
> > }
> > diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc
> > index 18392e031b8..7407591e98c 100644
> > --- a/gcc/tree-ssa-sccvn.cc
> > +++ b/gcc/tree-ssa-sccvn.cc
> > @@ -2493,8 +2493,8 @@ public:
> > eliminate_dom_walker (cdi_direction, bitmap);
> > ~eliminate_dom_walker ();
> >
> > - virtual edge before_dom_children (basic_block);
> > - virtual void after_dom_children (basic_block);
> > + edge before_dom_children (basic_block) final override;
> > + void after_dom_children (basic_block) final override;
> >
> > virtual tree eliminate_avail (basic_block, tree op);
> > virtual void eliminate_push_avail (basic_block, tree op);
> > diff --git a/gcc/tree-ssa-strlen.cc b/gcc/tree-ssa-strlen.cc
> > index 2cceba6f7af..7b3e3899ea2 100644
> > --- a/gcc/tree-ssa-strlen.cc
> > +++ b/gcc/tree-ssa-strlen.cc
> > @@ -243,8 +243,8 @@ public:
> >
> > ~strlen_pass ();
> >
> > - virtual edge before_dom_children (basic_block);
> > - virtual void after_dom_children (basic_block);
> > + edge before_dom_children (basic_block) final override;
> > + void after_dom_children (basic_block) final override;
> >
> > bool check_and_optimize_stmt (bool *cleanup_eh);
> > bool check_and_optimize_call (bool *zero_write);
> > diff --git a/gcc/tree-ssa-uncprop.cc b/gcc/tree-ssa-uncprop.cc
> > index 510f8319d8c..900bf336e2e 100644
> > --- a/gcc/tree-ssa-uncprop.cc
> > +++ b/gcc/tree-ssa-uncprop.cc
> > @@ -298,8 +298,8 @@ class uncprop_dom_walker : public dom_walker
> > public:
> > uncprop_dom_walker (cdi_direction direction) : dom_walker
> > (direction) {}
> >
> > - virtual edge before_dom_children (basic_block);
> > - virtual void after_dom_children (basic_block);
> > + edge before_dom_children (basic_block) final override;
> > + void after_dom_children (basic_block) final override;
> >
> > private:
> >
>
^ permalink raw reply [flat|nested] 39+ messages in thread
* PING^2 : Re: [PATCH 03/10] expr.cc: use final/override on op_by_pieces_d vfuncs
2022-06-13 18:25 ` PING: " David Malcolm
@ 2022-06-24 18:12 ` David Malcolm
0 siblings, 0 replies; 39+ messages in thread
From: David Malcolm @ 2022-06-24 18:12 UTC (permalink / raw)
To: gcc-patches
On Mon, 2022-06-13 at 14:25 -0400, David Malcolm wrote:
> Ping on this patch:
> https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595434.html
>
> OK for trunk?
>
> Thanks
> Dave
>
> On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote:
> > gcc/ChangeLog:
> > * expr.cc: Add "final" and "override" to op_by_pieces_d
> > vfunc
> > implementations as appropriate.
> >
> > Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> > ---
> > gcc/expr.cc | 14 +++++++-------
> > 1 file changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/gcc/expr.cc b/gcc/expr.cc
> > index 7197996cec7..ce58728862a 100644
> > --- a/gcc/expr.cc
> > +++ b/gcc/expr.cc
> > @@ -1357,8 +1357,8 @@ op_by_pieces_d::run ()
> > class move_by_pieces_d : public op_by_pieces_d
> > {
> > insn_gen_fn m_gen_fun;
> > - void generate (rtx, rtx, machine_mode);
> > - bool prepare_mode (machine_mode, unsigned int);
> > + void generate (rtx, rtx, machine_mode) final override;
> > + bool prepare_mode (machine_mode, unsigned int) final override;
> >
> > public:
> > move_by_pieces_d (rtx to, rtx from, unsigned HOST_WIDE_INT len,
> > @@ -1453,8 +1453,8 @@ move_by_pieces (rtx to, rtx from, unsigned
> > HOST_WIDE_INT len,
> > class store_by_pieces_d : public op_by_pieces_d
> > {
> > insn_gen_fn m_gen_fun;
> > - void generate (rtx, rtx, machine_mode);
> > - bool prepare_mode (machine_mode, unsigned int);
> > + void generate (rtx, rtx, machine_mode) final override;
> > + bool prepare_mode (machine_mode, unsigned int) final override;
> >
> > public:
> > store_by_pieces_d (rtx to, by_pieces_constfn cfn, void
> > *cfn_data,
> > @@ -1650,9 +1650,9 @@ class compare_by_pieces_d : public
> > op_by_pieces_d
> > rtx m_accumulator;
> > int m_count, m_batch;
> >
> > - void generate (rtx, rtx, machine_mode);
> > - bool prepare_mode (machine_mode, unsigned int);
> > - void finish_mode (machine_mode);
> > + void generate (rtx, rtx, machine_mode) final override;
> > + bool prepare_mode (machine_mode, unsigned int) final override;
> > + void finish_mode (machine_mode) final override;
> > public:
> > compare_by_pieces_d (rtx op0, rtx op1, by_pieces_constfn
> > op1_cfn,
> > void *op1_cfn_data, HOST_WIDE_INT len, int
> > align,
>
^ permalink raw reply [flat|nested] 39+ messages in thread
* PING^2 : Re: [PATCH 04/10] tree-switch-conversion.h: use final/override for cluster vfunc impls
2022-06-13 18:26 ` PING " David Malcolm
@ 2022-06-24 18:14 ` David Malcolm
0 siblings, 0 replies; 39+ messages in thread
From: David Malcolm @ 2022-06-24 18:14 UTC (permalink / raw)
To: gcc-patches, Martin Liska
I'd like to ping this patch:
https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595435.html
OK for trunk?
Thanks
Dave
On Mon, 2022-06-13 at 14:26 -0400, David Malcolm wrote:
> Ping for this patch:
> https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595435.html
>
> OK for trunk?
>
> Thanks
> Dave
>
> On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote:
> > gcc/ChangeLog:
> > * tree-switch-conversion.h: Add "final" and "override" to
> > cluster
> > vfunc implementations as appropriate.
> >
> > Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> > ---
> > gcc/tree-switch-conversion.h | 32 +++++++++++++++++---------------
> > 1 file changed, 17 insertions(+), 15 deletions(-)
> >
> > diff --git a/gcc/tree-switch-conversion.h b/gcc/tree-switch-
> > conversion.h
> > index 2b677d9f7e9..d22515eb296 100644
> > --- a/gcc/tree-switch-conversion.h
> > +++ b/gcc/tree-switch-conversion.h
> > @@ -130,19 +130,19 @@ public:
> > {}
> >
> > cluster_type
> > - get_type ()
> > + get_type () final override
> > {
> > return SIMPLE_CASE;
> > }
> >
> > tree
> > - get_low ()
> > + get_low () final override
> > {
> > return m_low;
> > }
> >
> > tree
> > - get_high ()
> > + get_high () final override
> > {
> > return m_high;
> > }
> > @@ -153,13 +153,13 @@ public:
> > }
> >
> > void
> > - debug ()
> > + debug () final override
> > {
> > dump (stderr);
> > }
> >
> > void
> > - dump (FILE *f, bool details ATTRIBUTE_UNUSED = false)
> > + dump (FILE *f, bool details ATTRIBUTE_UNUSED = false) final
> > override
> > {
> > PRINT_CASE (f, get_low ());
> > if (get_low () != get_high ())
> > @@ -170,12 +170,12 @@ public:
> > fprintf (f, " ");
> > }
> >
> > - void emit (tree, tree, tree, basic_block, location_t)
> > + void emit (tree, tree, tree, basic_block, location_t) final
> > override
> > {
> > gcc_unreachable ();
> > }
> >
> > - bool is_single_value_p ()
> > + bool is_single_value_p () final override
> > {
> > return tree_int_cst_equal (get_low (), get_high ());
> > }
> > @@ -224,24 +224,24 @@ public:
> > ~group_cluster ();
> >
> > tree
> > - get_low ()
> > + get_low () final override
> > {
> > return m_cases[0]->get_low ();
> > }
> >
> > tree
> > - get_high ()
> > + get_high () final override
> > {
> > return m_cases[m_cases.length () - 1]->get_high ();
> > }
> >
> > void
> > - debug ()
> > + debug () final override
> > {
> > dump (stderr);
> > }
> >
> > - void dump (FILE *f, bool details = false);
> > + void dump (FILE *f, bool details = false) final override;
> >
> > /* List of simple clusters handled by the group. */
> > vec<simple_cluster *> m_cases;
> > @@ -261,13 +261,14 @@ public:
> > {}
> >
> > cluster_type
> > - get_type ()
> > + get_type () final override
> > {
> > return JUMP_TABLE;
> > }
> >
> > void emit (tree index_expr, tree index_type,
> > - tree default_label_expr, basic_block default_bb,
> > location_t loc);
> > + tree default_label_expr, basic_block default_bb,
> > location_t loc)
> > + final override;
> >
> > /* Find jump tables of given CLUSTERS, where all members of the
> > vector
> > are of type simple_cluster. New clusters are returned. */
> > @@ -366,7 +367,7 @@ public:
> > {}
> >
> > cluster_type
> > - get_type ()
> > + get_type () final override
> > {
> > return BIT_TEST;
> > }
> > @@ -388,7 +389,8 @@ public:
> > There *MUST* be max_case_bit_tests or less unique case
> > node targets. */
> > void emit (tree index_expr, tree index_type,
> > - tree default_label_expr, basic_block default_bb,
> > location_t loc);
> > + tree default_label_expr, basic_block default_bb,
> > location_t loc)
> > + final override;
> >
> > /* Find bit tests of given CLUSTERS, where all members of the
> > vector
> > are of type simple_cluster. New clusters are returned. */
>
^ permalink raw reply [flat|nested] 39+ messages in thread
* PING^2 : Re: [PATCH 08/10] i386: add 'final' and 'override' to scalar_chain vfunc impls
2022-06-13 18:30 ` PING: " David Malcolm
@ 2022-06-24 18:19 ` David Malcolm
2022-06-24 20:58 ` Uros Bizjak
2022-08-16 8:55 ` [PATCH][pushed] i386: add 'final' and 'override' to scalar_chain Martin Liška
0 siblings, 2 replies; 39+ messages in thread
From: David Malcolm @ 2022-06-24 18:19 UTC (permalink / raw)
To: gcc-patches, Jan Hubicka, Uros Bizjak
I'd like to ping this patch:
https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595440.html
OK for trunk?
Thanks
Dave
On Mon, 2022-06-13 at 14:30 -0400, David Malcolm wrote:
> Ping for this patch:
> https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595440.html
>
> OK for trunk?
>
> Thanks
> Dave
>
> On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote:
> > gcc/ChangeLog:
> > * config/i386/i386-features.h: Add "final" and "override" to
> > scalar_chain vfunc implementations as appropriate.
> >
> > Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> > ---
> > gcc/config/i386/i386-features.h | 16 ++++++++--------
> > 1 file changed, 8 insertions(+), 8 deletions(-)
> >
> > diff --git a/gcc/config/i386/i386-features.h b/gcc/config/i386/i386-
> > features.h
> > index 5c307607ae5..f46a6d95b74 100644
> > --- a/gcc/config/i386/i386-features.h
> > +++ b/gcc/config/i386/i386-features.h
> > @@ -169,18 +169,18 @@ class general_scalar_chain : public
> > scalar_chain
> > public:
> > general_scalar_chain (enum machine_mode smode_, enum machine_mode
> > vmode_);
> > ~general_scalar_chain ();
> > - int compute_convert_gain ();
> > + int compute_convert_gain () final override;
> > private:
> > hash_map<rtx, rtx> defs_map;
> > bitmap insns_conv;
> > unsigned n_sse_to_integer;
> > unsigned n_integer_to_sse;
> > - void mark_dual_mode_def (df_ref def);
> > - void convert_insn (rtx_insn *insn);
> > + void mark_dual_mode_def (df_ref def) final override;
> > + void convert_insn (rtx_insn *insn) final override;
> > void convert_op (rtx *op, rtx_insn *insn);
> > void convert_reg (rtx_insn *insn, rtx dst, rtx src);
> > void make_vector_copies (rtx_insn *, rtx);
> > - void convert_registers ();
> > + void convert_registers () final override;
> > int vector_const_cost (rtx exp);
> > };
> >
> > @@ -190,14 +190,14 @@ class timode_scalar_chain : public scalar_chain
> > timode_scalar_chain () : scalar_chain (TImode, V1TImode) {}
> >
> > /* Convert from TImode to V1TImode is always faster. */
> > - int compute_convert_gain () { return 1; }
> > + int compute_convert_gain () final override { return 1; }
> >
> > private:
> > - void mark_dual_mode_def (df_ref def);
> > + void mark_dual_mode_def (df_ref def) final override;
> > void fix_debug_reg_uses (rtx reg);
> > - void convert_insn (rtx_insn *insn);
> > + void convert_insn (rtx_insn *insn) final override;
> > /* We don't convert registers to difference size. */
> > - void convert_registers () {}
> > + void convert_registers () final override {}
> > };
> >
> > } // anon namespace
>
^ permalink raw reply [flat|nested] 39+ messages in thread
* PING^2: Re: [PATCH 10/10] Add 'final' and 'override' in various places
2022-06-13 18:30 ` PING " David Malcolm
@ 2022-06-24 18:20 ` David Malcolm
0 siblings, 0 replies; 39+ messages in thread
From: David Malcolm @ 2022-06-24 18:20 UTC (permalink / raw)
To: gcc-patches
On Mon, 2022-06-13 at 14:30 -0400, David Malcolm wrote:
> Ping re this patch:
> https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595443.html
>
> OK for trunk?
>
> Thanks
> Dave
>
> On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote:
> > gcc/cp/ChangeLog:
> > * cxx-pretty-print.h: Add "final" and "override" to various
> > vfunc
> > implementations, removing redundant "virtual" as
> > appropriate.
> > * module.cc: Likewise.
> >
> > gcc/ChangeLog:
> > * genmatch.cc: Add "final" and "override" to various vfunc
> > implementations, removing redundant "virtual" as
> > appropriate.
> > * gensupport.cc: Likewise.
> > * gimple-range-cache.h: Likewise.
> > * ipa-icf-gimple.h: Likewise.
> > * ipa-icf.h: Likewise.
> > * read-md.h: Likewise.
> > * read-rtl-function.cc: Likewise.
> > * tree-ssa-loop-ch.cc: Likewise.
> > * tree-ssa-sccvn.cc: Likewise.
> >
> > gcc/lto/ChangeLog:
> > * lto-dump.cc: Add "final" and "override" to various vfunc
> > implementations, removing redundant "virtual" as
> > appropriate.
> >
> > Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> > ---
> > gcc/cp/cxx-pretty-print.h | 38 +++++++++++++++++++----------------
> > ---
> > gcc/cp/module.cc | 4 ++--
> > gcc/genmatch.cc | 22 +++++++++++-----------
> > gcc/gensupport.cc | 2 +-
> > gcc/gimple-range-cache.h | 4 ++--
> > gcc/ipa-icf-gimple.h | 6 ++++--
> > gcc/ipa-icf.h | 36 ++++++++++++++++++++---------------
> > -
> > gcc/lto/lto-dump.cc | 8 ++++----
> > gcc/read-md.h | 2 +-
> > gcc/read-rtl-function.cc | 6 +++---
> > gcc/tree-ssa-loop-ch.cc | 4 ++--
> > gcc/tree-ssa-sccvn.cc | 4 ++--
> > 12 files changed, 71 insertions(+), 65 deletions(-)
> >
> > diff --git a/gcc/cp/cxx-pretty-print.h b/gcc/cp/cxx-pretty-print.h
> > index 5080f70a8e4..593bd91d4f7 100644
> > --- a/gcc/cp/cxx-pretty-print.h
> > +++ b/gcc/cp/cxx-pretty-print.h
> > @@ -36,25 +36,25 @@ public:
> >
> > pretty_printer *clone () const override;
> >
> > - void constant (tree);
> > - void id_expression (tree);
> > - void primary_expression (tree);
> > - void postfix_expression (tree);
> > - void unary_expression (tree);
> > - void multiplicative_expression (tree);
> > - void conditional_expression (tree);
> > - void assignment_expression (tree);
> > - void expression (tree);
> > - void type_id (tree);
> > - void statement (tree);
> > - void declaration (tree);
> > - void declaration_specifiers (tree);
> > - void simple_type_specifier (tree);
> > - void function_specifier (tree);
> > - void declarator (tree);
> > - void direct_declarator (tree);
> > - void abstract_declarator (tree);
> > - void direct_abstract_declarator (tree);
> > + void constant (tree) final override;
> > + void id_expression (tree) final override;
> > + void primary_expression (tree) final override;
> > + void postfix_expression (tree) final override;
> > + void unary_expression (tree) final override;
> > + void multiplicative_expression (tree) final override;
> > + void conditional_expression (tree) final override;
> > + void assignment_expression (tree) final override;
> > + void expression (tree) final override;
> > + void type_id (tree) final override;
> > + void statement (tree) final override;
> > + void declaration (tree) final override;
> > + void declaration_specifiers (tree) final override;
> > + void simple_type_specifier (tree) final override;
> > + void function_specifier (tree) final override;
> > + void declarator (tree) final override;
> > + void direct_declarator (tree) final override;
> > + void abstract_declarator (tree) final override;
> > + void direct_abstract_declarator (tree) final override;
> >
> > /* This is the enclosing scope of the entity being pretty-
> > printed.
> > */
> > tree enclosing_scope;
> > diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
> > index d1dc73724d1..e93151c98c2 100644
> > --- a/gcc/cp/module.cc
> > +++ b/gcc/cp/module.cc
> > @@ -1483,10 +1483,10 @@ private:
> >
> > protected:
> > using allocator::grow;
> > - virtual char *grow (char *, unsigned needed);
> > + char *grow (char *, unsigned needed) final override;
> > #if MAPPED_WRITING
> > using allocator::shrink;
> > - virtual void shrink (char *);
> > + void shrink (char *) final override;
> > #endif
> >
> > public:
> > diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc
> > index 2b84b849330..a0b22c50ae3 100644
> > --- a/gcc/genmatch.cc
> > +++ b/gcc/genmatch.cc
> > @@ -723,9 +723,9 @@ public:
> > bool force_leaf;
> > /* If non-zero, the group for optional handling. */
> > unsigned char opt_grp;
> > - virtual void gen_transform (FILE *f, int, const char *, bool,
> > int,
> > - const char *, capture_info *,
> > - dt_operand ** = 0, int = 0);
> > + void gen_transform (FILE *f, int, const char *, bool, int,
> > + const char *, capture_info *,
> > + dt_operand ** = 0, int = 0) override;
> > };
> >
> > /* An operator that is represented by native C code. This is
> > always
> > @@ -757,9 +757,9 @@ public:
> > unsigned nr_stmts;
> > /* The identifier replacement vector. */
> > vec<id_tab> ids;
> > - virtual void gen_transform (FILE *f, int, const char *, bool,
> > int,
> > - const char *, capture_info *,
> > - dt_operand ** = 0, int = 0);
> > + void gen_transform (FILE *f, int, const char *, bool, int,
> > + const char *, capture_info *,
> > + dt_operand ** = 0, int = 0) final override;
> > };
> >
> > /* A wrapper around another operand that captures its value. */
> > @@ -778,9 +778,9 @@ public:
> > bool value_match;
> > /* The captured value. */
> > operand *what;
> > - virtual void gen_transform (FILE *f, int, const char *, bool,
> > int,
> > - const char *, capture_info *,
> > - dt_operand ** = 0, int = 0);
> > + void gen_transform (FILE *f, int, const char *, bool, int,
> > + const char *, capture_info *,
> > + dt_operand ** = 0, int = 0) final override;
> > };
> >
> > /* if expression. */
> > @@ -1655,7 +1655,7 @@ public:
> > : dt_node (type, parent_), op (op_), match_dop (match_dop_),
> > pos (pos_), value_match (false), for_id (current_id) {}
> >
> > - void gen (FILE *, int, bool, int);
> > + void gen (FILE *, int, bool, int) final override;
> > unsigned gen_predicate (FILE *, int, const char *, bool);
> > unsigned gen_match_op (FILE *, int, const char *, bool);
> >
> > @@ -1681,7 +1681,7 @@ public:
> > indexes (indexes_), info (NULL) {}
> >
> > void gen_1 (FILE *, int, bool, operand *);
> > - void gen (FILE *f, int, bool, int);
> > + void gen (FILE *f, int, bool, int) final override;
> > };
> >
> > template<>
> > diff --git a/gcc/gensupport.cc b/gcc/gensupport.cc
> > index 42680499d86..8fcacf8f9d2 100644
> > --- a/gcc/gensupport.cc
> > +++ b/gcc/gensupport.cc
> > @@ -2310,7 +2310,7 @@ class gen_reader : public rtx_reader
> > {
> > public:
> > gen_reader () : rtx_reader (false) {}
> > - void handle_unknown_directive (file_location, const char *);
> > + void handle_unknown_directive (file_location, const char *)
> > final
> > override;
> > };
> >
> > void
> > diff --git a/gcc/gimple-range-cache.h b/gcc/gimple-range-cache.h
> > index 555fe32513f..d768f418f0d 100644
> > --- a/gcc/gimple-range-cache.h
> > +++ b/gcc/gimple-range-cache.h
> > @@ -77,8 +77,8 @@ public:
> > ranger_cache (int not_executable_flag, bool use_imm_uses);
> > ~ranger_cache ();
> >
> > - virtual bool range_of_expr (irange &r, tree name, gimple *stmt);
> > - virtual bool range_on_edge (irange &r, edge e, tree expr);
> > + bool range_of_expr (irange &r, tree name, gimple *stmt) final
> > override;
> > + bool range_on_edge (irange &r, edge e, tree expr) final
> > override;
> > bool block_range (irange &r, basic_block bb, tree name, bool
> > calc =
> > true);
> >
> > bool get_global_range (irange &r, tree name) const;
> > diff --git a/gcc/ipa-icf-gimple.h b/gcc/ipa-icf-gimple.h
> > index 1545e4a5905..8f498b31eef 100644
> > --- a/gcc/ipa-icf-gimple.h
> > +++ b/gcc/ipa-icf-gimple.h
> > @@ -282,11 +282,13 @@ private:
> > public:
> > /* Return true if two operands are equal. The flags fields can
> > be
> > used
> > to specify OEP flags described above. */
> > - virtual bool operand_equal_p (const_tree, const_tree, unsigned
> > int
> > flags);
> > + bool operand_equal_p (const_tree, const_tree, unsigned int
> > flags)
> > + final override;
> >
> > /* Generate a hash value for an expression. This can be used
> > iteratively
> > by passing a previous result as the HSTATE argument. */
> > - virtual void hash_operand (const_tree, inchash::hash &, unsigned
> > flags);
> > + void hash_operand (const_tree, inchash::hash &, unsigned flags)
> > + final override;
> > void hash_operand (const_tree, inchash::hash &, unsigned flags,
> > operand_access_type access);
> > };
> > diff --git a/gcc/ipa-icf.h b/gcc/ipa-icf.h
> > index dbae2cca02b..bb550923ad4 100644
> > --- a/gcc/ipa-icf.h
> > +++ b/gcc/ipa-icf.h
> > @@ -317,16 +317,18 @@ public:
> >
> > ~sem_function ();
> >
> > - virtual void init (ipa_icf_gimple::func_checker *);
> > - virtual bool equals_wpa (sem_item *item,
> > - hash_map <symtab_node *, sem_item *>
> > &ignored_nodes);
> > - virtual hashval_t get_hash (void);
> > - virtual bool equals (sem_item *item,
> > - hash_map <symtab_node *, sem_item *>
> > &ignored_nodes);
> > - virtual bool merge (sem_item *alias_item);
> > + void init (ipa_icf_gimple::func_checker *) final override;
> > + bool equals_wpa (sem_item *item,
> > + hash_map <symtab_node *, sem_item *>
> > &ignored_nodes)
> > + final override;
> > + hashval_t get_hash (void) final override;
> > + bool equals (sem_item *item,
> > + hash_map <symtab_node *, sem_item *> &ignored_nodes)
> > + final override;
> > + bool merge (sem_item *alias_item) final override;
> >
> > /* Dump symbol to FILE. */
> > - virtual void dump_to_file (FILE *file)
> > + void dump_to_file (FILE *file) final override
> > {
> > gcc_assert (file);
> > dump_function_to_file (decl, file, TDF_DETAILS);
> > @@ -426,17 +428,19 @@ public:
> > sem_variable (varpool_node *_node, bitmap_obstack *stack);
> >
> > /* Semantic variable initialization function. */
> > - virtual void init (ipa_icf_gimple::func_checker *);
> > + void init (ipa_icf_gimple::func_checker *) final override;
> >
> > - virtual hashval_t get_hash (void);
> > - virtual bool merge (sem_item *alias_item);
> > - virtual void dump_to_file (FILE *file);
> > - virtual bool equals (sem_item *item,
> > - hash_map <symtab_node *, sem_item *>
> > &ignored_nodes);
> > + hashval_t get_hash (void) final override;
> > + bool merge (sem_item *alias_item) final override;
> > + void dump_to_file (FILE *file) final override;
> > + bool equals (sem_item *item,
> > + hash_map <symtab_node *, sem_item *> &ignored_nodes)
> > + final override;
> >
> > /* Fast equality variable based on knowledge known in WPA. */
> > - virtual bool equals_wpa (sem_item *item,
> > - hash_map <symtab_node *, sem_item *>
> > &ignored_nodes);
> > + bool equals_wpa (sem_item *item,
> > + hash_map <symtab_node *, sem_item *>
> > &ignored_nodes)
> > + final override;
> >
> > /* Returns varpool_node. */
> > inline varpool_node *get_node (void)
> > diff --git a/gcc/lto/lto-dump.cc b/gcc/lto/lto-dump.cc
> > index 1fb3fb86fb5..f88486b5143 100644
> > --- a/gcc/lto/lto-dump.cc
> > +++ b/gcc/lto/lto-dump.cc
> > @@ -80,7 +80,7 @@ public:
> > virtual ~variable_entry ()
> > {}
> >
> > - virtual size_t get_size () const
> > + size_t get_size () const final override
> > {
> > varpool_node *vnode = dyn_cast<varpool_node *> (node);
> > if (DECL_SIZE (vnode->decl) && tree_fits_shwi_p (DECL_SIZE
> > (vnode-
> > > decl)))
> > @@ -88,7 +88,7 @@ public:
> > return 0;
> > }
> >
> > - virtual void dump ()
> > + void dump () final override
> > {
> > symbol_entry :: dump ();
> > varpool_node *vnode = dyn_cast<varpool_node *> (node);
> > @@ -111,13 +111,13 @@ public:
> > virtual ~function_entry ()
> > {}
> >
> > - virtual void dump ()
> > + void dump () final override
> > {
> > symbol_entry :: dump ();
> > printf ("\n");
> > }
> >
> > - virtual size_t get_size () const
> > + size_t get_size () const final override
> > {
> > cgraph_node *cnode = dyn_cast<cgraph_node *> (node);
> > gcc_assert (cnode);
> > diff --git a/gcc/read-md.h b/gcc/read-md.h
> > index 34a64fa93a2..7d8cd4a8336 100644
> > --- a/gcc/read-md.h
> > +++ b/gcc/read-md.h
> > @@ -330,7 +330,7 @@ class noop_reader : public md_reader
> > noop_reader () : md_reader (false) {}
> >
> > /* A dummy implementation which skips unknown directives. */
> > - void handle_unknown_directive (file_location, const char *);
> > + void handle_unknown_directive (file_location, const char *)
> > override;
> > };
> >
> > /* An md_reader subclass that actually handles full hierarchical
> > diff --git a/gcc/read-rtl-function.cc b/gcc/read-rtl-function.cc
> > index eacbe4c1200..3bcff1540e7 100644
> > --- a/gcc/read-rtl-function.cc
> > +++ b/gcc/read-rtl-function.cc
> > @@ -188,7 +188,7 @@ class fixup_insn_uid : public operand_fixup
> > m_insn_uid (insn_uid)
> > {}
> >
> > - void apply (function_reader *reader) const;
> > + void apply (function_reader *reader) const final override;
> >
> > private:
> > int m_insn_uid;
> > @@ -206,7 +206,7 @@ class fixup_note_insn_basic_block : public
> > operand_fixup
> > m_bb_idx (bb_idx)
> > {}
> >
> > - void apply (function_reader *reader) const;
> > + void apply (function_reader *reader) const final override;
> >
> > private:
> > int m_bb_idx;
> > @@ -225,7 +225,7 @@ class fixup_expr : public fixup
> >
> > ~fixup_expr () { free (m_desc); }
> >
> > - void apply (function_reader *reader) const;
> > + void apply (function_reader *reader) const final override;
> >
> > private:
> > char *m_desc;
> > diff --git a/gcc/tree-ssa-loop-ch.cc b/gcc/tree-ssa-loop-ch.cc
> > index 9ab63d1fa0c..d1391940c2b 100644
> > --- a/gcc/tree-ssa-loop-ch.cc
> > +++ b/gcc/tree-ssa-loop-ch.cc
> > @@ -320,7 +320,7 @@ public:
> >
> > protected:
> > /* ch_base method: */
> > - virtual bool process_loop_p (class loop *loop);
> > + bool process_loop_p (class loop *loop) final override;
> > }; // class pass_ch
> >
> > const pass_data pass_data_ch_vect =
> > @@ -358,7 +358,7 @@ public:
> >
> > protected:
> > /* ch_base method: */
> > - virtual bool process_loop_p (class loop *loop);
> > + bool process_loop_p (class loop *loop) final override;
> > }; // class pass_ch_vect
> >
> > /* For all loops, copy the condition at the end of the loop body
> > in
> > front
> > diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc
> > index 7407591e98c..b2f35a5fb55 100644
> > --- a/gcc/tree-ssa-sccvn.cc
> > +++ b/gcc/tree-ssa-sccvn.cc
> > @@ -2534,9 +2534,9 @@ public:
> > : eliminate_dom_walker (CDI_DOMINATORS, NULL), entry (entry_),
> > m_avail_freelist (NULL) {}
> >
> > - virtual tree eliminate_avail (basic_block, tree op);
> > + tree eliminate_avail (basic_block, tree op) final override;
> >
> > - virtual void eliminate_push_avail (basic_block, tree);
> > + void eliminate_push_avail (basic_block, tree) final override;
> >
> > basic_block entry;
> > /* Freelist of avail entries which are allocated from the
> > vn_ssa_aux
>
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: PING^2: Re: [PATCH 01/10] Add 'final' and 'override' to opt_pass vfunc impls
2022-06-24 18:08 ` PING^2: " David Malcolm
@ 2022-06-24 18:45 ` Jeff Law
2022-06-27 21:16 ` David Malcolm
0 siblings, 1 reply; 39+ messages in thread
From: Jeff Law @ 2022-06-24 18:45 UTC (permalink / raw)
To: gcc-patches
On 6/24/2022 12:08 PM, David Malcolm via Gcc-patches wrote:
> On Mon, 2022-06-13 at 14:22 -0400, David Malcolm wrote:
>> Ping for this patch:
>> https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595444.html
>>
>> OK for trunk?
Sorry, I though the series had been approved at some point. In
general, adding final/override and removing redundant virtuals should be
considered trivial IMHO.
So just to be clear, OK for the trunk.
jeff
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: PING^2 : Re: [PATCH 08/10] i386: add 'final' and 'override' to scalar_chain vfunc impls
2022-06-24 18:19 ` PING^2 : " David Malcolm
@ 2022-06-24 20:58 ` Uros Bizjak
2022-06-27 21:25 ` David Malcolm
2022-08-16 8:55 ` [PATCH][pushed] i386: add 'final' and 'override' to scalar_chain Martin Liška
1 sibling, 1 reply; 39+ messages in thread
From: Uros Bizjak @ 2022-06-24 20:58 UTC (permalink / raw)
To: David Malcolm; +Cc: gcc-patches, Jan Hubicka
On Fri, Jun 24, 2022 at 8:19 PM David Malcolm <dmalcolm@redhat.com> wrote:
>
> I'd like to ping this patch:
> https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595440.html
>
> OK for trunk?
I have no idea what patch does, but if all other targets do the same,
x86 shouldn't be left behind.
So, rubber-stamping OK.
Thanks,
Uros.
>
> Thanks
> Dave
>
>
> On Mon, 2022-06-13 at 14:30 -0400, David Malcolm wrote:
> > Ping for this patch:
> > https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595440.html
> >
> > OK for trunk?
> >
> > Thanks
> > Dave
> >
> > On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote:
> > > gcc/ChangeLog:
> > > * config/i386/i386-features.h: Add "final" and "override" to
> > > scalar_chain vfunc implementations as appropriate.
> > >
> > > Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> > > ---
> > > gcc/config/i386/i386-features.h | 16 ++++++++--------
> > > 1 file changed, 8 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/gcc/config/i386/i386-features.h b/gcc/config/i386/i386-
> > > features.h
> > > index 5c307607ae5..f46a6d95b74 100644
> > > --- a/gcc/config/i386/i386-features.h
> > > +++ b/gcc/config/i386/i386-features.h
> > > @@ -169,18 +169,18 @@ class general_scalar_chain : public
> > > scalar_chain
> > > public:
> > > general_scalar_chain (enum machine_mode smode_, enum machine_mode
> > > vmode_);
> > > ~general_scalar_chain ();
> > > - int compute_convert_gain ();
> > > + int compute_convert_gain () final override;
> > > private:
> > > hash_map<rtx, rtx> defs_map;
> > > bitmap insns_conv;
> > > unsigned n_sse_to_integer;
> > > unsigned n_integer_to_sse;
> > > - void mark_dual_mode_def (df_ref def);
> > > - void convert_insn (rtx_insn *insn);
> > > + void mark_dual_mode_def (df_ref def) final override;
> > > + void convert_insn (rtx_insn *insn) final override;
> > > void convert_op (rtx *op, rtx_insn *insn);
> > > void convert_reg (rtx_insn *insn, rtx dst, rtx src);
> > > void make_vector_copies (rtx_insn *, rtx);
> > > - void convert_registers ();
> > > + void convert_registers () final override;
> > > int vector_const_cost (rtx exp);
> > > };
> > >
> > > @@ -190,14 +190,14 @@ class timode_scalar_chain : public scalar_chain
> > > timode_scalar_chain () : scalar_chain (TImode, V1TImode) {}
> > >
> > > /* Convert from TImode to V1TImode is always faster. */
> > > - int compute_convert_gain () { return 1; }
> > > + int compute_convert_gain () final override { return 1; }
> > >
> > > private:
> > > - void mark_dual_mode_def (df_ref def);
> > > + void mark_dual_mode_def (df_ref def) final override;
> > > void fix_debug_reg_uses (rtx reg);
> > > - void convert_insn (rtx_insn *insn);
> > > + void convert_insn (rtx_insn *insn) final override;
> > > /* We don't convert registers to difference size. */
> > > - void convert_registers () {}
> > > + void convert_registers () final override {}
> > > };
> > >
> > > } // anon namespace
> >
>
>
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: PING^2: Re: [PATCH 01/10] Add 'final' and 'override' to opt_pass vfunc impls
2022-06-24 18:45 ` Jeff Law
@ 2022-06-27 21:16 ` David Malcolm
0 siblings, 0 replies; 39+ messages in thread
From: David Malcolm @ 2022-06-27 21:16 UTC (permalink / raw)
To: Jeff Law, gcc-patches
On Fri, 2022-06-24 at 12:45 -0600, Jeff Law via Gcc-patches wrote:
>
>
> On 6/24/2022 12:08 PM, David Malcolm via Gcc-patches wrote:
> > On Mon, 2022-06-13 at 14:22 -0400, David Malcolm wrote:
> > > Ping for this patch:
> > > https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595444.html
> > >
> > > OK for trunk?
> Sorry, I though the series had been approved at some point. In
> general, adding final/override and removing redundant virtuals should
> be
> considered trivial IMHO.
>
> So just to be clear, OK for the trunk.
Thanks; I've pushed the remaining patches as r13-1305-g725793af78064f
through r13-1310-g26f77c4d19b827.
I had to do some minor refreshing of the patches against trunk to avoid
conflicts; I bootstrapped and regression-tested the result on x86_64-
pc-linux-gnu before pushing.
Dave
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: PING^2 : Re: [PATCH 08/10] i386: add 'final' and 'override' to scalar_chain vfunc impls
2022-06-24 20:58 ` Uros Bizjak
@ 2022-06-27 21:25 ` David Malcolm
0 siblings, 0 replies; 39+ messages in thread
From: David Malcolm @ 2022-06-27 21:25 UTC (permalink / raw)
To: Uros Bizjak; +Cc: gcc-patches, Jan Hubicka
On Fri, 2022-06-24 at 22:58 +0200, Uros Bizjak wrote:
> On Fri, Jun 24, 2022 at 8:19 PM David Malcolm <dmalcolm@redhat.com>
> wrote:
> >
> > I'd like to ping this patch:
> > https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595440.html
> >
> > OK for trunk?
>
> I have no idea what patch does,
Sorry for any confusion; there was a description in the cover letter to
the kit, but you won't have seen that due to me CCing you to just this
one.
This is a C++11 feature, which helps document our intentions in those
places where we're using virtual functions. We can add "final" and
"override" to the decls of virtual function in derived classes, which
document to both human and automated readers of the code that the decl
is intended to override a virtual function in a base class. In
particular, it can help catch commom mistakes where we intended to
override a virtual function, but messed up the prototypes and so merely
introduced a similar-looking function that never gets called. For
example, G++ has a -Wsuggest-override warning (which I hope we'll
eventually be able to turn on during our bootstraps).
> but if all other targets do the same,
> x86 shouldn't be left behind.
> So, rubber-stamping OK.
Thanks. As it happens, x86 is actually the only patch I've done this
cleanup for - but Jeff declared this cleanup to be obvious when
reviewing another patch in the kit, so I've pushed this (as r13-1309-
g0a8333ade9a03f), along with the rest of the kit.
Hope this makes sense
Dave
>
> Thanks,
> Uros.
>
> >
> > Thanks
> > Dave
> >
> >
> > On Mon, 2022-06-13 at 14:30 -0400, David Malcolm wrote:
> > > Ping for this patch:
> > > https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595440.html
> > >
> > > OK for trunk?
> > >
> > > Thanks
> > &g