compiler: include selected constant types during export processing

The machinery that collects types referenced by expressions that are
part of inlinable function bodies was missing the types of local named
constants in certain cases. This patch updates the
Collect_export_references::expression() hook to look for references to
local named constants and include their types in the exported set.

Fixes golang/go#34577.

Change-Id: Ib80e7526c01edc1a3f2b422d84785ea67767c888
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/198017
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 files changed