From 94946989e82cfa996873bcf6273242f5606cd7f5 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 3 Jan 2020 08:55:33 -0500 Subject: [PATCH] analyzer: delete checker_event::clone checker_event has a clone vfunc implemented by all the concrete subclasses, but this is never used (a holdover from a very early implementation). This patch deletes it. gcc/analyzer/ChangeLog: * checker-path.h (checker_event::clone): Delete vfunc decl. (debug_event::clone): Delete vfunc impl. (custom_event::clone): Delete vfunc impl. (statement_event::clone): Delete vfunc impl. (function_entry_event::clone): Delete vfunc impl. (state_change_event::clone): Delete vfunc impl. (start_cfg_edge_event::clone): Delete vfunc impl. (end_cfg_edge_event::clone): Delete vfunc impl. (call_event::clone): Delete vfunc impl. (return_event::clone): Delete vfunc impl. (setjmp_event::clone): Delete vfunc impl. (rewind_from_longjmp_event::clone): Delete vfunc impl. (rewind_to_setjmp_event::clone): Delete vfunc impl. (warning_event::clone): Delete vfunc impl. --- gcc/analyzer/ChangeLog | 17 +++++++++ gcc/analyzer/checker-path.h | 72 ------------------------------------- 2 files changed, 17 insertions(+), 72 deletions(-) diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog index 08c16b70128..863bf3fe510 100644 --- a/gcc/analyzer/ChangeLog +++ b/gcc/analyzer/ChangeLog @@ -1,3 +1,20 @@ +2020-01-14 David Malcolm + + * checker-path.h (checker_event::clone): Delete vfunc decl. + (debug_event::clone): Delete vfunc impl. + (custom_event::clone): Delete vfunc impl. + (statement_event::clone): Delete vfunc impl. + (function_entry_event::clone): Delete vfunc impl. + (state_change_event::clone): Delete vfunc impl. + (start_cfg_edge_event::clone): Delete vfunc impl. + (end_cfg_edge_event::clone): Delete vfunc impl. + (call_event::clone): Delete vfunc impl. + (return_event::clone): Delete vfunc impl. + (setjmp_event::clone): Delete vfunc impl. + (rewind_from_longjmp_event::clone): Delete vfunc impl. + (rewind_to_setjmp_event::clone): Delete vfunc impl. + (warning_event::clone): Delete vfunc impl. + 2020-01-14 David Malcolm * supergraph.cc (supernode::dump_dot): Ensure that the TABLE diff --git a/gcc/analyzer/checker-path.h b/gcc/analyzer/checker-path.h index cabbeb4fd4f..31d4004227d 100644 --- a/gcc/analyzer/checker-path.h +++ b/gcc/analyzer/checker-path.h @@ -88,8 +88,6 @@ public: /* Additional functionality. */ - virtual checker_event *clone () const = 0; - virtual void prepare_for_emission (checker_path *, pending_diagnostic *pd, diagnostic_event_id_t emission_id); @@ -128,11 +126,6 @@ public: label_text get_desc (bool) const FINAL OVERRIDE; - checker_event *clone () const FINAL OVERRIDE - { - return new debug_event (m_loc, m_fndecl, m_depth, m_desc); - } - private: char *m_desc; }; @@ -156,11 +149,6 @@ public: label_text get_desc (bool) const FINAL OVERRIDE; - checker_event *clone () const FINAL OVERRIDE - { - return new custom_event (m_loc, m_fndecl, m_depth, m_desc); - } - private: char *m_desc; }; @@ -176,11 +164,6 @@ public: label_text get_desc (bool) const FINAL OVERRIDE; - checker_event *clone () const FINAL OVERRIDE - { - return new statement_event (m_stmt, m_fndecl, m_depth, m_dst_state); - } - const gimple * const m_stmt; const program_state m_dst_state; }; @@ -197,11 +180,6 @@ public: label_text get_desc (bool can_colorize) const FINAL OVERRIDE; - checker_event *clone () const FINAL OVERRIDE - { - return new function_entry_event (m_loc, m_fndecl, m_depth); - } - bool is_function_entry_p () const FINAL OVERRIDE { return true; } }; @@ -221,13 +199,6 @@ public: label_text get_desc (bool can_colorize) const FINAL OVERRIDE; - checker_event *clone () const FINAL OVERRIDE - { - return new state_change_event (m_node, m_stmt, m_depth, - m_sm, m_var, m_from, m_to, m_origin, - m_dst_state); - } - region_id get_lvalue (tree expr) const { return m_dst_state.m_region_model->get_lvalue (expr, NULL); @@ -302,11 +273,6 @@ public: label_text get_desc (bool can_colorize) const FINAL OVERRIDE; - checker_event *clone () const FINAL OVERRIDE - { - return new start_cfg_edge_event (m_eedge, m_loc, m_fndecl, m_depth); - } - private: label_text maybe_describe_condition (bool can_colorize) const; @@ -333,11 +299,6 @@ public: { return label_text::borrow ("...to here"); } - - checker_event *clone () const FINAL OVERRIDE - { - return new end_cfg_edge_event (m_eedge, m_loc, m_fndecl, m_depth); - } }; /* A concrete event subclass for an interprocedural call. */ @@ -350,11 +311,6 @@ public: label_text get_desc (bool can_colorize) const FINAL OVERRIDE; - checker_event *clone () const FINAL OVERRIDE - { - return new call_event (m_eedge, m_loc, m_fndecl, m_depth); - } - bool is_call_p () const FINAL OVERRIDE; }; @@ -368,11 +324,6 @@ public: label_text get_desc (bool can_colorize) const FINAL OVERRIDE; - checker_event *clone () const FINAL OVERRIDE - { - return new return_event (m_eedge, m_loc, m_fndecl, m_depth); - } - bool is_return_p () const FINAL OVERRIDE; }; @@ -388,11 +339,6 @@ public: { } - setjmp_event *clone () const FINAL OVERRIDE - { - return new setjmp_event (m_loc, m_enode, m_fndecl, m_depth); - } - label_text get_desc (bool can_colorize) const FINAL OVERRIDE; void prepare_for_emission (checker_path *path, @@ -436,12 +382,6 @@ public: } label_text get_desc (bool can_colorize) const FINAL OVERRIDE; - - rewind_from_longjmp_event *clone () const FINAL OVERRIDE - { - return new rewind_from_longjmp_event (get_eedge (), - m_loc, m_fndecl, m_depth); - } }; /* A concrete event subclass for rewinding from a longjmp to a setjmp, @@ -460,13 +400,6 @@ public: label_text get_desc (bool can_colorize) const FINAL OVERRIDE; - rewind_to_setjmp_event *clone () const FINAL OVERRIDE - { - return new rewind_to_setjmp_event (get_eedge (), - m_loc, m_fndecl, m_depth, - m_rewind_info); - } - void prepare_for_emission (checker_path *path, pending_diagnostic *pd, diagnostic_event_id_t emission_id) FINAL OVERRIDE; @@ -494,11 +427,6 @@ public: label_text get_desc (bool can_colorize) const FINAL OVERRIDE; - warning_event *clone () const FINAL OVERRIDE - { - return new warning_event (m_loc, m_fndecl, m_depth, m_sm, m_var, m_state); - } - private: const state_machine *m_sm; tree m_var; -- 2.30.2