]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compiler/internal/gc: make Type.Copyto a []*Node
authorHÃ¥vard Haugen <havard.haugen@gmail.com>
Sun, 13 Sep 2015 20:58:12 +0000 (22:58 +0200)
committerDave Cheney <dave@cheney.net>
Mon, 14 Sep 2015 04:51:46 +0000 (04:51 +0000)
Passes go build -a -toolexec 'toolstash -cmp' std cmd

Change-Id: Ief4613cfb341172a85e3a894f44fb2bb308c7b55
Reviewed-on: https://go-review.googlesource.com/14554
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
src/cmd/compile/internal/gc/go.go
src/cmd/compile/internal/gc/typecheck.go

index f360378a43d44135f40c7dcc8b02094db542c805..a39cc6d48967a4fc0cd472cd2fc229d7174c5b3b 100644 (file)
@@ -210,7 +210,7 @@ type Type struct {
        Embedlineno int32 // first use of TFORW as embedded type
 
        // for TFORW, where to copy the eventual value to
-       Copyto *NodeList
+       Copyto []*Node
 
        Lastfn *Node // for usefield
 }
index 8989371e9141bb3632a0caa3a95753639fc9ba2f..bb75a034a07898dbef99b80a64cd90a671764e48 100644 (file)
@@ -3544,7 +3544,7 @@ var mapqueue *NodeList
 func copytype(n *Node, t *Type) {
        if t.Etype == TFORW {
                // This type isn't computed yet; when it is, update n.
-               t.Copyto = list(t.Copyto, n)
+               t.Copyto = append(t.Copyto, n)
 
                return
        }
@@ -3569,8 +3569,8 @@ func copytype(n *Node, t *Type) {
        t.Copyto = nil
 
        // Update nodes waiting on this type.
-       for ; l != nil; l = l.Next {
-               copytype(l.N, t)
+       for _, n := range l {
+               copytype(n, t)
        }
 
        // Double-check use of type as embedded type.