From b1e5bb2993c995cdcd756012fcfe04c124c0a837 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Tue, 12 May 2020 10:54:51 -0400
Subject: [PATCH 114/293] FIXME: WIP on capturing concrete bindings purely as
 bit ranges w/o regions

---
 gcc/analyzer/analyzer-selftests.cc |   2 +
 gcc/analyzer/analyzer-selftests.h  |   1 +
 gcc/analyzer/analyzer.h            |   6 +-
 gcc/analyzer/region-model2.cc      |  29 +++-
 gcc/analyzer/region-model2.h       |   1 +
 gcc/analyzer/store2.cc             | 213 +++++++++++++++++++++++++----
 gcc/analyzer/store2.h              | 103 +++++++++-----
 7 files changed, 294 insertions(+), 61 deletions(-)

diff --git a/gcc/analyzer/analyzer-selftests.cc b/gcc/analyzer/analyzer-selftests.cc
index d1f0724ec21..9e412759591 100644
--- a/gcc/analyzer/analyzer-selftests.cc
+++ b/gcc/analyzer/analyzer-selftests.cc
@@ -51,6 +51,7 @@ void
 run_analyzer_selftests ()
 {
 #if ENABLE_ANALYZER
+  analyzer_store2_cc_tests (); // FIXME: keep alphabetized? or by dependency
   analyzer_constraint_manager_cc_tests ();
   analyzer_constraint_manager2_cc_tests ();
   analyzer_function_set_cc_tests ();
@@ -62,6 +63,7 @@ run_analyzer_selftests ()
   analyzer_revamp_state_cc_tests ();
   analyzer_sm_file_cc_tests ();
   analyzer_sm_signal_cc_tests ();
+  //analyzer_store2_cc_tests ();
   analyzer_uniq_manager_cc_tests ();
 #endif /* #if ENABLE_ANALYZER */
 }
diff --git a/gcc/analyzer/analyzer-selftests.h b/gcc/analyzer/analyzer-selftests.h
index c3db56caff7..fad549c4c9b 100644
--- a/gcc/analyzer/analyzer-selftests.h
+++ b/gcc/analyzer/analyzer-selftests.h
@@ -45,6 +45,7 @@ extern void analyzer_region_model2_cc_tests ();
 extern void analyzer_revamp_state_cc_tests ();
 extern void analyzer_sm_file_cc_tests ();
 extern void analyzer_sm_signal_cc_tests ();
+extern void analyzer_store2_cc_tests ();
 extern void analyzer_uniq_manager_cc_tests ();
 
 } /* end of namespace ana::selftest.  */
diff --git a/gcc/analyzer/analyzer.h b/gcc/analyzer/analyzer.h
index d15fbabdf24..91c2369ed11 100644
--- a/gcc/analyzer/analyzer.h
+++ b/gcc/analyzer/analyzer.h
@@ -148,14 +148,16 @@ enum poison_kind
 
 extern const char *poison_kind_to_str (enum poison_kind);
 
+typedef offset_int bit_offset_t;
+typedef offset_int bit_size_t;
+
 /* The location of a region expressesd as an offset relative to a
    base region.  */
+// FIXME: and size???
 
 class region_offset
 {
 public:
-  typedef offset_int bit_offset_t;
-
   static region_offset make_concrete (const region2 *base_region,
 				      bit_offset_t offset)
   {
diff --git a/gcc/analyzer/region-model2.cc b/gcc/analyzer/region-model2.cc
index d8ea2cb6f5e..f2a4b560605 100644
--- a/gcc/analyzer/region-model2.cc
+++ b/gcc/analyzer/region-model2.cc
@@ -991,6 +991,8 @@ region2::get_base_region () const
   return iter;
 }
 
+/* FIXME.  */
+
 region_offset
 region2::get_offset () const
 {
@@ -1001,11 +1003,36 @@ region2::get_offset () const
 
 /* FIXME.  */
 
+bool
+region2::get_bit_size (bit_size_t *out) const
+{
+  tree type = get_type ();
+  gcc_assert (type);
+
+  // FIXME: use TYPE_SIZE ??
+  HOST_WIDE_INT bytes = int_size_in_bytes (type);
+  if (bytes == -1)
+    {
+      // FIXME: this will fail for VLAs
+      return false;
+    }
+  *out = bytes * BITS_PER_UNIT;
+  return true;
+  /* FIXME: or maybe max_int_size_in_bytes (const_tree type)
+     FIXME: what about varying sizes??? */
+
+  /* See also bit_position (const_tree field)
+     and int_byte_position (const_tree field).  */
+  gcc_unreachable (); // TODO
+}
+
+/* FIXME.  */
+
 region_offset
 region2::calc_offset () const
 {
   const region2 *iter_region = this;
-  region_offset::bit_offset_t accum_bit_offset = 0;
+  bit_offset_t accum_bit_offset = 0;
 
   while (iter_region)
     {
diff --git a/gcc/analyzer/region-model2.h b/gcc/analyzer/region-model2.h
index b63d329fffd..c19f3d50fa8 100644
--- a/gcc/analyzer/region-model2.h
+++ b/gcc/analyzer/region-model2.h
@@ -925,6 +925,7 @@ public:
   static int cmp_ptrs (const void *, const void *);
 
   region_offset get_offset () const;
+  bool get_bit_size (bit_size_t *out) const;
 
   virtual path_var get_representative_path_var () const;
 
diff --git a/gcc/analyzer/store2.cc b/gcc/analyzer/store2.cc
index 6c275777669..07b7f2365ee 100644
--- a/gcc/analyzer/store2.cc
+++ b/gcc/analyzer/store2.cc
@@ -72,19 +72,33 @@ const char *binding_kind_to_string (enum binding_kind kind)
   return kind == BK_direct ? "direct" : "default";
 }
 
+#if 1
 /* class binding_key2.  */
 
 const binding_key2 *
 binding_key2::make (store2_manager *mgr, const region2 *r,
 		    enum binding_kind kind)
 {
+  gcc_assert (r->get_type ());
+
   region_offset offset = r->get_offset ();
   if (offset.symbolic_p ())
+#if 0
+    gcc_unreachable ();
+#else
     return mgr->get_symbolic_binding (offset.get_base_region (), kind,
 				      offset.get_base_region ()); // FIXME
-  else
-    return mgr->get_concrete_binding (offset.get_base_region (), kind,
-				      offset.get_bit_offset ());
+#endif
+    else
+      {
+	bit_size_t bit_size;
+	if (r->get_bit_size (&bit_size))
+	  return mgr->get_concrete_binding (offset.get_bit_offset (),
+					    bit_size, kind);
+	else
+	  return mgr->get_symbolic_binding (offset.get_base_region (), kind,
+					    offset.get_base_region ()); // FIXME
+      }
 }
 
 /* FIXME.  */
@@ -92,9 +106,13 @@ binding_key2::make (store2_manager *mgr, const region2 *r,
 void
 binding_key2::dump_to_pp (pretty_printer *pp, bool simple) const
 {
+#if 1
+  pp_printf (pp, "kind: %s", binding_kind_to_string (m_kind));
+#else
   pp_string (pp, "region: ");
   m_region->dump_to_pp (pp, simple);
   pp_printf (pp, ", kind: %s", binding_kind_to_string (m_kind));
+#endif
 }
 
 /* FIXME.  */
@@ -126,9 +144,10 @@ binding_key2::cmp_ptrs (const void *p1, const void *p2)
 int
 binding_key2::cmp (const binding_key2 *k1, const binding_key2 *k2)
 {
+#if 0
   if (int reg_cmp = region2::cmp_ids (k1->m_region, k2->m_region))
     return reg_cmp;
-
+#endif
   enum binding_kind kind1 = k1->get_kind ();
   enum binding_kind kind2 = k2->get_kind ();
   if (kind1 != kind2)
@@ -142,7 +161,9 @@ binding_key2::cmp (const binding_key2 *k1, const binding_key2 *k2)
     {
       const concrete_binding2 *b1 = (const concrete_binding2 *)k1;
       const concrete_binding2 *b2 = (const concrete_binding2 *)k2;
-      return wi::cmp (b1->get_bit_offset (), b2->get_bit_offset (), SIGNED);
+      return wi::cmp (b1->get_start_bit_offset (), b2->get_start_bit_offset (),
+		      SIGNED);
+      // TODO compare sizes
     }
   else
     {
@@ -151,15 +172,48 @@ binding_key2::cmp (const binding_key2 *k1, const binding_key2 *k2)
     }
 }
 
+/* class concrete_binding2 : public binding_key2.  */
+
+/* FIXME. */
+
+void
+concrete_binding2::dump_to_pp (pretty_printer *pp, bool simple) const
+{
+  binding_key2::dump_to_pp (pp, simple);
+  pp_string (pp, ", start: ");
+  pp_wide_int (pp, m_start_bit_offset, SIGNED);
+  pp_string (pp, ", size: ");
+  pp_wide_int (pp, m_size_in_bits, SIGNED);
+  pp_string (pp, ", next: ");
+  pp_wide_int (pp, get_next_bit_offset (), SIGNED);
+}
+
+/* FIXME. */
+
+bool
+concrete_binding2::overlaps_p (const concrete_binding2 &other) const
+{
+  if (m_start_bit_offset < other.get_next_bit_offset ()
+      && get_next_bit_offset () > other.get_start_bit_offset ())
+    return true;
+  return false;
+}
+
+#if 1
 /* class symbolic_binding2 : public binding_key2.  */
 
 void
 symbolic_binding2::dump_to_pp (pretty_printer *pp, bool simple) const
 {
   binding_key2::dump_to_pp (pp, simple);
+  pp_string (pp, ", region: ");
+  m_region->dump_to_pp (pp, simple);
   pp_string (pp, ", concrete offset region: ");
   m_concrete_offset_region->dump_to_pp (pp, simple);
 }
+#endif
+
+#endif
 
 /* class binding_cluster2.  */
 
@@ -309,10 +363,11 @@ binding_cluster2::get_default_binding_recursive (store2_manager *mgr,
   if (const svalue2 *default_sval
       = get_binding (mgr, reg, BK_default))
     return default_sval;
-  if (const region2 *parent_reg = reg->get_parent_region ())
-    if (const svalue2 *parent_default_sval
-	= get_default_binding_recursive (mgr, parent_reg))
-      gcc_unreachable (); // TODO: extract value for child
+  if (reg != m_base_region)
+    if (const region2 *parent_reg = reg->get_parent_region ())
+      if (const svalue2 *parent_default_sval
+	  = get_default_binding_recursive (mgr, parent_reg))
+	gcc_unreachable (); // TODO: extract value for child
   return NULL;
 }
 
@@ -350,9 +405,8 @@ binding_cluster2::get_overlapping_bindings (store2_manager *mgr,
 	  if (const concrete_binding2 *iter_ckey
 	      = iter_key->dyn_cast_concrete_binding2 ())
 	    {
-	      if (ckey->get_bit_offset () == iter_ckey->get_bit_offset ())
+	      if (ckey->overlaps_p (*iter_ckey))
 		out->safe_push (iter_key);
-	      // TODO: also compare sizes?
 	    }
 	  else
 	    {
@@ -430,7 +484,8 @@ binding_cluster2::get_representative_path_vars (const region2 *base_reg,
 		= key->dyn_cast_concrete_binding2 ())
 	    {
 	      // FIXME: support fields etc
-	      if (ckey->get_bit_offset () == 0)
+	      // TODO: check size as well
+	      if (ckey->get_start_bit_offset () == 0)
 		{
 		  out_pvs->safe_push (base_reg->get_representative_path_var ());
 		}
@@ -450,14 +505,16 @@ binding_cluster2::get_representative_path_vars (const region2 *base_reg,
 /* binding consolidation.  */
 
 const concrete_binding2 *
-store2_manager::get_concrete_binding (const region2 *reg,
-				      enum binding_kind kind,
-				      concrete_binding2::bit_offset_t offset)
+store2_manager::get_concrete_binding (bit_offset_t start_bit_offset,
+				      bit_offset_t size_in_bits,
+				      enum binding_kind kind)
 {
-  concrete_binding2 *b = new concrete_binding2 (reg, kind, offset);
+  concrete_binding2 *b
+    = new concrete_binding2 (start_bit_offset, size_in_bits, kind);
   return m_concrete_binding_key_mgr.consolidate (b);
 }
 
+#if 1
 const symbolic_binding2 *
 store2_manager::get_symbolic_binding (const region2 *reg,
 				      enum binding_kind kind,
@@ -467,6 +524,7 @@ store2_manager::get_symbolic_binding (const region2 *reg,
     = new symbolic_binding2 (reg, kind, concrete_offset_region);
   return m_symbolic_binding_key_mgr.consolidate (b);
 }
+#endif
 
 /* class store2.  */
 
@@ -696,7 +754,7 @@ store2::get_or_create_cluster (const region2 *base_reg)
   if (binding_cluster2 **slot = m_cluster_map.get (base_reg))
     return *slot;
 
-  binding_cluster2 *cluster = new binding_cluster2 ();
+  binding_cluster2 *cluster = new binding_cluster2 (base_reg);
   m_cluster_map.put (base_reg, cluster);
   // FIXME: can this directly go in *slot ?
 
@@ -716,14 +774,8 @@ store2::on_escape_to_unknown_fncall (store2_manager *mgr,
   gcc_assert (base_reg);
   gcc_assert (base_reg->get_base_region () == base_reg);
 
-  if (binding_cluster2 **cluster_slot = m_cluster_map.get (base_reg))
-    (*cluster_slot)->on_escape_to_unknown_fncall (mgr);
-  else
-    {
-      binding_cluster2 *cluster = new binding_cluster2 ();
-      m_cluster_map.put (base_reg, cluster);
-      cluster->on_escape_to_unknown_fncall (mgr);
-    }
+  binding_cluster2 *cluster = get_or_create_cluster (base_reg);
+  cluster->on_escape_to_unknown_fncall (mgr);
   /* FIXME: but don't bother marking every global as escaped; instead,
      clear these.  */
 }
@@ -776,6 +828,117 @@ store2::remove_overlapping_bindings (store2_manager *mgr, const region2 *reg)
     (*cluster_slot)->remove_overlapping_bindings (mgr, reg);
 }
 
+#if CHECKING_P
+
+namespace selftest {
+
+/* FIXME.  */
+
+static void
+assert_overlap (const location &loc,
+		const concrete_binding2 *b1,
+		const concrete_binding2 *b2)
+{
+  ASSERT_TRUE_AT (loc, b1->overlaps_p (*b2));
+  ASSERT_TRUE_AT (loc, b2->overlaps_p (*b1));
+}
+
+/* FIXME.  */
+
+static void
+assert_disjoint (const location &loc,
+		 const concrete_binding2 *b1,
+		 const concrete_binding2 *b2)
+{
+  ASSERT_FALSE_AT (loc, b1->overlaps_p (*b2));
+  ASSERT_FALSE_AT (loc, b2->overlaps_p (*b1));
+}
+
+/* FIXME.  */
+
+#define ASSERT_OVERLAP(B1, B2) \
+  SELFTEST_BEGIN_STMT				\
+  assert_overlap (SELFTEST_LOCATION, B1, B2);	\
+  SELFTEST_END_STMT
+
+/* FIXME.  */
+
+#define ASSERT_DISJOINT(B1, B2) \
+  SELFTEST_BEGIN_STMT				\
+  assert_disjoint (SELFTEST_LOCATION, B1, B2);  \
+  SELFTEST_END_STMT
+
+/* Verify that concrete_binding2::overlaps_p works as expected.  */
+
+static void
+test_binding_key_overlap ()
+{
+  store2_manager mgr (NULL);
+
+  /* Various 8-bit bindings.  */
+  const concrete_binding2 *cb_0_7
+    = mgr.get_concrete_binding (0, 8, BK_direct);
+  const concrete_binding2 *cb_8_15
+    = mgr.get_concrete_binding (8, 8, BK_direct);
+  const concrete_binding2 *cb_16_23
+    = mgr.get_concrete_binding (16, 8, BK_direct);
+  const concrete_binding2 *cb_24_31
+    = mgr.get_concrete_binding (24, 8, BK_direct);
+
+  /* 16-bit bindings.  */
+  const concrete_binding2 *cb_0_15
+    = mgr.get_concrete_binding (0, 16, BK_direct);
+  const concrete_binding2 *cb_8_23
+    = mgr.get_concrete_binding (8, 16, BK_direct);
+  const concrete_binding2 *cb_16_31
+    = mgr.get_concrete_binding (16, 16, BK_direct);
+
+  /* 32-bit binding.  */
+  const concrete_binding2 *cb_0_31
+    = mgr.get_concrete_binding (0, 32, BK_direct);
+
+  /* Everything should self-overlap.  */
+  ASSERT_OVERLAP (cb_0_7, cb_0_7);
+  ASSERT_OVERLAP (cb_8_15, cb_8_15);
+  ASSERT_OVERLAP (cb_16_23, cb_16_23);
+  ASSERT_OVERLAP (cb_24_31, cb_24_31);
+  ASSERT_OVERLAP (cb_0_15, cb_0_15);
+  ASSERT_OVERLAP (cb_8_23, cb_8_23);
+  ASSERT_OVERLAP (cb_16_31, cb_16_31);
+  ASSERT_OVERLAP (cb_0_31, cb_0_31);
+
+  /* Verify the 8-bit bindings that don't overlap each other.  */
+  ASSERT_DISJOINT (cb_0_7, cb_8_15);
+  ASSERT_DISJOINT (cb_8_15, cb_16_23);
+
+  /* Check for overlap of differently-sized bindings.  */
+  ASSERT_OVERLAP (cb_0_7, cb_0_31);
+  /* ...and with differing start points.  */
+  ASSERT_OVERLAP (cb_8_15, cb_0_31);
+  ASSERT_DISJOINT (cb_8_15, cb_16_31);
+  ASSERT_OVERLAP (cb_16_23, cb_0_31);
+  ASSERT_OVERLAP (cb_16_31, cb_0_31);
+
+  ASSERT_DISJOINT (cb_0_7, cb_8_23);
+  ASSERT_OVERLAP (cb_8_23, cb_16_23);
+  ASSERT_OVERLAP (cb_8_23, cb_16_31);
+  ASSERT_DISJOINT (cb_8_23, cb_24_31);
+}
+
+/* Run all of the selftests within this file.  */
+
+void
+analyzer_store2_cc_tests ()
+{
+  test_binding_key_overlap ();
+  // TODO: test making keys for regions; verify expected sizes/overlaps etc
+}
+
+} // namespace selftest
+
+#endif /* CHECKING_P */
+
+
 } // namespace ana
 
 #endif /* #if ENABLE_ANALYZER */
diff --git a/gcc/analyzer/store2.h b/gcc/analyzer/store2.h
index c80f8e26e4b..cd1f224490a 100644
--- a/gcc/analyzer/store2.h
+++ b/gcc/analyzer/store2.h
@@ -70,35 +70,42 @@ public:
   { return NULL; }
 
 protected:
-  binding_key2 (const region2 *region, enum binding_kind kind)
-  : m_region (region), m_kind (kind) {}
-
-  const region2 *get_region () const { return m_region; }
+  binding_key2 (enum binding_kind kind) : m_kind (kind) {}
 
   enum binding_kind get_kind () const { return m_kind; }
 
   hashval_t impl_hash () const
   {
-    return (long)m_region ^ m_kind;
+    return m_kind;
   }
   bool impl_eq (const binding_key2 &other)
   {
-    return m_region == other.m_region && m_kind == other.m_kind;
+    return m_kind == other.m_kind;
   }
 
 private:
-  const region2 *m_region;
+  /* FIXME: this is a concrete binding.  */
   enum binding_kind m_kind;
 };
 
+/* FIXME: trying it as a range of bits, without tying it an
+   underlying region.
+   As a range, we can distinguish between the first field of a compound
+   region vs the region as a whole.
+   But what about casts?  Presumably we generate cast unaryop svalues
+   of the bound svalue.
+
+   Idea: generalize the start/size fields to each be ranges, to handle
+   both concrete and symbolic bindings in one class.  */
+
 class concrete_binding2 : public binding_key2
 {
 public:
-  typedef region_offset::bit_offset_t bit_offset_t;
-
-  concrete_binding2 (const region2 *region, enum binding_kind kind,
-		     bit_offset_t offset)
-  : binding_key2 (region, kind), m_offset (offset)
+  concrete_binding2 (bit_offset_t start_bit_offset, bit_size_t size_in_bits,
+		     enum binding_kind kind)
+  : binding_key2 (kind),
+    m_start_bit_offset (start_bit_offset),
+    m_size_in_bits (size_in_bits)
   {}
   bool concrete_p () const FINAL OVERRIDE { return true; }
 
@@ -110,51 +117,64 @@ public:
   {
     if (!binding_key2::impl_eq (other))
       return false;
-    return m_offset == other.m_offset;
+    return (m_start_bit_offset == other.m_start_bit_offset
+	    && m_size_in_bits == other.m_size_in_bits);
   }
 
-  void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE
-  {
-    binding_key2::dump_to_pp (pp, simple);
-    pp_string (pp, ", offset: ");
-    pp_wide_int (pp, m_offset, SIGNED);
-  }
+  void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE;
 
   const concrete_binding2 *dyn_cast_concrete_binding2 () const FINAL OVERRIDE
   { return this; }
 
-  bit_offset_t get_bit_offset () const { return m_offset; }
+  bit_offset_t get_start_bit_offset () const { return m_start_bit_offset; }
+  bit_size_t get_size_in_bits () const { return m_size_in_bits; }
+  /* Return the next bit offset after the end of this binding.  */
+  bit_offset_t get_next_bit_offset () const
+  {
+    return m_start_bit_offset + m_size_in_bits;
+  }
+
+  bool overlaps_p (const concrete_binding2 &other) const;
 
 private:
-  bit_offset_t m_offset;
+  bit_offset_t m_start_bit_offset;
+  bit_size_t m_size_in_bits;
 };
 
+#if 1
 class symbolic_binding2 : public binding_key2
 {
 public:
   symbolic_binding2 (const region2 *region, enum binding_kind kind,
 		     const region2 *concrete_offset_region)
-  : binding_key2 (region, kind),
+  : binding_key2 (kind),
+    m_region (region),
     m_concrete_offset_region (concrete_offset_region)
   {}
   bool concrete_p () const FINAL OVERRIDE { return false; }
 
   hashval_t hash () const
   {
-    return binding_key2::impl_hash () ^ (long)m_concrete_offset_region;
+    return (binding_key2::impl_hash ()
+	    ^ (long)m_region
+	    ^ (long)m_concrete_offset_region);
   }
   bool operator== (const symbolic_binding2 &other)
   {
     if (!binding_key2::impl_eq (other))
       return false;
-    return m_concrete_offset_region == other.m_concrete_offset_region;
+    return (m_region == other.m_region
+	    && m_concrete_offset_region == other.m_concrete_offset_region);
   }
 
   void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE;
 
 private:
+  // TODO
+  const region2 *m_region;
   const region2 *m_concrete_offset_region;
 };
+#endif
 
 /* All of the bindings within a store for regions that share the same
    base region.  */
@@ -162,7 +182,8 @@ private:
 class binding_cluster2
 {
 public:
-  binding_cluster2 () : m_map (), m_escaped (false) {}
+  binding_cluster2 (const region2 *base_region)
+  : m_base_region (base_region), m_map (), m_escaped (false) {}
 
   bool operator== (const binding_cluster2 &other) const;
   bool operator!= (const binding_cluster2 &other) const
@@ -172,13 +193,8 @@ public:
 
   void dump_to_pp (pretty_printer *pp, bool simple, bool multiline) const;
 
-#if 1
   void bind (store2_manager *mgr, const region2 *, const svalue2 *,
 	     binding_kind kind);
-#else
-  const binding_cluster2 *bind (const extrinsic_state &ext_state,
-			       const region2 *, const svalue2 *) const;
-#endif
 
   void clobber_region (store2_manager *mgr, const region2 *reg);
   void purge_region (store2_manager *mgr, const region2 *reg);
@@ -212,10 +228,23 @@ public:
 				     auto_vec<path_var> *out_pvs) const;
 
 private:
+#if 0
+  void get_overlapping_bindings (store2_manager *mgr, const region2 *reg,
+				 auto_vec<const binding_range *> *out);
+#else
   void get_overlapping_bindings (store2_manager *mgr, const region2 *reg,
 				 auto_vec<const binding_key2 *> *out);
+#endif
+
+  const region2 *m_base_region;
 
+#if 0
+  /* FIXME: experimental representation; ultimately will probably want
+     something we can do faster than O(n) lookup in.  */
+  typedef hash_map <const binding_range *, const svalue2 *> map_t;
+#else
   typedef hash_map <const binding_key2 *, const svalue2 *> map_t;
+#endif
   map_t m_map;
 
   /* Has a pointer to this cluster "escaped" into a part of the program
@@ -288,16 +317,24 @@ class store2_manager
 public:
   store2_manager (region_model2_manager *mgr) : m_mgr (mgr) {}
 
+#if 0
+  const concrete_binding2 *
+  get_binding_range (const region2 *region,
+#else
   /* binding consolidation.  */
   const concrete_binding2 *
-  get_concrete_binding (const region2 *region,
-			enum binding_kind kind,
-			concrete_binding2::bit_offset_t offset);
+  get_concrete_binding (bit_offset_t start_bit_offset,
+			bit_offset_t size_in_bits,
+			enum binding_kind kind);
 
+  // TODO:
+#if 1
   const symbolic_binding2 *
   get_symbolic_binding (const region2 *region,
 			enum binding_kind kind,
 			const region2 *concrete_offset_region);
+#endif
+#endif
 
   region_model2_manager *get_svalue2_manager () const
   {
-- 
2.26.2

