]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: delay all transforms for generic funcs/methods
authorDan Scales <danscales@google.com>
Tue, 7 Sep 2021 00:46:50 +0000 (17:46 -0700)
committerDan Scales <danscales@google.com>
Mon, 20 Sep 2021 18:17:05 +0000 (18:17 +0000)
commit6acac8b6856b2531f4ac7ee0eb37048d588d98c7
tree46ef44756afbbe23628c36beda6f0903b7877ee6
parent988f18d61d27f75f6a21cef0aa28b8d85982a85d
cmd/compile: delay all transforms for generic funcs/methods

This change cleans up the code, by just delaying all transforms on
generic function methods/functions until stenciling time. That way, we
don't have extra code to decide whether to delay, or an extra value for
the typecheck flag. We are already doing all possible transforms at
stencil time anyway, so no changes to the stenciling code.

transform.go includes a change for one case where we check for shape
rather than tparam, now that we only apply transforms to stenciled
functions, not generic functions. This change is to allow CONVIFACE node
to be correctly inserted (needed for dictionaries), even with this
strange code that doesn't add the CONVIFACE node if the concrete type is
NOT huge...

Change-Id: I5f1e71fab11b53385902074915b3ad85f8e753fa
Reviewed-on: https://go-review.googlesource.com/c/go/+/350736
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
src/cmd/compile/internal/ir/mini.go
src/cmd/compile/internal/noder/helpers.go
src/cmd/compile/internal/noder/stmt.go
src/cmd/compile/internal/noder/transform.go