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/region.h | |
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/region.h')
-rw-r--r-- | gcc/analyzer/region.h | 142 |
1 files changed, 71 insertions, 71 deletions
diff --git a/gcc/analyzer/region.h b/gcc/analyzer/region.h index d32110b..60d8149 100644 --- a/gcc/analyzer/region.h +++ b/gcc/analyzer/region.h @@ -306,13 +306,13 @@ public: ~frame_region (); /* region vfuncs. */ - enum region_kind get_kind () const FINAL OVERRIDE { return RK_FRAME; } - const frame_region * dyn_cast_frame_region () const FINAL OVERRIDE + enum region_kind get_kind () const final override { return RK_FRAME; } + const frame_region * dyn_cast_frame_region () const final override { return this; } - void accept (visitor *v) const FINAL OVERRIDE; - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + void accept (visitor *v) const final override; + void dump_to_pp (pretty_printer *pp, bool simple) const final override; /* Accessors. */ const frame_region *get_calling_frame () const { return m_calling_frame; } @@ -371,8 +371,8 @@ class globals_region : public space_region {} /* region vfuncs. */ - enum region_kind get_kind () const FINAL OVERRIDE { return RK_GLOBALS; } - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + enum region_kind get_kind () const final override { return RK_GLOBALS; } + void dump_to_pp (pretty_printer *pp, bool simple) const final override; }; } // namespace ana @@ -398,8 +398,8 @@ public: {} /* region vfuncs. */ - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; - enum region_kind get_kind () const FINAL OVERRIDE { return RK_CODE; } + void dump_to_pp (pretty_printer *pp, bool simple) const final override; + enum region_kind get_kind () const final override { return RK_CODE; } const region *get_element (region_model *model, const svalue *index, @@ -432,10 +432,10 @@ public: } /* region vfuncs. */ - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; - enum region_kind get_kind () const FINAL OVERRIDE { return RK_FUNCTION; } + void dump_to_pp (pretty_printer *pp, bool simple) const final override; + enum region_kind get_kind () const final override { return RK_FUNCTION; } const function_region * - dyn_cast_function_region () const FINAL OVERRIDE{ return this; } + dyn_cast_function_region () const final override{ return this; } tree get_fndecl () const { return m_fndecl; } @@ -472,8 +472,8 @@ public: } /* region vfuncs. */ - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; - enum region_kind get_kind () const FINAL OVERRIDE { return RK_LABEL; } + void dump_to_pp (pretty_printer *pp, bool simple) const final override; + enum region_kind get_kind () const final override { return RK_LABEL; } tree get_label () const { return m_label; } @@ -503,9 +503,9 @@ public: : space_region (id, parent) {} - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + void dump_to_pp (pretty_printer *pp, bool simple) const final override; - enum region_kind get_kind () const FINAL OVERRIDE { return RK_STACK; } + enum region_kind get_kind () const final override { return RK_STACK; } }; } // namespace ana @@ -530,8 +530,8 @@ public: : space_region (id, parent) {} - enum region_kind get_kind () const FINAL OVERRIDE { return RK_HEAP; } - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + enum region_kind get_kind () const final override { return RK_HEAP; } + void dump_to_pp (pretty_printer *pp, bool simple) const final override; }; } // namespace ana @@ -555,8 +555,8 @@ class root_region : public region public: root_region (unsigned id); - enum region_kind get_kind () const FINAL OVERRIDE { return RK_ROOT; } - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + enum region_kind get_kind () const final override { return RK_ROOT; } + void dump_to_pp (pretty_printer *pp, bool simple) const final override; }; } // namespace ana @@ -614,11 +614,11 @@ public: symbolic_region (unsigned id, region *parent, const svalue *sval_ptr); const symbolic_region * - dyn_cast_symbolic_region () const FINAL OVERRIDE { return this; } + dyn_cast_symbolic_region () const final override { return this; } - enum region_kind get_kind () const FINAL OVERRIDE { return RK_SYMBOLIC; } - void accept (visitor *v) const FINAL OVERRIDE; - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + enum region_kind get_kind () const final override { return RK_SYMBOLIC; } + void accept (visitor *v) const final override; + void dump_to_pp (pretty_printer *pp, bool simple) const final override; const svalue *get_pointer () const { return m_sval_ptr; } @@ -656,13 +656,13 @@ public: m_tracked (calc_tracked_p (decl)) {} - enum region_kind get_kind () const FINAL OVERRIDE { return RK_DECL; } + enum region_kind get_kind () const final override { return RK_DECL; } const decl_region * - dyn_cast_decl_region () const FINAL OVERRIDE { return this; } + dyn_cast_decl_region () const final override { return this; } - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + void dump_to_pp (pretty_printer *pp, bool simple) const final override; - bool tracked_p () const FINAL OVERRIDE { return m_tracked; } + bool tracked_p () const final override { return m_tracked; } tree get_decl () const { return m_decl; } int get_stack_depth () const; @@ -738,15 +738,15 @@ public: m_field (field) {} - enum region_kind get_kind () const FINAL OVERRIDE { return RK_FIELD; } + enum region_kind get_kind () const final override { return RK_FIELD; } - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + void dump_to_pp (pretty_printer *pp, bool simple) const final override; const field_region * - dyn_cast_field_region () const FINAL OVERRIDE { return this; } + dyn_cast_field_region () const final override { return this; } tree get_field () const { return m_field; } - bool get_relative_concrete_offset (bit_offset_t *out) const FINAL OVERRIDE; + bool get_relative_concrete_offset (bit_offset_t *out) const final override; private: tree m_field; @@ -819,18 +819,18 @@ public: m_index (index) {} - enum region_kind get_kind () const FINAL OVERRIDE { return RK_ELEMENT; } + enum region_kind get_kind () const final override { return RK_ELEMENT; } const element_region * - dyn_cast_element_region () const FINAL OVERRIDE { return this; } + dyn_cast_element_region () const final override { return this; } - void accept (visitor *v) const FINAL OVERRIDE; + void accept (visitor *v) const final override; - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + void dump_to_pp (pretty_printer *pp, bool simple) const final override; const svalue *get_index () const { return m_index; } virtual bool - get_relative_concrete_offset (bit_offset_t *out) const FINAL OVERRIDE; + get_relative_concrete_offset (bit_offset_t *out) const final override; private: const svalue *m_index; @@ -904,17 +904,17 @@ public: m_byte_offset (byte_offset) {} - enum region_kind get_kind () const FINAL OVERRIDE { return RK_OFFSET; } + enum region_kind get_kind () const final override { return RK_OFFSET; } const offset_region * - dyn_cast_offset_region () const FINAL OVERRIDE { return this; } + dyn_cast_offset_region () const final override { return this; } - void accept (visitor *v) const FINAL OVERRIDE; + void accept (visitor *v) const final override; - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + void dump_to_pp (pretty_printer *pp, bool simple) const final override; const svalue *get_byte_offset () const { return m_byte_offset; } - bool get_relative_concrete_offset (bit_offset_t *out) const FINAL OVERRIDE; + bool get_relative_concrete_offset (bit_offset_t *out) const final override; private: const svalue *m_byte_offset; @@ -992,19 +992,19 @@ public: m_byte_size_sval (byte_size_sval) {} - enum region_kind get_kind () const FINAL OVERRIDE { return RK_SIZED; } + enum region_kind get_kind () const final override { return RK_SIZED; } const sized_region * - dyn_cast_sized_region () const FINAL OVERRIDE { return this; } + dyn_cast_sized_region () const final override { return this; } - void accept (visitor *v) const FINAL OVERRIDE; + void accept (visitor *v) const final override; - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + void dump_to_pp (pretty_printer *pp, bool simple) const final override; - bool get_byte_size (byte_size_t *out) const FINAL OVERRIDE; - bool get_bit_size (bit_size_t *out) const FINAL OVERRIDE; + bool get_byte_size (byte_size_t *out) const final override; + bool get_bit_size (bit_size_t *out) const final override; const svalue * - get_byte_size_sval (region_model_manager *) const FINAL OVERRIDE + get_byte_size_sval (region_model_manager *) const final override { return m_byte_size_sval; } @@ -1074,11 +1074,11 @@ public: m_original_region (original_region) {} - enum region_kind get_kind () const FINAL OVERRIDE { return RK_CAST; } + enum region_kind get_kind () const final override { return RK_CAST; } const cast_region * - dyn_cast_cast_region () const FINAL OVERRIDE { return this; } - void accept (visitor *v) const FINAL OVERRIDE; - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + dyn_cast_cast_region () const final override { return this; } + void accept (visitor *v) const final override; + void dump_to_pp (pretty_printer *pp, bool simple) const final override; const region *get_original_region () const { return m_original_region; } @@ -1115,9 +1115,9 @@ public: {} enum region_kind - get_kind () const FINAL OVERRIDE { return RK_HEAP_ALLOCATED; } + get_kind () const final override { return RK_HEAP_ALLOCATED; } - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + void dump_to_pp (pretty_printer *pp, bool simple) const final override; }; /* An untyped region dynamically allocated on the stack via "alloca". */ @@ -1129,9 +1129,9 @@ public: : region (complexity (parent), id, parent, NULL_TREE) {} - enum region_kind get_kind () const FINAL OVERRIDE { return RK_ALLOCA; } + enum region_kind get_kind () const final override { return RK_ALLOCA; } - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + void dump_to_pp (pretty_printer *pp, bool simple) const final override; }; /* A region for a STRING_CST. */ @@ -1145,11 +1145,11 @@ public: {} const string_region * - dyn_cast_string_region () const FINAL OVERRIDE { return this; } + dyn_cast_string_region () const final override { return this; } - enum region_kind get_kind () const FINAL OVERRIDE { return RK_STRING; } + enum region_kind get_kind () const final override { return RK_STRING; } - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + void dump_to_pp (pretty_printer *pp, bool simple) const final override; tree get_string_cst () const { return m_string_cst; } @@ -1220,18 +1220,18 @@ public: {} const bit_range_region * - dyn_cast_bit_range_region () const FINAL OVERRIDE { return this; } + dyn_cast_bit_range_region () const final override { return this; } - enum region_kind get_kind () const FINAL OVERRIDE { return RK_BIT_RANGE; } + enum region_kind get_kind () const final override { return RK_BIT_RANGE; } - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + void dump_to_pp (pretty_printer *pp, bool simple) const final override; const bit_range &get_bits () const { return m_bits; } - bool get_byte_size (byte_size_t *out) const FINAL OVERRIDE; - bool get_bit_size (bit_size_t *out) const FINAL OVERRIDE; - const svalue *get_byte_size_sval (region_model_manager *mgr) const FINAL OVERRIDE; - bool get_relative_concrete_offset (bit_offset_t *out) const FINAL OVERRIDE; + bool get_byte_size (byte_size_t *out) const final override; + bool get_bit_size (bit_size_t *out) const final override; + const svalue *get_byte_size_sval (region_model_manager *mgr) const final override; + bool get_relative_concrete_offset (bit_offset_t *out) const final override; private: bit_range m_bits; @@ -1305,11 +1305,11 @@ public: {} const var_arg_region * - dyn_cast_var_arg_region () const FINAL OVERRIDE { return this; } + dyn_cast_var_arg_region () const final override { return this; } - enum region_kind get_kind () const FINAL OVERRIDE { return RK_VAR_ARG; } + enum region_kind get_kind () const final override { return RK_VAR_ARG; } - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + void dump_to_pp (pretty_printer *pp, bool simple) const final override; const frame_region *get_frame_region () const; unsigned get_index () const { return m_idx; } @@ -1345,9 +1345,9 @@ public: : region (complexity (parent), id, parent, type) {} - enum region_kind get_kind () const FINAL OVERRIDE { return RK_UNKNOWN; } + enum region_kind get_kind () const final override { return RK_UNKNOWN; } - void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + void dump_to_pp (pretty_printer *pp, bool simple) const final override; }; } // namespace ana |