aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2017-06-16 14:54:39 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2017-06-16 14:54:39 +0000
commitd7b11178c4579f9c109c77609ef60dd0d6448598 (patch)
tree325f67f3de1acf3c96827888275b367428efc805 /gcc
parentba27a39d379b3ac69bd81944b65a99a0f02f240d (diff)
downloadgcc-d7b11178c4579f9c109c77609ef60dd0d6448598.zip
gcc-d7b11178c4579f9c109c77609ef60dd0d6448598.tar.gz
gcc-d7b11178c4579f9c109c77609ef60dd0d6448598.tar.bz2
Symbol tables are insert only.
* cp-tree.h (default_hash_traits <lang_identifier *>): Don't derive from pointer_hash. Make undeletable. From-SVN: r249266
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/cp-tree.h8
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2d7ee17..7f9ddb0 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
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
overflow.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index c56e59c..6c236ae 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -550,7 +550,7 @@ identifier_p (tree t)
template <>
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
simpler. We'll get dynamic type checking with the hash function
@@ -558,10 +558,14 @@ struct default_hash_traits <lang_identifier *>
GTY((skip)) typedef tree value_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);
}
+
+ /* 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