]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: limit Implicit method to nodes where it is defined
authorRuss Cox <rsc@golang.org>
Fri, 11 Dec 2020 21:52:21 +0000 (16:52 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 17 Dec 2020 03:50:21 +0000 (03:50 +0000)
commitf6d2834f8f78447a06fdb05f85a2c5690e915892
treeea28423140d4697ddc6aa1d4a49b7cffd7e6125e
parent7fde0d2b507b989cb9a23d6dbae9acaa13328c53
[dev.regabi] cmd/compile: limit Implicit method to nodes where it is defined

The general concept of an "implicit" operation is provided by every
expr representation, but it really only makes sense for a few of them,
and worse the exact definition of what "implicit" means differs from
node to node.

This CL moves the method to each node implementation, although
they all share the same header bit instead of each defining a bool field
that would turn into 8 bytes on 64-bit systems.

Now we can say precisely which Nodes have a meaningful Implicit
method: AddrExpr, CompLitExpr, ConvExpr, ParenExpr, and StarExpr.

Passes buildall w/ toolstash -cmp.

Change-Id: I7d85cb0507a514cdcb6eed21347f362e5fb57a91
Reviewed-on: https://go-review.googlesource.com/c/go/+/277918
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/ir/expr.go