+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)
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 *);
};
/* 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 *);
+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.
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;
}
else
{
- hash_table<pointer_hash <tree_node> > htab (37);
+ hash_table<nofree_ptr_hash <tree_node> > htab (37);
detect_field_duplicates_hash (fieldlist, &htab);
}
}
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);
/* 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 *);
/* 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 *);
/* 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 *);
};
/* 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 *);
+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
}
\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
/* 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)
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. */
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)))
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);
}
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). */
/* 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 *);
};
/* 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 *);
};
/* 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 *);
};
/* 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 *);
};
/* 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 *);
#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);
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);
{
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);
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;
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);
#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);
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);
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);
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);
/* 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 *);
/* 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;
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 *);
};
/* 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 &);
};
/* 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 *);
};
/* 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 *);
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 *);
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 *);
};
}
-/* 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;
}
};
+/* 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
};
/* 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;
/* 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 *);
};
/* 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 *);
+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.
/* 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);
};
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 *);
};
/* 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 *);
};
+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.
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 *);
};
+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.
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 *);
};
/* 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 **);
};
/* 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 *);
};
/* 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 *);
};
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 &);
};
/* 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 *);
};
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. */
/* 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 *);
};
/* 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 *);
};
/* 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 *);
};
/* 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 *);
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;
/* 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 *);
/* 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 *);
};
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 *);
+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.
\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);
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;
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);
}