Commit d7b11178 by Nathan Sidwell Committed by Nathan Sidwell

Symbol tables are insert only.

	* cp-tree.h (default_hash_traits <lang_identifier *>): Don't
	derive from pointer_hash.  Make undeletable.

From-SVN: r249266
parent ba27a39d
2017-06-16 Nathan Sidwell <nathan@acm.org> 2017-06-16 Nathan Sidwell <nathan@acm.org>
Symbol tables are insert only.
* cp-tree.h (default_hash_traits <lang_identifier *>): Don't
derive from pointer_hash. Make undeletable.
* class.c (resort_type_method_vec): Avoid potential unsigned * class.c (resort_type_method_vec): Avoid potential unsigned
overflow. overflow.
......
...@@ -550,7 +550,7 @@ identifier_p (tree t) ...@@ -550,7 +550,7 @@ identifier_p (tree t)
template <> template <>
struct default_hash_traits <lang_identifier *> struct default_hash_traits <lang_identifier *>
: pointer_hash <tree_node>, ggc_remove <tree> : pointer_hash <tree_node>
{ {
/* Use a regular tree as the type, to make using the hash table /* Use a regular tree as the type, to make using the hash table
simpler. We'll get dynamic type checking with the hash function simpler. We'll get dynamic type checking with the hash function
...@@ -558,10 +558,14 @@ struct default_hash_traits <lang_identifier *> ...@@ -558,10 +558,14 @@ struct default_hash_traits <lang_identifier *>
GTY((skip)) typedef tree value_type; GTY((skip)) typedef tree value_type;
GTY((skip)) typedef tree compare_type; GTY((skip)) typedef tree compare_type;
static hashval_t hash (const value_type &id) static hashval_t hash (const value_type id)
{ {
return IDENTIFIER_HASH_VALUE (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 (); }
}; };
/* In an IDENTIFIER_NODE, nonzero if this identifier is actually a /* In an IDENTIFIER_NODE, nonzero if this identifier is actually a
......
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