From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVuB2-0002qw-1C for qemu-devel@nongnu.org; Tue, 16 Feb 2016 23:57:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVuAy-0005Ok-Lp for qemu-devel@nongnu.org; Tue, 16 Feb 2016 23:57:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVuAy-0005NC-G6 for qemu-devel@nongnu.org; Tue, 16 Feb 2016 23:57:20 -0500 References: <1453219845-30939-1-git-send-email-eblake@redhat.com> <1453219845-30939-30-git-send-email-eblake@redhat.com> <87a8nt380k.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <56C3FDAE.1020704@redhat.com> Date: Tue, 16 Feb 2016 21:57:18 -0700 MIME-Version: 1.0 In-Reply-To: <87a8nt380k.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BEGo8UaSqD1M0IpqXsMc1AR1EULUDFd0K" Subject: Re: [Qemu-devel] [PATCH v9 29/37] qapi: Eliminate empty visit_type_FOO_fields List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: marcandre.lureau@redhat.com, qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BEGo8UaSqD1M0IpqXsMc1AR1EULUDFd0K Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/25/2016 10:04 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> For empty structs, such as the 'Abort' helper type used as part >> of the 'transaction' command, we were emitting a no-op >> visit_type_FOO_fields(). Optimize things to instead omit calls >> for empty structs. Generated code changes resemble: >> >> Another reason for doing this optimization is that it gets us >> closer to merging the code for visiting structs and unions: >> since flat unions have no local members, they do not need to >> have a visit_type_UNION_fields() emitted, even when they start >> sharing the code used to visit structs. >> >=20 > I'm not sure the optimization is worthwhile by itself. Empty structs > are rare. I'm reserving judgement until I see the struct/union > unification. We managed to pull off unification without this patch, and your argument about making the generator more verbose with no-ops if it is less maintenance is still resonating with me. I think I'm going to drop this and 30/37 in my next round of patches, with no real loss in functionality= =2E --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --BEGo8UaSqD1M0IpqXsMc1AR1EULUDFd0K Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWw/2uAAoJEKeha0olJ0Nq5OwIAInbot/MosHyzqF9xPqJnMse r2ZDxX0Ggv1RBEXrzjoYU4tbHz3eUVmstLa3zM6Q/WMvusM4tXm6Wek+HaCcx61D Iie5S7XGl2qfQwr8miAQ0P4dXwjyezt3yfrRkr/poLfCXZA7s+WlYQJ4rqPe1HhQ AIDbYneOEs34SfqwdNu3eQV9ug1FPiIcVRBR5Au0ag7gK1I6OFWljnyr+WBQ2T+0 eQPcedvEjubWllDMqqA2yN02H69mlAsZtIzHAL33Ui/h0BuoN19P3XkktQu6f6dK uZHjAYHoGxd+uJkWBV32mEnTnpJJ+6NpcwuFDyd0z9C86bXlYMOaHDpibt7xBKQ= =o0UW -----END PGP SIGNATURE----- --BEGo8UaSqD1M0IpqXsMc1AR1EULUDFd0K--