mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: convert inl.go to use nodeSeq
Passes toolstash -cmp. Update #14473. Change-Id: I60ef7cac553b346ca6b8cc7152cd184e59994b66 Reviewed-on: https://go-review.googlesource.com/20216 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:
parent
c0740fed37
commit
99b6b77e22
4 changed files with 127 additions and 153 deletions
|
|
@ -2708,8 +2708,8 @@ func mkpkg(path string) *Pkg {
|
|||
return p
|
||||
}
|
||||
|
||||
func addinit(np **Node, init *NodeList) {
|
||||
if init == nil {
|
||||
func addinit(np **Node, init nodesOrNodeList) {
|
||||
if nodeSeqLen(init) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -2725,18 +2725,10 @@ func addinit(np **Node, init *NodeList) {
|
|||
*np = n
|
||||
}
|
||||
|
||||
n.Ninit = concat(init, n.Ninit)
|
||||
setNodeSeq(&n.Ninit, append(nodeSeqSlice(init), nodeSeqSlice(n.Ninit)...))
|
||||
n.Ullman = UINF
|
||||
}
|
||||
|
||||
func addinitslice(np **Node, init []*Node) {
|
||||
var l *NodeList
|
||||
for _, n := range init {
|
||||
l = list(l, n)
|
||||
}
|
||||
addinit(np, l)
|
||||
}
|
||||
|
||||
var reservedimports = []string{
|
||||
"go",
|
||||
"type",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue