aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/typecheck/iimport.go
diff options
context:
space:
mode:
authorDan Scales <danscales@google.com>2021-02-02 12:17:57 -0800
committerDan Scales <danscales@google.com>2021-02-03 01:18:23 +0000
commite633f343ba791e770c6a6c2f8ff3640d2e8ff079 (patch)
tree862cd9c47e985812e60310dd31a75a803b3f584c /src/cmd/compile/internal/typecheck/iimport.go
parent0d2d6c74644c4e09655225894e6eca2a06aeeef4 (diff)
downloadgo-e633f343ba791e770c6a6c2f8ff3640d2e8ff079.tar.gz
go-e633f343ba791e770c6a6c2f8ff3640d2e8ff079.zip
[dev.typeparams] cmd/compile: add OFUNCINST/OTYPEINST nodes for generic func/type instantiation
Expresses things more clearly, especially in cases like 'f := min[int]' where we create a xsgeneric function instantiation, but don't immediately call it. min[int](2, 3) now looks like: . CALLFUNC tc(1) Use:1 int # min1.go:11 int . . FUNCINST tc(1) FUNC-func(int, int) int # min1.go:11 FUNC-func(int, int) int . . . NAME-main.min tc(1) Class:PFUNC Offset:0 Used FUNC-func[T](T, T) T # min1.go:3 . . FUNCINST-Targs . . . TYPE .int Offset:0 type int . CALLFUNC-Args . . LITERAL-2 tc(1) int # min1.go:11 . . LITERAL-3 tc(1) int # min1.go:11 Remove the targs parameter from ir.NewCallExpr(), not needed anymore, since type arguments are included in the FUNCINST. Change-Id: I23438b75288330475294d7ace239ba64acfa641e Reviewed-on: https://go-review.googlesource.com/c/go/+/288951 Run-TryBot: Dan Scales <danscales@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Dan Scales <danscales@google.com> Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/iimport.go')
-rw-r--r--src/cmd/compile/internal/typecheck/iimport.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/typecheck/iimport.go b/src/cmd/compile/internal/typecheck/iimport.go
index 201b217e8e..7b5b113b15 100644
--- a/src/cmd/compile/internal/typecheck/iimport.go
+++ b/src/cmd/compile/internal/typecheck/iimport.go
@@ -1068,7 +1068,7 @@ func (r *importReader) node() ir.Node {
case ir.OCALL:
pos := r.pos()
init := r.stmtList()
- n := ir.NewCallExpr(pos, ir.OCALL, r.expr(), nil, r.exprList())
+ n := ir.NewCallExpr(pos, ir.OCALL, r.expr(), r.exprList())
*n.PtrInit() = init
n.IsDDD = r.bool()
return n
@@ -1236,5 +1236,5 @@ func (r *importReader) exprsOrNil() (a, b ir.Node) {
}
func builtinCall(pos src.XPos, op ir.Op) *ir.CallExpr {
- return ir.NewCallExpr(pos, ir.OCALL, ir.NewIdent(base.Pos, types.BuiltinPkg.Lookup(ir.OpNames[op])), nil, nil)
+ return ir.NewCallExpr(pos, ir.OCALL, ir.NewIdent(base.Pos, types.BuiltinPkg.Lookup(ir.OpNames[op])), nil)
}