[dev.typeparams] cmd/compile: record more typ/fun info for dictionaries in unified IR

Records whether a derived type is needed at run-time as well as
instantiated functions that rely on derived types (and thus need
sub-dictionaries).

Change-Id: I2f2036976bfce5b3b4372fba88b4116dafa7e6b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/334349
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
Matthew Dempsky 2021-07-13 09:09:32 -07:00
parent 82744bfbfc
commit 5517053d17
4 changed files with 194 additions and 67 deletions

View file

@ -259,6 +259,7 @@ func readPackage(pr *pkgReader, importpkg *types.Pkg) {
for i, n := 0, r.len(); i < n; i++ {
r.sync(syncObject)
assert(!r.bool())
idx := r.reloc(relocObj)
assert(r.len() == 0)
@ -293,6 +294,7 @@ func writeNewExport(out io.Writer) {
for i, n := 0, r.len(); i < n; i++ {
r.sync(syncObject)
assert(!r.bool())
idx := r.reloc(relocObj)
assert(r.len() == 0)
@ -325,6 +327,7 @@ func writeNewExport(out io.Writer) {
w.len(len(idxs))
for _, idx := range idxs {
w.sync(syncObject)
w.bool(false)
w.reloc(relocObj, idx)
w.len(0)
}