abitidy: Add an anonymous type id renumbering strategy using first member

This change adds a strategy where the first member (first enumerator for
enums and first data member for structs or unions) is used to compute a
more stable hash for ids of anonymous types.

The stategy here is to use a combination of the name and type of the
first member as well as the kind (struct/union/enum) of the type being
renumbered to compute a new type id.

Using this strategy it was found that while computation of hashes, the
length of a collision chain was at most 3 with the android13-5.15
kernel. Moreover, the total number of hash collisions were less than 30.
Therefore, this strategy is very effective in preventing long collision
chains, hence preventing long chain of changes in case anonymous types
get renumbered due to addition of new anonymous types.

Bug: 239910948
Signed-off-by: Sid Nayyar <sidnayyar@google.com>
Change-Id: Iaa06244ac18bf19c4748a971df599cd6620cba07
1 file changed