]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: merge {Selector,CallPart,Method}Expr
authorMatthew Dempsky <mdempsky@google.com>
Tue, 29 Dec 2020 00:14:11 +0000 (16:14 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 29 Dec 2020 02:35:04 +0000 (02:35 +0000)
commit4629f6a51da5afabbebe9616f65fbfe0675d6039
tree8e81fbaa7ef4a2efc7cbc750df95c0eb817a4bee
parente563715b3085f44a76564485214e33e3c3b2b7b0
[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>
14 files changed:
src/cmd/compile/internal/escape/escape.go
src/cmd/compile/internal/inline/inl.go
src/cmd/compile/internal/ir/expr.go
src/cmd/compile/internal/ir/fmt.go
src/cmd/compile/internal/ir/node_gen.go
src/cmd/compile/internal/staticinit/sched.go
src/cmd/compile/internal/typecheck/expr.go
src/cmd/compile/internal/typecheck/func.go
src/cmd/compile/internal/typecheck/iexport.go
src/cmd/compile/internal/typecheck/typecheck.go
src/cmd/compile/internal/walk/closure.go
src/cmd/compile/internal/walk/complit.go
src/cmd/compile/internal/walk/expr.go
src/cmd/compile/internal/walk/order.go