cmd/compile: add Nodes.Set1 method and use it where possible

Passes toolstash -cmp.

Change-Id: I05322fb5afd213f13fb247ec1a5f655c17a58774
Reviewed-on: https://go-review.googlesource.com/20522
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Ian Lance Taylor 2016-03-10 10:13:42 -08:00
parent 72655afb4e
commit c63dbd87c1
15 changed files with 63 additions and 54 deletions

View file

@ -778,7 +778,7 @@ func slicelit(ctxt int, n *Node, var_ *Node, init *Nodes) {
a = Nod(OADDR, a, nil)
} else {
a = Nod(ONEW, nil, nil)
a.List.Set([]*Node{typenod(t)})
a.List.Set1(typenod(t))
}
a = Nod(OAS, vauto, a)
@ -850,7 +850,7 @@ func maplit(ctxt int, n *Node, var_ *Node, init *Nodes) {
nerr := nerrors
a := Nod(OMAKE, nil, nil)
a.List.Set([]*Node{typenod(n.Type)})
a.List.Set1(typenod(n.Type))
litas(var_, a, init)
// count the initializers
@ -952,9 +952,9 @@ func maplit(ctxt int, n *Node, var_ *Node, init *Nodes) {
r = Nod(OAS, r, a)
a = Nod(OFOR, nil, nil)
a.Nbody.Set([]*Node{r})
a.Nbody.Set1(r)
a.Ninit.Set([]*Node{Nod(OAS, index, Nodintconst(0))})
a.Ninit.Set1(Nod(OAS, index, Nodintconst(0)))
a.Left = Nod(OLT, index, Nodintconst(tarr.Bound))
a.Right = Nod(OAS, index, Nod(OADD, index, Nodintconst(1)))