cmd/gc: rewrite argtype to substitute in a single pass
Substituting in multiple passes meant walking the type
multiple times, and worse, if a complex type was substituted
in an early pass, later passes would follow it, possibly recursively,
until hitting the depth 10 limit.
Change-Id: Ie61d6ec08438e297baabe932afe33d08f358e55f
Reviewed-on: https://go-review.googlesource.com/7625
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
diff --git a/src/cmd/internal/gc/swt.go b/src/cmd/internal/gc/swt.go
index cf40ffc..c1e0405 100644
--- a/src/cmd/internal/gc/swt.go
+++ b/src/cmd/internal/gc/swt.go
@@ -543,7 +543,7 @@
} else {
a = syslook("ifacethash", 1)
}
- argtype(a, t)
+ substArgTypes(a, t)
a = Nod(OCALL, a, nil)
a.List = list1(s.facename)
a = Nod(OAS, s.hashname, a)