aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/typecheck
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2021-06-27 01:28:38 +0700
committerCuong Manh Le <cuong.manhle.vn@gmail.com>2021-06-27 09:38:35 +0000
commit1b995f91a526ff165952218848c3173026a8dc53 (patch)
tree3c44f5759bb701dcc0158d0b35f00d7e7d298f11 /src/cmd/compile/internal/typecheck
parentd44ed5d14486728e2f9dfb9f682f37d6fb4024cb (diff)
downloadgo-1b995f91a526ff165952218848c3173026a8dc53.tar.gz
go-1b995f91a526ff165952218848c3173026a8dc53.zip
[dev.typeparams] cmd/compile: rename OCALLPART to OMETHVALUE
Go spec call them "method values", not "partial calls". Note that we use "OMETHVALUE" (as opposed to "OMETHODVALUE") to be consistent with "OMETHEXPR". Change-Id: I1efd985d4b567a1b4b20aeb603eb82db579edbd5 Reviewed-on: https://go-review.googlesource.com/c/go/+/330837 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>
Diffstat (limited to 'src/cmd/compile/internal/typecheck')
-rw-r--r--src/cmd/compile/internal/typecheck/const.go2
-rw-r--r--src/cmd/compile/internal/typecheck/crawler.go2
-rw-r--r--src/cmd/compile/internal/typecheck/expr.go2
-rw-r--r--src/cmd/compile/internal/typecheck/func.go4
-rw-r--r--src/cmd/compile/internal/typecheck/iexport.go4
-rw-r--r--src/cmd/compile/internal/typecheck/iimport.go6
6 files changed, 10 insertions, 10 deletions
diff --git a/src/cmd/compile/internal/typecheck/const.go b/src/cmd/compile/internal/typecheck/const.go
index 761b043794..f8150d249a 100644
--- a/src/cmd/compile/internal/typecheck/const.go
+++ b/src/cmd/compile/internal/typecheck/const.go
@@ -901,7 +901,7 @@ func evalunsafe(n ir.Node) int64 {
switch tsel.Op() {
case ir.ODOT, ir.ODOTPTR:
break
- case ir.OCALLPART:
+ case ir.OMETHVALUE:
base.Errorf("invalid expression %v: argument is a method value", n)
return 0
default:
diff --git a/src/cmd/compile/internal/typecheck/crawler.go b/src/cmd/compile/internal/typecheck/crawler.go
index 655ac6e465..9a348b9f37 100644
--- a/src/cmd/compile/internal/typecheck/crawler.go
+++ b/src/cmd/compile/internal/typecheck/crawler.go
@@ -201,7 +201,7 @@ func (p *crawler) markInlBody(n *ir.Name) {
p.checkGenericType(n.Type())
case ir.OTYPE:
p.checkGenericType(n.Type())
- case ir.OCALLPART:
+ case ir.OMETHVALUE:
// Okay, because we don't yet inline indirect
// calls to method values.
case ir.OCLOSURE:
diff --git a/src/cmd/compile/internal/typecheck/expr.go b/src/cmd/compile/internal/typecheck/expr.go
index d52f011072..f039cbab08 100644
--- a/src/cmd/compile/internal/typecheck/expr.go
+++ b/src/cmd/compile/internal/typecheck/expr.go
@@ -541,7 +541,7 @@ func tcDot(n *ir.SelectorExpr, top int) ir.Node {
}
if (n.Op() == ir.ODOTINTER || n.Op() == ir.ODOTMETH) && top&ctxCallee == 0 {
- n.SetOp(ir.OCALLPART)
+ n.SetOp(ir.OMETHVALUE)
n.SetType(MethodValueWrapper(n).Type())
}
return n
diff --git a/src/cmd/compile/internal/typecheck/func.go b/src/cmd/compile/internal/typecheck/func.go
index 20b991be56..f4fcfddcf1 100644
--- a/src/cmd/compile/internal/typecheck/func.go
+++ b/src/cmd/compile/internal/typecheck/func.go
@@ -126,7 +126,7 @@ func ClosureType(clo *ir.ClosureExpr) *types.Type {
}
// PartialCallType returns the struct type used to hold all the information
-// needed in the closure for n (n must be a OCALLPART node).
+// 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 {
t := types.NewStruct(types.NoPkg, []*types.Field{
@@ -225,7 +225,7 @@ func fnpkg(fn *ir.Name) *types.Pkg {
//
// TODO(mdempsky): Move into walk. This isn't part of type checking.
func MethodValueWrapper(dot *ir.SelectorExpr) *ir.Func {
- if dot.Op() != ir.OCALLPART {
+ if dot.Op() != ir.OMETHVALUE {
base.Fatalf("MethodValueWrapper: unexpected %v (%v)", dot, dot.Op())
}
diff --git a/src/cmd/compile/internal/typecheck/iexport.go b/src/cmd/compile/internal/typecheck/iexport.go
index 10d4bd6e7e..b17af815ec 100644
--- a/src/cmd/compile/internal/typecheck/iexport.go
+++ b/src/cmd/compile/internal/typecheck/iexport.go
@@ -1775,7 +1775,7 @@ func (w *exportWriter) expr(n ir.Node) {
// case OSTRUCTKEY:
// unreachable - handled in case OSTRUCTLIT by elemList
- case ir.OXDOT, ir.ODOT, ir.ODOTPTR, ir.ODOTINTER, ir.ODOTMETH, ir.OCALLPART, ir.OMETHEXPR:
+ case ir.OXDOT, ir.ODOT, ir.ODOTPTR, ir.ODOTINTER, ir.ODOTMETH, ir.OMETHVALUE, ir.OMETHEXPR:
n := n.(*ir.SelectorExpr)
if go117ExportTypes {
// For go117ExportTypes, we usually see all ops except
@@ -1792,7 +1792,7 @@ func (w *exportWriter) expr(n ir.Node) {
if n.Op() == ir.ODOT || n.Op() == ir.ODOTPTR || n.Op() == ir.ODOTINTER {
w.exoticField(n.Selection)
}
- // n.Selection is not required for OMETHEXPR, ODOTMETH, and OCALLPART. It will
+ // n.Selection is not required for OMETHEXPR, ODOTMETH, and OMETHVALUE. It will
// be reconstructed during import. n.Selection is computed during
// transformDot() for OXDOT.
}
diff --git a/src/cmd/compile/internal/typecheck/iimport.go b/src/cmd/compile/internal/typecheck/iimport.go
index d94f649a45..7b61260e79 100644
--- a/src/cmd/compile/internal/typecheck/iimport.go
+++ b/src/cmd/compile/internal/typecheck/iimport.go
@@ -1357,7 +1357,7 @@ func (r *importReader) node() ir.Node {
// case OSTRUCTKEY:
// unreachable - handled in case OSTRUCTLIT by elemList
- case ir.OXDOT, ir.ODOT, ir.ODOTPTR, ir.ODOTINTER, ir.ODOTMETH, ir.OCALLPART, ir.OMETHEXPR:
+ case ir.OXDOT, ir.ODOT, ir.ODOTPTR, ir.ODOTINTER, ir.ODOTMETH, ir.OMETHVALUE, ir.OMETHEXPR:
// For !go117ExportTypes, we should only see OXDOT.
// For go117ExportTypes, we usually see all the other ops, but can see
// OXDOT for generic functions.
@@ -1373,12 +1373,12 @@ func (r *importReader) node() ir.Node {
switch op {
case ir.ODOT, ir.ODOTPTR, ir.ODOTINTER:
n.Selection = r.exoticField()
- case ir.ODOTMETH, ir.OCALLPART, ir.OMETHEXPR:
+ case ir.ODOTMETH, ir.OMETHVALUE, ir.OMETHEXPR:
// These require a Lookup to link to the correct declaration.
rcvrType := expr.Type()
typ := n.Type()
n.Selection = Lookdot(n, rcvrType, 1)
- if op == ir.OCALLPART || op == ir.OMETHEXPR {
+ if op == ir.OMETHVALUE || op == ir.OMETHEXPR {
// Lookdot clobbers the opcode and type, undo that.
n.SetOp(op)
n.SetType(typ)