summaryrefslogtreecommitdiff
path: root/gcc/dominance.c
diff options
context:
space:
mode:
authorTrevor Saunders <tsaunders@mozilla.com>2014-06-24 13:22:11 +0000
committerTrevor Saunders <tbsaunde@gcc.gnu.org>2014-06-24 13:22:11 +0000
commit1eb68d2d011dd181aca030e98ab02f29375e89da (patch)
treee42565bc6a235c9d4d379f34d53a38e7f997cb45 /gcc/dominance.c
parent84baa4b968f2dbf4e85e49dba9215ad0f0f3ddc8 (diff)
downloadgcc-1eb68d2d011dd181aca030e98ab02f29375e89da.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. From-SVN: r211938
Diffstat (limited to 'gcc/dominance.c')
-rw-r--r--gcc/dominance.c11
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);