]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc/
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Jun 2015 17:06:36 +0000 (17:06 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Jun 2015 17:06:36 +0000 (17:06 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224959 138bc75d-0d04-0410-961f-82ee72b054a4

34 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/cfgloop.h
gcc/cgraph.c
gcc/cgraph.h
gcc/config/darwin.c
gcc/config/rs6000/rs6000.c
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/mangle.c
gcc/cp/pt.c
gcc/cp/tree.c
gcc/cp/typeck2.c
gcc/dwarf2out.c
gcc/fortran/ChangeLog
gcc/fortran/trans-decl.c
gcc/fortran/trans.h
gcc/function.c
gcc/function.h
gcc/gimple-ssa.h
gcc/hash-table.h
gcc/hash-traits.h
gcc/java/ChangeLog
gcc/java/java-tree.h
gcc/libfuncs.h
gcc/lto-streamer.h
gcc/objc/ChangeLog
gcc/objc/objc-act.c
gcc/optabs.c
gcc/tree-scalar-evolution.c
gcc/varasm.c

index b3d064e24e16411a50ca85f85eac131a4ad4d54e..9737e4ada5c8ac1fde1ee3dad726521e22f66e04 100644 (file)
@@ -1,3 +1,30 @@
+2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * 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  <richard.sandiford@arm.com>
 
        * hash-traits.h (free_ptr_hash): New class.
index 61afc6a87e54bc7819efd500cdf1426a03ee53c7..780d916b7d73346a16697e919bf4c9ea49079d12 100644 (file)
@@ -1,3 +1,8 @@
+2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * c-common.c (c_type_hasher): Inherit from ggc_ptr_hash rather than
+       ggc_hasher.
+
 2015-06-25  Andrew MacLeod  <amacleod@redhat.com>
 
        * cilk.c: Move calls.h after tm.h in the include chain.
index 5ceee5f101c1bda41d8e350003382d9ff64d1c9c..18026306f32f2971721cb0a7e35d8ef0542410f0 100644 (file)
@@ -5089,7 +5089,7 @@ c_apply_type_quals_to_decl (int type_quals, tree decl)
     }
 }
 
-struct c_type_hasher : ggc_hasher<tree>
+struct c_type_hasher : ggc_ptr_hash<tree_node>
 {
   static hashval_t hash (tree);
   static bool equal (tree, tree);
index 29b626a90edd45d65cc36789849cd1a815506d66..fe3bb921ea46f91730c09982fd51037ce1394297 100644 (file)
@@ -85,7 +85,7 @@ struct GTY ((for_user)) loop_exit {
   struct loop_exit *next_e;
 };
 
-struct loop_exit_hasher : ggc_hasher<loop_exit *>
+struct loop_exit_hasher : ggc_ptr_hash<loop_exit>
 {
   typedef edge compare_type;
 
index 60f90060187cf759c22b9dd263e00bf2eb1a249f..698f56ea549330dfb7a351264f4a906dc91fd1a0 100644 (file)
@@ -126,7 +126,7 @@ struct cgraph_2node_hook_list {
 
 /* Hash descriptor for cgraph_function_version_info.  */
 
-struct function_version_hasher : ggc_hasher<cgraph_function_version_info *>
+struct function_version_hasher : ggc_ptr_hash<cgraph_function_version_info>
 {
   static hashval_t hash (cgraph_function_version_info *);
   static bool equal (cgraph_function_version_info *,
index 62d4ad6ee7c623208838a38fc0f45a37ecf3d9e5..d4cb94d49501dae9a50470ed460fa06bd041c7c5 100644 (file)
@@ -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<section_hash_entry *>
+struct section_name_hasher : ggc_ptr_hash<section_hash_entry>
 {
   typedef const char *compare_type;
 
@@ -769,7 +769,7 @@ enum cgraph_inline_failed_type_t
 
 struct cgraph_edge;
 
-struct cgraph_edge_hasher : ggc_hasher<cgraph_edge *>
+struct cgraph_edge_hasher : ggc_ptr_hash<cgraph_edge>
 {
   typedef gimple compare_type;
 
@@ -2801,7 +2801,7 @@ varpool_node::all_refs_explicit_p ()
          && !force_output);
 }
 
-struct tree_descriptor_hasher : ggc_hasher<constant_descriptor_tree *>
+struct tree_descriptor_hasher : ggc_ptr_hash<constant_descriptor_tree>
 {
   static hashval_t hash (constant_descriptor_tree *);
   static bool equal (constant_descriptor_tree *, constant_descriptor_tree *);
index 3627ba6c2faaf074cdf00a974865d464a004af43..93c6d6734b34c99f9d434bfb5568a6c9e18135d0 100644 (file)
@@ -477,7 +477,7 @@ typedef struct GTY ((for_user)) machopic_indirection
   bool used;
 } machopic_indirection;
 
-struct indirection_hasher : ggc_hasher<machopic_indirection *>
+struct indirection_hasher : ggc_ptr_hash<machopic_indirection>
 {
   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<cfstring_descriptor *>
+struct cfstring_hasher : ggc_ptr_hash<cfstring_descriptor>
 {
   static hashval_t hash (cfstring_descriptor *);
   static bool equal (cfstring_descriptor *, cfstring_descriptor *);
index 56acc86578cf641f93fb2f0f663222407a7a3433..38442ec3b146f5fec639e6a407a46832c68a7700 100644 (file)
@@ -1228,7 +1228,7 @@ struct GTY((for_user)) toc_hash_struct
   int labelno;
 };
 
-struct toc_hasher : ggc_hasher<toc_hash_struct *>
+struct toc_hasher : ggc_ptr_hash<toc_hash_struct>
 {
   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<builtin_hash_struct *>
+struct builtin_hasher : ggc_ptr_hash<builtin_hash_struct>
 {
   static hashval_t hash (builtin_hash_struct *);
   static bool equal (builtin_hash_struct *, builtin_hash_struct *);
index 6bc2962255b2caa93ec617ed21b7ba49eab25397..338e21e1862eb055e9351d1b9b5ac569b79125ad 100644 (file)
@@ -1,3 +1,15 @@
+2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * 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  <richard.sandiford@arm.com>
 
        * class.c (fixed_type_or_null_ref_ht): Inherit from nofree_ptr_hash
index f6e2bc8508c08b4c7e38a60f9398b3df1ee4c9b6..9cb45eade41aa9c338f867251ab7a8f63f4124e1 100644 (file)
@@ -123,7 +123,7 @@ struct GTY((for_user)) constexpr_fundef {
   tree body;
 };
 
-struct constexpr_fundef_hasher : ggc_hasher<constexpr_fundef *>
+struct constexpr_fundef_hasher : ggc_ptr_hash<constexpr_fundef>
 {
   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<constexpr_call *>
+struct constexpr_call_hasher : ggc_ptr_hash<constexpr_call>
 {
   static hashval_t hash (constexpr_call *);
   static bool equal (constexpr_call *, constexpr_call *);
index b53aa9028e23f9e107f2de86264b05bf566815ec..e8cc38f97e6bf07e8359de26f79c7f8b337c1f72 100644 (file)
@@ -1181,7 +1181,7 @@ struct GTY((for_user)) cxx_int_tree_map {
   tree to;
 };
 
-struct cxx_int_tree_map_hasher : ggc_hasher<cxx_int_tree_map *>
+struct cxx_int_tree_map_hasher : ggc_ptr_hash<cxx_int_tree_map>
 {
   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<cxx_int_tree_map *>
 
 struct named_label_entry;
 
-struct named_label_hasher : ggc_hasher<named_label_entry *>
+struct named_label_hasher : ggc_ptr_hash<named_label_entry>
 {
   static hashval_t hash (named_label_entry *);
   static bool equal (named_label_entry *, named_label_entry *);
index 8f0bb34c4b6bb32a2e259bf3ff80c7e403fa9527..545f4cd9078bbde51661c39f8fcf48dfca16e4d2 100644 (file)
@@ -3331,7 +3331,7 @@ struct typename_info {
   bool class_p;
 };
 
-struct typename_hasher : ggc_hasher<tree>
+struct typename_hasher : ggc_ptr_hash<tree_node>
 {
   typedef typename_info *compare_type;
 
index 69ecb674bc34b0a37ec27b6f9384b19d22a2ead3..2fdc4b20bcef442707080fbfb42e761448b3a154 100644 (file)
@@ -3841,7 +3841,7 @@ mangle_thunk (tree fn_decl, const int this_adjusting, tree fixed_offset,
   return result;
 }
 
-struct conv_type_hasher : ggc_hasher<tree>
+struct conv_type_hasher : ggc_ptr_hash<tree_node>
 {
   static hashval_t hash (tree);
   static bool equal (tree, tree);
index b63c0d4b7dbb16b11d35b74b09556f1bbd339806..fe5fc1447426e8698431f7b385ddf2a9747da2f2 100644 (file)
@@ -89,7 +89,7 @@ struct GTY((for_user)) spec_entry
   tree spec;
 };
 
-struct spec_hasher : ggc_hasher<spec_entry *>
+struct spec_hasher : ggc_ptr_hash<spec_entry>
 {
   static hashval_t hash (spec_entry *);
   static bool equal (spec_entry *, spec_entry *);
index 3ee2f347258123df9e70acf950deae032a44dc2b..f373ddde77b330418a6d805e1c16feb9861cd339 100644 (file)
@@ -734,7 +734,7 @@ struct cplus_array_info
   tree domain;
 };
 
-struct cplus_array_hasher : ggc_hasher<tree>
+struct cplus_array_hasher : ggc_ptr_hash<tree_node>
 {
   typedef cplus_array_info *compare_type;
 
@@ -1712,7 +1712,7 @@ struct list_proxy
   tree chain;
 };
 
-struct list_hasher : ggc_hasher<tree>
+struct list_hasher : ggc_ptr_hash<tree_node>
 {
   typedef list_proxy *compare_type;
 
index 6c3aa4ca033a167c6e89265a5a38c5c23a7ce73d..30d93ed39faab32f7431ca0c6d9183ac61f1bd90 100644 (file)
@@ -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<pending_abstract_type *>
+struct abstract_type_hasher : ggc_ptr_hash<pending_abstract_type>
 {
   typedef tree compare_type;
   static hashval_t hash (pending_abstract_type *);
index 4b89d3e667d93de4148f307070c8957f2065a1fb..0f08daacf13ed911f406e693a7e57828024a3f93 100644 (file)
@@ -220,7 +220,7 @@ struct GTY((for_user)) indirect_string_node {
   unsigned int index;
 };
 
-struct indirect_string_hasher : ggc_hasher<indirect_string_node *>
+struct indirect_string_hasher : ggc_ptr_hash<indirect_string_node>
 {
   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<dwarf_file_data *>
+struct dwarf_file_hasher : ggc_ptr_hash<dwarf_file_data>
 {
   typedef const char *compare_type;
 
@@ -2807,7 +2807,7 @@ struct dwarf_file_hasher : ggc_hasher<dwarf_file_data *>
 /* Filenames referenced by this compilation unit.  */
 static GTY(()) hash_table<dwarf_file_hasher> *file_table;
 
-struct decl_die_hasher : ggc_hasher<die_node *>
+struct decl_die_hasher : ggc_ptr_hash<die_node>
 {
   typedef tree compare_type;
 
@@ -2818,7 +2818,7 @@ struct decl_die_hasher : ggc_hasher<die_node *>
    The key is a DECL_UID() which is a unique number identifying each decl.  */
 static GTY (()) hash_table<decl_die_hasher> *decl_die_table;
 
-struct block_die_hasher : ggc_hasher<die_struct *>
+struct block_die_hasher : ggc_ptr_hash<die_struct>
 {
   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<var_loc_list *>
+struct decl_loc_hasher : ggc_ptr_hash<var_loc_list>
 {
   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<cached_dw_loc_list *>
+struct dw_loc_list_hasher : ggc_ptr_hash<cached_dw_loc_list>
 {
 
   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<addr_table_entry *>
+struct addr_hasher : ggc_ptr_hash<addr_table_entry>
 {
   static hashval_t hash (addr_table_entry *);
   static bool equal (addr_table_entry *, addr_table_entry *);
index 52f24b20b7a571ad3f57510012c58bc53b9a102a..42a3064aa9d57de60100872aa6550a58f40f1329 100644 (file)
@@ -1,3 +1,8 @@
+2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * trans-decl.c (module_hasher): Likewise.
+       * trans.h (module_decl_hasher): Likewise.
+
 2015-06-24  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
        PR fortran/66528
index 1eed32d210560157ddf5c8a5714c7cf29a7f664e..09cdcd0a3ce7263b626b9709982155806ff5ea81 100644 (file)
@@ -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<module_htab_entry *>
+struct module_hasher : ggc_ptr_hash<module_htab_entry>
 {
   typedef const char *compare_type;
 
index 570b5b88e30d88d17cb469c3d10a140086af7dd0..e6180886f19997bc0d8b55e466bb87e8b0c01931 100644 (file)
@@ -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<tree_node *>
+struct module_decl_hasher : ggc_ptr_hash<tree_node>
 {
   typedef const char *compare_type;
 
index e746b3fbbe230af3a4059b6907d5601a850375b8..f6b7d30b07b82371317d18e52cb57b4216b432ec 100644 (file)
@@ -574,7 +574,7 @@ struct GTY((for_user)) temp_slot_address_entry {
   struct temp_slot *temp_slot;
 };
 
-struct temp_address_hasher : ggc_hasher<temp_slot_address_entry *>
+struct temp_address_hasher : ggc_ptr_hash<temp_slot_address_entry>
 {
   static hashval_t hash (temp_slot_address_entry *);
   static bool equal (temp_slot_address_entry *, temp_slot_address_entry *);
index f9b2468e0be8482e7b67219928e5c0f33ec81748..e286188f01841444761abdb211661f250a6f17b5 100644 (file)
@@ -415,7 +415,7 @@ struct GTY((for_user)) types_used_by_vars_entry {
   tree var_decl;
 };
 
-struct used_type_hasher : ggc_hasher<types_used_by_vars_entry *>
+struct used_type_hasher : ggc_ptr_hash<types_used_by_vars_entry>
 {
   static hashval_t hash (types_used_by_vars_entry *);
   static bool equal (types_used_by_vars_entry *, types_used_by_vars_entry *);
index 2bfcc03450e2b5007fa71c0647cc4575004babaa..25dde08315839b5179b69b9d8e21c26402f5b61f 100644 (file)
@@ -34,7 +34,7 @@ struct GTY((for_user)) tm_restart_node {
 
 /* Hasher for tm_restart_node.  */
 
-struct tm_restart_hasher : ggc_hasher<tm_restart_node *>
+struct tm_restart_hasher : ggc_ptr_hash<tm_restart_node>
 {
   static hashval_t hash (tm_restart_node *n) { return htab_hash_pointer (n); }
 
@@ -45,7 +45,7 @@ struct tm_restart_hasher : ggc_hasher<tm_restart_node *>
   }
 };
 
-struct ssa_name_hasher : ggc_hasher<tree>
+struct ssa_name_hasher : ggc_ptr_hash<tree_node>
 {
   /* Hash a tree in a uid_decl_map.  */
 
index 31440f6f44e49485e00ebc25929f8dc11990803f..3f49345a909eb34b9b2186f72fe1668e8fc4518a 100644 (file)
@@ -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.
 
index e4c182eabf2c0f79c645385c0a1e60c86e9300b1..77f88f30dc643c39cb9fed0a22ac080b6ef1bf68 100644 (file)
@@ -121,14 +121,11 @@ pointer_hash <Type>::is_empty (Type *e)
   return e == NULL;
 }
 
-/* Hasher for entry in gc memory.  */
+/* Remover and marker for entries in gc memory.  */
 
 template<typename T>
-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<typename T>
-struct ggc_cache_hasher : ggc_hasher<T>
+struct ggc_cache_hasher : ggc_remove<T>
 {
+  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 <T>, typed_noop_remove <T> {};
 template <typename T>
 struct free_ptr_hash : pointer_hash <T>, typed_free_remove <T> {};
 
+/* Traits for elements that point to gc memory.  The pointed-to data
+   must be kept across collections.  */
+
+template <typename T>
+struct ggc_ptr_hash : pointer_hash <T>, ggc_remove <T *> {};
+
 #endif
index edc2c552361abfd2dd7847c906f99aa87651b2fc..6a9330481e4790a46af44988b8d131887971a106 100644 (file)
@@ -1,3 +1,9 @@
+2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * java-tree.h (treetreehasher): Inherit from ggc_ptr_hash
+       rather than ggc_hasher.
+       (ict_hasher, type_assertion_hasher): Likewise.
+
 2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
 
        * jcf-io.c (charstar_hash): Inherit from nofree_ptr_hash rather
index 7c9a51973c8a55e5d3417ece7924f22975dad173..c29911978b61178f18b85a8c49878cc4d2db97c2 100644 (file)
@@ -714,7 +714,7 @@ struct GTY((for_user)) treetreehash_entry {
   tree value;
 };
 
-struct treetreehasher : ggc_hasher<treetreehash_entry *>
+struct treetreehasher : ggc_ptr_hash<treetreehash_entry>
 {
   typedef tree compare_type;
 
@@ -722,7 +722,7 @@ struct treetreehasher : ggc_hasher<treetreehash_entry *>
   static bool equal (treetreehash_entry *, tree);
 };
 
-struct ict_hasher : ggc_hasher<tree_node *>
+struct ict_hasher : ggc_ptr_hash<tree_node>
 {
   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<type_assertion *>
+struct type_assertion_hasher : ggc_ptr_hash<type_assertion>
 {
   static hashval_t hash (type_assertion *);
   static bool equal (type_assertion *, type_assertion *);
index a2e8414c392d7deb395b92e14bc088551098d1dd..22e6973fd2db9e93781bae538e300f359c1b1b91 100644 (file)
@@ -61,7 +61,7 @@ struct GTY((for_user)) libfunc_entry {
 
 /* Descriptor for libfunc_entry.  */
 
-struct libfunc_hasher : ggc_hasher<libfunc_entry *>
+struct libfunc_hasher : ggc_ptr_hash<libfunc_entry>
 {
   static hashval_t hash (libfunc_entry *);
   static bool equal (libfunc_entry *, libfunc_entry *);
index 1463dd99fcfb17e5a92c93fd27e8f1a836b99a79..d5a330dfa51a8dfaa5dba0361b0cc3b64acf11eb 100644 (file)
@@ -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<lto_in_decl_state *>
+struct decl_state_hasher : ggc_ptr_hash<lto_in_decl_state>
 {
   static hashval_t
   hash (lto_in_decl_state *s)
index 5d618ab1cd057c383d5c0fef6e6f5854446b17a3..24fd40f0f4e6867b92a60a0e308ad6fe8ce385e6 100644 (file)
@@ -1,3 +1,8 @@
+2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * objc-act.c (objc_string_hasher): Inherit from ggc_ptr_hash
+       rather than ggc_hasher.
+
 2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
 
        * objc-act.c (decl_name_hash): Inherit from nofree_ptr_hash rather
index 53e50e55d64fae2d967cec7af71f9d212060f263..db772605f7c5a76eec79171df8197b9866f3ef35 100644 (file)
@@ -265,7 +265,7 @@ struct GTY((for_user)) string_descriptor {
   tree constructor;
 };
 
-struct objc_string_hasher : ggc_hasher<string_descriptor *>
+struct objc_string_hasher : ggc_ptr_hash<string_descriptor>
 {
   static hashval_t hash (string_descriptor *);
   static bool equal (string_descriptor *, string_descriptor *);
index 491341b888773257293c1409f8bd77cf0ee7205d..8377c2267e6003ebc02062b2c9c24fa58aee89dc 100644 (file)
@@ -6051,7 +6051,7 @@ gen_satfractuns_conv_libfunc (convert_optab tab,
 
 /* Hashtable callbacks for libfunc_decls.  */
 
-struct libfunc_decl_hasher : ggc_hasher<tree>
+struct libfunc_decl_hasher : ggc_ptr_hash<tree_node>
 {
   static hashval_t
   hash (tree entry)
index 1abefea69b463c79638438dd8e72e52bb10d45e5..676fbe8c8639c761b8a657dd5a7e75117f64eae5 100644 (file)
@@ -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<scev_info_str *>
+struct scev_info_hasher : ggc_ptr_hash<scev_info_str>
 {
   static hashval_t hash (scev_info_str *i);
   static bool equal (const scev_info_str *a, const scev_info_str *b);
index 8b4385b78568206d54e7e82b6fa1b0ee0a9c9fad..0f87228600bb7c2b1f6b4f581387e3ff988d039b 100644 (file)
@@ -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<section *>
+struct section_hasher : ggc_ptr_hash<section>
 {
   typedef const char *compare_type;
 
@@ -199,7 +199,7 @@ struct section_hasher : ggc_hasher<section *>
 /* Hash table of named sections.  */
 static GTY(()) hash_table<section_hasher> *section_htab;
 
-struct object_block_hasher : ggc_hasher<object_block *>
+struct object_block_hasher : ggc_ptr_hash<object_block>
 {
   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<constant_descriptor_rtx *>
+struct const_rtx_desc_hasher : ggc_ptr_hash<constant_descriptor_rtx>
 {
   static hashval_t hash (constant_descriptor_rtx *);
   static bool equal (constant_descriptor_rtx *, constant_descriptor_rtx *);