On 01/25/2016 10:04 AM, Markus Armbruster wrote:
> Eric Blake <ebl...@redhat.com> writes:
> 
>> 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.
>>

> 
> 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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to