summaryrefslogtreecommitdiff
path: root/gcc/gengtype.c
diff options
context:
space:
mode:
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2003-08-14 03:10:49 +0000
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2003-08-14 03:10:49 +0000
commitb14c913109caaec572866fa0398823f72efe8a6a (patch)
treef2335aeef6d79bb09b972a151a81ec8655d36c8b /gcc/gengtype.c
parentc235b58a9960d521ea6a36f5a1deb0821dced436 (diff)
downloadgcc-b14c913109caaec572866fa0398823f72efe8a6a.tar.gz
* gengtype.c (walk_type): Process a subobject before processing
the pointer that points to the subobject. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70427 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gengtype.c')
-rw-r--r--gcc/gengtype.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index 406aed319c9..67063ecb1c6 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, "");
}