hash-table.h: Update comments.
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 25 Jun 2015 17:06:13 +0000 (17:06 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 25 Jun 2015 17:06:13 +0000 (17:06 +0000)
gcc/
* hash-table.h: Update comments.
* hash-traits.h (pointer_hash): Don't inherit from typed_noop_remove.
(nofree_ptr_hash): New class.
* asan.c (asan_mem_ref_hasher): Inherit from nofree_ptr_hash rather
than typed_noop_remove.  Remove redudant typedefs.
* attribs.c (attribute_hasher): Likewise.
* cfg.c (bb_copy_hasher): Likewise.
* cselib.c (cselib_hasher): Likewise.
* dse.c (invariant_group_base_hasher): Likewise.
* dwarf2cfi.c (trace_info_hasher): Likewise.
* dwarf2out.c (macinfo_entry_hasher): Likewise.
(comdat_type_hasher, loc_list_hasher): Likewise.
* gcse.c (pre_ldst_expr_hasher): Likewise.
* genmatch.c (id_base): Likewise.
* genrecog.c (test_pattern_hasher): Likewise.
* gimple-ssa-strength-reduction.c (cand_chain_hasher): Likewise.
* haifa-sched.c (delay_i1_hasher): Likewise.
* hard-reg-set.h (simplifiable_subregs_hasher): Likewise.
* ipa-icf.h (congruence_class_group_hash): Likewise.
* ipa-profile.c (histogram_hash): Likewise.
* ira-color.c (allocno_hard_regs_hasher): Likewise.
* lto-streamer.h (string_slot_hasher): Likewise.
* lto-streamer.c (tree_entry_hasher): Likewise.
* plugin.c (event_hasher): Likewise.
* postreload-gcse.c (expr_hasher): Likewise.
* store-motion.c (st_expr_hasher): Likewise.
* tree-sra.c (uid_decl_hasher): Likewise.
* tree-ssa-coalesce.c (coalesce_pair_hasher): Likewise.
(ssa_name_var_hash): Likewise.
* tree-ssa-live.c (tree_int_map_hasher): Likewise.
* tree-ssa-loop-im.c (mem_ref_hasher): Likewise.
* tree-ssa-pre.c (pre_expr_d): Likewise.
* tree-ssa-sccvn.c (vn_nary_op_hasher): Likewise.
* vtable-verify.h (registration_hasher): Likewise.
* vtable-verify.c (vtbl_map_hasher): Likewise.
* config/arm/arm.c (libcall_hasher): Likewise.
* config/i386/winnt.c (wrapped_symbol_hasher): Likewise.
* config/ia64/ia64.c (bundle_state_hasher): Likewise.
* config/sol2.c (comdat_entry_hasher): Likewise.
* fold-const.c (fold): Use nofree_ptr_hash instead of pointer_hash.
(print_fold_checksum, fold_checksum_tree): Likewise.
(debug_fold_checksum, fold_build1_stat_loc): Likewise.
(fold_build2_stat_loc, fold_build3_stat_loc): Likewise.
(fold_build_call_array_loc): Likewise.
* tree-ssa-ccp.c (gimple_htab): Likewise.
* tree-browser.c (tree_upper_hasher): Inherit from nofree_ptr_hash
rather than pointer_type.

gcc/c/
* c-decl.c (detect_field_duplicates_hash): Use nofree_ptr_hash
instead of pointer_hash.
(detect_field_duplicates): Likewise.

gcc/cp/
* class.c (fixed_type_or_null_ref_ht): Inherit from nofree_ptr_hash
rather than pointer_hash.
(fixed_type_or_null): Use nofree_ptr_hash instead of pointer_hash.
* semantics.c (nrv_data): Likewise.
* tree.c (verify_stmt_tree_r, verify_stmt_tree): Likewise.

gcc/java/
* jcf-io.c (charstar_hash): Inherit from nofree_ptr_hash rather
than typed_noop_remove.  Remove redudant typedefs.

gcc/lto/
* lto.c (tree_scc_hasher): Inherit from nofree_ptr_hash rather
than typed_noop_remove.  Remove redudant typedefs.

gcc/objc/
* objc-act.c (decl_name_hash): Inherit from nofree_ptr_hash rather
than typed_noop_remove.  Remove redudant typedefs.

libcc1/
* plugin.cc (string_hasher): Inherit from nofree_ptr_hash rather
than typed_noop_remove.  Remove redudant typedefs.
(plugin_context): Use nofree_ptr_hash rather than pointer_hash.
(plugin_context::mark): Likewise.

From-SVN: r224957

53 files changed:
gcc/ChangeLog
gcc/asan.c
gcc/attribs.c
gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/cfg.c
gcc/config/arm/arm.c
gcc/config/i386/winnt.c
gcc/config/ia64/ia64.c
gcc/config/sol2.c
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/semantics.c
gcc/cp/tree.c
gcc/cselib.c
gcc/dse.c
gcc/dwarf2cfi.c
gcc/dwarf2out.c
gcc/fold-const.c
gcc/gcse.c
gcc/genmatch.c
gcc/genrecog.c
gcc/gimple-ssa-strength-reduction.c
gcc/haifa-sched.c
gcc/hard-reg-set.h
gcc/hash-table.h
gcc/hash-traits.h
gcc/ipa-icf.h
gcc/ipa-profile.c
gcc/ira-color.c
gcc/java/ChangeLog
gcc/java/jcf-io.c
gcc/lto-streamer.c
gcc/lto-streamer.h
gcc/lto/ChangeLog
gcc/lto/lto.c
gcc/objc/ChangeLog
gcc/objc/objc-act.c
gcc/plugin.c
gcc/postreload-gcse.c
gcc/store-motion.c
gcc/tree-browser.c
gcc/tree-sra.c
gcc/tree-ssa-ccp.c
gcc/tree-ssa-coalesce.c
gcc/tree-ssa-live.c
gcc/tree-ssa-loop-im.c
gcc/tree-ssa-pre.c
gcc/tree-ssa-sccvn.c
gcc/vtable-verify.c
gcc/vtable-verify.h
libcc1/ChangeLog
libcc1/plugin.cc

index a9220e6..3957e19 100644 (file)
@@ -1,5 +1,55 @@
 2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
 
+       * hash-table.h: Update comments.
+       * hash-traits.h (pointer_hash): Don't inherit from typed_noop_remove.
+       (nofree_ptr_hash): New class.
+       * asan.c (asan_mem_ref_hasher): Inherit from nofree_ptr_hash rather
+       than typed_noop_remove.  Remove redudant typedefs.
+       * attribs.c (attribute_hasher): Likewise.
+       * cfg.c (bb_copy_hasher): Likewise.
+       * cselib.c (cselib_hasher): Likewise.
+       * dse.c (invariant_group_base_hasher): Likewise.
+       * dwarf2cfi.c (trace_info_hasher): Likewise.
+       * dwarf2out.c (macinfo_entry_hasher): Likewise.
+       (comdat_type_hasher, loc_list_hasher): Likewise.
+       * gcse.c (pre_ldst_expr_hasher): Likewise.
+       * genmatch.c (id_base): Likewise.
+       * genrecog.c (test_pattern_hasher): Likewise.
+       * gimple-ssa-strength-reduction.c (cand_chain_hasher): Likewise.
+       * haifa-sched.c (delay_i1_hasher): Likewise.
+       * hard-reg-set.h (simplifiable_subregs_hasher): Likewise.
+       * ipa-icf.h (congruence_class_group_hash): Likewise.
+       * ipa-profile.c (histogram_hash): Likewise.
+       * ira-color.c (allocno_hard_regs_hasher): Likewise.
+       * lto-streamer.h (string_slot_hasher): Likewise.
+       * lto-streamer.c (tree_entry_hasher): Likewise.
+       * plugin.c (event_hasher): Likewise.
+       * postreload-gcse.c (expr_hasher): Likewise.
+       * store-motion.c (st_expr_hasher): Likewise.
+       * tree-sra.c (uid_decl_hasher): Likewise.
+       * tree-ssa-coalesce.c (coalesce_pair_hasher): Likewise.
+       (ssa_name_var_hash): Likewise.
+       * tree-ssa-live.c (tree_int_map_hasher): Likewise.
+       * tree-ssa-loop-im.c (mem_ref_hasher): Likewise.
+       * tree-ssa-pre.c (pre_expr_d): Likewise.
+       * tree-ssa-sccvn.c (vn_nary_op_hasher): Likewise.
+       * vtable-verify.h (registration_hasher): Likewise.
+       * vtable-verify.c (vtbl_map_hasher): Likewise.
+       * config/arm/arm.c (libcall_hasher): Likewise.
+       * config/i386/winnt.c (wrapped_symbol_hasher): Likewise.
+       * config/ia64/ia64.c (bundle_state_hasher): Likewise.
+       * config/sol2.c (comdat_entry_hasher): Likewise.
+       * fold-const.c (fold): Use nofree_ptr_hash instead of pointer_hash.
+       (print_fold_checksum, fold_checksum_tree): Likewise.
+       (debug_fold_checksum, fold_build1_stat_loc): Likewise.
+       (fold_build2_stat_loc, fold_build3_stat_loc): Likewise.
+       (fold_build_call_array_loc): Likewise.
+       * tree-ssa-ccp.c (gimple_htab): Likewise.
+       * tree-browser.c (tree_upper_hasher): Inherit from nofree_ptr_hash
+       rather than pointer_type.
+
+2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
+
        * hash-traits.h (pointer_hash::mark_deleted, pointer_hash::mark_empty)
        (pointer_hash::is_deleted, pointer_hash::is_empty): New functions.
 
index e89817e..3d72240 100644 (file)
@@ -426,12 +426,8 @@ asan_mem_ref_get_end (const asan_mem_ref *ref, tree len)
   return asan_mem_ref_get_end (ref->start, len);
 }
 
-struct asan_mem_ref_hasher
-  : typed_noop_remove <asan_mem_ref>
+struct asan_mem_ref_hasher : nofree_ptr_hash <asan_mem_ref>
 {
-  typedef asan_mem_ref *value_type;
-  typedef asan_mem_ref *compare_type;
-
   static inline hashval_t hash (const asan_mem_ref *);
   static inline bool equal (const asan_mem_ref *, const asan_mem_ref *);
 };
index 7931077..265009b 100644 (file)
@@ -57,9 +57,8 @@ substring_hash (const char *str, int l)
 
 /* Used for attribute_hash.  */
 
-struct attribute_hasher : typed_noop_remove <attribute_spec>
+struct attribute_hasher : nofree_ptr_hash <attribute_spec>
 {
-  typedef attribute_spec *value_type;
   typedef substring *compare_type;
   static inline hashval_t hash (const attribute_spec *);
   static inline bool equal (const attribute_spec *, const substring *);
index 6b3deac..e727fb5 100644 (file)
@@ -1,3 +1,9 @@
+2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * c-decl.c (detect_field_duplicates_hash): Use nofree_ptr_hash
+       instead of pointer_hash.
+       (detect_field_duplicates): Likewise.
+
 2015-06-25  Marek Polacek  <polacek@redhat.com>
 
        * c-array-notation.c: Use VAR_P throughout.
index fb4a83c..8621515 100644 (file)
@@ -7399,7 +7399,7 @@ is_duplicate_field (tree x, tree y)
 
 static void
 detect_field_duplicates_hash (tree fieldlist,
-                             hash_table<pointer_hash <tree_node> > *htab)
+                             hash_table<nofree_ptr_hash <tree_node> > *htab)
 {
   tree x, y;
   tree_node **slot;
@@ -7499,7 +7499,7 @@ detect_field_duplicates (tree fieldlist)
     }
   else
     {
-      hash_table<pointer_hash <tree_node> > htab (37);
+      hash_table<nofree_ptr_hash <tree_node> > htab (37);
       detect_field_duplicates_hash (fieldlist, &htab);
     }
 }
index 72f711c..fb13b7d 100644 (file)
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -1023,10 +1023,8 @@ struct htab_bb_copy_original_entry
   int index2;
 };
 
-struct bb_copy_hasher : typed_noop_remove <htab_bb_copy_original_entry>
+struct bb_copy_hasher : nofree_ptr_hash <htab_bb_copy_original_entry>
 {
-  typedef htab_bb_copy_original_entry *value_type;
-  typedef htab_bb_copy_original_entry *compare_type;
   static inline hashval_t hash (const htab_bb_copy_original_entry *);
   static inline bool equal (const htab_bb_copy_original_entry *existing,
                            const htab_bb_copy_original_entry * candidate);
index 9f4e395..2f711be 100644 (file)
@@ -5038,10 +5038,8 @@ arm_function_value(const_tree type, const_tree func,
 
 /* libcall hashtable helpers.  */
 
-struct libcall_hasher : typed_noop_remove <rtx_def>
+struct libcall_hasher : nofree_ptr_hash <const rtx_def>
 {
-  typedef const rtx_def *value_type;
-  typedef const rtx_def *compare_type;
   static inline hashval_t hash (const rtx_def *);
   static inline bool equal (const rtx_def *, const rtx_def *);
   static inline void remove (rtx_def *);
index 3924987..47ea87a 100644 (file)
@@ -709,10 +709,8 @@ i386_pe_record_stub (const char *name)
 
 /* Hashtable helpers.  */
 
-struct wrapped_symbol_hasher : typed_noop_remove <char>
+struct wrapped_symbol_hasher : nofree_ptr_hash <const char>
 {
-  typedef const char *value_type;
-  typedef const char *compare_type;
   static inline hashval_t hash (const char *);
   static inline bool equal (const char *, const char *);
   static inline void remove (const char *);
index 1cee14b..508532e 100644 (file)
@@ -8579,10 +8579,8 @@ finish_bundle_states (void)
 
 /* Hashtable helpers.  */
 
-struct bundle_state_hasher : typed_noop_remove <bundle_state>
+struct bundle_state_hasher : nofree_ptr_hash <bundle_state>
 {
-  typedef bundle_state *value_type;
-  typedef bundle_state *compare_type;
   static inline hashval_t hash (const bundle_state *);
   static inline bool equal (const bundle_state *, const bundle_state *);
 };
index 21147d6..168c895 100644 (file)
@@ -172,10 +172,8 @@ typedef struct comdat_entry
 
 /* Helpers for maintaining solaris_comdat_htab.  */
 
-struct comdat_entry_hasher : typed_noop_remove <comdat_entry>
+struct comdat_entry_hasher : nofree_ptr_hash <comdat_entry>
 {
-  typedef comdat_entry *value_type;
-  typedef comdat_entry *compare_type;
   static inline hashval_t hash (const comdat_entry *);
   static inline bool equal (const comdat_entry *, const comdat_entry *);
   static inline void remove (comdat_entry *);
index 9dc9266..6bc2962 100644 (file)
@@ -1,3 +1,11 @@
+2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * class.c (fixed_type_or_null_ref_ht): Inherit from nofree_ptr_hash
+       rather than pointer_hash.
+       (fixed_type_or_null): Use nofree_ptr_hash instead of pointer_hash.
+       * semantics.c (nrv_data): Likewise.
+       * tree.c (verify_stmt_tree_r, verify_stmt_tree): Likewise.
+
 2015-06-24  Jason Merrill  <jason@redhat.com>
 
        PR c++/66647
index 9da532e..007c49e 100644 (file)
@@ -6916,7 +6916,7 @@ finish_struct (tree t, tree attributes)
 }
 \f
 /* Hash table to avoid endless recursion when handling references.  */
-static hash_table<pointer_hash<tree_node> > *fixed_type_or_null_ref_ht;
+static hash_table<nofree_ptr_hash<tree_node> > *fixed_type_or_null_ref_ht;
 
 /* Return the dynamic type of INSTANCE, if known.
    Used to determine whether the virtual function table is needed
@@ -7035,7 +7035,7 @@ fixed_type_or_null (tree instance, int *nonnull, int *cdtorp)
          /* We only need one hash table because it is always left empty.  */
          if (!fixed_type_or_null_ref_ht)
            fixed_type_or_null_ref_ht
-             = new hash_table<pointer_hash<tree_node> > (37); 
+             = new hash_table<nofree_ptr_hash<tree_node> > (37);
 
          /* Reference variables should be references to objects.  */
          if (nonnull)
index c0abeab..cf34ddb 100644 (file)
@@ -4126,7 +4126,7 @@ struct nrv_data
 
   tree var;
   tree result;
-  hash_table<pointer_hash <tree_node> > visited;
+  hash_table<nofree_ptr_hash <tree_node> > visited;
 };
 
 /* Helper function for walk_tree, used by finalize_nrv below.  */
index bc8428d..3ee2f34 100644 (file)
@@ -2197,8 +2197,8 @@ static tree
 verify_stmt_tree_r (tree* tp, int * /*walk_subtrees*/, void* data)
 {
   tree t = *tp;
-  hash_table<pointer_hash <tree_node> > *statements
-      = static_cast <hash_table<pointer_hash <tree_node> > *> (data);
+  hash_table<nofree_ptr_hash <tree_node> > *statements
+      = static_cast <hash_table<nofree_ptr_hash <tree_node> > *> (data);
   tree_node **slot;
 
   if (!STATEMENT_CODE_P (TREE_CODE (t)))
@@ -2221,7 +2221,7 @@ verify_stmt_tree_r (tree* tp, int * /*walk_subtrees*/, void* data)
 void
 verify_stmt_tree (tree t)
 {
-  hash_table<pointer_hash <tree_node> > statements (37);
+  hash_table<nofree_ptr_hash <tree_node> > statements (37);
   cp_walk_tree (&t, verify_stmt_tree_r, &statements, NULL);
 }
 
index 6336e6b..6c04813 100644 (file)
@@ -106,9 +106,8 @@ static rtx cselib_expand_value_rtx_1 (rtx, struct expand_value_data *, int);
      this involves walking the table entries for a given value and comparing
      the locations of the entries with the rtx we are looking up.  */
 
-struct cselib_hasher : typed_noop_remove <cselib_val>
+struct cselib_hasher : nofree_ptr_hash <cselib_val>
 {
-  typedef cselib_val *value_type;
   struct key {
     /* The rtx value and its mode (needed separately for constant
        integers).  */
index 508ec00..0a4ba8f 100644 (file)
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -732,10 +732,8 @@ clear_alias_set_lookup (alias_set_type alias_set)
 /* Hashtable callbacks for maintaining the "bases" field of
    store_group_info, given that the addresses are function invariants.  */
 
-struct invariant_group_base_hasher : typed_noop_remove <group_info>
+struct invariant_group_base_hasher : nofree_ptr_hash <group_info>
 {
-  typedef group_info *value_type;
-  typedef group_info *compare_type;
   static inline hashval_t hash (const group_info *);
   static inline bool equal (const group_info *, const group_info *);
 };
index 4af2b99..e7117ff 100644 (file)
@@ -167,10 +167,8 @@ typedef dw_trace_info *dw_trace_info_ref;
 
 /* Hashtable helpers.  */
 
-struct trace_info_hasher : typed_noop_remove <dw_trace_info>
+struct trace_info_hasher : nofree_ptr_hash <dw_trace_info>
 {
-  typedef dw_trace_info *value_type;
-  typedef dw_trace_info *compare_type;
   static inline hashval_t hash (const dw_trace_info *);
   static inline bool equal (const dw_trace_info *, const dw_trace_info *);
 };
index 843fc1e..3999b72 100644 (file)
@@ -22779,10 +22779,8 @@ dwarf2out_undef (unsigned int lineno ATTRIBUTE_UNUSED,
 
 /* Helpers to manipulate hash table of CUs.  */
 
-struct macinfo_entry_hasher : typed_noop_remove <macinfo_entry>
+struct macinfo_entry_hasher : nofree_ptr_hash <macinfo_entry>
 {
-  typedef macinfo_entry *value_type;
-  typedef macinfo_entry *compare_type;
   static inline hashval_t hash (const macinfo_entry *);
   static inline bool equal (const macinfo_entry *, const macinfo_entry *);
 };
@@ -23871,10 +23869,8 @@ file_table_relative_p (dwarf_file_data **slot, bool *p)
 
 /* Helpers to manipulate hash table of comdat type units.  */
 
-struct comdat_type_hasher : typed_noop_remove <comdat_type_node>
+struct comdat_type_hasher : nofree_ptr_hash <comdat_type_node>
 {
-  typedef comdat_type_node *value_type;
-  typedef comdat_type_node *compare_type;
   static inline hashval_t hash (const comdat_type_node *);
   static inline bool equal (const comdat_type_node *, const comdat_type_node *);
 };
@@ -24984,10 +24980,8 @@ compare_locs (dw_loc_descr_ref x, dw_loc_descr_ref y)
 
 /* Hashtable helpers.  */
 
-struct loc_list_hasher : typed_noop_remove <dw_loc_list_struct>
+struct loc_list_hasher : nofree_ptr_hash <dw_loc_list_struct>
 {
-  typedef dw_loc_list_struct *value_type;
-  typedef dw_loc_list_struct *compare_type;
   static inline hashval_t hash (const dw_loc_list_struct *);
   static inline bool equal (const dw_loc_list_struct *,
                            const dw_loc_list_struct *);
index 6fa784a..c32ac3d 100644 (file)
@@ -13868,7 +13868,7 @@ fold (tree expr)
 #undef fold
 
 static void fold_checksum_tree (const_tree, struct md5_ctx *,
-                               hash_table<pointer_hash<const tree_node> > *);
+                               hash_table<nofree_ptr_hash<const tree_node> > *);
 static void fold_check_failed (const_tree, const_tree);
 void print_fold_checksum (const_tree);
 
@@ -13882,7 +13882,7 @@ fold (tree expr)
   tree ret;
   struct md5_ctx ctx;
   unsigned char checksum_before[16], checksum_after[16];
-  hash_table<pointer_hash<const tree_node> > ht (32);
+  hash_table<nofree_ptr_hash<const tree_node> > ht (32);
 
   md5_init_ctx (&ctx);
   fold_checksum_tree (expr, &ctx, &ht);
@@ -13906,7 +13906,7 @@ print_fold_checksum (const_tree expr)
 {
   struct md5_ctx ctx;
   unsigned char checksum[16], cnt;
-  hash_table<pointer_hash<const tree_node> > ht (32);
+  hash_table<nofree_ptr_hash<const tree_node> > ht (32);
 
   md5_init_ctx (&ctx);
   fold_checksum_tree (expr, &ctx, &ht);
@@ -13924,7 +13924,7 @@ fold_check_failed (const_tree expr ATTRIBUTE_UNUSED, const_tree ret ATTRIBUTE_UN
 
 static void
 fold_checksum_tree (const_tree expr, struct md5_ctx *ctx,
-                   hash_table<pointer_hash <const tree_node> > *ht)
+                   hash_table<nofree_ptr_hash <const tree_node> > *ht)
 {
   const tree_node **slot;
   enum tree_code code;
@@ -14085,7 +14085,7 @@ debug_fold_checksum (const_tree t)
   int i;
   unsigned char checksum[16];
   struct md5_ctx ctx;
-  hash_table<pointer_hash<const tree_node> > ht (32);
+  hash_table<nofree_ptr_hash<const tree_node> > ht (32);
 
   md5_init_ctx (&ctx);
   fold_checksum_tree (t, &ctx, &ht);
@@ -14113,7 +14113,7 @@ fold_build1_stat_loc (location_t loc,
 #ifdef ENABLE_FOLD_CHECKING
   unsigned char checksum_before[16], checksum_after[16];
   struct md5_ctx ctx;
-  hash_table<pointer_hash<const tree_node> > ht (32);
+  hash_table<nofree_ptr_hash<const tree_node> > ht (32);
 
   md5_init_ctx (&ctx);
   fold_checksum_tree (op0, &ctx, &ht);
@@ -14154,7 +14154,7 @@ fold_build2_stat_loc (location_t loc,
                checksum_after_op0[16],
                checksum_after_op1[16];
   struct md5_ctx ctx;
-  hash_table<pointer_hash<const tree_node> > ht (32);
+  hash_table<nofree_ptr_hash<const tree_node> > ht (32);
 
   md5_init_ctx (&ctx);
   fold_checksum_tree (op0, &ctx, &ht);
@@ -14208,7 +14208,7 @@ fold_build3_stat_loc (location_t loc, enum tree_code code, tree type,
                checksum_after_op1[16],
                checksum_after_op2[16];
   struct md5_ctx ctx;
-  hash_table<pointer_hash<const tree_node> > ht (32);
+  hash_table<nofree_ptr_hash<const tree_node> > ht (32);
 
   md5_init_ctx (&ctx);
   fold_checksum_tree (op0, &ctx, &ht);
@@ -14274,7 +14274,7 @@ fold_build_call_array_loc (location_t loc, tree type, tree fn,
                checksum_after_fn[16],
                checksum_after_arglist[16];
   struct md5_ctx ctx;
-  hash_table<pointer_hash<const tree_node> > ht (32);
+  hash_table<nofree_ptr_hash<const tree_node> > ht (32);
   int i;
 
   md5_init_ctx (&ctx);
index f1d3af9..bcd7c8f 100644 (file)
@@ -374,9 +374,8 @@ struct ls_expr
 /* Head of the list of load/store memory refs.  */
 static struct ls_expr * pre_ldst_mems = NULL;
 
-struct pre_ldst_expr_hasher : typed_noop_remove <ls_expr>
+struct pre_ldst_expr_hasher : nofree_ptr_hash <ls_expr>
 {
-  typedef ls_expr *value_type;
   typedef value_type compare_type;
   static inline hashval_t hash (const ls_expr *);
   static inline bool equal (const ls_expr *, const ls_expr *);
index e7e0ed7..2652105 100644 (file)
@@ -178,7 +178,7 @@ END_BUILTINS
 
 /* Base class for all identifiers the parser knows.  */
 
-struct id_base : typed_noop_remove<id_base>
+struct id_base : nofree_ptr_hash<id_base>
 {
   enum id_kind { CODE, FN, PREDICATE, USER } kind;
 
@@ -189,8 +189,6 @@ struct id_base : typed_noop_remove<id_base>
   const char *id;
 
   /* hash_table support.  */
-  typedef id_base *value_type;
-  typedef id_base *compare_type;
   static inline hashval_t hash (const id_base *);
   static inline int equal (const id_base *, const id_base *);
 };
index d62ba9f..b2e2335 100644 (file)
@@ -2519,10 +2519,8 @@ merge_relative_positions (position **roota, position *a,
 
 /* A hasher of states that treats two states as "equal" if they might be
    merged (but trying to be more discriminating than "return true").  */
-struct test_pattern_hasher : typed_noop_remove <merge_state_info>
+struct test_pattern_hasher : nofree_ptr_hash <merge_state_info>
 {
-  typedef merge_state_info *value_type;
-  typedef merge_state_info *compare_type;
   static inline hashval_t hash (const value_type &);
   static inline bool equal (const value_type &, const compare_type &);
 };
index 81ba14b..1d66667 100644 (file)
@@ -424,10 +424,8 @@ lookup_cand (cand_idx idx)
 
 /* Helper for hashing a candidate chain header.  */
 
-struct cand_chain_hasher : typed_noop_remove <cand_chain>
+struct cand_chain_hasher : nofree_ptr_hash <cand_chain>
 {
-  typedef cand_chain *value_type;
-  typedef cand_chain *compare_type;
   static inline hashval_t hash (const cand_chain *);
   static inline bool equal (const cand_chain *, const cand_chain *);
 };
index 21274de..5879282 100644 (file)
@@ -613,9 +613,8 @@ struct delay_pair
 
 /* Helpers for delay hashing.  */
 
-struct delay_i1_hasher : typed_noop_remove <delay_pair>
+struct delay_i1_hasher : nofree_ptr_hash <delay_pair>
 {
-  typedef delay_pair *value_type;
   typedef void *compare_type;
   static inline hashval_t hash (const delay_pair *);
   static inline bool equal (const delay_pair *, const void *);
index 8aaf423..f90ae5d 100644 (file)
@@ -616,9 +616,8 @@ extern char global_regs[FIRST_PSEUDO_REGISTER];
 struct simplifiable_subreg;
 struct subreg_shape;
 
-struct simplifiable_subregs_hasher : typed_noop_remove <simplifiable_subreg>
+struct simplifiable_subregs_hasher : nofree_ptr_hash <simplifiable_subreg>
 {
-  typedef simplifiable_subreg *value_type;
   typedef const subreg_shape *compare_type;
 
   static inline hashval_t hash (const simplifiable_subreg *);
index d0d93a3..31440f6 100644 (file)
@@ -118,12 +118,10 @@ along with GCC; see the file COPYING3.  If not see
    Suppose you want to put some_type into the hash table.  You could define
    the descriptor type as follows.
 
-      struct some_type_hasher : typed_noop_remove <some_type>
-      // Deriving from typed_noop_remove means that we get a 'remove' that does
+      struct some_type_hasher : nofree_ptr_hash <some_type>
+      // Deriving from nofree_ptr_hash means that we get a 'remove' that does
       // nothing.  This choice is good for raw values.
       {
-        typedef some_type value_type;
-        typedef some_type compare_type;
         static inline hashval_t hash (const value_type *);
         static inline bool equal (const value_type *, const compare_type *);
       };
index 65ed32c..5afcc11 100644 (file)
@@ -57,10 +57,12 @@ typed_noop_remove <Type>::remove (Type *p ATTRIBUTE_UNUSED)
 }
 
 
-/* Pointer hash with a no-op remove method.  */
+/* Pointer hasher based on pointer equality.  Other types of pointer hash
+   can inherit this and override the hash and equal functions with some
+   other form of equality (such as string equality).  */
 
 template <typename Type>
-struct pointer_hash : typed_noop_remove <Type>
+struct pointer_hash
 {
   typedef Type *value_type;
   typedef Type *compare_type;
@@ -165,4 +167,10 @@ struct ggc_cache_hasher : ggc_hasher<T>
   }
 };
 
+/* Traits for pointer elements that should not be freed when an element
+   is deleted.  */
+
+template <typename T>
+struct nofree_ptr_hash : pointer_hash <T>, typed_noop_remove <T> {};
+
 #endif
index ee35ee2..f229ca1 100644 (file)
@@ -439,11 +439,8 @@ struct congruence_class_group
 };
 
 /* Congruence class set structure.  */
-struct congruence_class_group_hash: typed_noop_remove <congruence_class_group>
+struct congruence_class_group_hash : nofree_ptr_hash <congruence_class_group>
 {
-  typedef congruence_class_group *value_type;
-  typedef congruence_class_group *compare_type;
-
   static inline hashval_t hash (const congruence_class_group *item)
   {
     return item->hash;
index 3de4ec5..9f2d67c 100644 (file)
@@ -102,10 +102,8 @@ static pool_allocator<histogram_entry> histogram_pool
 
 /* Hashtable support for storing SSA names hashed by their SSA_NAME_VAR.  */
 
-struct histogram_hash : typed_noop_remove <histogram_entry>
+struct histogram_hash : nofree_ptr_hash <histogram_entry>
 {
-  typedef histogram_entry *value_type;
-  typedef histogram_entry *compare_type;
   static inline hashval_t hash (const histogram_entry *);
   static inline int equal (const histogram_entry *, const histogram_entry *);
 };
index 860547c..972a053 100644 (file)
@@ -228,10 +228,8 @@ static vec<ira_allocno_t> allocno_stack_vec;
 /* Vector of unique allocno hard registers.  */
 static vec<allocno_hard_regs_t> allocno_hard_regs_vec;
 
-struct allocno_hard_regs_hasher : typed_noop_remove <allocno_hard_regs>
+struct allocno_hard_regs_hasher : nofree_ptr_hash <allocno_hard_regs>
 {
-  typedef allocno_hard_regs *value_type;
-  typedef allocno_hard_regs *compare_type;
   static inline hashval_t hash (const allocno_hard_regs *);
   static inline bool equal (const allocno_hard_regs *,
                            const allocno_hard_regs *);
index cb06d83..edc2c55 100644 (file)
@@ -1,3 +1,8 @@
+2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * jcf-io.c (charstar_hash): Inherit from nofree_ptr_hash rather
+       than typed_noop_remove.  Remove redudant typedefs.
+
 2015-06-17  Andrew MacLeod  <amacleod@redhat.com>
 
        * boehm.c: Do not include input.h, line-map.h or is-a.h.
index 8156927..91fe952 100644 (file)
@@ -275,10 +275,8 @@ find_classfile (char *filename, JCF *jcf, const char *dep_name)
 
 /* Hash table helper.  */
 
-struct charstar_hash : typed_noop_remove <char>
+struct charstar_hash : nofree_ptr_hash <const char>
 {
-  typedef const char *value_type;
-  typedef const char *compare_type;
   static inline hashval_t hash (const char *candidate);
   static inline bool equal (const char *existing, const char *candidate);
 };
index 1ac4ce1..c3badf8 100644 (file)
@@ -281,10 +281,8 @@ struct tree_hash_entry
   intptr_t value;
 };
 
-struct tree_entry_hasher : typed_noop_remove <tree_hash_entry>
+struct tree_entry_hasher : nofree_ptr_hash <tree_hash_entry>
 {
-  typedef tree_hash_entry value_type;
-  typedef tree_hash_entry compare_type;
   static inline hashval_t hash (const value_type *);
   static inline bool equal (const value_type *, const compare_type *);
 };
index 6eb040b..1463dd9 100644 (file)
@@ -652,10 +652,8 @@ struct string_slot
 
 /* Hashtable helpers.  */
 
-struct string_slot_hasher : typed_noop_remove <string_slot>
+struct string_slot_hasher : nofree_ptr_hash <string_slot>
 {
-  typedef string_slot *value_type;
-  typedef string_slot *compare_type;
   static inline hashval_t hash (const string_slot *);
   static inline bool equal (const string_slot *, const string_slot *);
 };
index b089bbf..08fb86d 100644 (file)
@@ -1,3 +1,8 @@
+2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * lto.c (tree_scc_hasher): Inherit from nofree_ptr_hash rather
+       than typed_noop_remove.  Remove redudant typedefs.
+
 2015-06-17  Andrew MacLeod  <amacleod@redhat.com>
 
        * lto-lang.c: Do not include input.h, line-map.h or is-a.h.
index 323c4f1..08234d8 100644 (file)
@@ -937,10 +937,8 @@ struct tree_scc
   tree entries[1];
 };
 
-struct tree_scc_hasher : typed_noop_remove <tree_scc>
+struct tree_scc_hasher : nofree_ptr_hash <tree_scc>
 {
-  typedef tree_scc *value_type;
-  typedef tree_scc *compare_type;
   static inline hashval_t hash (const tree_scc *);
   static inline bool equal (const tree_scc *, const tree_scc *);
 };
index 0450a3d..5d618ab 100644 (file)
@@ -1,3 +1,8 @@
+2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * objc-act.c (decl_name_hash): Inherit from nofree_ptr_hash rather
+       than typed_noop_remove.  Remove redudant typedefs.
+
 2015-06-17  Andrew MacLeod  <amacleod@redhat.com>
 
        * objc-act.c: Do not include input.h, line-map.h or is-a.h.
index 58f4760..53e50e5 100644 (file)
@@ -3856,10 +3856,8 @@ objc_get_class_ivars (tree class_name)
    more like a set).  So, we store the DECLs, but define equality as
    DECLs having the same name, and hash as the hash of the name.  */
 
-struct decl_name_hash : typed_noop_remove <tree_node>
+struct decl_name_hash : nofree_ptr_hash <tree_node>
 {
-  typedef tree_node *value_type;
-  typedef tree_node *compare_type;
   static inline hashval_t hash (const tree_node *);
   static inline bool equal (const tree_node *, const tree_node *);
 };
index 15756f3..93e2e3a 100644 (file)
@@ -55,10 +55,8 @@ const char **plugin_event_name = plugin_event_name_init;
 
 /* Event hashtable helpers.  */
 
-struct event_hasher : typed_noop_remove <const char *>
+struct event_hasher : nofree_ptr_hash <const char *>
 {
-  typedef const char **value_type;
-  typedef const char **compare_type;
   static inline hashval_t hash (const char **);
   static inline bool equal (const char **, const char **);
 };
index 39c8c39..a1ffdb4 100644 (file)
@@ -120,10 +120,8 @@ struct expr
 
 /* Hashtable helpers.  */
 
-struct expr_hasher : typed_noop_remove <expr>
+struct expr_hasher : nofree_ptr_hash <expr>
 {
-  typedef expr *value_type;
-  typedef expr *compare_type;
   static inline hashval_t hash (const expr *);
   static inline bool equal (const expr *, const expr *);
 };
index 32bf021..802c600 100644 (file)
@@ -122,10 +122,8 @@ static struct edge_list *edge_list;
 
 /* Hashtable helpers.  */
 
-struct st_expr_hasher : typed_noop_remove <st_expr>
+struct st_expr_hasher : nofree_ptr_hash <st_expr>
 {
-  typedef st_expr *value_type;
-  typedef st_expr *compare_type;
   static inline hashval_t hash (const st_expr *);
   static inline bool equal (const st_expr *, const st_expr *);
 };
index bd2e0fa..6a1a9f3 100644 (file)
@@ -104,7 +104,7 @@ static tree TB_history_prev (void);
 void browse_tree (tree);
 
 /* Hashtable helpers.  */
-struct tree_upper_hasher : pointer_hash<tree_node>
+struct tree_upper_hasher : nofree_ptr_hash<tree_node>
 {
   static inline bool equal (const value_type &, const compare_type &);
 };
index 8e34244..7cf9f7e 100644 (file)
@@ -341,10 +341,8 @@ static hash_map<tree, auto_vec<access_p> > *base_access_vec;
 
 /* Candidate hash table helpers.  */
 
-struct uid_decl_hasher : typed_noop_remove <tree_node>
+struct uid_decl_hasher : nofree_ptr_hash <tree_node>
 {
-  typedef tree_node *value_type;
-  typedef tree_node *compare_type;
   static inline hashval_t hash (const tree_node *);
   static inline bool equal (const tree_node *, const tree_node *);
 };
index 34c3ad6..496d840 100644 (file)
@@ -1972,7 +1972,7 @@ evaluate_stmt (gimple stmt)
   return val;
 }
 
-typedef hash_table<pointer_hash<gimple_statement_base> > gimple_htab;
+typedef hash_table<nofree_ptr_hash<gimple_statement_base> > gimple_htab;
 
 /* Given a BUILT_IN_STACK_SAVE value SAVED_VAL, insert a clobber of VAR before
    each matching BUILT_IN_STACK_RESTORE.  Mark visited phis in VISITED.  */
index b6ee224..ee30c5c 100644 (file)
@@ -69,10 +69,8 @@ typedef const struct coalesce_pair *const_coalesce_pair_p;
 
 /* Coalesce pair hashtable helpers.  */
 
-struct coalesce_pair_hasher : typed_noop_remove <coalesce_pair>
+struct coalesce_pair_hasher : nofree_ptr_hash <coalesce_pair>
 {
-  typedef coalesce_pair *value_type;
-  typedef coalesce_pair *compare_type;
   static inline hashval_t hash (const coalesce_pair *);
   static inline bool equal (const coalesce_pair *, const coalesce_pair *);
 };
@@ -1239,10 +1237,8 @@ coalesce_partitions (var_map map, ssa_conflicts_p graph, coalesce_list_p cl,
 
 /* Hashtable support for storing SSA names hashed by their SSA_NAME_VAR.  */
 
-struct ssa_name_var_hash : typed_noop_remove <tree_node>
+struct ssa_name_var_hash : nofree_ptr_hash <tree_node>
 {
-  typedef union tree_node *value_type;
-  typedef union tree_node *compare_type;
   static inline hashval_t hash (const tree_node *);
   static inline int equal (const tree_node *, const tree_node *);
 };
index 510e45b..45d9697 100644 (file)
@@ -89,10 +89,8 @@ static void  verify_live_on_entry (tree_live_info_p);
 
 /* Hashtable helpers.  */
 
-struct tree_int_map_hasher : typed_noop_remove <tree_int_map>
+struct tree_int_map_hasher : nofree_ptr_hash <tree_int_map>
 {
-  typedef tree_int_map *value_type;
-  typedef tree_int_map *compare_type;
   static inline hashval_t hash (const tree_int_map *);
   static inline bool equal (const tree_int_map *, const tree_int_map *);
 };
index 8f0cc80..477f373 100644 (file)
@@ -159,9 +159,8 @@ typedef struct im_mem_ref
 
 /* Mem_ref hashtable helpers.  */
 
-struct mem_ref_hasher : typed_noop_remove <im_mem_ref>
+struct mem_ref_hasher : nofree_ptr_hash <im_mem_ref>
 {
-  typedef im_mem_ref *value_type;
   typedef tree_node *compare_type;
   static inline hashval_t hash (const im_mem_ref *);
   static inline bool equal (const im_mem_ref *, const tree_node *);
index e8a670e..f766f9c 100644 (file)
@@ -207,15 +207,13 @@ typedef union pre_expr_union_d
   vn_reference_t reference;
 } pre_expr_union;
 
-typedef struct pre_expr_d : typed_noop_remove <pre_expr_d>
+typedef struct pre_expr_d : nofree_ptr_hash <pre_expr_d>
 {
   enum pre_expr_kind kind;
   unsigned int id;
   pre_expr_union u;
 
   /* hash_table support.  */
-  typedef pre_expr_d *value_type;
-  typedef pre_expr_d *compare_type;
   static inline hashval_t hash (const pre_expr_d *);
   static inline int equal (const pre_expr_d *, const pre_expr_d *);
 } *pre_expr;
index ccfa6b6..fc8fbee 100644 (file)
@@ -137,9 +137,8 @@ static vn_lookup_kind default_vn_walk_kind;
 
 /* vn_nary_op hashtable helpers.  */
 
-struct vn_nary_op_hasher : typed_noop_remove <vn_nary_op_s>
+struct vn_nary_op_hasher : nofree_ptr_hash <vn_nary_op_s>
 {
-  typedef vn_nary_op_s *value_type;
   typedef vn_nary_op_s *compare_type;
   static inline hashval_t hash (const vn_nary_op_s *);
   static inline bool equal (const vn_nary_op_s *, const vn_nary_op_s *);
index 7af54c0..8e24c92 100644 (file)
@@ -282,10 +282,8 @@ registration_hasher::equal (const vtable_registration *p1,
 
 /* Hashtable definition and functions for vtbl_map_hash.  */
 
-struct vtbl_map_hasher : typed_noop_remove <struct vtbl_map_node>
+struct vtbl_map_hasher : nofree_ptr_hash <struct vtbl_map_node>
 {
-  typedef struct vtbl_map_node *value_type;
-  typedef struct vtbl_map_node *compare_type;
   static inline hashval_t hash (const vtbl_map_node *);
   static inline bool equal (const vtbl_map_node *, const vtbl_map_node *);
 };
index fbb3bfd..dda6f06 100644 (file)
@@ -55,10 +55,8 @@ struct vtable_registration
   vec<unsigned> offsets;       /* The offsets array.                        */
 };
 
-struct registration_hasher : typed_noop_remove <struct vtable_registration>
+struct registration_hasher : nofree_ptr_hash <struct vtable_registration>
 {
-  typedef struct vtable_registration *value_type;
-  typedef struct vtable_registration *compare_type;
   static inline hashval_t hash (const vtable_registration *);
   static inline bool equal (const vtable_registration *,
                            const vtable_registration *);
index 231ac6d..aba33b9 100644 (file)
@@ -1,3 +1,10 @@
+2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * plugin.cc (string_hasher): Inherit from nofree_ptr_hash rather
+       than typed_noop_remove.  Remove redudant typedefs.
+       (plugin_context): Use nofree_ptr_hash rather than pointer_hash.
+       (plugin_context::mark): Likewise.
+
 2015-05-13  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>
 
        * Makefile.in: Regenerated with automake-1.11.6.
index 74a7ec3..4c268c3 100644 (file)
@@ -134,11 +134,8 @@ decl_addr_hasher::equal (const decl_addr_value *p1, const decl_addr_value *p2)
 
 \f
 
-struct string_hasher : typed_noop_remove<const char>
+struct string_hasher : nofree_ptr_hash<const char>
 {
-  typedef const char *value_type;
-  typedef const char *compare_type;
-
   static inline hashval_t hash (const char *s)
   {
     return htab_hash_string (s);
@@ -176,7 +173,7 @@ struct plugin_context : public cc1_plugin::connection
   hash_table<decl_addr_hasher> address_map;
 
   // A collection of trees that are preserved for the GC.
-  hash_table< pointer_hash<tree_node> > preserved;
+  hash_table< nofree_ptr_hash<tree_node> > preserved;
 
   // File name cache.
   hash_table<string_hasher> file_names;
@@ -245,9 +242,8 @@ plugin_context::mark ()
       ggc_mark ((*it)->address);
     }
 
-  for (hash_table< pointer_hash<tree_node> >::iterator it = preserved.begin ();
-       it != preserved.end ();
-       ++it)
+  for (hash_table< nofree_ptr_hash<tree_node> >::iterator
+        it = preserved.begin (); it != preserved.end (); ++it)
     ggc_mark (&*it);
 }