aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/noder/reader.go
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/noder/reader.go
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/noder/reader.go')
-rw-r--r--src/cmd/compile/internal/noder/reader.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/noder/reader.go b/src/cmd/compile/internal/noder/reader.go
index 459e1d1703..e5ad3f4b8e 100644
--- a/src/cmd/compile/internal/noder/reader.go
+++ b/src/cmd/compile/internal/noder/reader.go
@@ -1807,8 +1807,7 @@ func InlineCall(call *ir.CallExpr, fn *ir.Func, inlIndex int) *ir.InlinedCallExp
var args ir.Nodes
if call.Op() == ir.OCALLMETH {
- assert(call.X.Op() == ir.ODOTMETH)
- args.Append(call.X.(*ir.SelectorExpr).X)
+ base.FatalfAt(call.Pos(), "OCALLMETH missed by typecheck")
}
args.Append(call.Args...)