cmd/compile: add convnop helper function

Like the conv helper function but for creating OCONVNOP nodes
instead of OCONV nodes.

passes toolstash -cmp

Change-Id: Ib93ffe66590ebaa2b4fa552c81f1a2902e789d8e
Reviewed-on: https://go-review.googlesource.com/112597
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
Martin Möhrmann 2018-05-10 13:25:39 +02:00
parent 9e2a04d5eb
commit c5d38b896d
5 changed files with 21 additions and 27 deletions

View file

@ -1674,8 +1674,7 @@ func genwrapper(rcvr *types.Type, method *types.Field, newnam *types.Sym) {
if !dotlist[0].field.Type.IsPtr() {
dot = nod(OADDR, dot, nil)
}
as := nod(OAS, nthis, nod(OCONVNOP, dot, nil))
as.Right.Type = rcvr
as := nod(OAS, nthis, convnop(dot, rcvr))
fn.Nbody.Append(as)
fn.Nbody.Append(nodSym(ORETJMP, nil, methodSym(methodrcvr, method.Sym)))
} else {