mirror of
https://github.com/golang/go
synced 2024-11-17 07:24:53 -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:
parent
5c42b6a953
commit
4676c3675e
@ -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"
|
||||
}
|
||||
|
||||
|
@ -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()),
|
||||
|
@ -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())
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user