diff options
author | Geoffrey Keating <geoffk@apple.com> | 2003-08-14 03:10:49 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2003-08-14 03:10:49 +0000 |
commit | 4da6879c75da767a09b28a1e36fa19ae807738e5 (patch) | |
tree | f2335aeef6d79bb09b972a151a81ec8655d36c8b /gcc/gengtype.c | |
parent | 2842011664f2dd313ab8f5784fadc36ecb9f57cf (diff) | |
download | gcc-4da6879c75da767a09b28a1e36fa19ae807738e5.zip gcc-4da6879c75da767a09b28a1e36fa19ae807738e5.tar.gz gcc-4da6879c75da767a09b28a1e36fa19ae807738e5.tar.bz2 |
gengtype.c (walk_type): Process a subobject before processing the pointer that points to the subobject.
* gengtype.c (walk_type): Process a subobject before processing
the pointer that points to the subobject.
From-SVN: r70427
Diffstat (limited to 'gcc/gengtype.c')
-rw-r--r-- | gcc/gengtype.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/gengtype.c b/gcc/gengtype.c index 406aed3..67063ec 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -1480,12 +1480,13 @@ output_escaped_param (struct walk_type_data *d, const char *param, /* Call D->PROCESS_FIELD for every field (or subfield) of D->VAL, which is of type T. Write code to D->OF to constrain execution (at the point that D->PROCESS_FIELD is called) to the appropriate - cases. D->PREV_VAL lists the objects containing the current object, - D->OPT is a list of options to apply, D->INDENT is the current - indentation level, D->LINE is used to print error messages, - D->BITMAP indicates which languages to print the structure for, and - D->PARAM is the current parameter (from an enclosing param_is - option). */ + cases. Call D->PROCESS_FIELD on subobjects before calling it on + pointers to those objects. D->PREV_VAL lists the objects + containing the current object, D->OPT is a list of options to + apply, D->INDENT is the current indentation level, D->LINE is used + to print error messages, D->BITMAP indicates which languages to + print the structure for, and D->PARAM is the current parameter + (from an enclosing param_is option). */ static void walk_type (type_p t, struct walk_type_data *d) @@ -1622,7 +1623,6 @@ walk_type (type_p t, struct walk_type_data *d) oprintf (d->of, "%*sif (%s != NULL) {\n", d->indent, "", d->val); d->indent += 2; oprintf (d->of, "%*ssize_t i%d;\n", d->indent, "", loopcounter); - d->process_field(t, d); oprintf (d->of, "%*sfor (i%d = 0; i%d < (size_t)(", d->indent, "", loopcounter, loopcounter); output_escaped_param (d, length, "length"); @@ -1638,6 +1638,7 @@ walk_type (type_p t, struct walk_type_data *d) d->used_length = 0; d->indent -= 2; oprintf (d->of, "%*s}\n", d->indent, ""); + d->process_field(t, d); d->indent -= 2; oprintf (d->of, "%*s}\n", d->indent, ""); } |