public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com
Subject: Re: [12/12] Simplify uses of hash_map
Date: Thu, 25 Jun 2015 16:57:00 -0000	[thread overview]
Message-ID: <558C3091.5050607@redhat.com> (raw)
In-Reply-To: <87twty8ob7.fsf@e105548-lin.cambridge.arm.com>

On 06/23/2015 08:57 AM, Richard Sandiford wrote:
> At this point all hash_map traits know what kind of key they're
> dealing with, so we can make that a traits typedef, like it is for
> hash_table traits.  Then, if we make the default hash traits for
> T be T, we can use hash_table-style traits as the first template
> parameter to hash_map, without the need for a third.  That is, if
> foo_hash hashes elements of type foo_type:
>
>    typedef simple_hashmap_traits <foo_hash> foo_traits;
>    hash_map <foo_type, value_type, foo_traits> x;
>
> becomes just:
>
>    hash_map <foo_hash, value_type> x;
>
> just like a hash_table of foo_types would be:
>
>    hash_table <foo_hash> y;
>
> This patch makes that simplification.
>
>
> 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.
Phew.  OK.

jeff

  reply	other threads:[~2015-06-25 16:47 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87egl2bicm.fsf@e105548-lin.cambridge.arm.com>
2015-06-23 14:44 ` [01/12] Add hash_map traits that use existing hash_table-like traits Richard Sandiford
2015-06-25 16:34   ` Jeff Law
2015-06-23 14:45 ` [02/12] Move tree operand hashers to a new header file Richard Sandiford
2015-06-25 16:34   ` Jeff Law
2015-06-23 14:47 ` [03/12] Move decl hasher to " Richard Sandiford
2015-06-25 16:34   ` Jeff Law
2015-06-23 14:48 ` [04/12] Move ssa_name " Richard Sandiford
2015-06-25 16:35   ` Jeff Law
2015-06-23 14:49 ` [05/12] Move TREE_HASH " Richard Sandiford
2015-06-25 16:36   ` Jeff Law
2015-06-23 14:50 ` [06/12] Consolidate string hashers Richard Sandiford
2015-06-24 10:13   ` Mikhail Maltsev
2015-06-24 11:39     ` Richard Sandiford
2015-06-25 16:37   ` Jeff Law
2015-06-23 14:52 ` [07/12] Use new string hasher for MIPS Richard Sandiford
2015-06-25 16:39   ` Jeff Law
2015-06-23 14:53 ` [08/12] Add common traits for integer hash keys Richard Sandiford
2015-06-25 16:40   ` Jeff Law
2015-06-23 14:55 ` [09/12] Remove all but one use of default_hashmap_traits Richard Sandiford
2015-06-25 16:41   ` Jeff Law
2015-06-23 14:56 ` [10/12] Add helper class for valued-based empty and deleted slots Richard Sandiford
2015-06-25 16:41   ` Jeff Law
2015-06-23 14:57 ` [11/12] Remove default_hashmap_traits Richard Sandiford
2015-06-25 16:42   ` Jeff Law
2015-06-23 14:58 ` [12/12] Simplify uses of hash_map Richard Sandiford
2015-06-25 16:57   ` Jeff Law [this message]
2015-06-26 13:50     ` Rainer Orth
2015-06-26 14:38       ` Richard Sandiford
2015-06-26 14:39         ` Jan-Benedict Glaw
2015-06-26 15:34         ` Rainer Orth
2015-06-26 16:17           ` Richard Sandiford
2015-06-26 16:45             ` Richard Sandiford
2015-06-26 17:03               ` Richard Sandiford
2015-06-26 16:09       ` Mikhail Maltsev
2015-06-26 14:36   ` [BUILDROBOT] could not convert template argument ‘fill_decls_vec’ to ‘bool (*)(tree_node*&, tree_node**, auto_vec<cilk_decls>*)’ (was: [12/12] Simplify uses of hash_map) Jan-Benedict Glaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=558C3091.5050607@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).