diff options
author | Trevor Saunders <tsaunders@mozilla.com> | 2014-06-24 13:22:11 +0000 |
---|---|---|
committer | Trevor Saunders <tbsaunde@gcc.gnu.org> | 2014-06-24 13:22:11 +0000 |
commit | 1eb68d2d011dd181aca030e98ab02f29375e89da (patch) | |
tree | e42565bc6a235c9d4d379f34d53a38e7f997cb45 /gcc/lto/lto.c | |
parent | 84baa4b968f2dbf4e85e49dba9215ad0f0f3ddc8 (diff) | |
download | gcc-1eb68d2d011dd181aca030e98ab02f29375e89da.zip gcc-1eb68d2d011dd181aca030e98ab02f29375e89da.tar.gz gcc-1eb68d2d011dd181aca030e98ab02f29375e89da.tar.bz2 |
add hash_map class
gcc/
* alloc-pool.c (alloc_pool_hash): Use hash_map instead of hash_table.
* dominance.c (iterate_fix_dominators): Use hash_map instead of
pointer_map.
* hash-map.h: New file.
* ipa-comdats.c: Use hash_map instead of pointer_map.
* ipa.c: Likewise.
* lto-section-out.c: Adjust.
* lto-streamer.h: Replace pointer_map with hash_map.
* symtab.c (verify_symtab): Likewise.
* tree-ssa-strlen.c (decl_to_stridxlist_htab): Likewise.
* tree-ssa-uncprop.c (val_ssa_equiv): Likewise.
* tree-streamer.h: Likewise.
* tree-streamer.c: Adjust.
* pointer-set.h: Remove pointer_map.
gcc/lto/
* lto.c (canonical_type_hash_cache): Use hash_map instead of
pointer_map.
From-SVN: r211938
Diffstat (limited to 'gcc/lto/lto.c')
-rw-r--r-- | gcc/lto/lto.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 1fe7ce4..5c4acc5 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-pass.h" #include "langhooks.h" #include "bitmap.h" +#include "hash-map.h" #include "ipa-prop.h" #include "common.h" #include "debug.h" @@ -261,7 +262,7 @@ lto_read_in_decl_state (struct data_in *data_in, const uint32_t *data, /* Global canonical type table. */ static htab_t gimple_canonical_types; -static pointer_map <hashval_t> *canonical_type_hash_cache; +static hash_map<const_tree, hashval_t> *canonical_type_hash_cache; static unsigned long num_canonical_type_hash_entries; static unsigned long num_canonical_type_hash_queries; @@ -405,8 +406,7 @@ static hashval_t gimple_canonical_type_hash (const void *p) { num_canonical_type_hash_queries++; - hashval_t *slot - = canonical_type_hash_cache->contains (CONST_CAST_TREE ((const_tree) p)); + hashval_t *slot = canonical_type_hash_cache->get ((const_tree) p); gcc_assert (slot != NULL); return *slot; } @@ -648,10 +648,8 @@ gimple_register_canonical_type_1 (tree t, hashval_t hash) *slot = (void *) t; /* Cache the just computed hash value. */ num_canonical_type_hash_entries++; - bool existed_p; - hashval_t *hslot = canonical_type_hash_cache->insert (t, &existed_p); + bool existed_p = canonical_type_hash_cache->put (t, hash); gcc_assert (!existed_p); - *hslot = hash; } } @@ -2917,7 +2915,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) } cgraph_state = CGRAPH_LTO_STREAMING; - canonical_type_hash_cache = new pointer_map <hashval_t>; + canonical_type_hash_cache = new hash_map<const_tree, hashval_t> (251); gimple_canonical_types = htab_create_ggc (16381, gimple_canonical_type_hash, gimple_canonical_type_eq, 0); gcc_obstack_init (&tree_scc_hash_obstack); |