compiler: export indexed type data, read unexported types lazily

Introduce a new "types" command to the export data to record the
number of types and the size of their export data. It is immediately
followed by new "type" commands that can be indexed. Parse all the
exported types immediately so that we register them, but parse other
type data only as needed.

Change-Id: I811f8139728f9bb58a67fdc5c3bbf2d4e12437da
Reviewed-on: https://go-review.googlesource.com/c/143022
Reviewed-by: Than McIntosh <thanm@google.com>
9 files changed