1
0
mirror of https://github.com/golang/go synced 2024-11-17 05:14:56 -07:00

[dev.typeparams] cmd/compile: rename PartialCallType -> MethodValueType

CL 330837 rename OCALLPART to OMETHVALUE, so do the same thing for
PartialCallType for consistency.

Change-Id: Id40eb35bbcee7719acfb41fce0e2b968879f9fef
Reviewed-on: https://go-review.googlesource.com/c/go/+/332769
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Cuong Manh Le 2021-07-04 12:06:39 +07:00
parent 5c42b6a953
commit 4676c3675e
4 changed files with 7 additions and 7 deletions

View File

@ -193,7 +193,7 @@ func HeapAllocReason(n ir.Node) string {
if n.Op() == ir.OCLOSURE && typecheck.ClosureType(n.(*ir.ClosureExpr)).Size() > ir.MaxImplicitStackVarSize {
return "too large for stack"
}
if n.Op() == ir.OMETHVALUE && typecheck.PartialCallType(n.(*ir.SelectorExpr)).Size() > ir.MaxImplicitStackVarSize {
if n.Op() == ir.OMETHVALUE && typecheck.MethodValueType(n.(*ir.SelectorExpr)).Size() > ir.MaxImplicitStackVarSize {
return "too large for stack"
}

View File

@ -125,10 +125,10 @@ func ClosureType(clo *ir.ClosureExpr) *types.Type {
return typ
}
// PartialCallType returns the struct type used to hold all the information
// needed in the closure for n (n must be a OMETHVALUE node).
// The address of a variable of the returned type can be cast to a func.
func PartialCallType(n *ir.SelectorExpr) *types.Type {
// MethodValueType returns the struct type used to hold all the information
// needed in the closure for a OMETHVALUE node. The address of a variable of
// the returned type can be cast to a func.
func MethodValueType(n *ir.SelectorExpr) *types.Type {
t := types.NewStruct(types.NoPkg, []*types.Field{
types.NewField(base.Pos, Lookup("F"), types.Types[types.TUINTPTR]),
types.NewField(base.Pos, Lookup("R"), n.X.Type()),

View File

@ -175,7 +175,7 @@ func walkMethodValue(n *ir.SelectorExpr, init *ir.Nodes) ir.Node {
init.Append(typecheck.Stmt(check))
}
typ := typecheck.PartialCallType(n)
typ := typecheck.MethodValueType(n)
clos := ir.NewCompLitExpr(base.Pos, ir.OCOMPLIT, ir.TypeNode(typ), nil)
clos.SetEsc(n.Esc())

View File

@ -1306,7 +1306,7 @@ func (o *orderState) expr1(n, lhs ir.Node) ir.Node {
n := n.(*ir.SelectorExpr)
n.X = o.expr(n.X, nil)
if n.Transient() {
t := typecheck.PartialCallType(n)
t := typecheck.MethodValueType(n)
n.Prealloc = o.newTemp(t, false)
}
return n