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/ada/gcc-interface/trans.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gcc/ada/gcc-interface') diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 3323a56..77a8f87 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -36,7 +36,7 @@ #include "output.h" #include "libfuncs.h" /* For set_stack_check_libfunc. */ #include "tree-iterator.h" -#include "pointer-set.h" +#include "hash-set.h" #include "gimple-expr.h" #include "gimplify.h" #include "bitmap.h" @@ -3008,7 +3008,7 @@ struct nrv_data bitmap nrv; tree result; Node_Id gnat_ret; - struct pointer_set_t *visited; + hash_set *visited; }; /* Return true if T is a Named Return Value. */ @@ -3142,7 +3142,7 @@ finalize_nrv_r (tree *tp, int *walk_subtrees, void *data) /* Avoid walking into the same tree more than once. Unfortunately, we can't just use walk_tree_without_duplicates because it would only call us for the first occurrence of NRVs in the function body. */ - if (pointer_set_insert (dp->visited, *tp)) + if (dp->visited->add (*tp)) *walk_subtrees = 0; return NULL_TREE; @@ -3282,7 +3282,7 @@ finalize_nrv_unc_r (tree *tp, int *walk_subtrees, void *data) /* Avoid walking into the same tree more than once. Unfortunately, we can't just use walk_tree_without_duplicates because it would only call us for the first occurrence of NRVs in the function body. */ - if (pointer_set_insert (dp->visited, *tp)) + if (dp->visited->add (*tp)) *walk_subtrees = 0; return NULL_TREE; @@ -3330,13 +3330,13 @@ finalize_nrv (tree fndecl, bitmap nrv, vec *other, Node_Id gnat_ret data.nrv = nrv; data.result = DECL_RESULT (fndecl); data.gnat_ret = gnat_ret; - data.visited = pointer_set_create (); + data.visited = new hash_set; if (TYPE_RETURN_UNCONSTRAINED_P (TREE_TYPE (fndecl))) func = finalize_nrv_unc_r; else func = finalize_nrv_r; walk_tree (&DECL_SAVED_TREE (fndecl), func, &data, NULL); - pointer_set_destroy (data.visited); + delete data.visited; } /* Return true if RET_VAL can be used as a Named Return Value for the -- cgit v1.1