aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-family/c-common.c')
-rw-r--r--gcc/c-family/c-common.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index af50cc7..b3ec3a0 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -309,7 +309,6 @@ static bool check_case_bounds (location_t, tree, tree, tree *, tree *,
static void check_nonnull_arg (void *, tree, unsigned HOST_WIDE_INT);
static bool nonnull_check_p (tree, unsigned HOST_WIDE_INT);
-static int resort_field_decl_cmp (const void *, const void *);
/* Reserved words. The third field is a mask: keywords are disabled
if they match the mask.
@@ -5871,73 +5870,6 @@ check_builtin_function_arguments (location_t loc, vec<location_t> arg_loc,
}
}
-/* Function to help qsort sort FIELD_DECLs by name order. */
-
-int
-field_decl_cmp (const void *x_p, const void *y_p)
-{
- const tree *const x = (const tree *) x_p;
- const tree *const y = (const tree *) y_p;
-
- if (DECL_NAME (*x) == DECL_NAME (*y))
- /* A nontype is "greater" than a type. */
- return (TREE_CODE (*y) == TYPE_DECL) - (TREE_CODE (*x) == TYPE_DECL);
- if (DECL_NAME (*x) == NULL_TREE)
- return -1;
- if (DECL_NAME (*y) == NULL_TREE)
- return 1;
- if (DECL_NAME (*x) < DECL_NAME (*y))
- return -1;
- return 1;
-}
-
-static struct {
- gt_pointer_operator new_value;
- void *cookie;
-} resort_data;
-
-/* This routine compares two fields like field_decl_cmp but using the
-pointer operator in resort_data. */
-
-static int
-resort_field_decl_cmp (const void *x_p, const void *y_p)
-{
- const tree *const x = (const tree *) x_p;
- const tree *const y = (const tree *) y_p;
-
- if (DECL_NAME (*x) == DECL_NAME (*y))
- /* A nontype is "greater" than a type. */
- return (TREE_CODE (*y) == TYPE_DECL) - (TREE_CODE (*x) == TYPE_DECL);
- if (DECL_NAME (*x) == NULL_TREE)
- return -1;
- if (DECL_NAME (*y) == NULL_TREE)
- return 1;
- {
- tree d1 = DECL_NAME (*x);
- tree d2 = DECL_NAME (*y);
- resort_data.new_value (&d1, resort_data.cookie);
- resort_data.new_value (&d2, resort_data.cookie);
- if (d1 < d2)
- return -1;
- }
- return 1;
-}
-
-/* Resort DECL_SORTED_FIELDS because pointers have been reordered. */
-
-void
-resort_sorted_fields (void *obj,
- void * ARG_UNUSED (orig_obj),
- gt_pointer_operator new_value,
- void *cookie)
-{
- struct sorted_fields_type *sf = (struct sorted_fields_type *) obj;
- resort_data.new_value = new_value;
- resort_data.cookie = cookie;
- qsort (&sf->elts[0], sf->len, sizeof (tree),
- resort_field_decl_cmp);
-}
-
/* Subroutine of c_parse_error.
Return the result of concatenating LHS and RHS. RHS is really
a string literal, its first character is indicated by RHS_START and