Received: from eggs.gnu.org ([2001:4830:134:3::10]:56532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWUsl-0005fe-6e for qemu-devel@nongnu.org; Thu, 18 Feb 2016 15:09:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWUsh-0001E8-Vh for qemu-devel@nongnu.org; Thu, 18 Feb 2016 15:08:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47293) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWUsh-0001E4-QI for qemu-devel@nongnu.org; Thu, 18 Feb 2016 15:08:55 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 797EA552E6 for ; Thu, 18 Feb 2016 20:08:55 +0000 (UTC) From: Markus Armbruster References: <1455778109-6278-1-git-send-email-eblake@redhat.com> Date: Thu, 18 Feb 2016 21:08:53 +0100 In-Reply-To: <1455778109-6278-1-git-send-email-eblake@redhat.com> (Eric Blake's message of "Wed, 17 Feb 2016 23:48:14 -0700") Message-ID: <877fi1ye5m.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v11 00/15] prune some QAPI visitor cruft (was qapi cleanups subset E) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org Eric Blake writes: > I'm still working on my documentation patches for QAPI visitors > (https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg03504.html), > but am finding it easier to nuke bad code up front than to document > that it is bad only to later nuke it. So this pulls bits and pieces > of other patches that Markus I have previously posted, along with > some new glue, to get rid of some of the worst of the cruft. > > v10 was here: > https://lists.gnu.org/archive/html/qemu-devel/2016-02/msg03282.html > > Since then, I've folded in fixes for Markus' review comments, > including rearranging some hunks and retitling some patches, > and dropping the attempt to minimize generated gotos. The biggest > changes are moving where variants get visited (during > visit_type_FOO_fields() rather than visit_type_FOO()), dropping > visit_type_alternate_FOO() (open-coding it during > gen_visit_alternate()), and fixing bugs (properly handle > visit_start_union() so that there are no bisection points where > we are handling 'void *data' incorrectly). > > 001/15:[----] [--] 'qapi: Simplify excess input reporting in input visitors' > 002/15:[----] [--] 'qapi: Forbid empty unions and useless alternates' > 003/15:[down] 'qapi: Forbid 'any' inside an alternate' > 004/15:[down] 'qapi: Add tests of complex objects within alternate' > 005/15:[----] [--] 'qapi-visit: Simplify how we visit common union members' > 006/15:[down] 'qapi: Visit variants in visit_type_FOO_fields()' > 007/15:[0051] [FC] 'qapi-visit: Unify struct and union visit' > 008/15:[0012] [FC] 'qapi-visit: Less indirection in visit_type_Foo_fields()' > 009/15:[0002] [FC] 'qapi: Adjust layout of FooList types' > 010/15:[0004] [FC] 'qapi: Emit structs used as variants in topological order' > 011/15:[down] 'qapi-visit: Use common idiom in gen_visit_fields_decl()' > 012/15:[0148] [FC] 'qapi: Don't box struct branch of alternate' > 013/15:[0074] [FC] 'qapi: Don't box branches of flat unions' > 014/15:[down] 'qapi: Delete visit_start_union(), gen_visit_implicit_struct()' > 015/15:[0001] [FC] 'qapi: Change visit_start_implicit_struct to visit_start_alternate' Applied to qapi-next with minor tweaks. Diff between the final appended. I'd appreciate a look-over. Thanks! --- a/scripts/qapi-visit.py +++ b/scripts/qapi-visit.py @@ -41,7 +41,7 @@ static void visit_type_%(c_type)s_fields(Visitor *v, %(c_type)s *obj, Error **er c_type=typ.c_name()) -def gen_visit_struct_fields(name, base, members, variants=None): +def gen_visit_struct_fields(name, base, members, variants): ret = '' if base: