aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/escape
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2021-06-25 22:24:29 +0700
committerCuong Manh Le <cuong.manhle.vn@gmail.com>2021-06-26 08:39:47 +0000
commit0cf71f7f92c2623a132ab3257690826643d548af (patch)
tree4b830dda9c969984b9a6518d55f756378a19a961 /src/cmd/compile/internal/escape
parent180c338c6893c2e8b7f4692ed62f92a1ed0cd1e8 (diff)
downloadgo-0cf71f7f92c2623a132ab3257690826643d548af.tar.gz
go-0cf71f7f92c2623a132ab3257690826643d548af.zip
[dev.typeparams] cmd/compile: rewrite method calls during typecheck
CL 330671 move rewriting method call to method expression to escape analysis. This CL move the rewriting up further, into typecheck. It helps simplify the code for dowstream passes, as they now only have to deal with OCALLFUNC. There're two notes: - For -G=3, we can't rewrite d.M() where d is an instantiated receiver in transformCall, but let irgen.stencil to rewrite it. - Escape analysis still have to check for rewriting method calls, as the devirtualization pass can still generate OCALLMETH. Does not pass toolstash, since when the export data now contains method expression calls instead of method calls. Change-Id: I77465ef04d50dc4efedddca7eb55b3fc9483db0e Reviewed-on: https://go-review.googlesource.com/c/go/+/330831 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/escape')
-rw-r--r--src/cmd/compile/internal/escape/call.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/escape/call.go b/src/cmd/compile/internal/escape/call.go
index 62727a8ef8..46bfe65aff 100644
--- a/src/cmd/compile/internal/escape/call.go
+++ b/src/cmd/compile/internal/escape/call.go
@@ -68,7 +68,7 @@ func (e *escape) callCommon(ks []hole, call ir.Node, init *ir.Nodes, wrapper *ir
fn = ir.MethodExprName(v)
}
case ir.OCALLMETH:
- fn = ir.MethodExprName(call.X)
+ base.FatalfAt(call.Pos(), "OCALLMETH missed by typecheck")
}
fntype := call.X.Type()