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
|
|
@ -144,7 +144,7 @@ func emitptrargsmap() {
|
|||
off := duint32(sym, 0, uint32(nbitmap))
|
||||
off = duint32(sym, off, uint32(bv.n))
|
||||
var xoffset int64
|
||||
if Curfn.Type.Recv() != nil {
|
||||
if Curfn.IsMethod() {
|
||||
xoffset = 0
|
||||
onebitwalktype1(Curfn.Type.Recvs(), &xoffset, bv)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue