]> Cypherpunks.ru repositories - gostls13.git/commitdiff
[dev.typeparams] cmd/compile: rename PartialCallType -> MethodValueType
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Sun, 4 Jul 2021 05:06:39 +0000 (12:06 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Wed, 7 Jul 2021 11:18:25 +0000 (11:18 +0000)
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>
src/cmd/compile/internal/escape/utils.go
src/cmd/compile/internal/typecheck/func.go
src/cmd/compile/internal/walk/closure.go
src/cmd/compile/internal/walk/order.go

index 6e2f9c424a8cf70cc4f9700ed54edd72eef9ad54..5f462ef570faaef15f9a3e37f528ba1f1d0391ae 100644 (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"
        }
 
index 847e9b9aeadfbcdbab229989740083b77f30d90f..7dec65c1d6875fd54f305557bd7cca485e5da9f8 100644 (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()),
index 7f6ef473bf219f4c09e9ebf95bcc8641b4c97231..2d0b2dcc0ee2ca9a5fa51fc9041165d25b60901a 100644 (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())
index eec340261efde3bc7c2f2335d7f401b8d5e000cc..cd2bbcb73ba3381339b9edc3c190cfe8cec2e197 100644 (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