From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9U0k-0000jZ-IA for qemu-devel@nongnu.org; Thu, 17 Dec 2015 03:34:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9U0f-0001GP-Vv for qemu-devel@nongnu.org; Thu, 17 Dec 2015 03:34:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9U0f-0001GD-OE for qemu-devel@nongnu.org; Thu, 17 Dec 2015 03:34:01 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 6858EC05E140 for ; Thu, 17 Dec 2015 08:34:01 +0000 (UTC) From: Markus Armbruster Date: Thu, 17 Dec 2015 09:33:37 +0100 Message-Id: <1450341225-2735-33-git-send-email-armbru@redhat.com> In-Reply-To: <1450341225-2735-1-git-send-email-armbru@redhat.com> References: <1450341225-2735-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PULL 32/40] qapi: Inline _make_implicit_tag() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Eric Blake 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 Signed-off-by: Eric Blake Message-Id: <1449033659-25497-7-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster --- scripts/qapi.py | 9 +++------ 1 file 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, -- 2.4.3