mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
9e2a04d5eb
commit
c5d38b896d
5 changed files with 21 additions and 27 deletions
|
|
@ -580,8 +580,7 @@ func arrayClear(n, v1, v2, a *Node) bool {
|
|||
tmp := nod(OINDEX, a, nodintconst(0))
|
||||
tmp.SetBounded(true)
|
||||
tmp = nod(OADDR, tmp, nil)
|
||||
tmp = nod(OCONVNOP, tmp, nil)
|
||||
tmp.Type = types.Types[TUNSAFEPTR]
|
||||
tmp = convnop(tmp, types.Types[TUNSAFEPTR])
|
||||
n.Nbody.Append(nod(OAS, hp, tmp))
|
||||
|
||||
// hn = len(a) * sizeof(elem(a))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue