public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-1205] c++: Remove ifdefed code
@ 2022-06-22 15:46 Nathan Sidwell
  0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2022-06-22 15:46 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d844478ab47a16c8ae65f253fd1cdc685c7951fc

commit r13-1205-gd844478ab47a16c8ae65f253fd1cdc685c7951fc
Author: Nathan Sidwell <nathan@acm.org>
Date:   Wed Jun 22 07:51:44 2022 -0700

    c++: Remove ifdefed code
    
    The only reason I chose to use DECL_UID on this hash table was to make
    it stable against ASLR and perturbations due to other allocations.
    It's not required for correctness, as the comment mentions the
    equality fn uses pointer identity.
    
            gcc/cp/
            * module.cc (struct duplicate_hash): Remove.
            (duplicate_hash_map): Adjust.

Diff:
---
 gcc/cp/module.cc | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index b3fbd467ecb..d735d7e8b30 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -2829,24 +2829,10 @@ struct merge_key {
   }
 };
 
-struct duplicate_hash : nodel_ptr_hash<tree_node>
-{
-#if 0
-  /* This breaks variadic bases in the xtreme_header tests.  Since ::equal is
-     the default pointer_hash::equal, let's use the default hash as well.  */
-  inline static hashval_t hash (value_type decl)
-  {
-    if (TREE_CODE (decl) == TREE_BINFO)
-      decl = TYPE_NAME (BINFO_TYPE (decl));
-    return hashval_t (DECL_UID (decl));
-  }
-#endif
-};
-
 /* Hashmap of merged duplicates.  Usually decls, but can contain
    BINFOs.  */
 typedef hash_map<tree,uintptr_t,
-		 simple_hashmap_traits<duplicate_hash,uintptr_t> >
+		 simple_hashmap_traits<nodel_ptr_hash<tree_node>,uintptr_t> >
 duplicate_hash_map;
 
 /* Tree stream reader.  Note that reading a stream doesn't mark the


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-22 15:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-22 15:46 [gcc r13-1205] c++: Remove ifdefed code 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).