[1/2] analyzer: delete checker_event::clone

Message ID 20200103190108.12550-1-dmalcolm@redhat.com
State New
Headers show
Series
  • [1/2] analyzer: delete checker_event::clone
Related show

Commit Message

David Malcolm Jan. 3, 2020, 7:01 p.m.
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.

Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to dmalcolm/analyzer on the GCC git mirror.

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/checker-path.h | 72 -------------------------------------
 1 file changed, 72 deletions(-)

-- 
2.21.0

Patch

diff --git a/gcc/analyzer/checker-path.h b/gcc/analyzer/checker-path.h
index bdad5abc413d..9faaeb72ddc5 100644
--- a/gcc/analyzer/checker-path.h
+++ b/gcc/analyzer/checker-path.h
@@ -91,8 +91,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);
@@ -131,11 +129,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;
 };
@@ -159,11 +152,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;
 };
@@ -179,11 +167,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;
 };
@@ -200,11 +183,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; }
 };
 
@@ -224,13 +202,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);
@@ -305,11 +276,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;
 
@@ -336,11 +302,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.  */
@@ -353,11 +314,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;
 };
 
@@ -371,11 +327,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;
 };
 
@@ -391,11 +342,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,
@@ -439,12 +385,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,
@@ -463,13 +403,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;
@@ -497,11 +430,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;