mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: remove unneeded early transforms, with dictionary change
Now that we are computing the dictionary format on the instantiated functions, we can remove the early transformation code that was needed to create the implicit CONVIFACE nodes in the generic function. Change-Id: I1695484e7d59bccbfb757994f3e40e84288759a5 Reviewed-on: https://go-review.googlesource.com/c/go/+/349614 Run-TryBot: Dan Scales <danscales@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Dan Scales <danscales@google.com> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
59a9a035ff
commit
cfa233d76b
5 changed files with 26 additions and 119 deletions
|
|
@ -189,17 +189,6 @@ func Call(pos src.XPos, typ *types.Type, fun ir.Node, args []ir.Node, dots bool)
|
|||
// A function instantiation (even if fully concrete) shouldn't be
|
||||
// transformed yet, because we need to add the dictionary during the
|
||||
// transformation.
|
||||
//
|
||||
// However, if we have a function type (even though it is
|
||||
// parameterized), then we can add in any needed CONVIFACE nodes via
|
||||
// typecheckaste(). We need to call transformArgs() to deal first
|
||||
// with the f(g(()) case where g returns multiple return values. We
|
||||
// can't do anything if fun is a type param (which is probably
|
||||
// described by a structural constraint)
|
||||
if fun.Type().Kind() == types.TFUNC {
|
||||
transformArgs(n)
|
||||
typecheckaste(ir.OCALL, fun, n.IsDDD, fun.Type().Params(), n.Args, true)
|
||||
}
|
||||
return typed(typ, n)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue