cmd/compile: add Key, FieldSlice, and SetFields helpers

Allows safely eliminating more direct uses of Type's Type and Down
fields.

Passes toolstash -cmp.

Change-Id: I5c17fe541a0473c3cd2978d8314c4ab759079a61
Reviewed-on: https://go-review.googlesource.com/20541
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Matthew Dempsky 2016-03-10 05:22:14 -08:00
parent 0b281872e6
commit 1c2bdfb7d9
12 changed files with 106 additions and 106 deletions

View file

@ -979,7 +979,7 @@ func maplit(ctxt int, n *Node, var_ *Node, init *Nodes) {
// build list of var[c] = expr.
// use temporary so that mapassign1 can have addressable key, val.
if key == nil {
key = temp(var_.Type.Down)
key = temp(var_.Type.Key())
val = temp(var_.Type.Type)
}