+2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
+
+ * hash-traits.h (free_ptr_hash): New class.
+ * dwarf2out.c (decl_table_entry_hasher): Inherit from free_ptr_hash
+ rather than typed_free_remove. Remove redudant typedefs.
+ (external_ref_hasher): Likewise.
+ * except.c (action_record_hasher, ttypes_filter_hasher): Likewise.
+ (ehspec_hasher): Likewise.
+ * ggc-common.c (saving_hasher): Likewise.
+ * gimplify.c (gimplify_hasher): Likewise.
+ * haifa-sched.c (delay_i2_hasher): Likewise.
+ * loop-invariant.c (invariant_expr_hasher): Likewise.
+ * loop-iv.c (biv_entry_hasher): Likewise.
+ * loop-unroll.c (iv_split_hasher, var_expand_hasher): Likewise.
+ * trans-mem.c (tm_mem_map_hasher, tm_memop_hasher): Likewise.
+ * tree-cfg.c (locus_discrim_hasher): Likewise.
+ * tree-eh.c (finally_tree_hasher): Likewise.
+ * tree-into-ssa.c (var_info_hasher): Likewise.
+ * tree-parloops.c (reduction_hasher, name_to_copy_hasher): Likewise.
+ * tree-ssa-loop-ivopts.c (iv_inv_expr_hasher): Likewise.
+ * tree-ssa-phiopt.c (ssa_names_hasher): Likewise.
+ * tree-ssa-pre.c (expr_pred_trans_d): Likewise.
+ * tree-ssa-sccvn.c (vn_constant_hasher): Likewise.
+ * tree-ssa-structalias.c (equiv_class_hasher): Likewise.
+ (shared_bitmap_hasher): Likewise.
+ * tree-ssa-threadupdate.c (redirection_data): Likewise.
+ * tree-vectorizer.h (peel_info_hasher): Likewise.
+ * tree-vectorizer.c (simduid_to_vf, simd_array_to_simduid): Likewise.
+ * config/mips/mips.c (mips_lo_sum_offset_hasher): Likewise.
+
2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
* hash-table.h: Update comments.
/* Hashtable helpers. */
-struct mips_lo_sum_offset_hasher : typed_free_remove <mips_lo_sum_offset>
+struct mips_lo_sum_offset_hasher : free_ptr_hash <mips_lo_sum_offset>
{
- typedef mips_lo_sum_offset *value_type;
typedef rtx_def *compare_type;
static inline hashval_t hash (const mips_lo_sum_offset *);
static inline bool equal (const mips_lo_sum_offset *, const rtx_def *);
/* Hashtable helpers. */
-struct decl_table_entry_hasher : typed_free_remove <decl_table_entry>
+struct decl_table_entry_hasher : free_ptr_hash <decl_table_entry>
{
- typedef decl_table_entry *value_type;
typedef die_struct *compare_type;
static inline hashval_t hash (const decl_table_entry *);
static inline bool equal (const decl_table_entry *, const die_struct *);
/* Hashtable helpers. */
-struct external_ref_hasher : typed_free_remove <external_ref>
+struct external_ref_hasher : free_ptr_hash <external_ref>
{
- typedef external_ref *value_type;
- typedef external_ref *compare_type;
static inline hashval_t hash (const external_ref *);
static inline bool equal (const external_ref *, const external_ref *);
};
/* Hashtable helpers. */
-struct action_record_hasher : typed_free_remove <action_record>
+struct action_record_hasher : free_ptr_hash <action_record>
{
- typedef action_record *value_type;
- typedef action_record *compare_type;
static inline hashval_t hash (const action_record *);
static inline bool equal (const action_record *, const action_record *);
};
/* Helper for ttypes_filter hashing. */
-struct ttypes_filter_hasher : typed_free_remove <ttypes_filter>
+struct ttypes_filter_hasher : free_ptr_hash <ttypes_filter>
{
- typedef ttypes_filter *value_type;
typedef tree_node *compare_type;
static inline hashval_t hash (const ttypes_filter *);
static inline bool equal (const ttypes_filter *, const tree_node *);
/* Helper for ehspec hashing. */
-struct ehspec_hasher : typed_free_remove <ttypes_filter>
+struct ehspec_hasher : free_ptr_hash <ttypes_filter>
{
- typedef ttypes_filter *value_type;
- typedef ttypes_filter *compare_type;
static inline hashval_t hash (const ttypes_filter *);
static inline bool equal (const ttypes_filter *, const ttypes_filter *);
};
/* Helper for hashing saving_htab. */
-struct saving_hasher : typed_free_remove <ptr_data>
+struct saving_hasher : free_ptr_hash <ptr_data>
{
- typedef ptr_data *value_type;
typedef void *compare_type;
static inline hashval_t hash (const ptr_data *);
static inline bool equal (const ptr_data *, const void *);
/* Gimplify hashtable helper. */
-struct gimplify_hasher : typed_free_remove <elt_t>
+struct gimplify_hasher : free_ptr_hash <elt_t>
{
- typedef elt_t *value_type;
- typedef elt_t *compare_type;
static inline hashval_t hash (const elt_t *);
static inline bool equal (const elt_t *, const elt_t *);
};
return x->i1 == y;
}
-struct delay_i2_hasher : typed_free_remove <delay_pair>
+struct delay_i2_hasher : free_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 *);
template <typename T>
struct nofree_ptr_hash : pointer_hash <T>, typed_noop_remove <T> {};
+/* Traits for pointer elements that should be freed via free() when an
+ element is deleted. */
+
+template <typename T>
+struct free_ptr_hash : pointer_hash <T>, typed_free_remove <T> {};
+
#endif
return true;
}
-struct invariant_expr_hasher : typed_free_remove <invariant_expr_entry>
+struct invariant_expr_hasher : free_ptr_hash <invariant_expr_entry>
{
- typedef invariant_expr_entry *value_type;
- typedef invariant_expr_entry *compare_type;
static inline hashval_t hash (const invariant_expr_entry *);
static inline bool equal (const invariant_expr_entry *,
const invariant_expr_entry *);
/* Hashtable helper. */
-struct biv_entry_hasher : typed_free_remove <biv_entry>
+struct biv_entry_hasher : free_ptr_hash <biv_entry>
{
- typedef biv_entry *value_type;
typedef rtx_def *compare_type;
static inline hashval_t hash (const biv_entry *);
static inline bool equal (const biv_entry *, const rtx_def *);
/* Hashtable helper for iv_to_split. */
-struct iv_split_hasher : typed_free_remove <iv_to_split>
+struct iv_split_hasher : free_ptr_hash <iv_to_split>
{
- typedef iv_to_split *value_type;
- typedef iv_to_split *compare_type;
static inline hashval_t hash (const iv_to_split *);
static inline bool equal (const iv_to_split *, const iv_to_split *);
};
/* Hashtable helper for iv_to_split. */
-struct var_expand_hasher : typed_free_remove <var_to_expand>
+struct var_expand_hasher : free_ptr_hash <var_to_expand>
{
- typedef var_to_expand *value_type;
- typedef var_to_expand *compare_type;
static inline hashval_t hash (const var_to_expand *);
static inline bool equal (const var_to_expand *, const var_to_expand *);
};
/* Hashtable helpers. */
-struct tm_mem_map_hasher : typed_free_remove <tm_new_mem_map_t>
+struct tm_mem_map_hasher : free_ptr_hash <tm_new_mem_map_t>
{
- typedef tm_new_mem_map_t *value_type;
- typedef tm_new_mem_map_t *compare_type;
static inline hashval_t hash (const tm_new_mem_map_t *);
static inline bool equal (const tm_new_mem_map_t *, const tm_new_mem_map_t *);
};
/* TM memory operation hashtable helpers. */
-struct tm_memop_hasher : typed_free_remove <tm_memop>
+struct tm_memop_hasher : free_ptr_hash <tm_memop>
{
- typedef tm_memop *value_type;
- typedef tm_memop *compare_type;
static inline hashval_t hash (const tm_memop *);
static inline bool equal (const tm_memop *, const tm_memop *);
};
/* Hashtable helpers. */
-struct locus_discrim_hasher : typed_free_remove <locus_discrim_map>
+struct locus_discrim_hasher : free_ptr_hash <locus_discrim_map>
{
- typedef locus_discrim_map *value_type;
- typedef locus_discrim_map *compare_type;
static inline hashval_t hash (const locus_discrim_map *);
static inline bool equal (const locus_discrim_map *,
const locus_discrim_map *);
/* Hashtable helpers. */
-struct finally_tree_hasher : typed_free_remove <finally_tree_node>
+struct finally_tree_hasher : free_ptr_hash <finally_tree_node>
{
- typedef finally_tree_node *value_type;
- typedef finally_tree_node *compare_type;
static inline hashval_t hash (const finally_tree_node *);
static inline bool equal (const finally_tree_node *,
const finally_tree_node *);
/* VAR_INFOS hashtable helpers. */
-struct var_info_hasher : typed_free_remove <var_info_d>
+struct var_info_hasher : free_ptr_hash <var_info_d>
{
- typedef var_info_d *value_type;
- typedef var_info_d *compare_type;
static inline hashval_t hash (const value_type &);
static inline bool equal (const value_type &, const compare_type &);
};
/* Reduction info hashtable helpers. */
-struct reduction_hasher : typed_free_remove <reduction_info>
+struct reduction_hasher : free_ptr_hash <reduction_info>
{
- typedef reduction_info *value_type;
- typedef reduction_info *compare_type;
static inline hashval_t hash (const reduction_info *);
static inline bool equal (const reduction_info *, const reduction_info *);
};
/* Name copies hashtable helpers. */
-struct name_to_copy_hasher : typed_free_remove <name_to_copy_elt>
+struct name_to_copy_hasher : free_ptr_hash <name_to_copy_elt>
{
- typedef name_to_copy_elt *value_type;
- typedef name_to_copy_elt *compare_type;
static inline hashval_t hash (const name_to_copy_elt *);
static inline bool equal (const name_to_copy_elt *, const name_to_copy_elt *);
};
/* Hashtable helpers. */
-struct iv_inv_expr_hasher : typed_free_remove <iv_inv_expr_ent>
+struct iv_inv_expr_hasher : free_ptr_hash <iv_inv_expr_ent>
{
- typedef iv_inv_expr_ent *value_type;
- typedef iv_inv_expr_ent *compare_type;
static inline hashval_t hash (const iv_inv_expr_ent *);
static inline bool equal (const iv_inv_expr_ent *, const iv_inv_expr_ent *);
};
/* Hashtable helpers. */
-struct ssa_names_hasher : typed_free_remove <name_to_bb>
+struct ssa_names_hasher : free_ptr_hash <name_to_bb>
{
- typedef name_to_bb *value_type;
- typedef name_to_bb *compare_type;
static inline hashval_t hash (const name_to_bb *);
static inline bool equal (const name_to_bb *, const name_to_bb *);
};
/* A three tuple {e, pred, v} used to cache phi translations in the
phi_translate_table. */
-typedef struct expr_pred_trans_d : typed_free_remove<expr_pred_trans_d>
+typedef struct expr_pred_trans_d : free_ptr_hash<expr_pred_trans_d>
{
/* The expression. */
pre_expr e;
hashval_t hashcode;
/* hash_table support. */
- typedef expr_pred_trans_d *value_type;
- typedef expr_pred_trans_d *compare_type;
static inline hashval_t hash (const expr_pred_trans_d *);
static inline int equal (const expr_pred_trans_d *, const expr_pred_trans_d *);
} *expr_pred_trans_t;
/* vn_constant hashtable helpers. */
-struct vn_constant_hasher : typed_free_remove <vn_constant_s>
+struct vn_constant_hasher : free_ptr_hash <vn_constant_s>
{
- typedef vn_constant_s *value_type;
- typedef vn_constant_s *compare_type;
static inline hashval_t hash (const vn_constant_s *);
static inline bool equal (const vn_constant_s *, const vn_constant_s *);
};
/* Equiv_class_label hashtable helpers. */
-struct equiv_class_hasher : typed_free_remove <equiv_class_label>
+struct equiv_class_hasher : free_ptr_hash <equiv_class_label>
{
- typedef equiv_class_label *value_type;
- typedef equiv_class_label *compare_type;
static inline hashval_t hash (const equiv_class_label *);
static inline bool equal (const equiv_class_label *,
const equiv_class_label *);
/* Shared_bitmap hashtable helpers. */
-struct shared_bitmap_hasher : typed_free_remove <shared_bitmap_info>
+struct shared_bitmap_hasher : free_ptr_hash <shared_bitmap_info>
{
- typedef shared_bitmap_info *value_type;
- typedef shared_bitmap_info *compare_type;
static inline hashval_t hash (const shared_bitmap_info *);
static inline bool equal (const shared_bitmap_info *,
const shared_bitmap_info *);
may have many incoming edges threaded to the same outgoing edge. This
can be naturally implemented with a hash table. */
-struct redirection_data : typed_free_remove<redirection_data>
+struct redirection_data : free_ptr_hash<redirection_data>
{
/* We support wiring up two block duplicates in a jump threading path.
struct el *incoming_edges;
/* hash_table support. */
- typedef redirection_data *value_type;
- typedef redirection_data *compare_type;
static inline hashval_t hash (const redirection_data *);
static inline int equal (const redirection_data *, const redirection_data *);
};
\f
/* For mapping simduid to vectorization factor. */
-struct simduid_to_vf : typed_free_remove<simduid_to_vf>
+struct simduid_to_vf : free_ptr_hash<simduid_to_vf>
{
unsigned int simduid;
int vf;
/* hash_table support. */
- typedef simduid_to_vf *value_type;
- typedef simduid_to_vf *compare_type;
static inline hashval_t hash (const simduid_to_vf *);
static inline int equal (const simduid_to_vf *, const simduid_to_vf *);
};
This hash maps from the OMP simd array (D.1737[]) to DECL_UID of
simduid.0. */
-struct simd_array_to_simduid : typed_free_remove<simd_array_to_simduid>
+struct simd_array_to_simduid : free_ptr_hash<simd_array_to_simduid>
{
tree decl;
unsigned int simduid;
/* hash_table support. */
- typedef simd_array_to_simduid *value_type;
- typedef simd_array_to_simduid *compare_type;
static inline hashval_t hash (const simd_array_to_simduid *);
static inline int equal (const simd_array_to_simduid *,
const simd_array_to_simduid *);
/* Peeling hashtable helpers. */
-struct peel_info_hasher : typed_free_remove <_vect_peel_info>
+struct peel_info_hasher : free_ptr_hash <_vect_peel_info>
{
- typedef _vect_peel_info *value_type;
- typedef _vect_peel_info *compare_type;
static inline hashval_t hash (const _vect_peel_info *);
static inline bool equal (const _vect_peel_info *, const _vect_peel_info *);
};
+2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
+
+ * plugin.cc (decl_addr_hasher): Inherit from free_ptr_hash
+ rather than typed_free_remove. Remove redudant typedefs.
+
2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
* plugin.cc (string_hasher): Inherit from nofree_ptr_hash rather
tree address;
};
-struct decl_addr_hasher : typed_free_remove<decl_addr_value>
+struct decl_addr_hasher : free_ptr_hash<decl_addr_value>
{
- typedef decl_addr_value *value_type;
- typedef decl_addr_value *compare_type;
-
static inline hashval_t hash (const decl_addr_value *);
static inline bool equal (const decl_addr_value *, const decl_addr_value *);
};