===================================================================
@@ -118,12 +118,10 @@ Software Foundation; either version 3, o
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 *);
};
===================================================================
@@ -57,10 +57,12 @@ typed_noop_remove <Type>::remove (Type *
}
-/* 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
===================================================================
@@ -428,12 +428,8 @@ asan_mem_ref_get_end (const asan_mem_ref
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 *);
};
===================================================================
@@ -58,9 +58,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 *);
===================================================================
@@ -1025,10 +1025,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);
===================================================================
@@ -108,9 +108,8 @@ static rtx cselib_expand_value_rtx_1 (rt
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). */
===================================================================
@@ -734,10 +734,8 @@ clear_alias_set_lookup (alias_set_type a
/* 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 *);
};
===================================================================
@@ -168,10 +168,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 *);
};
===================================================================
@@ -22784,10 +22784,8 @@ dwarf2out_undef (unsigned int lineno ATT
/* 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 *);
};
@@ -23876,10 +23874,8 @@ file_table_relative_p (dwarf_file_data *
/* 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 *);
};
@@ -24989,10 +24985,8 @@ compare_locs (dw_loc_descr_ref x, dw_loc
/* 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 *);
===================================================================
@@ -375,9 +375,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 *);
===================================================================
@@ -175,7 +175,7 @@ enum built_in_function {
/* 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;
@@ -186,8 +186,6 @@ struct id_base : typed_noop_remove<id_ba
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 *);
};
===================================================================
@@ -2519,10 +2519,8 @@ merge_relative_positions (position **roo
/* 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 &);
};
===================================================================
@@ -426,10 +426,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 *);
};
===================================================================
@@ -614,9 +614,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 *);
===================================================================
@@ -616,9 +616,8 @@ #define EXECUTE_IF_SET_IN_HARD_REG_SET(S
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 *);
===================================================================
@@ -445,11 +445,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;
===================================================================
@@ -105,10 +105,8 @@ struct histogram_entry
/* 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 *);
};
===================================================================
@@ -229,10 +229,8 @@ #define SORTGT(x,y) (((x) > (y)) ? 1 : -
/* 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 *);
===================================================================
@@ -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 *);
};
===================================================================
@@ -284,10 +284,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 *);
};
===================================================================
@@ -56,10 +56,8 @@ const char **plugin_event_name = plugin_
/* 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 **);
};
===================================================================
@@ -121,10 +121,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 *);
};
===================================================================
@@ -123,10 +123,8 @@ static struct st_expr * store_motion_mem
/* 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 *);
};
===================================================================
@@ -343,10 +343,8 @@ pool_allocator<assign_link> assign_link:
/* 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 *);
};
===================================================================
@@ -72,10 +72,8 @@ typedef const struct coalesce_pair *cons
/* 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 *);
};
@@ -1242,10 +1240,8 @@ coalesce_partitions (var_map map, ssa_co
/* 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 *);
};
===================================================================
@@ -91,10 +91,8 @@ static void verify_live_on_entry (tree_
/* 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 *);
};
===================================================================
@@ -162,9 +162,8 @@ #define LOOP_DEP_BIT(loopnum, storedp) (
/* 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 *);
===================================================================
@@ -209,15 +209,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;
===================================================================
@@ -139,9 +139,8 @@ the Free Software Foundation; either ver
/* 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 *);
===================================================================
@@ -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 *);
===================================================================
@@ -285,10 +285,8 @@ registration_hasher::equal (const vtable
/* 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 *);
};
===================================================================
@@ -5028,10 +5028,8 @@ arm_function_value(const_tree type, cons
/* 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 *);
===================================================================
@@ -711,10 +711,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 *);
===================================================================
@@ -8581,10 +8581,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 *);
};
===================================================================
@@ -173,10 +173,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 *);
===================================================================
@@ -13970,7 +13970,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);
@@ -13984,7 +13984,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);
@@ -14008,7 +14008,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);
@@ -14026,7 +14026,7 @@ fold_check_failed (const_tree expr ATTRI
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;
@@ -14187,7 +14187,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);
@@ -14215,7 +14215,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);
@@ -14256,7 +14256,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);
@@ -14310,7 +14310,7 @@ fold_build3_stat_loc (location_t loc, en
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);
@@ -14376,7 +14376,7 @@ fold_build_call_array_loc (location_t lo
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);
===================================================================
@@ -1975,7 +1975,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. */
===================================================================
@@ -105,7 +105,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 &);
};
===================================================================
@@ -7407,7 +7407,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;
@@ -7507,7 +7507,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);
}
}
===================================================================
@@ -6919,7 +6919,7 @@ finish_struct (tree t, tree attributes)
}
/* 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
@@ -7038,7 +7038,7 @@ #define RECUR(T) fixed_type_or_null((T),
/* 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)
===================================================================
@@ -4127,7 +4127,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. */
===================================================================
@@ -2200,8 +2200,8 @@ count_trees (tree t)
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)))
@@ -2224,7 +2224,7 @@ verify_stmt_tree_r (tree* tp, int * /*wa
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);
}
===================================================================
@@ -276,10 +276,8 @@ find_classfile (char *filename, JCF *jcf
/* 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);
};
===================================================================
@@ -940,10 +940,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 *);
};
===================================================================
@@ -3859,10 +3859,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 *);
};
===================================================================
@@ -134,11 +134,8 @@ decl_addr_hasher::equal (const decl_addr
-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_plugi
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);
}