aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/openmp.c
diff options
context:
space:
mode:
authorTrevor Saunders <tsaunders@mozilla.com>2014-08-02 11:23:49 +0000
committerTrevor Saunders <tbsaunde@gcc.gnu.org>2014-08-02 11:23:49 +0000
commit6e2830c3dbe0d4972519ddd44bd1b15b2b274ba2 (patch)
treef0fb192e856fa98b7d91e225ff958dfcc1f602df /gcc/fortran/openmp.c
parent2df06cec0a2fe611c5487bf54c4ef8e3b2b30543 (diff)
downloadgcc-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/fortran/openmp.c')
-rw-r--r--gcc/fortran/openmp.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 68ba70f..410efb1 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "arith.h"
#include "match.h"
#include "parse.h"
-#include "pointer-set.h"
+#include "hash-set.h"
/* Match an end of OpenMP directive. End of OpenMP directive is optional
whitespace, followed by '\n' or comment '!'. */
@@ -3013,8 +3013,8 @@ resolve_omp_atomic (gfc_code *code)
struct omp_context
{
gfc_code *code;
- struct pointer_set_t *sharing_clauses;
- struct pointer_set_t *private_iterators;
+ hash_set<gfc_symbol *> *sharing_clauses;
+ hash_set<gfc_symbol *> *private_iterators;
struct omp_context *previous;
} *omp_current_ctx;
static gfc_code *omp_current_do_code;
@@ -3057,8 +3057,8 @@ gfc_resolve_omp_parallel_blocks (gfc_code *code, gfc_namespace *ns)
int list;
ctx.code = code;
- ctx.sharing_clauses = pointer_set_create ();
- ctx.private_iterators = pointer_set_create ();
+ ctx.sharing_clauses = new hash_set<gfc_symbol *>;
+ ctx.private_iterators = new hash_set<gfc_symbol *>;
ctx.previous = omp_current_ctx;
omp_current_ctx = &ctx;
@@ -3072,7 +3072,7 @@ gfc_resolve_omp_parallel_blocks (gfc_code *code, gfc_namespace *ns)
case OMP_LIST_REDUCTION:
case OMP_LIST_LINEAR:
for (n = omp_clauses->lists[list]; n; n = n->next)
- pointer_set_insert (ctx.sharing_clauses, n->sym);
+ ctx.sharing_clauses->add (n->sym);
break;
default:
break;
@@ -3097,8 +3097,8 @@ gfc_resolve_omp_parallel_blocks (gfc_code *code, gfc_namespace *ns)
}
omp_current_ctx = ctx.previous;
- pointer_set_destroy (ctx.sharing_clauses);
- pointer_set_destroy (ctx.private_iterators);
+ delete ctx.sharing_clauses;
+ delete ctx.private_iterators;
}
@@ -3154,10 +3154,10 @@ gfc_resolve_do_iterator (gfc_code *code, gfc_symbol *sym)
if (omp_current_ctx == NULL)
return;
- if (pointer_set_contains (omp_current_ctx->sharing_clauses, sym))
+ if (omp_current_ctx->sharing_clauses->contains (sym))
return;
- if (! pointer_set_insert (omp_current_ctx->private_iterators, sym))
+ if (! omp_current_ctx->private_iterators->add (sym))
{
gfc_omp_clauses *omp_clauses = omp_current_ctx->code->ext.omp_clauses;
gfc_omp_namelist *p;