aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorAlastair J. Houghton <ajh8@doc.ic.ac.uk>1999-10-15 08:42:02 +0000
committerJeff Law <law@gcc.gnu.org>1999-10-15 02:42:02 -0600
commitffc3b0f915b0f510a92a0604d0ddae4b6e7dd34e (patch)
tree8bc53910e67e019a077ccea4058a4d9f91b9d391 /gcc/c-decl.c
parente57ad0c81569d506af52ff39efd2fcd9719ef53a (diff)
downloadgcc-ffc3b0f915b0f510a92a0604d0ddae4b6e7dd34e.zip
gcc-ffc3b0f915b0f510a92a0604d0ddae4b6e7dd34e.tar.gz
gcc-ffc3b0f915b0f510a92a0604d0ddae4b6e7dd34e.tar.bz2
c-parse.in (component_decl): Support anonymous struct/union.
* c-parse.in (component_decl): Support anonymous struct/union. (%expect): Update. * c-parse.y: Regenerate. * c-parse.c: Likewise. * objc/objc-parse.y: Likewise. * objc/objc-parse.c: Likewise. * c-decl.c (finish_struct): Don't sort the fields. (field_decl_cmp): Delete unused function. Co-Authored-By: Mumit Khan <khan@xraylith.wisc.edu> From-SVN: r30016
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c60
1 files changed, 0 insertions, 60 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index ca9940c..3a38c4f 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -290,7 +290,6 @@ static tree lookup_tag_reverse PROTO((tree));
static tree grokdeclarator PROTO((tree, tree, enum decl_context,
int));
static tree grokparms PROTO((tree, int));
-static int field_decl_cmp PROTO((const PTR, const PTR));
static void layout_array_type PROTO((tree));
/* C-specific option variables. */
@@ -5287,26 +5286,6 @@ grokfield (filename, line, declarator, declspecs, width)
return value;
}
-/* Function to help qsort sort FIELD_DECLs by name order. */
-
-static int
-field_decl_cmp (xp, yp)
- const PTR xp;
- const PTR yp;
-{
- tree *x = (tree *)xp, *y = (tree *)yp;
-
- if (DECL_NAME (*x) == DECL_NAME (*y))
- return 0;
- if (DECL_NAME (*x) == NULL)
- return -1;
- if (DECL_NAME (*y) == NULL)
- return 1;
- if (DECL_NAME (*x) < DECL_NAME (*y))
- return -1;
- return 1;
-}
-
/* Fill in the fields of a RECORD_TYPE or UNION_TYPE node, T.
FIELDLIST is a chain of FIELD_DECL nodes for the fields.
ATTRIBUTES are attributes to be applied to the structure.
@@ -5541,45 +5520,6 @@ finish_struct (t, fieldlist, attributes)
TYPE_FIELDS (t) = fieldlist;
- /* If there are lots of fields, sort so we can look through them fast.
- We arbitrarily consider 16 or more elts to be "a lot". */
- {
- int len = 0;
-
- for (x = fieldlist; x; x = TREE_CHAIN (x))
- {
- if (len > 15)
- break;
- len += 1;
- }
- if (len > 15)
- {
- tree *field_array;
- char *space;
-
- len += list_length (x);
- /* Use the same allocation policy here that make_node uses, to
- ensure that this lives as long as the rest of the struct decl.
- All decls in an inline function need to be saved. */
- if (ggc_p)
- space = ggc_alloc (sizeof (struct lang_type) + len * sizeof (tree));
- else if (allocation_temporary_p ())
- space = savealloc (sizeof (struct lang_type) + len * sizeof (tree));
- else
- space = oballoc (sizeof (struct lang_type) + len * sizeof (tree));
-
- TYPE_LANG_SPECIFIC (t) = (struct lang_type *) space;
- TYPE_LANG_SPECIFIC (t)->len = len;
-
- field_array = &TYPE_LANG_SPECIFIC (t)->elts[0];
- len = 0;
- for (x = fieldlist; x; x = TREE_CHAIN (x))
- field_array[len++] = x;
-
- qsort (field_array, len, sizeof (tree), field_decl_cmp);
- }
- }
-
for (x = TYPE_MAIN_VARIANT (t); x; x = TYPE_NEXT_VARIANT (x))
{
TYPE_FIELDS (x) = TYPE_FIELDS (t);