aboutsummaryrefslogtreecommitdiff
path: root/gcc/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/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/c')
-rw-r--r--gcc/c/ChangeLog4
-rw-r--r--gcc/c/c-decl.c24
2 files changed, 14 insertions, 14 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 186a19d..c8c957d 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,7 @@
+2014-08-02 Trevor Saunders <tsaunders@mozilla.com>
+
+ * c-decl.c: Use hash_set instead of pointer_set.
+
2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
PR middle-end/61455
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 2a4b439..050ddff 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -59,7 +59,7 @@ along with GCC; see the file COPYING3. If not see
#include "cgraph.h"
#include "hash-table.h"
#include "langhooks-def.h"
-#include "pointer-set.h"
+#include "hash-set.h"
#include "plugin.h"
#include "c-family/c-ada-spec.h"
#include "cilk.h"
@@ -7221,17 +7221,17 @@ warn_cxx_compat_finish_struct (tree fieldlist)
if (!struct_parse_info->typedefs_seen.is_empty ()
&& fieldlist != NULL_TREE)
{
- /* Use a pointer_set using the name of the typedef. We can use
- a pointer_set because identifiers are interned. */
- struct pointer_set_t *tset = pointer_set_create ();
+ /* Use a hash_set<tree> using the name of the typedef. We can use
+ a hash_set<tree> because identifiers are interned. */
+ hash_set<tree> tset;
FOR_EACH_VEC_ELT (struct_parse_info->typedefs_seen, ix, x)
- pointer_set_insert (tset, DECL_NAME (x));
+ tset.add (DECL_NAME (x));
for (x = fieldlist; x != NULL_TREE; x = DECL_CHAIN (x))
{
if (DECL_NAME (x) != NULL_TREE
- && pointer_set_contains (tset, DECL_NAME (x)))
+ && tset.contains (DECL_NAME (x)))
{
warning_at (DECL_SOURCE_LOCATION (x), OPT_Wc___compat,
("using %qD as both field and typedef name is "
@@ -7241,8 +7241,6 @@ warn_cxx_compat_finish_struct (tree fieldlist)
the typedef name is used. */
}
}
-
- pointer_set_destroy (tset);
}
/* For each field which has a binding and which was not defined in
@@ -8189,7 +8187,7 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
struct c_binding *b;
tree parm, decl, last;
tree parmids = arg_info->parms;
- struct pointer_set_t *seen_args = pointer_set_create ();
+ hash_set<tree> seen_args;
if (!in_system_header_at (input_location))
warning_at (DECL_SOURCE_LOCATION (fndecl),
@@ -8220,7 +8218,7 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
"%qD declared as a non-parameter", decl);
/* If the declaration is already marked, we have a duplicate
name. Complain and ignore the duplicate. */
- else if (pointer_set_contains (seen_args, decl))
+ else if (seen_args.contains (decl))
{
error_at (DECL_SOURCE_LOCATION (decl),
"multiple parameters named %qD", decl);
@@ -8269,7 +8267,7 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
}
TREE_PURPOSE (parm) = decl;
- pointer_set_insert (seen_args, decl);
+ seen_args.add (decl);
}
/* Now examine the parms chain for incomplete declarations
@@ -8289,7 +8287,7 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
TREE_TYPE (parm) = error_mark_node;
}
- if (!pointer_set_contains (seen_args, parm))
+ if (!seen_args.contains (parm))
{
error_at (DECL_SOURCE_LOCATION (parm),
"declaration for parameter %qD but no such parameter",
@@ -8324,8 +8322,6 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
DECL_CHAIN (last) = 0;
}
- pointer_set_destroy (seen_args);
-
/* If there was a previous prototype,
set the DECL_ARG_TYPE of each argument according to
the type previously specified, and report any mismatches. */