+2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
+
+ * cgraph.h (asmname_hasher): Inherit from ggc_ptr_hash. Remove
+ redundant typedefs and members.
+ * coverage.c (counts_entry): Inherit from pointer_hash. Remove
+ redundant typedefs.
+ * dwarf2out.c (cu_hash_table_entry_hasher): Likewise.
+ * ipa-devirt.c (odr_name_hasher): Likewise.
+ (polymorphic_call_target_hasher): Likewise.
+ * ira-costs.c (cost_classes_hasher): Likewise.
+ * statistics.c (stats_counter_hasher): Likewise.
+ * trans-mem.c (log_entry_hasher): Likewise.
+ * tree-ssa-dom.c (expr_elt_hasher): Likewise.
+ * tree-ssa-sccvn.c (vn_phi_hasher, vn_reference_hasher): Likewise.
+ * tree-ssa-tail-merge.c (same_succ_def): Likewise.
+ * var-tracking.c (variable_hasher): Likewise.
+ * valtrack.h (dead_debug_hash_descr): Inherit from free_ptr_hash.
+ Remove redundant typedefs and members.
+
2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
* hash-traits.h (ggc_cache_hasher): Rename to...
FINISHED
};
-struct asmname_hasher
+struct asmname_hasher : ggc_ptr_hash <symtab_node>
{
- typedef symtab_node *value_type;
typedef const_tree compare_type;
static hashval_t hash (symtab_node *n);
static bool equal (symtab_node *n, const_tree t);
- static void ggc_mx (symtab_node *n);
- static void pch_nx (symtab_node *&);
- static void pch_nx (symtab_node *&, gt_pointer_operator, void *);
- static void remove (symtab_node *) {}
};
class GTY((tag ("SYMTAB"))) symbol_table
return symbol_table::decl_assembler_name_equal (n->decl, t);
}
-extern void gt_ggc_mx (symtab_node *&);
-
-inline void
-asmname_hasher::ggc_mx (symtab_node *n)
-{
- gt_ggc_mx (n);
-}
-
-extern void gt_pch_nx (symtab_node *&);
-
-inline void
-asmname_hasher::pch_nx (symtab_node *&n)
-{
- gt_pch_nx (n);
-}
-
-inline void
-asmname_hasher::pch_nx (symtab_node *&n, gt_pointer_operator op, void *cookie)
-{
- op (&n, cookie);
-}
-
/* In cgraph.c */
void cgraph_c_finalize (void);
void release_function_body (tree);
};
/* Counts information for a function. */
-typedef struct counts_entry
+typedef struct counts_entry : pointer_hash <counts_entry>
{
/* We hash by */
unsigned ident;
struct gcov_ctr_summary summary;
/* hash_table support. */
- typedef counts_entry *value_type;
- typedef counts_entry *compare_type;
static inline hashval_t hash (const counts_entry *);
static int equal (const counts_entry *, const counts_entry *);
static void remove (counts_entry *);
/* Helpers to manipulate hash table of CUs. */
-struct cu_hash_table_entry_hasher
+struct cu_hash_table_entry_hasher : pointer_hash <cu_hash_table_entry>
{
- typedef cu_hash_table_entry *value_type;
typedef die_struct *compare_type;
static inline hashval_t hash (const cu_hash_table_entry *);
static inline bool equal (const cu_hash_table_entry *, const die_struct *);
/* Hash used to unify ODR types based on their mangled name and for anonymous
namespace types. */
-struct odr_name_hasher
+struct odr_name_hasher : pointer_hash <odr_type_d>
{
- typedef odr_type_d *value_type;
typedef union tree_node *compare_type;
static inline hashval_t hash (const odr_type_d *);
static inline bool equal (const odr_type_d *, const tree_node *);
/* Polymorphic call target cache helpers. */
-struct polymorphic_call_target_hasher
+struct polymorphic_call_target_hasher
+ : pointer_hash <polymorphic_call_target_d>
{
- typedef polymorphic_call_target_d *value_type;
- typedef polymorphic_call_target_d *compare_type;
static inline hashval_t hash (const polymorphic_call_target_d *);
static inline bool equal (const polymorphic_call_target_d *,
const polymorphic_call_target_d *);
/* Helper for cost_classes hashing. */
-struct cost_classes_hasher
+struct cost_classes_hasher : pointer_hash <cost_classes>
{
- typedef cost_classes *value_type;
- typedef cost_classes *compare_type;
static inline hashval_t hash (const cost_classes *);
static inline bool equal (const cost_classes *, const cost_classes *);
static inline void remove (cost_classes *);
/* Hashtable helpers. */
-struct stats_counter_hasher
+struct stats_counter_hasher : pointer_hash <statistics_counter_t>
{
- typedef statistics_counter_t *value_type;
- typedef statistics_counter_t *compare_type;
static inline hashval_t hash (const statistics_counter_t *);
static inline bool equal (const statistics_counter_t *,
const statistics_counter_t *);
/* Log entry hashtable helpers. */
-struct log_entry_hasher
+struct log_entry_hasher : pointer_hash <tm_log_entry>
{
- typedef tm_log_entry *value_type;
- typedef tm_log_entry *compare_type;
static inline hashval_t hash (const tm_log_entry *);
static inline bool equal (const tm_log_entry *, const tm_log_entry *);
static inline void remove (tm_log_entry *);
const struct hashable_expr *);
static void free_expr_hash_elt (void *);
-struct expr_elt_hasher
+struct expr_elt_hasher : pointer_hash <expr_hash_elt>
{
- typedef expr_hash_elt *value_type;
- typedef expr_hash_elt *compare_type;
static inline hashval_t hash (const value_type &);
static inline bool equal (const value_type &, const compare_type &);
static inline void remove (value_type &);
static int
vn_phi_eq (const_vn_phi_t const vp1, const_vn_phi_t const vp2);
-struct vn_phi_hasher
+struct vn_phi_hasher : pointer_hash <vn_phi_s>
{
- typedef vn_phi_s *value_type;
- typedef vn_phi_s *compare_type;
static inline hashval_t hash (const vn_phi_s *);
static inline bool equal (const vn_phi_s *, const vn_phi_s *);
static inline void remove (vn_phi_s *);
/* vn_reference hashtable helpers. */
-struct vn_reference_hasher
+struct vn_reference_hasher : pointer_hash <vn_reference_s>
{
- typedef vn_reference_s *value_type;
- typedef vn_reference_s *compare_type;
static inline hashval_t hash (const vn_reference_s *);
static inline bool equal (const vn_reference_s *, const vn_reference_s *);
static inline void remove (vn_reference_s *);
Additionally, the hash value for the struct is cached in hashval, and
in_worklist indicates whether it's currently part of worklist. */
-struct same_succ_def
+struct same_succ_def : pointer_hash <same_succ_def>
{
/* The bbs that have the same successor bbs. */
bitmap bbs;
hashval_t hashval;
/* hash_table support. */
- typedef same_succ_def *value_type;
- typedef same_succ_def *compare_type;
static inline hashval_t hash (const same_succ_def *);
static int equal (const same_succ_def *, const same_succ_def *);
static void remove (same_succ_def *);
/* Descriptor for hash_table to hash by dead_debug_global_entry's REG
and map to DTEMP. */
-struct dead_debug_hash_descr
+struct dead_debug_hash_descr : free_ptr_hash <dead_debug_global_entry>
{
- /* The hash table contains pointers to entries of this type. */
- typedef struct dead_debug_global_entry *value_type;
- typedef struct dead_debug_global_entry *compare_type;
/* Hash on the pseudo number. */
static inline hashval_t hash (const dead_debug_global_entry *my);
/* Entries are identical if they refer to the same pseudo. */
static inline bool equal (const dead_debug_global_entry *my,
const dead_debug_global_entry *other);
- /* Release entries when they're removed. */
- static inline void remove (dead_debug_global_entry *p);
};
/* Hash on the pseudo number. */
return my->reg == other->reg;
}
-/* Release entries when they're removed. */
-inline void
-dead_debug_hash_descr::remove (dead_debug_global_entry *p)
-{
- XDELETE (p);
-}
-
/* Maintain a global table of pseudos used in debug insns after their
deaths in other blocks, and debug temps their deathpoint values are
to be bound to. */
/* Variable hashtable helpers. */
-struct variable_hasher
+struct variable_hasher : pointer_hash <variable_def>
{
- typedef variable_def *value_type;
typedef void *compare_type;
static inline hashval_t hash (const variable_def *);
static inline bool equal (const variable_def *, const void *);