]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: Remove ifdefed code
authorNathan Sidwell <nathan@acm.org>
Wed, 22 Jun 2022 14:51:44 +0000 (07:51 -0700)
committerNathan Sidwell <nathan@acm.org>
Wed, 22 Jun 2022 15:21:03 +0000 (08:21 -0700)
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.

gcc/cp/module.cc

index b3fbd467ecb75faea493dceedf68658faa4fca77..d735d7e8b30374490c6f219f1dbd3ee16e371f83 100644 (file)
@@ -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