From 203f2c4386837b6672f67fe74cfc940aaec300ac Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 25 Jun 2015 17:17:10 +0000 Subject: [PATCH] hash-map-traits.h (default_hashmap_traits): Delete. gcc/ * hash-map-traits.h (default_hashmap_traits): Delete. From-SVN: r224976 --- gcc/ChangeLog | 4 +++ gcc/hash-map-traits.h | 78 ------------------------------------------- 2 files changed, 4 insertions(+), 78 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 70f14f66ff9..216a77ed0f4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2015-06-25 Richard Sandiford + + * hash-map-traits.h (default_hashmap_traits): Delete. + 2015-06-25 Richard Sandiford * hash-map-traits.h (unbounded_hashmap_traits): New class. diff --git a/gcc/hash-map-traits.h b/gcc/hash-map-traits.h index 9cab0ec66c7..9cdbfbede2d 100644 --- a/gcc/hash-map-traits.h +++ b/gcc/hash-map-traits.h @@ -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 - static hashval_t - hash (T *p) - { - return uintptr_t (p) >> 3; - } - - /* If the value converts to hashval_t just use it. */ - - template static hashval_t hash (T v) { return v; } - - /* Return true if the two keys passed as arguments are equal. */ - - template - 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 static void remove (T &v) { v.~T (); } - - /* Mark the passed in entry as being deleted. */ - - template - static void - mark_deleted (T &e) - { - mark_key_deleted (e.m_key); - } - - /* Mark the passed in entry as being empty. */ - - template - static void - mark_empty (T &e) - { - mark_key_empty (e.m_key); - } - - /* Return true if the passed in entry is marked as deleted. */ - - template - static bool - is_deleted (T &e) - { - return e.m_key == (void *)1; - } - - /* Return true if the passed in entry is marked as empty. */ - - template static bool is_empty (T &e) { return e.m_key == NULL; } - -private: - template - static void - mark_key_deleted (T *&k) - { - k = reinterpret_cast (1); - } - - template - static void - mark_key_empty (T *&k) - { - k = static_cast (0); - } -}; - /* Implement hash_map traits for a key with hash traits H. Empty and deleted map entries are represented as empty and deleted keys. */ -- 2.30.2