mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: add Node.IsMethod helper
Changes generated with eg:
func before(n *gc.Node) bool { return n.Type.Recv() != nil }
func after(n *gc.Node) bool { return n.IsMethod() }
func before(n *gc.Node) bool { return n.Type.Recv() == nil }
func after(n *gc.Node) bool { return !n.IsMethod() }
Change-Id: I28e544490d17bbdc06ab11ed32464af5802ab206
Reviewed-on: https://go-review.googlesource.com/28968
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
3bf141955b
commit
2e4dc86bfb
5 changed files with 12 additions and 6 deletions
|
|
@ -116,7 +116,7 @@ func reexportdep(n *Node) {
|
|||
}
|
||||
|
||||
// nodes for method calls.
|
||||
if n.Type == nil || n.Type.Recv() != nil {
|
||||
if n.Type == nil || n.IsMethod() {
|
||||
break
|
||||
}
|
||||
fallthrough
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue