From fb5c464a861887d98d709b8060002d6fc96ec6e0 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 25 Jun 2015 17:17:20 +0000 Subject: [PATCH] hash-map-traits.h (simple_hashmap_traits::key_type): New typedef. gcc/ * hash-map-traits.h (simple_hashmap_traits::key_type): New typedef. (unbounded_int_hashmap_traits::key_type): Likewise. * hash-map.h (hash_map): Get the key type from the traits. * hash-traits.h (default_hash_traits): By default, inherit from the template parameter. * alias.c (alias_set_traits): Delete. (alias_set_entry_d::children): Use alias_set_hash as the first template parameter. (record_alias_subset): Update accordingly. * except.c (tree_hash_traits): Delete. (type_to_runtime_map): Use tree_hash as the first template parameter. (init_eh): Update accordingly. * genmatch.c (capture_id_map_hasher): Delete. (cid_map_t): Use nofree_string_hash as first template parameter. * ipa-icf.h (symbol_compare_hashmap_traits): Delete. * ipa-icf.c (sem_item_optimizer::subdivide_classes_by_sensitive_refs): Use symbol_compare_hash as the first template parameter in subdivide_hash_map. * mem-stats.h (mem_usage_pair::mem_alloc_hashmap_traits): Delete. (mem_usage_pair::mem_map_t): Use mem_location_hash as the first template parameter. * passes.c (pass_registry_hasher): Delete. (name_to_pass_map): Use nofree_string_hash as the first template parameter. (register_pass_name): Update accordingly. * sanopt.c (sanopt_tree_map_traits): Delete. (sanopt_tree_triplet_map_traits): Delete. (sanopt_ctx::asan_check_map): Use tree_operand_hash as the first template parameter. (sanopt_ctx::vptr_check_map): Use sanopt_tree_triplet_hash as the first template parameter. * sese.c (rename_map_hasher): Delete. (rename_map_type): Use tree_ssa_name_hash as the first template parameter. * symbol-summary.h (function_summary::summary_hashmap_traits): Delete. (function_summary::m_map): Use map_hash as the first template parameter. (function_summary::release): Update accordingly. * tree-if-conv.c (phi_args_hash_traits): Delete. (predicate_scalar_phi): Use tree_operand_hash as the first template parameter to phi_arg_map. * tree-inline.h (dependence_hasher): Delete. (copy_body_data::dependence_map): Use dependence_hash as the first template parameter. * tree-inline.c (remap_dependence_clique): Update accordingly. * tree-ssa-strlen.c (stridxlist_hash_traits): Delete. (decl_to_stridxlist_htab): Use tree_decl_hash as the first template parameter. (addr_stridxptr): Update accordingly. * value-prof.c (profile_id_traits): Delete. (cgraph_node_map): Use profile_id_hash as the first template parameter. (init_node_map): Update accordingly. * config/alpha/alpha.c (string_traits): Delete. (machine_function::links): Use nofree_string_hash as the first template parameter. (alpha_use_linkage, alpha_write_linkage): Update accordingly. * config/m32c/m32c.c (pragma_traits): Delete. (pragma_htab): Use nofree_string_hash as the first template parameter. (m32c_note_pragma_address): Update accordingly. * config/mep/mep.c (pragma_traits): Delete. (pragma_htab): Use nofree_string_hash as the first template parameter. (mep_note_pragma_flag): Update accordingly. * config/mips/mips.c (mips16_flip_traits): Delete. (mflip_mips16_htab): Use nofree_string_hash as the first template parameter. (mflip_mips16_use_mips16_p): Update accordingly. (local_alias_traits): Delete. (mips16_local_aliases): Use nofree_string_hash as the first template parameter. (mips16_local_alias): Update accordingly. From-SVN: r224977 --- gcc/ChangeLog | 74 ++++++++++++++++++++++++++++++++++++++++ gcc/alias.c | 7 ++-- gcc/config/alpha/alpha.c | 8 ++--- gcc/config/m32c/m32c.c | 7 ++-- gcc/config/mep/mep.c | 8 ++--- gcc/config/mips/mips.c | 16 +++------ gcc/except.c | 6 ++-- gcc/genmatch.c | 4 +-- gcc/hash-map-traits.h | 12 +++---- gcc/hash-map.h | 3 +- gcc/hash-traits.h | 2 +- gcc/ipa-icf.c | 3 +- gcc/ipa-icf.h | 2 -- gcc/mem-stats.h | 3 +- gcc/passes.c | 8 ++--- gcc/sanopt.c | 9 ++--- gcc/sese.c | 3 +- gcc/symbol-summary.h | 5 ++- gcc/tree-if-conv.c | 4 +-- gcc/tree-inline.c | 3 +- gcc/tree-inline.h | 3 +- gcc/tree-ssa-strlen.c | 7 ++-- gcc/value-prof.c | 7 ++-- 23 files changed, 116 insertions(+), 88 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 216a77ed0f4..e0134e10279 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,77 @@ +2015-06-25 Richard Sandiford + + * hash-map-traits.h (simple_hashmap_traits::key_type): New typedef. + (unbounded_int_hashmap_traits::key_type): Likewise. + * hash-map.h (hash_map): Get the key type from the traits. + * hash-traits.h (default_hash_traits): By default, inherit from the + template parameter. + * alias.c (alias_set_traits): Delete. + (alias_set_entry_d::children): Use alias_set_hash as the first + template parameter. + (record_alias_subset): Update accordingly. + * except.c (tree_hash_traits): Delete. + (type_to_runtime_map): Use tree_hash as the first template parameter. + (init_eh): Update accordingly. + * genmatch.c (capture_id_map_hasher): Delete. + (cid_map_t): Use nofree_string_hash as first template parameter. + * ipa-icf.h (symbol_compare_hashmap_traits): Delete. + * ipa-icf.c (sem_item_optimizer::subdivide_classes_by_sensitive_refs): + Use symbol_compare_hash as the first template parameter in + subdivide_hash_map. + * mem-stats.h (mem_usage_pair::mem_alloc_hashmap_traits): Delete. + (mem_usage_pair::mem_map_t): Use mem_location_hash as the first + template parameter. + * passes.c (pass_registry_hasher): Delete. + (name_to_pass_map): Use nofree_string_hash as the first template + parameter. + (register_pass_name): Update accordingly. + * sanopt.c (sanopt_tree_map_traits): Delete. + (sanopt_tree_triplet_map_traits): Delete. + (sanopt_ctx::asan_check_map): Use tree_operand_hash as the first + template parameter. + (sanopt_ctx::vptr_check_map): Use sanopt_tree_triplet_hash as + the first template parameter. + * sese.c (rename_map_hasher): Delete. + (rename_map_type): Use tree_ssa_name_hash as the first template + parameter. + * symbol-summary.h (function_summary::summary_hashmap_traits): Delete. + (function_summary::m_map): Use map_hash as the first template + parameter. + (function_summary::release): Update accordingly. + * tree-if-conv.c (phi_args_hash_traits): Delete. + (predicate_scalar_phi): Use tree_operand_hash as the first template + parameter to phi_arg_map. + * tree-inline.h (dependence_hasher): Delete. + (copy_body_data::dependence_map): Use dependence_hash as the first + template parameter. + * tree-inline.c (remap_dependence_clique): Update accordingly. + * tree-ssa-strlen.c (stridxlist_hash_traits): Delete. + (decl_to_stridxlist_htab): Use tree_decl_hash as the first template + parameter. + (addr_stridxptr): Update accordingly. + * value-prof.c (profile_id_traits): Delete. + (cgraph_node_map): Use profile_id_hash as the first template + parameter. + (init_node_map): Update accordingly. + * config/alpha/alpha.c (string_traits): Delete. + (machine_function::links): Use nofree_string_hash as the first + template parameter. + (alpha_use_linkage, alpha_write_linkage): Update accordingly. + * config/m32c/m32c.c (pragma_traits): Delete. + (pragma_htab): Use nofree_string_hash as the first template parameter. + (m32c_note_pragma_address): Update accordingly. + * config/mep/mep.c (pragma_traits): Delete. + (pragma_htab): Use nofree_string_hash as the first template parameter. + (mep_note_pragma_flag): Update accordingly. + * config/mips/mips.c (mips16_flip_traits): Delete. + (mflip_mips16_htab): Use nofree_string_hash as the first template + parameter. + (mflip_mips16_use_mips16_p): Update accordingly. + (local_alias_traits): Delete. + (mips16_local_aliases): Use nofree_string_hash as the first template + parameter. + (mips16_local_alias): Update accordingly. + 2015-06-25 Richard Sandiford * hash-map-traits.h (default_hashmap_traits): Delete. diff --git a/gcc/alias.c b/gcc/alias.c index 32eb3cf77ad..ca2082e7e65 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -142,7 +142,6 @@ along with GCC; see the file COPYING3. If not see error to attempt to explicitly construct a subset of zero. */ struct alias_set_hash : int_hash {}; -struct alias_set_traits : simple_hashmap_traits {}; struct GTY(()) alias_set_entry_d { /* The alias set number, as stored in MEM_ALIAS_SET. */ @@ -155,7 +154,7 @@ struct GTY(()) alias_set_entry_d { continuing our example above, the children here will be all of `int', `double', `float', and `struct S'. */ - hash_map *children; + hash_map *children; /* Nonzero if would have a child of zero: this effectively makes this alias set the same as alias set zero. */ @@ -1134,7 +1133,7 @@ record_alias_subset (alias_set_type superset, alias_set_type subset) subset_entry = get_alias_set_entry (subset); if (!superset_entry->children) superset_entry->children - = hash_map::create_ggc (64); + = hash_map::create_ggc (64); /* If there is an entry for the subset, enter all of its children (if they are not already present) as children of the SUPERSET. */ if (subset_entry) @@ -1146,7 +1145,7 @@ record_alias_subset (alias_set_type superset, alias_set_type subset) if (subset_entry->children) { - hash_map::iterator iter + hash_map::iterator iter = subset_entry->children->begin (); for (; iter != subset_entry->children->end (); ++iter) superset_entry->children->put ((*iter).first, (*iter).second); diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 39702783584..29dfc681e34 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -4806,8 +4806,6 @@ alpha_multipass_dfa_lookahead (void) struct GTY(()) alpha_links; -typedef simple_hashmap_traits string_traits; - struct GTY(()) machine_function { /* For flag_reorder_blocks_and_partition. */ @@ -4817,7 +4815,7 @@ struct GTY(()) machine_function bool uses_condition_handler; /* Linkage entries. */ - hash_map *links; + hash_map *links; }; /* How to allocate a 'struct machine_function'. */ @@ -9544,7 +9542,7 @@ alpha_use_linkage (rtx func, bool lflag, bool rflag) } else cfun->machine->links - = hash_map::create_ggc (64); + = hash_map::create_ggc (64); if (al == NULL) { @@ -9635,7 +9633,7 @@ alpha_write_linkage (FILE *stream, const char *funname) if (cfun->machine->links) { - hash_map::iterator iter + hash_map::iterator iter = cfun->machine->links->begin (); for (; iter != cfun->machine->links->end (); ++iter) alpha_write_one_linkage ((*iter).first, (*iter).second, stream); diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 7dd175363bc..7396be5c9fa 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -3053,17 +3053,14 @@ m32c_insert_attributes (tree node ATTRIBUTE_UNUSED, } } -typedef simple_hashmap_traits pragma_traits; - /* Hash table of pragma info. */ -static GTY(()) hash_map *pragma_htab; +static GTY(()) hash_map *pragma_htab; void m32c_note_pragma_address (const char *varname, unsigned address) { if (!pragma_htab) - pragma_htab - = hash_map::create_ggc (31); + pragma_htab = hash_map::create_ggc (31); const char *name = ggc_strdup (varname); unsigned int *slot = &pragma_htab->get_or_insert (name); diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c index 3698bb06e19..bd372d872fc 100644 --- a/gcc/config/mep/mep.c +++ b/gcc/config/mep/mep.c @@ -4071,18 +4071,14 @@ struct GTY(()) pragma_entry { int flag; }; -typedef simple_hashmap_traits pragma_traits; - /* Hash table of farcall-tagged sections. */ -static GTY(()) hash_map * - pragma_htab; +static GTY(()) hash_map *pragma_htab; static void mep_note_pragma_flag (const char *funcname, int flag) { if (!pragma_htab) - pragma_htab - = hash_map::create_ggc (31); + pragma_htab = hash_map::create_ggc (31); bool existed; const char *name = ggc_strdup (funcname); diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index c8374cf95d5..367ab74c5b8 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -1263,12 +1263,9 @@ static int mips_register_move_cost (machine_mode, reg_class_t, static unsigned int mips_function_arg_boundary (machine_mode, const_tree); static machine_mode mips_get_reg_raw_mode (int regno); -struct mips16_flip_traits : simple_hashmap_traits {}; - /* This hash table keeps track of implicit "mips16" and "nomips16" attributes for -mflip_mips16. It maps decl names onto a boolean mode setting. */ -static GTY (()) hash_map * - mflip_mips16_htab; +static GTY (()) hash_map *mflip_mips16_htab; /* True if -mflip-mips16 should next add an attribute for the default MIPS16 mode, false if it should next add an attribute for the opposite mode. */ @@ -1289,8 +1286,7 @@ mflip_mips16_use_mips16_p (tree decl) return !base_is_mips16; if (!mflip_mips16_htab) - mflip_mips16_htab - = hash_map::create_ggc (37); + mflip_mips16_htab = hash_map::create_ggc (37); name = IDENTIFIER_POINTER (DECL_NAME (decl)); @@ -6589,13 +6585,10 @@ mips_load_call_address (enum mips_call_type type, rtx dest, rtx addr) } } -struct local_alias_traits : simple_hashmap_traits {}; - /* Each locally-defined hard-float MIPS16 function has a local symbol associated with it. This hash table maps the function symbol (FUNC) to the local symbol (LOCAL). */ -static GTY (()) hash_map - *mips16_local_aliases; +static GTY (()) hash_map *mips16_local_aliases; /* FUNC is the symbol for a locally-defined hard-float MIPS16 function. Return a local alias for it, creating a new one if necessary. */ @@ -6605,8 +6598,7 @@ mips16_local_alias (rtx func) { /* Create the hash table if this is the first call. */ if (mips16_local_aliases == NULL) - mips16_local_aliases - = hash_map::create_ggc (37); + mips16_local_aliases = hash_map::create_ggc (37); /* Look up the function symbol, creating a new entry if need be. */ bool existed; diff --git a/gcc/except.c b/gcc/except.c index 081b402fc50..fae85a26f19 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -163,8 +163,7 @@ along with GCC; see the file COPYING3. If not see static GTY(()) int call_site_base; -struct tree_hash_traits : simple_hashmap_traits {}; -static GTY (()) hash_map *type_to_runtime_map; +static GTY (()) hash_map *type_to_runtime_map; /* Describe the SjLj_Function_Context structure. */ static GTY(()) tree sjlj_fc_type_node; @@ -247,8 +246,7 @@ init_eh (void) if (! flag_exceptions) return; - type_to_runtime_map - = hash_map::create_ggc (31); + type_to_runtime_map = hash_map::create_ggc (31); /* Create the SjLj_Function_Context structure. This should match the definition in unwind-sjlj.c. */ diff --git a/gcc/genmatch.c b/gcc/genmatch.c index b0b92904043..195dc3cf3bc 100644 --- a/gcc/genmatch.c +++ b/gcc/genmatch.c @@ -395,9 +395,7 @@ get_operator (const char *id) return 0; } -typedef simple_hashmap_traits capture_id_map_hasher; - -typedef hash_map cid_map_t; +typedef hash_map cid_map_t; /* The AST produced by parsing of the pattern definitions. */ diff --git a/gcc/hash-map-traits.h b/gcc/hash-map-traits.h index 9cdbfbede2d..2225426e365 100644 --- a/gcc/hash-map-traits.h +++ b/gcc/hash-map-traits.h @@ -31,9 +31,9 @@ along with GCC; see the file COPYING3. If not see template struct simple_hashmap_traits { - static inline hashval_t hash (const typename H::value_type &); - static inline bool equal_keys (const typename H::value_type &, - const typename H::value_type &); + typedef typename H::value_type key_type; + static inline hashval_t hash (const key_type &); + static inline bool equal_keys (const key_type &, const key_type &); template static inline void remove (T &); template static inline bool is_empty (const T &); template static inline bool is_deleted (const T &); @@ -43,15 +43,14 @@ struct simple_hashmap_traits template inline hashval_t -simple_hashmap_traits ::hash (const typename H::value_type &h) +simple_hashmap_traits ::hash (const key_type &h) { return H::hash (h); } template inline bool -simple_hashmap_traits ::equal_keys (const typename H::value_type &k1, - const typename H::value_type &k2) +simple_hashmap_traits ::equal_keys (const key_type &k1, const key_type &k2) { return H::equal (k1, k2); } @@ -158,6 +157,7 @@ unbounded_hashmap_traits ::mark_deleted (T &entry) template struct unbounded_int_hashmap_traits : unbounded_hashmap_traits { + typedef Key key_type; static inline hashval_t hash (Key); static inline bool equal_keys (Key, Key); }; diff --git a/gcc/hash-map.h b/gcc/hash-map.h index 2f1bca4d950..cd97d354f1c 100644 --- a/gcc/hash-map.h +++ b/gcc/hash-map.h @@ -21,10 +21,11 @@ along with GCC; see the file COPYING3. If not see #ifndef hash_map_h #define hash_map_h -template class GTY((user)) hash_map { + typedef typename Traits::key_type Key; struct hash_entry { Key m_key; diff --git a/gcc/hash-traits.h b/gcc/hash-traits.h index 26da1f239b8..450354ae1d7 100644 --- a/gcc/hash-traits.h +++ b/gcc/hash-traits.h @@ -278,7 +278,7 @@ struct ggc_cache_ptr_hash : pointer_hash , ggc_cache_remove {}; struct nofree_string_hash : string_hash, typed_noop_remove {}; -template struct default_hash_traits; +template struct default_hash_traits : T {}; template struct default_hash_traits : ggc_ptr_hash {}; diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index 9a8133faa2c..1f0a55f1fa3 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -2908,8 +2908,7 @@ sem_item_optimizer::subdivide_classes_by_equality (bool in_wpa) unsigned sem_item_optimizer::subdivide_classes_by_sensitive_refs () { - typedef hash_map , - symbol_compare_hashmap_traits> subdivide_hash_map; + typedef hash_map > subdivide_hash_map; unsigned newly_created_classes = 0; diff --git a/gcc/ipa-icf.h b/gcc/ipa-icf.h index b94a38e6f4e..67d5bdc90c5 100644 --- a/gcc/ipa-icf.h +++ b/gcc/ipa-icf.h @@ -125,8 +125,6 @@ struct symbol_compare_hash : nofree_ptr_hash return true; } }; -typedef simple_hashmap_traits - symbol_compare_hashmap_traits; /* Semantic item usage pair. */ diff --git a/gcc/mem-stats.h b/gcc/mem-stats.h index a9580ab442e..a6489b50068 100644 --- a/gcc/mem-stats.h +++ b/gcc/mem-stats.h @@ -260,10 +260,9 @@ public: && l1->m_line == l2->m_line; } }; - typedef simple_hashmap_traits mem_alloc_hashmap_traits; /* Internal class type definitions. */ - typedef hash_map mem_map_t; + typedef hash_map mem_map_t; typedef hash_map > reverse_mem_map_t; typedef hash_map > reverse_object_map_t; typedef std::pair mem_list_t; diff --git a/gcc/passes.c b/gcc/passes.c index c0a90063bb8..1316193ad41 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -858,10 +858,7 @@ pass_manager::register_dump_files (opt_pass *pass) while (pass); } -typedef simple_hashmap_traits pass_registry_hasher; - -static hash_map - *name_to_pass_map; +static hash_map *name_to_pass_map; /* Register PASS with NAME. */ @@ -869,8 +866,7 @@ static void register_pass_name (opt_pass *pass, const char *name) { if (!name_to_pass_map) - name_to_pass_map - = new hash_map (256); + name_to_pass_map = new hash_map (256); if (name_to_pass_map->get (name)) return; /* Ignore plugin passes. */ diff --git a/gcc/sanopt.c b/gcc/sanopt.c index e8dfc5f6e8b..967926f0519 100644 --- a/gcc/sanopt.c +++ b/gcc/sanopt.c @@ -97,8 +97,6 @@ maybe_get_single_definition (tree t) return NULL_TREE; } -typedef simple_hashmap_traits sanopt_tree_map_traits; - /* Tree triplet for vptr_check_map. */ struct sanopt_tree_triplet { @@ -154,8 +152,6 @@ struct sanopt_tree_triplet_hash : typed_noop_remove return ref.t1 == NULL; } }; -typedef simple_hashmap_traits - sanopt_tree_triplet_map_traits; /* This is used to carry various hash maps and variables used in sanopt_optimize_walker. */ @@ -168,13 +164,12 @@ struct sanopt_ctx /* This map maps a pointer (the second argument of ASAN_CHECK) to a vector of ASAN_CHECK call statements that check the access. */ - hash_map, sanopt_tree_map_traits> asan_check_map; + hash_map > asan_check_map; /* This map maps a tree triplet (the first, second and fourth argument of UBSAN_VPTR) to a vector of UBSAN_VPTR call statements that check that virtual table pointer. */ - hash_map, - sanopt_tree_triplet_map_traits> vptr_check_map; + hash_map > vptr_check_map; /* Number of IFN_ASAN_CHECK statements. */ int asan_num_accesses; diff --git a/gcc/sese.c b/gcc/sese.c index 95ef7e80372..2ba2f980ca0 100644 --- a/gcc/sese.c +++ b/gcc/sese.c @@ -76,8 +76,7 @@ debug_rename_map_1 (tree_node *const &old_name, tree_node *const &expr, return true; } -typedef simple_hashmap_traits rename_map_hasher; -typedef hash_map rename_map_type; +typedef hash_map rename_map_type; /* Print to stderr all the elements of RENAME_MAP. */ diff --git a/gcc/symbol-summary.h b/gcc/symbol-summary.h index facb5961eb6..eefbfd912a4 100644 --- a/gcc/symbol-summary.h +++ b/gcc/symbol-summary.h @@ -83,7 +83,7 @@ public: m_symtab_duplication_hook = NULL; /* Release all summaries. */ - typedef typename hash_map ::iterator map_iterator; + typedef typename hash_map ::iterator map_iterator; for (map_iterator it = m_map.begin (); it != m_map.end (); ++it) release ((*it).second); } @@ -201,7 +201,6 @@ protected: private: typedef int_hash map_hash; - typedef simple_hashmap_traits summary_hashmap_traits; /* Getter for summary callgraph ID. */ T* get (int uid) @@ -215,7 +214,7 @@ private: } /* Main summary store, where summary ID is used as key. */ - hash_map m_map; + hash_map m_map; /* Internal summary insertion hook pointer. */ cgraph_node_hook_list *m_symtab_insertion_hook; /* Internal summary removal hook pointer. */ diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index 59853c8adde..003f1ddecd2 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -1589,8 +1589,6 @@ convert_scalar_cond_reduction (gimple reduc, gimple_stmt_iterator *gsi, return rhs; } -typedef simple_hashmap_traits phi_args_hash_traits; - /* Produce condition for all occurrences of ARG in PHI node. */ static tree @@ -1737,7 +1735,7 @@ predicate_scalar_phi (gphi *phi, gimple_stmt_iterator *gsi) /* Create hashmap for PHI node which contain vector of argument indexes having the same value. */ bool swap = false; - hash_map, phi_args_hash_traits> phi_arg_map; + hash_map > phi_arg_map; unsigned int num_args = gimple_phi_num_args (phi); int max_ind = -1; /* Vector of different PHI argument values. */ diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index ce9495de2ef..68321985ef7 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -862,8 +862,7 @@ remap_dependence_clique (copy_body_data *id, unsigned short clique) if (clique == 0) return 0; if (!id->dependence_map) - id->dependence_map - = new hash_map; + id->dependence_map = new hash_map; bool existed; unsigned short &newc = id->dependence_map->get_or_insert (clique, &existed); if (!existed) diff --git a/gcc/tree-inline.h b/gcc/tree-inline.h index 3a47d978e12..58af9cdb7ba 100644 --- a/gcc/tree-inline.h +++ b/gcc/tree-inline.h @@ -36,7 +36,6 @@ enum copy_body_cge_which }; typedef int_hash dependence_hash; -typedef simple_hashmap_traits dependence_hasher; /* Data required for function body duplication. */ @@ -148,7 +147,7 @@ struct copy_body_data /* A map from the inlined functions dependence info cliques to equivalents in the function into which it is being inlined. */ - hash_map *dependence_map; + hash_map *dependence_map; }; /* Weights of constructions for estimate_num_insns. */ diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c index 97e896315d5..d4987519721 100644 --- a/gcc/tree-ssa-strlen.c +++ b/gcc/tree-ssa-strlen.c @@ -154,12 +154,9 @@ struct decl_stridxlist_map struct stridxlist list; }; -typedef simple_hashmap_traits stridxlist_hash_traits; - /* Hash table for mapping decls to a chained list of offset -> idx mappings. */ -static hash_map - *decl_to_stridxlist_htab; +static hash_map *decl_to_stridxlist_htab; /* Obstack for struct stridxlist and struct decl_stridxlist_map. */ static struct obstack stridx_obstack; @@ -325,7 +322,7 @@ addr_stridxptr (tree exp) if (!decl_to_stridxlist_htab) { decl_to_stridxlist_htab - = new hash_map (64); + = new hash_map (64); gcc_obstack_init (&stridx_obstack); } diff --git a/gcc/value-prof.c b/gcc/value-prof.c index a84b8dae7a3..2917c30de61 100644 --- a/gcc/value-prof.c +++ b/gcc/value-prof.c @@ -1249,10 +1249,8 @@ gimple_mod_subtract_transform (gimple_stmt_iterator *si) } typedef int_hash profile_id_hash; -typedef simple_hashmap_traits profile_id_traits; -static hash_map * -cgraph_node_map = 0; +static hash_map *cgraph_node_map = 0; /* Returns true if node graph is initialized. This is used to test if profile_id has been created @@ -1272,8 +1270,7 @@ void init_node_map (bool local) { struct cgraph_node *n; - cgraph_node_map - = new hash_map; + cgraph_node_map = new hash_map; FOR_EACH_DEFINED_FUNCTION (n) if (n->has_gimple_body_p ()) -- 2.30.2