qapi: Inline _make_implicit_tag()

Now that alternates no longer use an implicit tag, we can
inline _make_implicit_tag() into its one caller,
_def_union_type().

No change to generated code.

Backports commit 9d3f3494c5b941774e2c3e7639332d53bbe6f8be from qemu
This commit is contained in:
Lioncash 2018-02-19 21:54:40 -05:00
parent ff1c8774ff
commit a6b494dcae
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1320,11 +1320,6 @@ class QAPISchema(object):
typ, info, 'wrapper', [self._make_member('data', typ, info)])
return QAPISchemaObjectTypeVariant(case, typ)
def _make_implicit_tag(self, type_name, info, variants):
typ = self._make_implicit_enum_type(type_name, info,
[v.name for v in variants])
return QAPISchemaObjectTypeMember('type', typ, False)
def _def_union_type(self, expr, info):
name = expr['union']
data = expr['data']
@ -1338,7 +1333,9 @@ class QAPISchema(object):
else:
variants = [self._make_simple_variant(key, value, info)
for (key, value) in data.iteritems()]
tag_member = self._make_implicit_tag(name, info, variants)
typ = self._make_implicit_enum_type(name, info,
[v.name for v in variants])
tag_member = QAPISchemaObjectTypeMember('type', typ, False)
members = [tag_member]
self._def_entity(
QAPISchemaObjectType(name, info, base, members,