diff options
author | Trevor Saunders <tsaunders@mozilla.com> | 2014-08-02 11:23:49 +0000 |
---|---|---|
committer | Trevor Saunders <tbsaunde@gcc.gnu.org> | 2014-08-02 11:23:49 +0000 |
commit | 6e2830c3dbe0d4972519ddd44bd1b15b2b274ba2 (patch) | |
tree | f0fb192e856fa98b7d91e225ff958dfcc1f602df /gcc/tree-ssa-loop-niter.c | |
parent | 2df06cec0a2fe611c5487bf54c4ef8e3b2b30543 (diff) | |
download | gcc-6e2830c3dbe0d4972519ddd44bd1b15b2b274ba2.zip gcc-6e2830c3dbe0d4972519ddd44bd1b15b2b274ba2.tar.gz gcc-6e2830c3dbe0d4972519ddd44bd1b15b2b274ba2.tar.bz2 |
add a hash_set based on hash_table
This allows us to replace the usage of pointer_set outside of
pointer_map with a nicer interface.
gcc/ada/
* gcc-interface/trans.c: Use hash_set instead of pointer_set.
gcc/c-family/
* c-gimplify.c: Use hash_set instead of pointer_set.
gcc/c/
* c-decl.c: Use hash_set instead of pointer_set.
gcc/cp/
* class.c, cp-gimplify.c, cp-tree.h, decl.c, decl2.c, error.c,
method.c, name-lookup.c, pt.c, semantics.c, tree.c: Use hash_set
instead of pointer_set.
gcc/fortran/
* openmp.c, trans-decl.c: Use hash_set instead of pointer_set.
gcc/
* hash-set.h: new File.
* cfgexpand.c, cfgloop.c, cgraph.c, cgraphbuild.c, cgraphunit.c,
cprop.c, cse.c, gimple-walk.c, gimple-walk.h, gimplify.c, godump.c,
ipa-devirt.c, ipa-pure-const.c, ipa-visibility.c, ipa.c, lto-cgraph.c,
lto-streamer-out.c, stmt.c, tree-cfg.c, tree-core.h, tree-eh.c,
tree-inline.c, tree-inline.h, tree-nested.c, tree-pretty-print.c,
tree-ssa-loop-niter.c, tree-ssa-phiopt.c, tree-ssa-threadedge.c,
tree-ssa-uninit.c, tree.c, tree.h, value-prof.c, varasm.c,
varpool.c: Use hash_set instead of pointer_set.
gcc/lto/
* lto-partition.c, lto-partition.h: Use hash_set instead of
pointer_set.
From-SVN: r213516
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r-- | gcc/tree-ssa-loop-niter.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 36d68a8..83c1b19 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see #include "basic-block.h" #include "gimple-pretty-print.h" #include "intl.h" +#include "hash-set.h" #include "pointer-set.h" #include "tree-ssa-alias.h" #include "internal-fn.h" @@ -3281,7 +3282,7 @@ discover_iteration_bound_by_body_walk (struct loop *loop) static void maybe_lower_iteration_bound (struct loop *loop) { - pointer_set_t *not_executed_last_iteration = NULL; + hash_set<gimple> *not_executed_last_iteration = NULL; struct nb_iter_bound *elt; bool found_exit = false; vec<basic_block> queue = vNULL; @@ -3300,8 +3301,8 @@ maybe_lower_iteration_bound (struct loop *loop) && wi::ltu_p (elt->bound, loop->nb_iterations_upper_bound)) { if (!not_executed_last_iteration) - not_executed_last_iteration = pointer_set_create (); - pointer_set_insert (not_executed_last_iteration, elt->stmt); + not_executed_last_iteration = new hash_set<gimple>; + not_executed_last_iteration->add (elt->stmt); } } if (!not_executed_last_iteration) @@ -3327,7 +3328,7 @@ maybe_lower_iteration_bound (struct loop *loop) for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) { gimple stmt = gsi_stmt (gsi); - if (pointer_set_contains (not_executed_last_iteration, stmt)) + if (not_executed_last_iteration->contains (stmt)) { stmt_found = true; break; @@ -3376,7 +3377,7 @@ maybe_lower_iteration_bound (struct loop *loop) } BITMAP_FREE (visited); queue.release (); - pointer_set_destroy (not_executed_last_iteration); + delete not_executed_last_iteration; } /* Records estimates on numbers of iterations of LOOP. If USE_UNDEFINED_P |