Commit d6b605f6 by Nathan Sidwell Committed by Nathan Sidwell

[C++ PATCH] Kill unneeded hash specialization

https://gcc.gnu.org/ml/gcc-patches/2017-10/msg00621.html
	* cp-tree.h (default_hash_traits <lang_identifier *>): Delete
	specialization.

From-SVN: r253620
parent 92395f1c
2017-10-10 Nathan Sidwell <nathan@acm.org> 2017-10-10 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (default_hash_traits <lang_identifier *>): Delete
specialization.
* decl2.c (struct mangled_decl_hash): New hash traits. * decl2.c (struct mangled_decl_hash): New hash traits.
(mangled_decls): Make hash_table<mangled_decl_hash>. (mangled_decls): Make hash_table<mangled_decl_hash>.
(generate_mangling_alias, record_mangling): Adjust. (generate_mangling_alias, record_mangling): Adjust.
......
...@@ -572,30 +572,6 @@ identifier_p (tree t) ...@@ -572,30 +572,6 @@ identifier_p (tree t)
return NULL; return NULL;
} }
/* Hash trait specialization for lang_identifiers. This allows
PCH-safe maps keyed by DECL_NAME. If it wasn't for PCH, we could
just use a regular tree key. */
template <>
struct default_hash_traits <lang_identifier *>
: pointer_hash <tree_node>
{
/* Use a regular tree as the type, to make using the hash table
simpler. We'll get dynamic type checking with the hash function
itself. */
GTY((skip)) typedef tree value_type;
GTY((skip)) typedef tree compare_type;
static hashval_t hash (const value_type id)
{
return IDENTIFIER_HASH_VALUE (id);
}
/* Nothing is deletable. Everything is insertable. */
static bool is_deleted (value_type) { return false; }
static void remove (value_type) { gcc_unreachable (); }
};
#define LANG_IDENTIFIER_CAST(NODE) \ #define LANG_IDENTIFIER_CAST(NODE) \
((struct lang_identifier*)IDENTIFIER_NODE_CHECK (NODE)) ((struct lang_identifier*)IDENTIFIER_NODE_CHECK (NODE))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment