cmd/compile: add Fields field to Type

Switch TSTRUCT and TINTER to use Fields instead of Type, which wrings
out the remaining few direct uses of the latter.

Preparation for converting fields to use a separate "Field" type.

Passes toolstash/buildall.

Change-Id: I5a2ea7e159d0dde1be2c9afafc10a8f739d95743
Reviewed-on: https://go-review.googlesource.com/20675
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
Matthew Dempsky 2016-03-13 23:02:38 -07:00
parent 7971864267
commit 0d2e92c2ca
18 changed files with 89 additions and 83 deletions

View file

@ -883,19 +883,19 @@ func maplit(ctxt int, n *Node, var_ *Node, init *Nodes) {
tk := t.Down
tv := t.Type
symb := Lookup("b")
fieldb := typ(TFIELD)
fieldb.Type = tv
fieldb.Sym = symb
syma := Lookup("a")
fielda := typ(TFIELD)
fielda.Type = tk
fielda.Sym = syma
fielda.Down = fieldb
symb := Lookup("b")
var fields [2]*Type
fields[0] = typ(TFIELD)
fields[0].Type = tk
fields[0].Sym = syma
fields[1] = typ(TFIELD)
fields[1].Type = tv
fields[1].Sym = symb
tstruct := typ(TSTRUCT)
tstruct.Type = fielda
tstruct.SetFields(fields[:])
tarr := typ(TARRAY)
tarr.Bound = int64(b)