+2012-10-04 Basile Starynkevitch <basile@starynkevitch.net>
+
+ * gengtype.c (walk_type): Emit mark_hook when inside a
+ struct of a union member.
+
2012-10-04 Georg-Johann Lay <avr@gjlay.de>
* config/avr/predicates.md (flash_operand): New predicate.
const char *oldval = d->val;
const char *oldprevval1 = d->prev_val[1];
const char *oldprevval2 = d->prev_val[2];
+ const char *struct_mark_hook = NULL;
const int union_p = t->kind == TYPE_UNION;
int seen_default_p = 0;
options_p o;
if (!desc && strcmp (o->name, "desc") == 0
&& o->kind == OPTION_STRING)
desc = o->info.string;
+ else if (!struct_mark_hook && strcmp (o->name, "mark_hook") == 0
+ && o->kind == OPTION_STRING)
+ struct_mark_hook = o->info.string;
+
+ if (struct_mark_hook)
+ oprintf (d->of, "%*s%s (&%s));\n",
+ d->indent, "", struct_mark_hook, oldval);
d->prev_val[2] = oldval;
d->prev_val[1] = oldprevval2;