diff options
author | Eric Blake <eblake@redhat.com> | 2015-12-01 22:20:50 -0700 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:28:19 -0600 |
commit | 68dfce67bc7a7c18cfc1d45090f17a34f061ef0b (patch) | |
tree | 7bdc9499f64c912fc940c900981afec4a7af9652 /scripts/qapi.py | |
parent | 57db6482291c7eade3cead7835742669292eff4c (diff) | |
download | hqemu-68dfce67bc7a7c18cfc1d45090f17a34f061ef0b.zip hqemu-68dfce67bc7a7c18cfc1d45090f17a34f061ef0b.tar.gz |
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.
Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1449033659-25497-7-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qapi.py')
-rw-r--r-- | scripts/qapi.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/scripts/qapi.py b/scripts/qapi.py index 2b46dd0..7e6c396 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -1319,11 +1319,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'] @@ -1337,7 +1332,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, |