summaryrefslogtreecommitdiff
path: root/gcc/tree-affine.c
diff options
context:
space:
mode:
authorTrevor Saunders <tsaunders@mozilla.com>2014-08-07 10:44:14 +0000
committerTrevor Saunders <tbsaunde@gcc.gnu.org>2014-08-07 10:44:14 +0000
commit39c8aaa4bfab14d348ffbe515b332f03383eb1e9 (patch)
treee1ee8dbd0c20ebb30d7feede4036d428ac99a76f /gcc/tree-affine.c
parent66b5e890ec57bcd04ccde2b69cdd88810697667e (diff)
convert the rest of the users of pointer_map to hash_map
gcc/ * hash-map.h (default_hashmap_traits): Adjust overloads of hash function to not conflict. * alias.c, cfgexpand.c, dse.c, except.h, gimple-expr.c, gimple-ssa-strength-reduction.c, gimple-ssa.h, ifcvt.c, lto-streamer-out.c, lto-streamer.h, tree-affine.c, tree-affine.h, tree-predcom.c, tree-scalar-evolution.c, tree-ssa-loop-im.c, tree-ssa-loop-niter.c, tree-ssa.c, value-prof.c: Use hash_map instead of pointer_map. gcc/cp/ * cp-tree.h, pt.c: Use hash_map instead of pointer_map. gcc/lto/ * lto-partition.c, lto.c: Use hash_map instead of pointer_map. From-SVN: r213703
Diffstat (limited to 'gcc/tree-affine.c')
-rw-r--r--gcc/tree-affine.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c
index 0b8577836d6..5c894ea6f78 100644
--- a/gcc/tree-affine.c
+++ b/gcc/tree-affine.c
@@ -621,14 +621,13 @@ struct name_expansion
void
aff_combination_expand (aff_tree *comb ATTRIBUTE_UNUSED,
- struct pointer_map_t **cache ATTRIBUTE_UNUSED)
+ hash_map<tree, name_expansion *> **cache)
{
unsigned i;
aff_tree to_add, current, curre;
tree e, rhs;
gimple def;
widest_int scale;
- void **slot;
struct name_expansion *exp;
aff_combination_zero (&to_add, comb->type);
@@ -664,9 +663,9 @@ aff_combination_expand (aff_tree *comb ATTRIBUTE_UNUSED,
continue;
if (!*cache)
- *cache = pointer_map_create ();
- slot = pointer_map_insert (*cache, e);
- exp = (struct name_expansion *) *slot;
+ *cache = new hash_map<tree, name_expansion *>;
+ name_expansion **slot = &(*cache)->get_or_insert (e);
+ exp = *slot;
if (!exp)
{
@@ -732,22 +731,19 @@ aff_combination_expand (aff_tree *comb ATTRIBUTE_UNUSED,
void
tree_to_aff_combination_expand (tree expr, tree type, aff_tree *comb,
- struct pointer_map_t **cache)
+ hash_map<tree, name_expansion *> **cache)
{
tree_to_aff_combination (expr, type, comb);
aff_combination_expand (comb, cache);
}
/* Frees memory occupied by struct name_expansion in *VALUE. Callback for
- pointer_map_traverse. */
+ hash_map::traverse. */
-static bool
-free_name_expansion (const void *key ATTRIBUTE_UNUSED, void **value,
- void *data ATTRIBUTE_UNUSED)
+bool
+free_name_expansion (tree const &, name_expansion **value, void *)
{
- struct name_expansion *const exp = (struct name_expansion *) *value;
-
- free (exp);
+ free (*value);
return true;
}
@@ -755,13 +751,13 @@ free_name_expansion (const void *key ATTRIBUTE_UNUSED, void **value,
tree_to_aff_combination_expand. */
void
-free_affine_expand_cache (struct pointer_map_t **cache)
+free_affine_expand_cache (hash_map<tree, name_expansion *> **cache)
{
if (!*cache)
return;
- pointer_map_traverse (*cache, free_name_expansion, NULL);
- pointer_map_destroy (*cache);
+ (*cache)->traverse<void *, free_name_expansion> (NULL);
+ delete (*cache);
*cache = NULL;
}