[5/6,analyzer] Use DISABLE_COPY_AND_ASSIGN in various places

Message ID 20191205200852.19076-6-dmalcolm@redhat.com
State New
Headers show
Series
  • Use DISABLE_COPY_AND_ASSIGN
Related show

Commit Message

David Malcolm Dec. 5, 2019, 8:08 p.m.
This patch adds DISABLE_COPY_AND_ASSIGN to various classes that had
a dtor but for which I hadn't bothered implementing the copy ctor
and assignment operator.

gcc/ChangeLog:
	* analyzer/analysis-plan.h (analysis_plan): Add
	DISABLE_COPY_AND_ASSIGN.
	* analyzer/diagnostic-manager.h (saved_diagnostic): Likewise.
	* analyzer/exploded-graph.h (exploded_node): Likewise.
	(exploded_edge): Likewise.
	(exploded_graph): Likewise.
	* analyzer/sm.h (state_machine): Likewise.
	* analyzer/state-purge.h (state_purge_map): Likewise.
---
 gcc/analyzer/analysis-plan.h      | 2 ++
 gcc/analyzer/diagnostic-manager.h | 3 +++
 gcc/analyzer/exploded-graph.h     | 7 +++++++
 gcc/analyzer/sm.h                 | 2 ++
 gcc/analyzer/state-purge.h        | 2 ++
 5 files changed, 16 insertions(+)

-- 
2.21.0

Patch

diff --git a/gcc/analyzer/analysis-plan.h b/gcc/analyzer/analysis-plan.h
index c9396ec83854..f22e7338b1e7 100644
--- a/gcc/analyzer/analysis-plan.h
+++ b/gcc/analyzer/analysis-plan.h
@@ -42,6 +42,8 @@  public:
   bool use_summary_p (const cgraph_edge *edge) const;
 
 private:
+  DISABLE_COPY_AND_ASSIGN (analysis_plan);
+
   const supergraph &m_sg;
 
   /* Result of ipa_reverse_postorder.  */
diff --git a/gcc/analyzer/diagnostic-manager.h b/gcc/analyzer/diagnostic-manager.h
index 8591d2ec7cd6..ac4e74a9090c 100644
--- a/gcc/analyzer/diagnostic-manager.h
+++ b/gcc/analyzer/diagnostic-manager.h
@@ -59,6 +59,9 @@  public:
   state_machine::state_t m_state;
   pending_diagnostic *m_d;
   exploded_edge *m_trailing_eedge;
+
+private:
+  DISABLE_COPY_AND_ASSIGN (saved_diagnostic);
 };
 
 /* A class with responsibility for saving pending diagnostics, so that
diff --git a/gcc/analyzer/exploded-graph.h b/gcc/analyzer/exploded-graph.h
index 26ae109628f4..c8784acd8d91 100644
--- a/gcc/analyzer/exploded-graph.h
+++ b/gcc/analyzer/exploded-graph.h
@@ -241,6 +241,8 @@  class exploded_node : public dnode<eg_traits>
   void dump_succs_and_preds (FILE *outf) const;
 
 private:
+  DISABLE_COPY_AND_ASSIGN (exploded_node);
+
   const char * get_dot_fillcolor () const;
 
   /* The <program_point, program_state> pair.  This is const, as it
@@ -296,6 +298,9 @@  class exploded_edge : public dedge<eg_traits>
 
      Owned by this class.  */
   custom_info_t *m_custom_info;
+
+private:
+  DISABLE_COPY_AND_ASSIGN (exploded_edge);
 };
 
 /* Extra data for an exploded_edge that represents a rewind from a
@@ -733,6 +738,8 @@  public:
   { return &m_per_call_string_data; }
 
 private:
+  DISABLE_COPY_AND_ASSIGN (exploded_graph);
+
   const supergraph &m_sg;
 
   /* Map from point/state to exploded node.
diff --git a/gcc/analyzer/sm.h b/gcc/analyzer/sm.h
index 905e64407df6..65205f8fd47f 100644
--- a/gcc/analyzer/sm.h
+++ b/gcc/analyzer/sm.h
@@ -90,6 +90,8 @@  protected:
   state_t add_state (const char *name);
 
 private:
+  DISABLE_COPY_AND_ASSIGN (state_machine);
+
   const char *m_name;
   auto_vec<const char *> m_state_names;
 };
diff --git a/gcc/analyzer/state-purge.h b/gcc/analyzer/state-purge.h
index f50c239503ea..46be95bcb9a1 100644
--- a/gcc/analyzer/state-purge.h
+++ b/gcc/analyzer/state-purge.h
@@ -105,6 +105,8 @@  public:
   iterator end () const { return m_map.end (); }
 
 private:
+  DISABLE_COPY_AND_ASSIGN (state_purge_map);
+
   const supergraph &m_sg;
   map_t m_map;
 };