qapi: Create simple union type member earlier
commit46292ba75c515baf733df18644052b2ce9492728
authorEric Blake <eblake@redhat.com>
Tue, 13 Oct 2015 04:22:29 +0000 (12 22:22 -0600)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 15 Oct 2015 06:39:08 +0000 (15 08:39 +0200)
treee2338c12c4ff9ae52c8d1d1861c1ef93526ed840
parent9f08c8ec73878122ad4b061ed334f0437afaaa32
qapi: Create simple union type member earlier

For simple unions, we were creating the implicit 'type' tag
member during the QAPISchemaObjectTypeVariants constructor.
This is different from every other implicit QAPISchemaEntity
object, which get created by QAPISchema methods.  Hoist the
creation to the caller (renaming _make_tag_enum() to
_make_implicit_tag()), and pass the entity rather than the
string name, so that we have the nice property that no
entities are created as a side effect within a different
entity.  A later patch will then have an easier time of
associating location info with each entity creation.

No change to generated code.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1444710158-8723-10-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi.py