compiler: split writing of equal and hash functions for types

Separate the generation of type equality and hash functions, rather
than doing them in a single operation.

This is almost entirely a pure refactoring in preparation for
generating hash functions only for types that are map keys.  The only
change in generated code is that for types that are the size of
numeric types, but not aligned like numeric types, such as [8]byte,
now use standard hash functions.  They previously used special-purpose
hash functions because they required special-purpose equal functions.

Change-Id: Iecd37b7ce896e57bd4f57b77de94b7e836de8c99
Reviewed-by: Cherry Zhang <>
Reviewed-by: Than McIntosh <>
6 files changed