cmd/compile: hide testdclstack behind debug flag

This reduces compilation time for the program
in #18602 from 7 hours to 30 min.

Updates #14781
Updates #18602

Change-Id: I3c4af878a08920e6373d3b3b0c4453ee002e32eb
Reviewed-on: https://go-review.googlesource.com/35113
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2017-01-11 13:53:34 -08:00
parent 641ef2a733
commit f65abf6ddc
5 changed files with 20 additions and 10 deletions

View file

@ -1833,7 +1833,9 @@ func genwrapper(rcvr *Type, method *Field, newnam *Sym, iface int) {
funcbody(fn)
Curfn = fn
popdcl()
testdclstack()
if debug_dclstack != 0 {
testdclstack()
}
// wrappers where T is anonymous (struct or interface) can be duplicated.
if rcvr.IsStruct() || rcvr.IsInterface() || rcvr.IsPtr() && rcvr.Elem().IsStruct() {