diff options
author | Dan Scales <danscales@google.com> | 2021-05-14 16:35:04 -0700 |
---|---|---|
committer | Dan Scales <danscales@google.com> | 2021-05-24 22:17:33 +0000 |
commit | d48f6d9f6f1ee7099ad129552507903e191ad589 (patch) | |
tree | 261a885d30efe6bafe1b6150fab107cd8aecb35c /src/cmd/compile/internal/typecheck/iexport.go | |
parent | 4c50721cda74abbf7732638f39a23dfbf6271a48 (diff) | |
download | go-d48f6d9f6f1ee7099ad129552507903e191ad589.tar.gz go-d48f6d9f6f1ee7099ad129552507903e191ad589.zip |
[dev.typeparams] Don't check typecheck(3) on transform, so no need to export/import it
We have a value typecheck(3) that indicates that a node in a generic
function still needs transformation (via the functions in transform.go).
But it is not very desirable to export/import the value of typecheck(3).
So, I changed the stenciling code to just try to transform all relevant
node types during node copy. Almost all tranform functions were already
idempotent. I only had to add an extra if check before calling
transformAssign() in the OAS case. We still use the typecheck(3) in
noder to determine when higher-nodes have to delay transformation
because one or more of their args are delaying transformation.
Added new test mapsimp.go that required these tranformations after import.
As an additional change, export/import of OINDEX requires exporting the
type using w.exoticType() rather than w.typ(), in order to handle
generic functions. Since generic functions can have pre-transform
operations, the index operation can have a tuple type (multiple return
from a map lookup).
Added printing of imported function bodies in -W=3 debug mode.
Change-Id: I220e2428dc5f2741e91db146f075eb5b6045f451
Reviewed-on: https://go-review.googlesource.com/c/go/+/322191
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/iexport.go')
-rw-r--r-- | src/cmd/compile/internal/typecheck/iexport.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/typecheck/iexport.go b/src/cmd/compile/internal/typecheck/iexport.go index d956ada3c5..292bb2c409 100644 --- a/src/cmd/compile/internal/typecheck/iexport.go +++ b/src/cmd/compile/internal/typecheck/iexport.go @@ -1735,7 +1735,7 @@ func (w *exportWriter) expr(n ir.Node) { w.expr(n.X) w.expr(n.Index) if go117ExportTypes { - w.typ(n.Type()) + w.exoticType(n.Type()) if n.Op() == ir.OINDEXMAP { w.bool(n.Assigned) } |