Commit 4da6879c by Geoffrey Keating Committed by Geoffrey Keating

gengtype.c (walk_type): Process a subobject before processing the pointer that…

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
parent 28420116
2003-08-13 Geoffrey Keating <geoffk@apple.com>
* gengtype.c (walk_type): Process a subobject before processing
the pointer that points to the subobject.
2003-08-13 Per Bothner <pbothner@apple.com> 2003-08-13 Per Bothner <pbothner@apple.com>
* regclass.c (init_reg_modes): Make non-static. * regclass.c (init_reg_modes): Make non-static.
......
...@@ -1480,12 +1480,13 @@ output_escaped_param (struct walk_type_data *d, const char *param, ...@@ -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, /* 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 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 the point that D->PROCESS_FIELD is called) to the appropriate
cases. D->PREV_VAL lists the objects containing the current object, cases. Call D->PROCESS_FIELD on subobjects before calling it on
D->OPT is a list of options to apply, D->INDENT is the current pointers to those objects. D->PREV_VAL lists the objects
indentation level, D->LINE is used to print error messages, containing the current object, D->OPT is a list of options to
D->BITMAP indicates which languages to print the structure for, and apply, D->INDENT is the current indentation level, D->LINE is used
D->PARAM is the current parameter (from an enclosing param_is to print error messages, D->BITMAP indicates which languages to
option). */ print the structure for, and D->PARAM is the current parameter
(from an enclosing param_is option). */
static void static void
walk_type (type_p t, struct walk_type_data *d) walk_type (type_p t, struct walk_type_data *d)
...@@ -1622,7 +1623,6 @@ 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); oprintf (d->of, "%*sif (%s != NULL) {\n", d->indent, "", d->val);
d->indent += 2; d->indent += 2;
oprintf (d->of, "%*ssize_t i%d;\n", d->indent, "", loopcounter); 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, "", oprintf (d->of, "%*sfor (i%d = 0; i%d < (size_t)(", d->indent, "",
loopcounter, loopcounter); loopcounter, loopcounter);
output_escaped_param (d, length, "length"); output_escaped_param (d, length, "length");
...@@ -1638,6 +1638,7 @@ walk_type (type_p t, struct walk_type_data *d) ...@@ -1638,6 +1638,7 @@ walk_type (type_p t, struct walk_type_data *d)
d->used_length = 0; d->used_length = 0;
d->indent -= 2; d->indent -= 2;
oprintf (d->of, "%*s}\n", d->indent, ""); oprintf (d->of, "%*s}\n", d->indent, "");
d->process_field(t, d);
d->indent -= 2; d->indent -= 2;
oprintf (d->of, "%*s}\n", d->indent, ""); oprintf (d->of, "%*s}\n", d->indent, "");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment