]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: rewrite method call into method expression during escap...
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 24 Jun 2021 16:05:09 +0000 (23:05 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 25 Jun 2021 02:29:28 +0000 (02:29 +0000)
commit2493c727425547db935a1c6e519bc19d01476380
tree357aee3a225987ebf5b1000e34d19a9b8b3a430d
parentf190a9280ddcaa958610e104a3f6c105fedd3fee
[dev.typeparams] cmd/compile: rewrite method call into method expression during escape analysis

CL 330331 extended escape analysis to analyze method expression calls
the same as normal method calls. We can now simply desugar method calls
into function calls in escape analysis.

To do this, two things must be changed:

 - Folding the rewrite method call to method expression call into an
   export function in typecheck package, so others can re-use it.

 - walkCall now have to call usemethod for method expression calls.
   (It seems to me this is a bug in current tip, because if one write
   (*rtype).Method(typ, i) in package "reflect", then the function won't
   be marked with AttrReflectMethod)

Passes toolstash -cmp.

Change-Id: I4745ab6110b417c7fd32949cc799811a882cd2ec
Reviewed-on: https://go-review.googlesource.com/c/go/+/330671
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/devirtualize/devirtualize.go
src/cmd/compile/internal/escape/call.go
src/cmd/compile/internal/typecheck/func.go
src/cmd/compile/internal/walk/expr.go