unicorn/qemu/scripts
Eric Blake b7886e2d59
qapi: Track simple union tag in object.local_members
We were previously creating all unions with an empty list for
local_members. However, it will make it easier to unify struct
and union generation if we include the generated tag member in
local_members. That way, we can have a common code pattern:
visit the base (if any), visit the local members (if any), visit
the variants (if any). The local_members of a flat union
remains empty (because the discriminator is already visited as
part of the base). Then, by visiting tag_member.check() during
AlternateType.check(), we no longer need to call it during
Variants.check().

The various front end entities now exist as follows:
struct: optional base, optional local_members, no variants
simple union: no base, one-element local_members, variants with tag_member
from local_members
flat union: base, no local_members, variants with tag_member from base
alternate: no base, no local_members, variants

With the new local members, we require a bit of finesse to
avoid assertions in the clients.

No change to generated code.

Backports commit da34a9bd999d1be13954c699bbae0295cdaa3200 from qemu
2018-02-19 20:02:03 -05:00
..
create_config more cleanup qemu/configure 2017-01-19 14:11:54 +08:00
make_device_config.sh
ordereddict.py
qapi-event.py qapi: Share gen_visit_fields() 2018-02-19 18:41:41 -05:00
qapi-types.py qapi: Track simple union tag in object.local_members 2018-02-19 20:02:03 -05:00
qapi-visit.py qapi: Track simple union tag in object.local_members 2018-02-19 20:02:03 -05:00
qapi.py qapi: Track simple union tag in object.local_members 2018-02-19 20:02:03 -05:00