+2011-03-07 Nathan Froyd <froydnj@codesourcery.com>
+
+ PR c/47786
+ * c-common.c (c_type_hash): Call list_length instead of iterating
+ through DECL_CHAIN. Rename 'i' to 'n_elements'.
+
2011-02-19 Jakub Jelinek <jakub@redhat.com>
PR c/47809
static hashval_t
c_type_hash (const void *p)
{
- int i = 0;
+ int n_elements;
int shift, size;
const_tree const t = (const_tree) p;
tree t2;
default:
gcc_unreachable ();
}
- for (; t2; t2 = DECL_CHAIN (t2))
- i++;
+ /* FIXME: We want to use a DECL_CHAIN iteration method here, but
+ TYPE_VALUES of ENUMERAL_TYPEs is stored as a TREE_LIST. */
+ n_elements = list_length (t2);
/* We might have a VLA here. */
if (TREE_CODE (TYPE_SIZE (t)) != INTEGER_CST)
size = 0;
else
size = TREE_INT_CST_LOW (TYPE_SIZE (t));
- return ((size << 24) | (i << shift));
+ return ((size << 24) | (n_elements << shift));
}
static GTY((param_is (union tree_node))) htab_t type_hash_table;