cmd/compile: eliminate a bunch of IterFields/IterMethods calls

This is an automated rewrite of all the calls of the form:

    for f, it := IterFields(t); f != nil; f = it.Next() { ... }

Followup CLs will work on cleaning up the remaining cases.

Change-Id: Ic1005ad45ae0b50c63e815e34e507e2d2644ba1a
Reviewed-on: https://go-review.googlesource.com/20794
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Matthew Dempsky 2016-03-17 01:32:18 -07:00
parent 517b6131b2
commit f6bca3f32d
17 changed files with 69 additions and 76 deletions

View file

@ -294,7 +294,7 @@ func dumpexporttype(t *Type) {
switch t.Etype {
case TSTRUCT, TINTER:
for f, it := IterFields(t); f != nil; f = it.Next() {
for _, f := range t.Fields().Slice() {
dumpexporttype(f.Type)
}
case TFUNC:
@ -313,7 +313,7 @@ func dumpexporttype(t *Type) {
}
var m []*Field
for f, it := IterMethods(t); f != nil; f = it.Next() {
for _, f := range t.Methods().Slice() {
dumpexporttype(f.Type)
m = append(m, f)
}
@ -601,7 +601,7 @@ func dumpasmhdr() {
break
}
fmt.Fprintf(b, "#define %s__size %d\n", t.Sym.Name, int(t.Width))
for t, it := IterFields(t); t != nil; t = it.Next() {
for _, t := range t.Fields().Slice() {
if !isblanksym(t.Sym) {
fmt.Fprintf(b, "#define %s_%s %d\n", n.Sym.Name, t.Sym.Name, int(t.Width))
}