* [C++ PATCH] symbol tables don't delete
@ 2017-06-16 14:55 Nathan Sidwell
0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2017-06-16 14:55 UTC (permalink / raw)
To: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 150 bytes --]
We don't need to delete entries from a symbol table, so there's no point
providing that functionality.
Applied to trunk.
nathan
--
Nathan Sidwell
[-- Attachment #2: sym.diff --]
[-- Type: text/x-patch, Size: 1201 bytes --]
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.
Index: cp-tree.h
===================================================================
--- cp-tree.h (revision 249264)
+++ cp-tree.h (working copy)
@@ -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_identif
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-16 14:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-16 14:55 [C++ PATCH] symbol tables don't delete Nathan Sidwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).