From 5932ca9d11708d20bdab5ac96f71ccc5abcf2951 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Tue, 21 Nov 2006 00:16:45 +0000 Subject: [PATCH] gengtype.c (process_gc_options): Remove unnecessary forward decl. * gengtype.c (process_gc_options): Remove unnecessary forward decl. Add another out parameter, "skip". (set_gc_used_type): Adjust calls to process_gc_options. If a field is tagged "skip", do not mark its type used. From-SVN: r119034 --- gcc/ChangeLog | 7 +++++++ gcc/gengtype.c | 13 ++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2a6a7e276cc..896ac0e0243 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2006-11-20 Zack Weinberg + + * gengtype.c (process_gc_options): Remove unnecessary forward decl. + Add another out parameter, "skip". + (set_gc_used_type): Adjust calls to process_gc_options. If a field + is tagged "skip", do not mark its type used. + 2006-11-20 Andrew Pinski PR tree-opt/25500 diff --git a/gcc/gengtype.c b/gcc/gengtype.c index 1464c5f26af..f62659ada47 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -869,8 +869,6 @@ note_yacc_type (options_p o, pair_p fields, pair_p typeinfo, do_typedef ("YYSTYPE", new_structure ("yy_union", 1, pos, typeinfo, o), pos); } -static void process_gc_options (options_p, enum gc_used_enum, - int *, int *, int *, type_p *); static void set_gc_used_type (type_p, enum gc_used_enum, type_p *); static void set_gc_used (pair_p); @@ -878,7 +876,7 @@ static void set_gc_used (pair_p); static void process_gc_options (options_p opt, enum gc_used_enum level, int *maybe_undef, - int *pass_param, int *length, type_p *nested_ptr) + int *pass_param, int *length, int *skip, type_p *nested_ptr) { options_p o; for (o = opt; o; o = o->next) @@ -890,6 +888,8 @@ process_gc_options (options_p opt, enum gc_used_enum level, int *maybe_undef, *pass_param = 1; else if (strcmp (o->name, "length") == 0) *length = 1; + else if (strcmp (o->name, "skip") == 0) + *skip = 1; else if (strcmp (o->name, "nested_ptr") == 0) *nested_ptr = ((const struct nested_ptr_data *) o->info)->type; } @@ -913,7 +913,7 @@ set_gc_used_type (type_p t, enum gc_used_enum level, type_p param[NUM_PARAM]) int dummy; type_p dummy2; - process_gc_options (t->u.s.opt, level, &dummy, &dummy, &dummy, + process_gc_options (t->u.s.opt, level, &dummy, &dummy, &dummy, &dummy, &dummy2); for (f = t->u.s.fields; f; f = f->next) @@ -921,9 +921,10 @@ set_gc_used_type (type_p t, enum gc_used_enum level, type_p param[NUM_PARAM]) int maybe_undef = 0; int pass_param = 0; int length = 0; + int skip = 0; type_p nested_ptr = NULL; process_gc_options (f->opt, level, &maybe_undef, &pass_param, - &length, &nested_ptr); + &length, &skip, &nested_ptr); if (nested_ptr && f->type->kind == TYPE_POINTER) set_gc_used_type (nested_ptr, GC_POINTED_TO, @@ -935,6 +936,8 @@ set_gc_used_type (type_p t, enum gc_used_enum level, type_p param[NUM_PARAM]) else if (pass_param && f->type->kind == TYPE_POINTER && param) set_gc_used_type (find_param_structure (f->type->u.p, param), GC_POINTED_TO, NULL); + else if (skip) + ; /* target type is not used through this field */ else set_gc_used_type (f->type, GC_USED, pass_param ? param : NULL); }