From 4c1177e161e329b741e7b5ae55950fe65dfc8df5 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 25 Jun 2015 17:07:01 +0000 Subject: [PATCH] hash-table.h (has_is_deleted, [...]): Delete. gcc/ * hash-table.h (has_is_deleted, is_deleted_helper): Delete. (has_is_empty, is_empty_helper): Delete. (has_mark_deleted, mark_deleted_helper): Delete. (has_mark_empty, mark_empty_helper): Delete. (hash_table::is_deleted): Call the Descriptor unconditionally. (hash_table::is_empty): Likewise. (hash_table::mark_deleted): Likewise. (hash_table::mark_empty): Likewise. From-SVN: r224962 --- gcc/ChangeLog | 11 ++++ gcc/hash-table.h | 141 +++++------------------------------------------ 2 files changed, 24 insertions(+), 128 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 27bbec5ab06..3a7e1b052ab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2015-06-25 Richard Sandiford + + * hash-table.h (has_is_deleted, is_deleted_helper): Delete. + (has_is_empty, is_empty_helper): Delete. + (has_mark_deleted, mark_deleted_helper): Delete. + (has_mark_empty, mark_empty_helper): Delete. + (hash_table::is_deleted): Call the Descriptor unconditionally. + (hash_table::is_empty): Likewise. + (hash_table::mark_deleted): Likewise. + (hash_table::mark_empty): Likewise. + 2015-06-25 Richard Sandiford * cgraph.h (asmname_hasher): Inherit from ggc_ptr_hash. Remove diff --git a/gcc/hash-table.h b/gcc/hash-table.h index 5f3dbede8c1..618845335cd 100644 --- a/gcc/hash-table.h +++ b/gcc/hash-table.h @@ -323,122 +323,6 @@ hash_table_mod2 (hashval_t hash, unsigned int index) return 1 + mul_mod (hash, p->prime - 2, p->inv_m2, p->shift); } - template - struct has_is_deleted -{ - template struct helper {}; - template static char test (helper *); - template static int test (...); - static const bool value = sizeof (test (0)) == sizeof (char); -}; - -template::value> -struct is_deleted_helper -{ - static inline bool - call (Type &v) - { - return Traits::is_deleted (v); - } -}; - -template -struct is_deleted_helper -{ - static inline bool - call (Type *v) - { - return v == HTAB_DELETED_ENTRY; - } -}; - - template - struct has_is_empty -{ - template struct helper {}; - template static char test (helper *); - template static int test (...); - static const bool value = sizeof (test (0)) == sizeof (char); -}; - -template::value> -struct is_empty_helper -{ - static inline bool - call (Type &v) - { - return Traits::is_empty (v); - } -}; - -template -struct is_empty_helper -{ - static inline bool - call (Type *v) - { - return v == HTAB_EMPTY_ENTRY; - } -}; - - template - struct has_mark_deleted -{ - template struct helper {}; - template static char test (helper *); - template static int test (...); - static const bool value = sizeof (test (0)) == sizeof (char); -}; - -template::value> -struct mark_deleted_helper -{ - static inline void - call (Type &v) - { - Traits::mark_deleted (v); - } -}; - -template -struct mark_deleted_helper -{ - static inline void - call (Type *&v) - { - v = static_cast (HTAB_DELETED_ENTRY); - } -}; - - template - struct has_mark_empty -{ - template struct helper {}; - template static char test (helper *); - template static int test (...); - static const bool value = sizeof (test (0)) == sizeof (char); -}; - -template::value> -struct mark_empty_helper -{ - static inline void - call (Type &v) - { - Traits::mark_empty (v); - } -}; - -template -struct mark_empty_helper -{ - static inline void - call (Type *&v) - { - v = static_cast (HTAB_EMPTY_ENTRY); - } -}; - class mem_usage; /* User-facing hash table type. @@ -610,23 +494,24 @@ private: value_type *find_empty_slot_for_expand (hashval_t); void expand (); static bool is_deleted (value_type &v) - { - return is_deleted_helper::call (v); - } + { + return Descriptor::is_deleted (v); + } + static bool is_empty (value_type &v) - { - return is_empty_helper::call (v); - } + { + return Descriptor::is_empty (v); + } static void mark_deleted (value_type &v) - { - return mark_deleted_helper::call (v); - } + { + Descriptor::mark_deleted (v); + } static void mark_empty (value_type &v) - { - return mark_empty_helper::call (v); - } + { + Descriptor::mark_empty (v); + } /* Table itself. */ typename Descriptor::value_type *m_entries; -- 2.30.2