From ca752f3929677221a5806daf4940367308fc16d7 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 25 Jun 2015 17:06:36 +0000 Subject: [PATCH] hash-traits.h (ggc_hasher): Rename to... gcc/ * hash-traits.h (ggc_hasher): Rename to... (ggc_remover): ...this and remove typedefs. (ggc_cache_hasher): Update accordingly. Add typedefs. (ggc_ptr_hash): New class. * hash-table.h: Update comment. * cfgloop.h (loop_exit_hasher): Inherit from ggc_ptr_hash rather than ggc_hasher. * cgraph.h (section_name_hasher, cgraph_edge_hasher): Likewise. (tree_descriptor_hasher): Likewise. * cgraph.c (function_version_hasher): Likewise. * dwarf2out.c (indirect_string_hasher, dwarf_file_hasher): Likewise. (decl_die_hasher, block_die_hasher, decl_loc_hasher): Likewise. (dw_loc_list_hasher, addr_hasher): Likewise. * function.h (used_type_hasher): Likewise. * function.c (temp_address_hasher): Likewise. * gimple-ssa.h (tm_restart_hasher, ssa_name_hasher): Likewise. * libfuncs.h (libfunc_hasher): Likewise. * lto-streamer.h (decl_state_hasher): Likewise. * optabs.c (libfunc_decl_hasher): Likewise. * tree-scalar-evolution.c (scev_info_hasher): Likewise. * varasm.c (section_hasher, object_block_hasher): Likewise. (const_rtx_desc_hasher): Likewise. * config/darwin.c (indirection_hasher, cfstring_hasher): Likewise. * config/rs6000/rs6000.c (toc_hasher, builtin_hasher): Likewise. gcc/c-family/ * c-common.c (c_type_hasher): Inherit from ggc_ptr_hash rather than ggc_hasher. gcc/cp/ * constexpr.c (constexpr_fundef_hasher): Inherit from ggc_ptr_hash rather than ggc_hasher. (constexpr_call_hasher): Likewise. * cp-tree.h (cxx_int_tree_map_hasher, named_label_hasher): Likewise. * decl.c (typename_hasher): Likewise. * mangle.c (conv_type_hasher): Likewise. * pt.c (spec_hasher): Likewise. * tree.c (cplus_array_hasher, list_hasher): Likewise. * typeck2.c (abstract_type_hasher): Likewise. gcc/fortran/ * trans-decl.c (module_hasher): Likewise. * trans.h (module_decl_hasher): Likewise. gcc/java/ * java-tree.h (treetreehasher): Inherit from ggc_ptr_hash rather than ggc_hasher. (ict_hasher, type_assertion_hasher): Likewise. gcc/objc/ * objc-act.c (objc_string_hasher): Inherit from ggc_ptr_hash rather than ggc_hasher. From-SVN: r224959 --- gcc/ChangeLog | 27 +++++++++++++++++++++++++++ gcc/c-family/ChangeLog | 5 +++++ gcc/c-family/c-common.c | 2 +- gcc/cfgloop.h | 2 +- gcc/cgraph.c | 2 +- gcc/cgraph.h | 6 +++--- gcc/config/darwin.c | 4 ++-- gcc/config/rs6000/rs6000.c | 4 ++-- gcc/cp/ChangeLog | 12 ++++++++++++ gcc/cp/constexpr.c | 4 ++-- gcc/cp/cp-tree.h | 4 ++-- gcc/cp/decl.c | 2 +- gcc/cp/mangle.c | 2 +- gcc/cp/pt.c | 2 +- gcc/cp/tree.c | 4 ++-- gcc/cp/typeck2.c | 2 +- gcc/dwarf2out.c | 14 +++++++------- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/trans-decl.c | 2 +- gcc/fortran/trans.h | 2 +- gcc/function.c | 2 +- gcc/function.h | 2 +- gcc/gimple-ssa.h | 4 ++-- gcc/hash-table.h | 9 +++++++-- gcc/hash-traits.h | 18 ++++++++++++------ gcc/java/ChangeLog | 6 ++++++ gcc/java/java-tree.h | 6 +++--- gcc/libfuncs.h | 2 +- gcc/lto-streamer.h | 2 +- gcc/objc/ChangeLog | 5 +++++ gcc/objc/objc-act.c | 2 +- gcc/optabs.c | 2 +- gcc/tree-scalar-evolution.c | 2 +- gcc/varasm.c | 6 +++--- 34 files changed, 123 insertions(+), 52 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b3d064e24e1..9737e4ada5c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,30 @@ +2015-06-25 Richard Sandiford + + * hash-traits.h (ggc_hasher): Rename to... + (ggc_remover): ...this and remove typedefs. + (ggc_cache_hasher): Update accordingly. Add typedefs. + (ggc_ptr_hash): New class. + * hash-table.h: Update comment. + * cfgloop.h (loop_exit_hasher): Inherit from ggc_ptr_hash rather than + ggc_hasher. + * cgraph.h (section_name_hasher, cgraph_edge_hasher): Likewise. + (tree_descriptor_hasher): Likewise. + * cgraph.c (function_version_hasher): Likewise. + * dwarf2out.c (indirect_string_hasher, dwarf_file_hasher): Likewise. + (decl_die_hasher, block_die_hasher, decl_loc_hasher): Likewise. + (dw_loc_list_hasher, addr_hasher): Likewise. + * function.h (used_type_hasher): Likewise. + * function.c (temp_address_hasher): Likewise. + * gimple-ssa.h (tm_restart_hasher, ssa_name_hasher): Likewise. + * libfuncs.h (libfunc_hasher): Likewise. + * lto-streamer.h (decl_state_hasher): Likewise. + * optabs.c (libfunc_decl_hasher): Likewise. + * tree-scalar-evolution.c (scev_info_hasher): Likewise. + * varasm.c (section_hasher, object_block_hasher): Likewise. + (const_rtx_desc_hasher): Likewise. + * config/darwin.c (indirection_hasher, cfstring_hasher): Likewise. + * config/rs6000/rs6000.c (toc_hasher, builtin_hasher): Likewise. + 2015-06-25 Richard Sandiford * hash-traits.h (free_ptr_hash): New class. diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 61afc6a87e5..780d916b7d7 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2015-06-25 Richard Sandiford + + * c-common.c (c_type_hasher): Inherit from ggc_ptr_hash rather than + ggc_hasher. + 2015-06-25 Andrew MacLeod * cilk.c: Move calls.h after tm.h in the include chain. diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 5ceee5f101c..18026306f32 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -5089,7 +5089,7 @@ c_apply_type_quals_to_decl (int type_quals, tree decl) } } -struct c_type_hasher : ggc_hasher +struct c_type_hasher : ggc_ptr_hash { static hashval_t hash (tree); static bool equal (tree, tree); diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h index 29b626a90ed..fe3bb921ea4 100644 --- a/gcc/cfgloop.h +++ b/gcc/cfgloop.h @@ -85,7 +85,7 @@ struct GTY ((for_user)) loop_exit { struct loop_exit *next_e; }; -struct loop_exit_hasher : ggc_hasher +struct loop_exit_hasher : ggc_ptr_hash { typedef edge compare_type; diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 60f90060187..698f56ea549 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -126,7 +126,7 @@ struct cgraph_2node_hook_list { /* Hash descriptor for cgraph_function_version_info. */ -struct function_version_hasher : ggc_hasher +struct function_version_hasher : ggc_ptr_hash { static hashval_t hash (cgraph_function_version_info *); static bool equal (cgraph_function_version_info *, diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 62d4ad6ee7c..d4cb94d4950 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -44,7 +44,7 @@ struct GTY((for_user)) section_hash_entry_d typedef struct section_hash_entry_d section_hash_entry; -struct section_name_hasher : ggc_hasher +struct section_name_hasher : ggc_ptr_hash { typedef const char *compare_type; @@ -769,7 +769,7 @@ enum cgraph_inline_failed_type_t struct cgraph_edge; -struct cgraph_edge_hasher : ggc_hasher +struct cgraph_edge_hasher : ggc_ptr_hash { typedef gimple compare_type; @@ -2801,7 +2801,7 @@ varpool_node::all_refs_explicit_p () && !force_output); } -struct tree_descriptor_hasher : ggc_hasher +struct tree_descriptor_hasher : ggc_ptr_hash { static hashval_t hash (constant_descriptor_tree *); static bool equal (constant_descriptor_tree *, constant_descriptor_tree *); diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 3627ba6c2fa..93c6d6734b3 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -477,7 +477,7 @@ typedef struct GTY ((for_user)) machopic_indirection bool used; } machopic_indirection; -struct indirection_hasher : ggc_hasher +struct indirection_hasher : ggc_ptr_hash { typedef const char *compare_type; static hashval_t hash (machopic_indirection *); @@ -3271,7 +3271,7 @@ typedef struct GTY ((for_user)) cfstring_descriptor { tree constructor; } cfstring_descriptor; -struct cfstring_hasher : ggc_hasher +struct cfstring_hasher : ggc_ptr_hash { static hashval_t hash (cfstring_descriptor *); static bool equal (cfstring_descriptor *, cfstring_descriptor *); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 56acc86578c..38442ec3b14 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1228,7 +1228,7 @@ struct GTY((for_user)) toc_hash_struct int labelno; }; -struct toc_hasher : ggc_hasher +struct toc_hasher : ggc_ptr_hash { static hashval_t hash (toc_hash_struct *); static bool equal (toc_hash_struct *, toc_hash_struct *); @@ -1245,7 +1245,7 @@ struct GTY((for_user)) builtin_hash_struct unsigned char uns_p[4]; /* and whether the types are unsigned. */ }; -struct builtin_hasher : ggc_hasher +struct builtin_hasher : ggc_ptr_hash { static hashval_t hash (builtin_hash_struct *); static bool equal (builtin_hash_struct *, builtin_hash_struct *); diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6bc2962255b..338e21e1862 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,15 @@ +2015-06-25 Richard Sandiford + + * constexpr.c (constexpr_fundef_hasher): Inherit from ggc_ptr_hash + rather than ggc_hasher. + (constexpr_call_hasher): Likewise. + * cp-tree.h (cxx_int_tree_map_hasher, named_label_hasher): Likewise. + * decl.c (typename_hasher): Likewise. + * mangle.c (conv_type_hasher): Likewise. + * pt.c (spec_hasher): Likewise. + * tree.c (cplus_array_hasher, list_hasher): Likewise. + * typeck2.c (abstract_type_hasher): Likewise. + 2015-06-25 Richard Sandiford * class.c (fixed_type_or_null_ref_ht): Inherit from nofree_ptr_hash diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index f6e2bc8508c..9cb45eade41 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -123,7 +123,7 @@ struct GTY((for_user)) constexpr_fundef { tree body; }; -struct constexpr_fundef_hasher : ggc_hasher +struct constexpr_fundef_hasher : ggc_ptr_hash { static hashval_t hash (constexpr_fundef *); static bool equal (constexpr_fundef *, constexpr_fundef *); @@ -872,7 +872,7 @@ struct GTY((for_user)) constexpr_call { hashval_t hash; }; -struct constexpr_call_hasher : ggc_hasher +struct constexpr_call_hasher : ggc_ptr_hash { static hashval_t hash (constexpr_call *); static bool equal (constexpr_call *, constexpr_call *); diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index b53aa9028e2..e8cc38f97e6 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1181,7 +1181,7 @@ struct GTY((for_user)) cxx_int_tree_map { tree to; }; -struct cxx_int_tree_map_hasher : ggc_hasher +struct cxx_int_tree_map_hasher : ggc_ptr_hash { static hashval_t hash (cxx_int_tree_map *); static bool equal (cxx_int_tree_map *, cxx_int_tree_map *); @@ -1189,7 +1189,7 @@ struct cxx_int_tree_map_hasher : ggc_hasher struct named_label_entry; -struct named_label_hasher : ggc_hasher +struct named_label_hasher : ggc_ptr_hash { static hashval_t hash (named_label_entry *); static bool equal (named_label_entry *, named_label_entry *); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 8f0bb34c4b6..545f4cd9078 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -3331,7 +3331,7 @@ struct typename_info { bool class_p; }; -struct typename_hasher : ggc_hasher +struct typename_hasher : ggc_ptr_hash { typedef typename_info *compare_type; diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 69ecb674bc3..2fdc4b20bce 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -3841,7 +3841,7 @@ mangle_thunk (tree fn_decl, const int this_adjusting, tree fixed_offset, return result; } -struct conv_type_hasher : ggc_hasher +struct conv_type_hasher : ggc_ptr_hash { static hashval_t hash (tree); static bool equal (tree, tree); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b63c0d4b7db..fe5fc144742 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -89,7 +89,7 @@ struct GTY((for_user)) spec_entry tree spec; }; -struct spec_hasher : ggc_hasher +struct spec_hasher : ggc_ptr_hash { static hashval_t hash (spec_entry *); static bool equal (spec_entry *, spec_entry *); diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 3ee2f347258..f373ddde77b 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -734,7 +734,7 @@ struct cplus_array_info tree domain; }; -struct cplus_array_hasher : ggc_hasher +struct cplus_array_hasher : ggc_ptr_hash { typedef cplus_array_info *compare_type; @@ -1712,7 +1712,7 @@ struct list_proxy tree chain; }; -struct list_hasher : ggc_hasher +struct list_hasher : ggc_ptr_hash { typedef list_proxy *compare_type; diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 6c3aa4ca033..30d93ed39fa 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -156,7 +156,7 @@ struct GTY((chain_next ("%h.next"), for_user)) pending_abstract_type { struct pending_abstract_type* next; }; -struct abstract_type_hasher : ggc_hasher +struct abstract_type_hasher : ggc_ptr_hash { typedef tree compare_type; static hashval_t hash (pending_abstract_type *); diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 4b89d3e667d..0f08daacf13 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -220,7 +220,7 @@ struct GTY((for_user)) indirect_string_node { unsigned int index; }; -struct indirect_string_hasher : ggc_hasher +struct indirect_string_hasher : ggc_ptr_hash { typedef const char *compare_type; @@ -2796,7 +2796,7 @@ static GTY(()) limbo_die_node *limbo_die_list; DW_AT_{,MIPS_}linkage_name once their DECL_ASSEMBLER_NAMEs are set. */ static GTY(()) limbo_die_node *deferred_asm_name; -struct dwarf_file_hasher : ggc_hasher +struct dwarf_file_hasher : ggc_ptr_hash { typedef const char *compare_type; @@ -2807,7 +2807,7 @@ struct dwarf_file_hasher : ggc_hasher /* Filenames referenced by this compilation unit. */ static GTY(()) hash_table *file_table; -struct decl_die_hasher : ggc_hasher +struct decl_die_hasher : ggc_ptr_hash { typedef tree compare_type; @@ -2818,7 +2818,7 @@ struct decl_die_hasher : ggc_hasher The key is a DECL_UID() which is a unique number identifying each decl. */ static GTY (()) hash_table *decl_die_table; -struct block_die_hasher : ggc_hasher +struct block_die_hasher : ggc_ptr_hash { static hashval_t hash (die_struct *); static bool equal (die_struct *, die_struct *); @@ -2882,7 +2882,7 @@ struct GTY ((chain_next ("%h.next"))) call_arg_loc_node { }; -struct decl_loc_hasher : ggc_hasher +struct decl_loc_hasher : ggc_ptr_hash { typedef const_tree compare_type; @@ -2912,7 +2912,7 @@ struct GTY ((for_user)) cached_dw_loc_list_def { }; typedef struct cached_dw_loc_list_def cached_dw_loc_list; -struct dw_loc_list_hasher : ggc_hasher +struct dw_loc_list_hasher : ggc_ptr_hash { typedef const_tree compare_type; @@ -4238,7 +4238,7 @@ AT_loc_list_ptr (dw_attr_ref a) return &a->dw_attr_val.v.val_loc_list; } -struct addr_hasher : ggc_hasher +struct addr_hasher : ggc_ptr_hash { static hashval_t hash (addr_table_entry *); static bool equal (addr_table_entry *, addr_table_entry *); diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 52f24b20b7a..42a3064aa9d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2015-06-25 Richard Sandiford + + * trans-decl.c (module_hasher): Likewise. + * trans.h (module_decl_hasher): Likewise. + 2015-06-24 Manuel López-Ibáñez PR fortran/66528 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 1eed32d2105..09cdcd0a3ce 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -4360,7 +4360,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block) gfc_add_init_cleanup (block, gfc_finish_block (&tmpblock), NULL_TREE); } -struct module_hasher : ggc_hasher +struct module_hasher : ggc_ptr_hash { typedef const char *compare_type; diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index 570b5b88e30..e6180886f19 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -598,7 +598,7 @@ void gfc_generate_module_vars (gfc_namespace *); /* Get the appropriate return statement for a procedure. */ tree gfc_generate_return (void); -struct module_decl_hasher : ggc_hasher +struct module_decl_hasher : ggc_ptr_hash { typedef const char *compare_type; diff --git a/gcc/function.c b/gcc/function.c index e746b3fbbe2..f6b7d30b07b 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -574,7 +574,7 @@ struct GTY((for_user)) temp_slot_address_entry { struct temp_slot *temp_slot; }; -struct temp_address_hasher : ggc_hasher +struct temp_address_hasher : ggc_ptr_hash { static hashval_t hash (temp_slot_address_entry *); static bool equal (temp_slot_address_entry *, temp_slot_address_entry *); diff --git a/gcc/function.h b/gcc/function.h index f9b2468e0be..e286188f018 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -415,7 +415,7 @@ struct GTY((for_user)) types_used_by_vars_entry { tree var_decl; }; -struct used_type_hasher : ggc_hasher +struct used_type_hasher : ggc_ptr_hash { static hashval_t hash (types_used_by_vars_entry *); static bool equal (types_used_by_vars_entry *, types_used_by_vars_entry *); diff --git a/gcc/gimple-ssa.h b/gcc/gimple-ssa.h index 2bfcc03450e..25dde083158 100644 --- a/gcc/gimple-ssa.h +++ b/gcc/gimple-ssa.h @@ -34,7 +34,7 @@ struct GTY((for_user)) tm_restart_node { /* Hasher for tm_restart_node. */ -struct tm_restart_hasher : ggc_hasher +struct tm_restart_hasher : ggc_ptr_hash { static hashval_t hash (tm_restart_node *n) { return htab_hash_pointer (n); } @@ -45,7 +45,7 @@ struct tm_restart_hasher : ggc_hasher } }; -struct ssa_name_hasher : ggc_hasher +struct ssa_name_hasher : ggc_ptr_hash { /* Hash a tree in a uid_decl_map. */ diff --git a/gcc/hash-table.h b/gcc/hash-table.h index 31440f6f44e..3f49345a909 100644 --- a/gcc/hash-table.h +++ b/gcc/hash-table.h @@ -91,8 +91,8 @@ along with GCC; see the file COPYING3. If not see We compose this into a few steps. 1. Decide on a removal policy for values stored in the table. - hash-traits.h provides class templates for the two most common - policies. + hash-traits.h provides class templates for the three most common + policies: * typed_free_remove implements the static 'remove' member function by calling free(). @@ -100,6 +100,11 @@ along with GCC; see the file COPYING3. If not see * typed_noop_remove implements the static 'remove' member function by doing nothing. + * ggc_remove implements the static 'remove' member by doing nothing, + but instead provides routines for gc marking and for PCH streaming. + Use this for garbage-collected data that needs to be preserved across + collections. + You can use these policies by simply deriving the descriptor type from one of those class template, with the appropriate argument. diff --git a/gcc/hash-traits.h b/gcc/hash-traits.h index e4c182eabf2..77f88f30dc6 100644 --- a/gcc/hash-traits.h +++ b/gcc/hash-traits.h @@ -121,14 +121,11 @@ pointer_hash ::is_empty (Type *e) return e == NULL; } -/* Hasher for entry in gc memory. */ +/* Remover and marker for entries in gc memory. */ template -struct ggc_hasher +struct ggc_remove { - typedef T value_type; - typedef T compare_type; - static void remove (T &) {} static void @@ -155,8 +152,11 @@ struct ggc_hasher /* Hasher for cache entry in gc memory. */ template -struct ggc_cache_hasher : ggc_hasher +struct ggc_cache_hasher : ggc_remove { + typedef T value_type; + typedef T compare_type; + /* Entries are weakly held because this is for caches. */ static void ggc_mx (T &) {} @@ -179,4 +179,10 @@ struct nofree_ptr_hash : pointer_hash , typed_noop_remove {}; template struct free_ptr_hash : pointer_hash , typed_free_remove {}; +/* Traits for elements that point to gc memory. The pointed-to data + must be kept across collections. */ + +template +struct ggc_ptr_hash : pointer_hash , ggc_remove {}; + #endif diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index edc2c552361..6a9330481e4 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,9 @@ +2015-06-25 Richard Sandiford + + * java-tree.h (treetreehasher): Inherit from ggc_ptr_hash + rather than ggc_hasher. + (ict_hasher, type_assertion_hasher): Likewise. + 2015-06-25 Richard Sandiford * jcf-io.c (charstar_hash): Inherit from nofree_ptr_hash rather diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 7c9a51973c8..c29911978b6 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -714,7 +714,7 @@ struct GTY((for_user)) treetreehash_entry { tree value; }; -struct treetreehasher : ggc_hasher +struct treetreehasher : ggc_ptr_hash { typedef tree compare_type; @@ -722,7 +722,7 @@ struct treetreehasher : ggc_hasher static bool equal (treetreehash_entry *, tree); }; -struct ict_hasher : ggc_hasher +struct ict_hasher : ggc_ptr_hash { static hashval_t hash (tree t) { return htab_hash_pointer (t); } static bool equal (tree a, tree b) { return a == b; } @@ -797,7 +797,7 @@ typedef struct GTY((for_user)) type_assertion { tree op2; /* Second operand. */ } type_assertion; -struct type_assertion_hasher : ggc_hasher +struct type_assertion_hasher : ggc_ptr_hash { static hashval_t hash (type_assertion *); static bool equal (type_assertion *, type_assertion *); diff --git a/gcc/libfuncs.h b/gcc/libfuncs.h index a2e8414c392..22e6973fd2d 100644 --- a/gcc/libfuncs.h +++ b/gcc/libfuncs.h @@ -61,7 +61,7 @@ struct GTY((for_user)) libfunc_entry { /* Descriptor for libfunc_entry. */ -struct libfunc_hasher : ggc_hasher +struct libfunc_hasher : ggc_ptr_hash { static hashval_t hash (libfunc_entry *); static bool equal (libfunc_entry *, libfunc_entry *); diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h index 1463dd99fcf..d5a330dfa51 100644 --- a/gcc/lto-streamer.h +++ b/gcc/lto-streamer.h @@ -508,7 +508,7 @@ struct GTY((for_user)) lto_in_decl_state typedef struct lto_in_decl_state *lto_in_decl_state_ptr; -struct decl_state_hasher : ggc_hasher +struct decl_state_hasher : ggc_ptr_hash { static hashval_t hash (lto_in_decl_state *s) diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 5d618ab1cd0..24fd40f0f4e 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,8 @@ +2015-06-25 Richard Sandiford + + * objc-act.c (objc_string_hasher): Inherit from ggc_ptr_hash + rather than ggc_hasher. + 2015-06-25 Richard Sandiford * objc-act.c (decl_name_hash): Inherit from nofree_ptr_hash rather diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 53e50e55d64..db772605f7c 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -265,7 +265,7 @@ struct GTY((for_user)) string_descriptor { tree constructor; }; -struct objc_string_hasher : ggc_hasher +struct objc_string_hasher : ggc_ptr_hash { static hashval_t hash (string_descriptor *); static bool equal (string_descriptor *, string_descriptor *); diff --git a/gcc/optabs.c b/gcc/optabs.c index 491341b8887..8377c2267e6 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -6051,7 +6051,7 @@ gen_satfractuns_conv_libfunc (convert_optab tab, /* Hashtable callbacks for libfunc_decls. */ -struct libfunc_decl_hasher : ggc_hasher +struct libfunc_decl_hasher : ggc_ptr_hash { static hashval_t hash (tree entry) diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 1abefea69b4..676fbe8c863 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -339,7 +339,7 @@ tree chrec_dont_know; happen, then it qualifies it with chrec_known. */ tree chrec_known; -struct scev_info_hasher : ggc_hasher +struct scev_info_hasher : ggc_ptr_hash { static hashval_t hash (scev_info_str *i); static bool equal (const scev_info_str *a, const scev_info_str *b); diff --git a/gcc/varasm.c b/gcc/varasm.c index 8b4385b7856..0f87228600b 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -188,7 +188,7 @@ static GTY(()) section *unnamed_sections; ((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \ && DECL_SECTION_NAME (DECL) != NULL) -struct section_hasher : ggc_hasher
+struct section_hasher : ggc_ptr_hash
{ typedef const char *compare_type; @@ -199,7 +199,7 @@ struct section_hasher : ggc_hasher
/* Hash table of named sections. */ static GTY(()) hash_table *section_htab; -struct object_block_hasher : ggc_hasher +struct object_block_hasher : ggc_ptr_hash { typedef const section *compare_type; @@ -3539,7 +3539,7 @@ struct GTY((chain_next ("%h.next"), for_user)) constant_descriptor_rtx { int mark; }; -struct const_rtx_desc_hasher : ggc_hasher +struct const_rtx_desc_hasher : ggc_ptr_hash { static hashval_t hash (constant_descriptor_rtx *); static bool equal (constant_descriptor_rtx *, constant_descriptor_rtx *); -- 2.30.2