diff options
author | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-24 13:22:11 +0000 |
---|---|---|
committer | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-24 13:22:11 +0000 |
commit | d62dd03970a5f6e18a0479428413081d7e1d7b96 (patch) | |
tree | e42565bc6a235c9d4d379f34d53a38e7f997cb45 /gcc/dominance.c | |
parent | 2933f7af8a2a577315202dc58abaa5ed4cc808b6 (diff) | |
download | gcc-d62dd03970a5f6e18a0479428413081d7e1d7b96.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211938 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dominance.c')
-rw-r--r-- | gcc/dominance.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/dominance.c b/gcc/dominance.c index 7adec4f7376..be0a43910e6 100644 --- a/gcc/dominance.c +++ b/gcc/dominance.c @@ -43,6 +43,7 @@ #include "diagnostic-core.h" #include "et-forest.h" #include "timevar.h" +#include "hash-map.h" #include "pointer-set.h" #include "graphds.h" #include "bitmap.h" @@ -1258,7 +1259,6 @@ iterate_fix_dominators (enum cdi_direction dir, vec<basic_block> bbs, size_t dom_i; edge e; edge_iterator ei; - pointer_map<int> *map; int *parent, *son, *brother; unsigned int dir_index = dom_convert_dir_to_idx (dir); @@ -1346,15 +1346,15 @@ iterate_fix_dominators (enum cdi_direction dir, vec<basic_block> bbs, } /* Construct the graph G. */ - map = new pointer_map<int>; + hash_map<basic_block, int> map (251); FOR_EACH_VEC_ELT (bbs, i, bb) { /* If the dominance tree is conservatively correct, split it now. */ if (conservative) set_immediate_dominator (CDI_DOMINATORS, bb, NULL); - *map->insert (bb) = i; + map.put (bb, i); } - *map->insert (ENTRY_BLOCK_PTR_FOR_FN (cfun)) = n; + map.put (ENTRY_BLOCK_PTR_FOR_FN (cfun), n); g = new_graph (n + 1); for (y = 0; y < g->n_vertices; y++) @@ -1367,7 +1367,7 @@ iterate_fix_dominators (enum cdi_direction dir, vec<basic_block> bbs, if (dom == bb) continue; - dom_i = *map->contains (dom); + dom_i = *map.get (dom); /* Do not include parallel edges to G. */ if (!bitmap_set_bit ((bitmap) g->vertices[dom_i].data, i)) @@ -1378,7 +1378,6 @@ iterate_fix_dominators (enum cdi_direction dir, vec<basic_block> bbs, } for (y = 0; y < g->n_vertices; y++) BITMAP_FREE (g->vertices[y].data); - delete map; /* Find the dominator tree of G. */ son = XNEWVEC (int, n + 1); |