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>
diff --git a/src/cmd/compile/internal/gc/bexport.go b/src/cmd/compile/internal/gc/bexport.go
index c539fe5..d6f3a51 100644
--- a/src/cmd/compile/internal/gc/bexport.go
+++ b/src/cmd/compile/internal/gc/bexport.go
@@ -465,7 +465,7 @@
 		// TODO(gri) Determine if they are already sorted
 		// in which case we can drop this step.
 		var methods []*Field
-		for m, it := IterMethods(t); m != nil; m = it.Next() {
+		for _, m := range t.Methods().Slice() {
 			methods = append(methods, m)
 		}
 		sort.Sort(methodbyname(methods))
@@ -565,7 +565,7 @@
 	}
 
 	p.int(countfield(t))
-	for f, it := IterFields(t); f != nil; f = it.Next() {
+	for _, f := range t.Fields().Slice() {
 		if p.trace {
 			p.tracef("\n")
 		}
@@ -594,7 +594,7 @@
 	}
 
 	p.int(countfield(t))
-	for m, it := IterFields(t); m != nil; m = it.Next() {
+	for _, m := range t.Fields().Slice() {
 		if p.trace {
 			p.tracef("\n")
 		}
@@ -655,7 +655,7 @@
 		n = -n
 	}
 	p.int(n)
-	for q, it := IterFields(params); q != nil; q = it.Next() {
+	for _, q := range params.Fields().Slice() {
 		p.param(q, n, numbered)
 	}
 }