aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c/c-decl.c')
-rw-r--r--gcc/c/c-decl.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index a4a8108..80867ca 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -53,7 +53,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-core.h"
#include "dumpfile.h"
#include "cgraph.h"
-#include "hashtab.h"
+#include "hash-table.h"
#include "langhooks-def.h"
#include "pointer-set.h"
#include "plugin.h"
@@ -6895,15 +6895,16 @@ is_duplicate_field (tree x, tree y)
to HTAB, giving errors for any duplicates. */
static void
-detect_field_duplicates_hash (tree fieldlist, htab_t htab)
+detect_field_duplicates_hash (tree fieldlist,
+ hash_table <pointer_hash <tree_node> > htab)
{
tree x, y;
- void **slot;
+ tree_node **slot;
for (x = fieldlist; x ; x = DECL_CHAIN (x))
if ((y = DECL_NAME (x)) != 0)
{
- slot = htab_find_slot (htab, y, INSERT);
+ slot = htab.find_slot (y, INSERT);
if (*slot)
{
error ("duplicate member %q+D", x);
@@ -6923,7 +6924,7 @@ detect_field_duplicates_hash (tree fieldlist, htab_t htab)
&& TREE_CODE (TYPE_NAME (TREE_TYPE (x))) == TYPE_DECL)
{
tree xn = DECL_NAME (TYPE_NAME (TREE_TYPE (x)));
- slot = htab_find_slot (htab, xn, INSERT);
+ slot = htab.find_slot (xn, INSERT);
if (*slot)
error ("duplicate member %q+D", TYPE_NAME (TREE_TYPE (x)));
*slot = xn;
@@ -6995,10 +6996,11 @@ detect_field_duplicates (tree fieldlist)
}
else
{
- htab_t htab = htab_create (37, htab_hash_pointer, htab_eq_pointer, NULL);
+ hash_table <pointer_hash <tree_node> > htab;
+ htab.create (37);
detect_field_duplicates_hash (fieldlist, htab);
- htab_delete (htab);
+ htab.dispose ();
}
}