From e39ec57764e654be17434332ff1b78d2f9a592b6 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Thu, 21 May 2020 12:59:17 -0400
Subject: [PATCH 172/315] FIXME: cleanups

---
 gcc/analyzer/region-model2.h                  | 37 -------------------
 .../gcc.dg/analyzer/malloc-paths-7.c          |  3 ++
 2 files changed, 3 insertions(+), 37 deletions(-)

diff --git a/gcc/analyzer/region-model2.h b/gcc/analyzer/region-model2.h
index cec326000cd..af8849733e0 100644
--- a/gcc/analyzer/region-model2.h
+++ b/gcc/analyzer/region-model2.h
@@ -1212,10 +1212,6 @@ public:
 #if 0
   void add_to_hash (inchash::hash &hstate) const FINAL OVERRIDE;
 #endif
-
-#if 0
-  auto_vec<region2 *> m_frame_rids;
-#endif
 };
 
 } // namespace ana
@@ -1290,26 +1286,6 @@ public:
   }
 
 #if 0
-  region2_id push_frame (region_model2 *model, function *fun,
-			vec<svalue2_id> *arg_sids,
-			region_model2_context *ctxt);
-  void pop_frame (region_model2 *model, region2_id result_dst_rid,
-		  bool purge, purge_stats *stats,
-		  region_model2_context *ctxt);
-  region2_id ensure_stack_region2 (region_model2 *model);
-  region2_id get_stack_region2_id () const { return m_stack_rid; }
-  stack_region2 *get_stack_region2 (const region_model2 *model) const;
-
-  region2_id ensure_globals_region2 (region_model2 *model);
-  region2_id get_globals_region2_id () const { return m_globals_rid; }
-  globals_region2 *get_globals_region2 (const region_model2 *model) const;
-
-  region2_id ensure_code_region2 (region_model2 *model);
-  code_region2 *get_code_region2 (const region_model2 *model) const;
-
-  region2_id ensure_heap_region2 (region_model2 *model);
-  heap_region2 *get_heap_region2 (const region_model2 *model) const;
-
   static bool can_merge_p (const root_region2 *root_region2_a,
 			   const root_region2 *root_region2_b,
 			   root_region2 *merged_root_region2,
@@ -1849,12 +1825,6 @@ class region_model2
 			      const gimple *last_stmt,
 			      region_model2_context *ctxt);
 
-#if 0
-  egion2_id get_root_rid () const { return m_root_rid; }
-  root_region2 *get_root_region2 () const;
-
-  region2_id get_stack_region2_id () const;
-#endif
   const region2 *push_frame (function *fun, vec<const svalue2 *> *arg_sids,
 			     region_model2_context *ctxt);
   const frame_region2 *get_current_frame () const { return m_current_frame; }
@@ -1866,7 +1836,6 @@ class region_model2
   const frame_region2 *get_frame_at_index (int index) const;
 
 #if 0
-  region2_id get_globals_region2_id () const;
   void replace_svalue2 (svalue2_id sid, const svalue2 *new_sval);
 #endif
 
@@ -1876,8 +1845,6 @@ class region_model2
   const svalue2 *get_rvalue (tree expr, region_model2_context *ctxt);
 
 #if 0
-  svalue2_id get_or_create_ptr_svalue2 (tree ptr_type, region2_id id);
-
   svalue2_id maybe_cast (tree type, svalue2_id sid, region_model2_context *ctxt);
   svalue2_id maybe_cast_1 (tree type, svalue2_id sid);
 
@@ -1918,8 +1885,6 @@ class region_model2
   bool add_constraint (tree lhs, enum tree_code op, tree rhs,
 		       region_model2_context *ctxt);
 #if 0
-  tree maybe_get_constant (svalue2_id sid) const;
-
   region2_id add_new_malloc_region2 ();
 #endif
   const region2 *create_region_for_heap_alloc (const svalue2 *size_in_bytes);
@@ -1939,8 +1904,6 @@ class region_model2
   void purge_region2s (const region2_id_set &set,
 		      purge_stats *stats,
 		      logger *logger);
-  unsigned get_num_svalue2s () const { return m_svalue2s.length (); }
-  unsigned get_num_region2s () const { return m_region2s.length (); }
 #endif
   /* For selftests.  */
   constraint_manager2 *get_constraints2 ()
diff --git a/gcc/testsuite/gcc.dg/analyzer/malloc-paths-7.c b/gcc/testsuite/gcc.dg/analyzer/malloc-paths-7.c
index f6b99e35a43..96e97b10d68 100644
--- a/gcc/testsuite/gcc.dg/analyzer/malloc-paths-7.c
+++ b/gcc/testsuite/gcc.dg/analyzer/malloc-paths-7.c
@@ -19,3 +19,6 @@ void test (void)
   free (q);
   free (p);
 }
+
+/* FIXME: with region_model2, it seems to be using wrong location for
+   leak; at the "if (!q)" rather than at the "return".  */
-- 
2.26.2

