hash-map-traits.h (default_hashmap_traits): Delete.
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 25 Jun 2015 17:17:10 +0000 (17:17 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 25 Jun 2015 17:17:10 +0000 (17:17 +0000)
gcc/
* hash-map-traits.h (default_hashmap_traits): Delete.

From-SVN: r224976

gcc/ChangeLog
gcc/hash-map-traits.h

index 70f14f6..216a77e 100644 (file)
@@ -1,5 +1,9 @@
 2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
 
+       * hash-map-traits.h (default_hashmap_traits): Delete.
+
+2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
+
        * hash-map-traits.h (unbounded_hashmap_traits): New class.
        (unbounded_int_hashmap_traits): Likewise.
        * cfgexpand.c (part_traits): Use unbounded_int_hashmap_traits.
index 9cab0ec..9cdbfbe 100644 (file)
@@ -25,84 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 
 #include "hash-traits.h"
 
-/* implement default behavior for traits when types allow it.  */
-
-struct default_hashmap_traits
-{
-  /* Hashes the passed in key.  */
-
-  template<typename T>
-  static hashval_t
-  hash (T *p)
-    {
-      return uintptr_t (p) >> 3;
-    }
-
-  /* If the value converts to hashval_t just use it.  */
-
-  template<typename T> static hashval_t hash (T v) { return v; }
-
-  /* Return true if the two keys passed as arguments are equal.  */
-
-  template<typename T>
-  static bool
-  equal_keys (const T &a, const T &b)
-    {
-      return a == b;
-    }
-
-  /* Called to dispose of the key and value before marking the entry as
-     deleted.  */
-
-  template<typename T> static void remove (T &v) { v.~T (); }
-
-  /* Mark the passed in entry as being deleted.  */
-
-  template<typename T>
-  static void
-  mark_deleted (T &e)
-    {
-      mark_key_deleted (e.m_key);
-    }
-
-  /* Mark the passed in entry as being empty.  */
-
-  template<typename T>
-  static void
-  mark_empty (T &e)
-    {
-      mark_key_empty (e.m_key);
-    }
-
-  /* Return true if the passed in entry is marked as deleted.  */
-
-  template<typename T>
-  static bool
-  is_deleted (T &e)
-    {
-      return e.m_key == (void *)1;
-    }
-
-  /* Return true if the passed in entry is marked as empty.  */
-
-  template<typename T> static bool is_empty (T &e) { return e.m_key == NULL; }
-
-private:
-  template<typename T>
-  static void
-  mark_key_deleted (T *&k)
-    {
-      k = reinterpret_cast<T *> (1);
-    }
-
-  template<typename T>
-  static void
-  mark_key_empty (T *&k)
-    {
-      k = static_cast<T *> (0);
-    }
-};
-
 /* Implement hash_map traits for a key with hash traits H.  Empty and
    deleted map entries are represented as empty and deleted keys.  */