qapi-types: Consolidate gen_struct() and gen_union()
authorEric Blake <eblake@redhat.com>
Wed, 18 Nov 2015 08:52:37 +0000 (01:52 -0700)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 17 Dec 2015 07:21:26 +0000 (08:21 +0100)
commit570cd8d1194cf68f7c9948971e52e47f20855a77
treeaf52a158262451db81f4e61b0f3a71b83d0ea91a
parentda34a9bd999d1be13954c699bbae0295cdaa3200
qapi-types: Consolidate gen_struct() and gen_union()

These two methods are now close enough that we can finally merge
them, relying on the fact that simple unions now provide a
reasonable local_members.  Change gen_struct() to gen_object()
that handles all forms of QAPISchemaObjectType, and rename and
shrink gen_union() to gen_variants() to handle the portion of
gen_object() needed when variants are present.

gen_struct_fields() now has a single caller, so it no longer
needs an optional parameter; however, I did not choose to inline
it into the caller.

No difference to generated code.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1447836791-369-3-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi-types.py