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/gimplify.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/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 4ab36d0..c0ae7cc 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see #include "coretypes.h" #include "tree.h" #include "expr.h" +#include "hash-set.h" #include "pointer-set.h" #include "hash-table.h" #include "basic-block.h" @@ -134,7 +135,7 @@ struct gimplify_omp_ctx { struct gimplify_omp_ctx *outer_context; splay_tree variables; - struct pointer_set_t *privatized_types; + hash_set<tree> *privatized_types; location_t location; enum omp_clause_default_kind default_kind; enum omp_region_type region_type; @@ -352,7 +353,7 @@ new_omp_context (enum omp_region_type region_type) c = XCNEW (struct gimplify_omp_ctx); c->outer_context = gimplify_omp_ctxp; c->variables = splay_tree_new (splay_tree_compare_decl_uid, 0, 0); - c->privatized_types = pointer_set_create (); + c->privatized_types = new hash_set<tree>; c->location = input_location; c->region_type = region_type; if ((region_type & ORT_TASK) == 0) @@ -369,7 +370,7 @@ static void delete_omp_context (struct gimplify_omp_ctx *c) { splay_tree_delete (c->variables); - pointer_set_destroy (c->privatized_types); + delete c->privatized_types; XDELETE (c); } @@ -744,7 +745,7 @@ mostly_copy_tree_r (tree *tp, int *walk_subtrees, void *data) copy their subtrees if we can make sure to do it only once. */ if (code == SAVE_EXPR || code == TARGET_EXPR || code == BIND_EXPR) { - if (data && !pointer_set_insert ((struct pointer_set_t *)data, t)) + if (data && !((hash_set<tree> *)data)->add (t)) ; else *walk_subtrees = 0; @@ -829,15 +830,14 @@ unshare_body (tree fndecl) struct cgraph_node *cgn = cgraph_node::get (fndecl); /* If the language requires deep unsharing, we need a pointer set to make sure we don't repeatedly unshare subtrees of unshareable nodes. */ - struct pointer_set_t *visited - = lang_hooks.deep_unsharing ? pointer_set_create () : NULL; + hash_set<tree> *visited + = lang_hooks.deep_unsharing ? new hash_set<tree> : NULL; copy_if_shared (&DECL_SAVED_TREE (fndecl), visited); copy_if_shared (&DECL_SIZE (DECL_RESULT (fndecl)), visited); copy_if_shared (&DECL_SIZE_UNIT (DECL_RESULT (fndecl)), visited); - if (visited) - pointer_set_destroy (visited); + delete visited; if (cgn) for (cgn = cgn->nested; cgn; cgn = cgn->next_nested) @@ -1733,7 +1733,7 @@ gimplify_conversion (tree *expr_p) } /* Nonlocal VLAs seen in the current function. */ -static struct pointer_set_t *nonlocal_vlas; +static hash_set<tree> *nonlocal_vlas; /* The VAR_DECLs created for nonlocal VLAs for debug info purposes. */ static tree nonlocal_vla_vars; @@ -1784,7 +1784,7 @@ gimplify_var_or_parm_decl (tree *expr_p) && (ctx->region_type == ORT_WORKSHARE || ctx->region_type == ORT_SIMD)) ctx = ctx->outer_context; - if (!ctx && !pointer_set_insert (nonlocal_vlas, decl)) + if (!ctx && !nonlocal_vlas->add (decl)) { tree copy = copy_node (decl); @@ -5463,7 +5463,7 @@ omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *ctx, tree type) return; type = TYPE_MAIN_VARIANT (type); - if (pointer_set_insert (ctx->privatized_types, type)) + if (ctx->privatized_types->add (type)) return; switch (TREE_CODE (type)) @@ -8766,7 +8766,7 @@ gimplify_body (tree fndecl, bool do_parms) cgn = cgraph_node::get (fndecl); if (cgn && cgn->origin) - nonlocal_vlas = pointer_set_create (); + nonlocal_vlas = new hash_set<tree>; /* Make sure input_location isn't set to something weird. */ input_location = DECL_SOURCE_LOCATION (fndecl); @@ -8830,7 +8830,7 @@ gimplify_body (tree fndecl, bool do_parms) nonlocal_vla_vars); nonlocal_vla_vars = NULL_TREE; } - pointer_set_destroy (nonlocal_vlas); + delete nonlocal_vlas; nonlocal_vlas = NULL; } |