From 6e2830c3dbe0d4972519ddd44bd1b15b2b274ba2 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Sat, 2 Aug 2014 11:23:49 +0000 Subject: 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 --- gcc/tree-ssa-threadedge.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'gcc/tree-ssa-threadedge.c') diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c index 9807b42..3dee5ba 100644 --- a/gcc/tree-ssa-threadedge.c +++ b/gcc/tree-ssa-threadedge.c @@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see #include "function.h" #include "timevar.h" #include "dumpfile.h" -#include "pointer-set.h" +#include "hash-set.h" #include "tree-ssa-alias.h" #include "internal-fn.h" #include "gimple-expr.h" @@ -693,13 +693,13 @@ propagate_threaded_block_debug_into (basic_block dest, basic_block src) } auto_vec fewvars; - pointer_set_t *vars = NULL; + hash_set *vars = NULL; /* If we're already starting with 3/4 of alloc_count, go for a - pointer_set, otherwise start with an unordered stack-allocated + hash_set, otherwise start with an unordered stack-allocated VEC. */ if (i * 4 > alloc_count * 3) - vars = pointer_set_create (); + vars = new hash_set; /* Now go through the initial debug stmts in DEST again, this time actually inserting in VARS or FEWVARS. Don't bother checking for @@ -720,7 +720,7 @@ propagate_threaded_block_debug_into (basic_block dest, basic_block src) gcc_unreachable (); if (vars) - pointer_set_insert (vars, var); + vars->add (var); else fewvars.quick_push (var); } @@ -754,7 +754,7 @@ propagate_threaded_block_debug_into (basic_block dest, basic_block src) or somesuch. Adding `&& bb == src' to the condition below will preserve all potentially relevant debug notes. */ - if (vars && pointer_set_insert (vars, var)) + if (vars && vars->add (var)) continue; else if (!vars) { @@ -769,11 +769,11 @@ propagate_threaded_block_debug_into (basic_block dest, basic_block src) fewvars.quick_push (var); else { - vars = pointer_set_create (); + vars = new hash_set; for (i = 0; i < alloc_count; i++) - pointer_set_insert (vars, fewvars[i]); + vars->add (fewvars[i]); fewvars.release (); - pointer_set_insert (vars, var); + vars->add (var); } } @@ -786,7 +786,7 @@ propagate_threaded_block_debug_into (basic_block dest, basic_block src) while (bb != src && single_pred_p (bb)); if (vars) - pointer_set_destroy (vars); + delete vars; else if (fewvars.exists ()) fewvars.release (); } -- cgit v1.1