[PATCH 1/2] Ensure change_kind enum values are used consistently.

Dodji Seketeli dodji@seketeli.org
Thu Mar 19 10:50:48 GMT 2020


Giuliano Procida <gprocida@google.com> a écrit:

> The change_kind enumeration (bitset) values are used to track what
> kinds of a changes are present at a diff node.
>
> Local type and non-type changes may be present. These are tracked
> using 3 bits, with the invariant that LOCAL_TYPE_CHANGE_KIND or
> LOCAL_NON_TYPE_CHANGE_KIND both imply LOCAL_CHANGE_KIND. This
> invariant has to be maintained in code which doesn't always happen.
>
> This patch fixes a couple of cases where LOCAL_CHANGE_KIND or
> LOCAL_TYPE_CHANGE_KIND was missing and changes a few other bits of
> code so that it is clear that two bits are being paired together.
>
> 	* src/abg-comparison.cc (distinct_diff::has_local_changes):
> 	Remove unnecessary parentheses around return expression.
> 	* src/abg-default-reporter.cc (report): In the reference_diff
> 	overload, replace test against LOCAL_CHANGE_KIND with test
> 	against ALL_LOCAL_CHANGES_MASK.
> 	* src/abg-ir.cc (equals): In the array_type_def and class_decl
> 	overloads, add missing LOCAL_TYPE_CHANGE_KIND. In the
> 	class_decl overload, also add missing LOCAL_CHANGE_KIND. In
> 	the enum_type_decl and function_decl::parameter overloads
> 	clarify pairing of LOCAL*CHANGE_KIND bits.
> 	(enum_has_non_name_change): Clarify pairing of
> 	LOCAL*CHANGE_KIND bits.

I am applying this to master with just one little nit change: I made the
ChangeLog part of the commit log be the last.

Thanks!

Cheers,

-- 
		Dodji


More information about the Libabigail mailing list