diff options
author | Trevor Saunders <tsaunders@mozilla.com> | 2014-08-02 11:34:54 +0000 |
---|---|---|
committer | Trevor Saunders <tbsaunde@gcc.gnu.org> | 2014-08-02 11:34:54 +0000 |
commit | b787e7a2c2c9be2f548d4c76ec324b71859851a4 (patch) | |
tree | b20f9df1d7e2cb3a642d2fab604f827c7d23712a /gcc/tree-ssa-loop-ivopts.c | |
parent | 6e2830c3dbe0d4972519ddd44bd1b15b2b274ba2 (diff) | |
download | gcc-b787e7a2c2c9be2f548d4c76ec324b71859851a4.tar.gz |
convert many uses of pointer_map to hash_map
gcc/c-family/
* cilk.c: Use hash_map instead of pointer_map.
gcc/c/
* c-typeck.c: Use hash_map instead of pointer_map.
gcc/cp/
* optimize.c, semantics.c: Use hash_map instead of pointer_map.
gcc/
* hash-map.h (default_hashmap_traits::mark_key_deleted):
Fix cast.
(hash_map::remove): New method.
(hash_map::traverse): New method.
* cgraph.h, except.c, except.h, gimple-ssa-strength-reduction.c,
ipa-utils.c, lto-cgraph.c, lto-streamer.h, omp-low.c, predict.c,
tree-cfg.c, tree-cfgcleanup.c, tree-eh.c, tree-eh.h, tree-inline.c,
tree-inline.h, tree-nested.c, tree-sra.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-reassoc.c, tree-ssa-structalias.c,
tree-ssa.c, tree-ssa.h, var-tracking.c: Use hash_map instead of
pointer_map.
From-SVN: r213517
Diffstat (limited to 'gcc/tree-ssa-loop-ivopts.c')
-rw-r--r-- | gcc/tree-ssa-loop-ivopts.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 3b4a6cdf24c..158a0814d69 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -70,7 +70,7 @@ along with GCC; see the file COPYING3. If not see #include "tm_p.h" #include "basic-block.h" #include "gimple-pretty-print.h" -#include "pointer-set.h" +#include "hash-map.h" #include "hash-table.h" #include "tree-ssa-alias.h" #include "internal-fn.h" @@ -293,7 +293,7 @@ struct ivopts_data struct loop *current_loop; /* Numbers of iterations for all exits of the current loop. */ - struct pointer_map_t *niters; + hash_map<edge, tree_niter_desc *> *niters; /* Number of registers used in it. */ unsigned regs_used; @@ -814,15 +814,15 @@ static struct tree_niter_desc * niter_for_exit (struct ivopts_data *data, edge exit) { struct tree_niter_desc *desc; - void **slot; + tree_niter_desc **slot; if (!data->niters) { - data->niters = pointer_map_create (); + data->niters = new hash_map<edge, tree_niter_desc *>; slot = NULL; } else - slot = pointer_map_contains (data->niters, exit); + slot = data->niters->get (exit); if (!slot) { @@ -837,11 +837,10 @@ niter_for_exit (struct ivopts_data *data, edge exit) XDELETE (desc); desc = NULL; } - slot = pointer_map_insert (data->niters, exit); - *slot = desc; + data->niters->put (exit, desc); } else - desc = (struct tree_niter_desc *) *slot; + desc = *slot; return desc; } @@ -6704,15 +6703,12 @@ remove_unused_ivs (struct ivopts_data *data) } /* Frees memory occupied by struct tree_niter_desc in *VALUE. Callback - for pointer_map_traverse. */ + for hash_map::traverse. */ -static bool -free_tree_niter_desc (const void *key ATTRIBUTE_UNUSED, void **value, - void *data ATTRIBUTE_UNUSED) +bool +free_tree_niter_desc (edge const &, tree_niter_desc *const &value, void *) { - struct tree_niter_desc *const niter = (struct tree_niter_desc *) *value; - - free (niter); + free (value); return true; } @@ -6727,8 +6723,8 @@ free_loop_data (struct ivopts_data *data) if (data->niters) { - pointer_map_traverse (data->niters, free_tree_niter_desc, NULL); - pointer_map_destroy (data->niters); + data->niters->traverse<void *, free_tree_niter_desc> (NULL); + delete data->niters; data->niters = NULL; } |