From: Nathan Sidwell Date: Fri, 16 Jun 2017 14:54:39 +0000 (+0000) Subject: Symbol tables are insert only. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d7b11178c4579f9c109c77609ef60dd0d6448598;p=gcc.git Symbol tables are insert only. * cp-tree.h (default_hash_traits ): Don't derive from pointer_hash. Make undeletable. From-SVN: r249266 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2d7ee176894..7f9ddb03df9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2017-06-16 Nathan Sidwell + Symbol tables are insert only. + * cp-tree.h (default_hash_traits ): 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 c56e59cbd7e..6c236aee4c7 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 - : pointer_hash , ggc_remove + : pointer_hash { /* 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 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