diff options
author | David Malcolm <dmalcolm@redhat.com> | 2022-05-23 19:28:48 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2022-05-23 19:28:48 -0400 |
commit | 8473ef7be60443c06c949571995f00e2793c2c5b (patch) | |
tree | ddf08ed85cdfc67b7d454044c8d2a2fb3559d7bf /gcc | |
parent | 58c9c7407a1a992ac253826790cd2b8920e3fe8f (diff) | |
download | gcc-8473ef7be60443c06c949571995f00e2793c2c5b.zip gcc-8473ef7be60443c06c949571995f00e2793c2c5b.tar.gz gcc-8473ef7be60443c06c949571995f00e2793c2c5b.tar.bz2 |
test plugins: use "final" and "override" directly, rather than via macros
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/analyzer_gil_plugin.c: Replace uses of "FINAL" and
"OVERRIDE" with "final" and "override".
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gcc.dg/plugin/analyzer_gil_plugin.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/gcc/testsuite/gcc.dg/plugin/analyzer_gil_plugin.c b/gcc/testsuite/gcc.dg/plugin/analyzer_gil_plugin.c index 12d1c8d..b5ae128 100644 --- a/gcc/testsuite/gcc.dg/plugin/analyzer_gil_plugin.c +++ b/gcc/testsuite/gcc.dg/plugin/analyzer_gil_plugin.c @@ -47,13 +47,13 @@ class gil_state_machine : public state_machine public: gil_state_machine (logger *logger); - bool inherited_state_p () const FINAL OVERRIDE { return false; } + bool inherited_state_p () const final override { return false; } bool on_stmt (sm_context *sm_ctxt, const supernode *node, - const gimple *stmt) const FINAL OVERRIDE; + const gimple *stmt) const final override; - bool can_purge_p (state_t s) const FINAL OVERRIDE; + bool can_purge_p (state_t s) const final override; void check_for_pyobject_usage_without_gil (sm_context *sm_ctxt, const supernode *node, @@ -82,12 +82,12 @@ class gil_diagnostic : public pending_diagnostic { public: /* There isn't a warning ID for us to use. */ - int get_controlling_option () const FINAL OVERRIDE + int get_controlling_option () const final override { return 0; } - location_t fixup_location (location_t loc) const FINAL OVERRIDE + location_t fixup_location (location_t loc) const final override { /* Ideally we'd check for specific macros here, and only resolve certain macros. */ @@ -98,7 +98,7 @@ public: } label_text describe_state_change (const evdesc::state_change &change) - FINAL OVERRIDE + final override { if (change.is_global_p () && change.m_new_state == m_sm.m_released_gil) @@ -125,25 +125,25 @@ class double_save_thread : public gil_diagnostic : gil_diagnostic (sm), m_call (call) {} - const char *get_kind () const FINAL OVERRIDE + const char *get_kind () const final override { return "double_save_thread"; } - bool subclass_equal_p (const pending_diagnostic &base_other) const OVERRIDE + bool subclass_equal_p (const pending_diagnostic &base_other) const override { const double_save_thread &sub_other = (const double_save_thread &)base_other; return m_call == sub_other.m_call; } - bool emit (rich_location *rich_loc) FINAL OVERRIDE + bool emit (rich_location *rich_loc) final override { return warning_at (rich_loc, get_controlling_option (), "nested usage of %qs", "Py_BEGIN_ALLOW_THREADS"); } - label_text describe_final_event (const evdesc::final_event &ev) FINAL OVERRIDE + label_text describe_final_event (const evdesc::final_event &ev) final override { return ev.formatted_print ("nested usage of %qs here", "Py_BEGIN_ALLOW_THREADS"); @@ -162,12 +162,12 @@ class fncall_without_gil : public gil_diagnostic m_arg_idx (arg_idx) {} - const char *get_kind () const FINAL OVERRIDE + const char *get_kind () const final override { return "fncall_without_gil"; } - bool subclass_equal_p (const pending_diagnostic &base_other) const OVERRIDE + bool subclass_equal_p (const pending_diagnostic &base_other) const override { const fncall_without_gil &sub_other = (const fncall_without_gil &)base_other; @@ -176,7 +176,7 @@ class fncall_without_gil : public gil_diagnostic && m_arg_idx == sub_other.m_arg_idx); } - bool emit (rich_location *rich_loc) FINAL OVERRIDE + bool emit (rich_location *rich_loc) final override { auto_diagnostic_group d; if (m_callee_fndecl) @@ -191,7 +191,7 @@ class fncall_without_gil : public gil_diagnostic m_arg_idx + 1, m_callee_fndecl); } - 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_callee_fndecl) return ev.formatted_print ("use of PyObject as argument %i of %qE here" @@ -216,25 +216,25 @@ class pyobject_usage_without_gil : public gil_diagnostic : gil_diagnostic (sm), m_expr (expr) {} - const char *get_kind () const FINAL OVERRIDE + const char *get_kind () const final override { return "pyobject_usage_without_gil"; } - 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_expr, ((const pyobject_usage_without_gil&)base_other).m_expr); } - bool emit (rich_location *rich_loc) FINAL OVERRIDE + bool emit (rich_location *rich_loc) final override { auto_diagnostic_group d; return warning_at (rich_loc, get_controlling_option (), "use of PyObject %qE without the GIL", m_expr); } - label_text describe_final_event (const evdesc::final_event &ev) FINAL OVERRIDE + label_text describe_final_event (const evdesc::final_event &ev) final override { return ev.formatted_print ("PyObject %qE used here without the GIL", m_expr); |