diff options
Diffstat (limited to 'gcc/tree-affine.c')
-rw-r--r-- | gcc/tree-affine.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c index 0b85778..5c894ea 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; } |