aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/escape/escape.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2020-12-28 16:14:11 -0800
committerMatthew Dempsky <mdempsky@google.com>2020-12-29 02:35:04 +0000
commit4629f6a51da5afabbebe9616f65fbfe0675d6039 (patch)
tree8e81fbaa7ef4a2efc7cbc750df95c0eb817a4bee /src/cmd/compile/internal/escape/escape.go
parente563715b3085f44a76564485214e33e3c3b2b7b0 (diff)
downloadgo-4629f6a51da5afabbebe9616f65fbfe0675d6039.tar.gz
[dev.regabi] cmd/compile: merge {Selector,CallPart,Method}Expr
These three expression nodes all represent the same syntax, and so they're represented the same within types2. And also they're not handled that meaningfully differently throughout the rest of the compiler to merit unique representations. Method expressions are somewhat unique today that they're very frequently turned into plain function names. But eventually that can be handled by a post-typecheck desugaring phase that reduces the number of redundant AST forms. Passes toolstash -cmp. Change-Id: I20df91bbd0d885c1f18ec67feb61ae1558670719 Reviewed-on: https://go-review.googlesource.com/c/go/+/280636 Trust: Matthew Dempsky <mdempsky@google.com> Trust: Dan Scales <danscales@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dan Scales <danscales@google.com>
Diffstat (limited to 'src/cmd/compile/internal/escape/escape.go')
-rw-r--r--src/cmd/compile/internal/escape/escape.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/escape/escape.go b/src/cmd/compile/internal/escape/escape.go
index d8f0111d2d..7b4037e028 100644
--- a/src/cmd/compile/internal/escape/escape.go
+++ b/src/cmd/compile/internal/escape/escape.go
@@ -612,10 +612,10 @@ func (e *escape) exprSkipInit(k hole, n ir.Node) {
// Flow the receiver argument to both the closure and
// to the receiver parameter.
- n := n.(*ir.CallPartExpr)
+ n := n.(*ir.SelectorExpr)
closureK := e.spill(k, n)
- m := n.Method
+ m := n.Selection
// We don't know how the method value will be called
// later, so conservatively assume the result
@@ -1542,7 +1542,7 @@ func (e *escape) finish(fns []*ir.Func) {
n := n.(*ir.ClosureExpr)
n.SetTransient(true)
case ir.OCALLPART:
- n := n.(*ir.CallPartExpr)
+ n := n.(*ir.SelectorExpr)
n.SetTransient(true)
case ir.OSLICELIT:
n := n.(*ir.CompLitExpr)
@@ -1863,7 +1863,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.OCALLPART && typecheck.PartialCallType(n.(*ir.CallPartExpr)).Size() >= ir.MaxImplicitStackVarSize {
+ if n.Op() == ir.OCALLPART && typecheck.PartialCallType(n.(*ir.SelectorExpr)).Size() >= ir.MaxImplicitStackVarSize {
return "too large for stack"
}