Revert "cmd/compile: skip reexporting types in reexportdep"

This reverts commit edad59cfae.

Fixes #20682.

Change-Id: If998c8b4bf177d5da9e26f75579bd5497ec86d38
Reviewed-on: https://go-review.googlesource.com/45911
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
Matthew Dempsky 2017-06-15 10:47:57 -07:00
parent 7d21123995
commit 8d2b3bb7b1
2 changed files with 81 additions and 1 deletions

View file

@ -506,6 +506,13 @@ func (p *exporter) obj(sym *types.Sym) {
var f *Func
if inlineable {
f = asNode(sym.Def).Func
// TODO(gri) re-examine reexportdeplist:
// Because we can trivially export types
// in-place, we don't need to collect types
// inside function bodies in the exportlist.
// With an adjusted reexportdeplist used only
// by the binary exporter, we can also avoid
// the global exportlist.
reexportdeplist(f.Inl)
}
p.funcList = append(p.funcList, f)
@ -698,7 +705,7 @@ func (p *exporter) typ(t *types.Type) {
var f *Func
if inlineable {
f = mfn.Func
reexportdeplist(f.Inl)
reexportdeplist(mfn.Func.Inl)
}
p.funcList = append(p.funcList, f)
}