[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v8 06/26] qapi-types: Convert to QAPISchemaVisit
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v8 06/26] qapi-types: Convert to QAPISchemaVisitor, fixing flat unions |
Date: |
Wed, 16 Sep 2015 11:09:04 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
On 09/16/2015 05:06 AM, Markus Armbruster wrote:
> Fixes flat unions to get the base's base members. Test case is from
> commit 2fc0043, in qapi-schema-test.json:
>
>
> Flat union visitors remain broken. They'll be fixed next.
>
> Two ugly special cases for simple unions now stand out like sore
> thumbs:
>
> 1. The type tag is named 'type' everywhere, except in generated C,
> where it's 'kind'.
>
> 2. QAPISchema lowers simple unions to semantically equivalent flat
> unions. However, the C generated for a simple unions differs from
> the C generated for its equivalent flat union, and we therefore
> need special code to preserve that pointless difference for now.
>
> Mark both TODO.
>
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
> +
> + def visit_enum_type(self, name, info, values, prefix):
> + self._fwdecl += generate_enum(name, values, prefix)
> + self._fwdefn += generate_enum_lookup(name, values, prefix)
straightforward.
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v8 02/26] qapi: New QAPISchema intermediate reperesentation, (continued)
- [Qemu-devel] [PATCH v8 08/26] qapi-commands: Convert to QAPISchemaVisitor, Markus Armbruster, 2015/09/16
- [Qemu-devel] [PATCH v8 01/26] qapi: Rename class QAPISchema to QAPISchemaParser, Markus Armbruster, 2015/09/16
- [Qemu-devel] [PATCH v8 06/26] qapi-types: Convert to QAPISchemaVisitor, fixing flat unions, Markus Armbruster, 2015/09/16
- [Qemu-devel] [PATCH v8 14/26] qapi-visit: Rearrange code a bit, Markus Armbruster, 2015/09/16
- [Qemu-devel] [PATCH v8 07/26] qapi-visit: Convert to QAPISchemaVisitor, fixing bugs, Markus Armbruster, 2015/09/16
- [Qemu-devel] [PATCH v8 03/26] qapi: QAPISchema code generation helper methods, Markus Armbruster, 2015/09/16
- [Qemu-devel] [PATCH v8 20/26] qapi: Make output visitor return qnull() instead of NULL, Markus Armbruster, 2015/09/16