diff options
author | David Malcolm <dmalcolm@redhat.com> | 2022-05-20 10:05:54 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2022-05-20 10:05:54 -0400 |
commit | ff171cb13df671a2a0647a68da0fdc1f9a78b8c9 (patch) | |
tree | 099c56c115ca15e17c84d4178b546191fdf0b2b1 /gcc/analyzer/sm-file.cc | |
parent | 6c420193e86b39a09304b2845335571eefe24d5d (diff) | |
download | gcc-ff171cb13df671a2a0647a68da0fdc1f9a78b8c9.zip gcc-ff171cb13df671a2a0647a68da0fdc1f9a78b8c9.tar.gz gcc-ff171cb13df671a2a0647a68da0fdc1f9a78b8c9.tar.bz2 |
Use "final" and "override" directly, rather than via macros
As of GCC 11 onwards we have required a C++11 compiler, such as GCC 4.8
or later. On the assumption that any such compiler correctly implements
"final" and "override", this patch updates the source tree to stop using
the FINAL and OVERRIDE macros from ansidecl.h, in favor of simply using
"final" and "override" directly.
libcpp/ChangeLog:
* lex.cc: Replace uses of "FINAL" and "OVERRIDE" with "final" and
"override".
gcc/analyzer/ChangeLog:
* analyzer-pass.cc: Replace uses of "FINAL" and "OVERRIDE" with
"final" and "override".
* call-info.h: Likewise.
* checker-path.h: Likewise.
* constraint-manager.cc: Likewise.
* diagnostic-manager.cc: Likewise.
* engine.cc: Likewise.
* exploded-graph.h: Likewise.
* feasible-graph.h: Likewise.
* pending-diagnostic.h: Likewise.
* region-model-impl-calls.cc: Likewise.
* region-model.cc: Likewise.
* region-model.h: Likewise.
* region.h: Likewise.
* sm-file.cc: Likewise.
* sm-malloc.cc: Likewise.
* sm-pattern-test.cc: Likewise.
* sm-sensitive.cc: Likewise.
* sm-signal.cc: Likewise.
* sm-taint.cc: Likewise.
* state-purge.h: Likewise.
* store.cc: Likewise.
* store.h: Likewise.
* supergraph.h: Likewise.
* svalue.h: Likewise.
* trimmed-graph.h: Likewise.
* varargs.cc: Likewise.
gcc/c-family/ChangeLog:
* c-format.cc: Replace uses of "FINAL" and "OVERRIDE" with "final"
and "override".
* c-pretty-print.h: Likewise.
gcc/cp/ChangeLog:
* cxx-pretty-print.h: Replace uses of "FINAL" and "OVERRIDE" with
"final" and "override".
* error.cc: Likewise.
gcc/jit/ChangeLog:
* jit-playback.h: Replace uses of "FINAL" and "OVERRIDE" with
"final" and "override".
* jit-recording.cc: Likewise.
* jit-recording.h: Likewise.
gcc/ChangeLog:
* config/aarch64/aarch64-sve-builtins-base.cc: Replace uses of
"FINAL" and "OVERRIDE" with "final" and "override".
* config/aarch64/aarch64-sve-builtins-functions.h: Likewise.
* config/aarch64/aarch64-sve-builtins-shapes.cc: Likewise.
* config/aarch64/aarch64-sve-builtins-sve2.cc: Likewise.
* diagnostic-path.h: Likewise.
* digraph.cc: Likewise.
* gcc-rich-location.h: Likewise.
* gimple-array-bounds.cc: Likewise.
* gimple-loop-versioning.cc: Likewise.
* gimple-range-cache.cc: Likewise.
* gimple-range-cache.h: Likewise.
* gimple-range-fold.cc: Likewise.
* gimple-range-fold.h: Likewise.
* gimple-range-tests.cc: Likewise.
* gimple-range.h: Likewise.
* gimple-ssa-evrp.cc: Likewise.
* input.cc: Likewise.
* json.h: Likewise.
* read-rtl-function.cc: Likewise.
* tree-complex.cc: Likewise.
* tree-diagnostic-path.cc: Likewise.
* tree-ssa-ccp.cc: Likewise.
* tree-ssa-copy.cc: Likewise.
* tree-vrp.cc: Likewise.
* value-query.h: Likewise.
* vr-values.h: Likewise.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/analyzer/sm-file.cc')
-rw-r--r-- | gcc/analyzer/sm-file.cc | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/gcc/analyzer/sm-file.cc b/gcc/analyzer/sm-file.cc index 3a45e62..e9b5b8b 100644 --- a/gcc/analyzer/sm-file.cc +++ b/gcc/analyzer/sm-file.cc @@ -57,10 +57,10 @@ class fileptr_state_machine : public state_machine public: fileptr_state_machine (logger *logger); - bool inherited_state_p () const FINAL OVERRIDE { return false; } + bool inherited_state_p () const final override { return false; } state_machine::state_t - get_default_state (const svalue *sval) const FINAL OVERRIDE + get_default_state (const svalue *sval) const final override { if (tree cst = sval->maybe_get_constant ()) { @@ -72,17 +72,17 @@ public: bool on_stmt (sm_context *sm_ctxt, const supernode *node, - const gimple *stmt) const FINAL OVERRIDE; + const gimple *stmt) const final override; void on_condition (sm_context *sm_ctxt, const supernode *node, const gimple *stmt, const svalue *lhs, enum tree_code op, - const svalue *rhs) const FINAL OVERRIDE; + const svalue *rhs) const final override; - bool can_purge_p (state_t s) const FINAL OVERRIDE; - pending_diagnostic *on_leak (tree var) const FINAL OVERRIDE; + bool can_purge_p (state_t s) const final override; + pending_diagnostic *on_leak (tree var) const final override; /* State for a FILE * returned from fopen that hasn't been checked for NULL. @@ -111,13 +111,13 @@ public: : m_sm (sm), m_arg (arg) {} - bool subclass_equal_p (const pending_diagnostic &base_other) const OVERRIDE + bool subclass_equal_p (const pending_diagnostic &base_other) const override { return same_tree_p (m_arg, ((const file_diagnostic &)base_other).m_arg); } label_text describe_state_change (const evdesc::state_change &change) - OVERRIDE + override { if (change.m_old_state == m_sm.get_start_state () && change.m_new_state == m_sm.m_unchecked) @@ -155,14 +155,14 @@ public: : file_diagnostic (sm, arg) {} - const char *get_kind () const FINAL OVERRIDE { return "double_fclose"; } + const char *get_kind () const final override { return "double_fclose"; } - int get_controlling_option () const FINAL OVERRIDE + int get_controlling_option () const final override { return OPT_Wanalyzer_double_fclose; } - bool emit (rich_location *rich_loc) FINAL OVERRIDE + bool emit (rich_location *rich_loc) final override { return warning_at (rich_loc, get_controlling_option (), "double %<fclose%> of FILE %qE", @@ -170,7 +170,7 @@ public: } label_text describe_state_change (const evdesc::state_change &change) - OVERRIDE + override { if (change.m_new_state == m_sm.m_closed) { @@ -180,7 +180,7 @@ public: return file_diagnostic::describe_state_change (change); } - label_text describe_final_event (const evdesc::final_event &ev) FINAL OVERRIDE + label_text describe_final_event (const evdesc::final_event &ev) final override { if (m_first_fclose_event.known_p ()) return ev.formatted_print ("second %qs here; first %qs was at %@", @@ -200,14 +200,14 @@ public: : file_diagnostic (sm, arg) {} - const char *get_kind () const FINAL OVERRIDE { return "file_leak"; } + const char *get_kind () const final override { return "file_leak"; } - int get_controlling_option () const FINAL OVERRIDE + int get_controlling_option () const final override { return OPT_Wanalyzer_file_leak; } - bool emit (rich_location *rich_loc) FINAL OVERRIDE + bool emit (rich_location *rich_loc) final override { diagnostic_metadata m; /* CWE-775: "Missing Release of File Descriptor or Handle after @@ -223,7 +223,7 @@ public: } label_text describe_state_change (const evdesc::state_change &change) - FINAL OVERRIDE + final override { if (change.m_new_state == m_sm.m_unchecked) { @@ -233,7 +233,7 @@ public: return file_diagnostic::describe_state_change (change); } - label_text describe_final_event (const evdesc::final_event &ev) FINAL OVERRIDE + label_text describe_final_event (const evdesc::final_event &ev) final override { if (m_fopen_event.known_p ()) { |