Keeps the top-level loop in Main slightly cleaner.
Change-Id: I9c8d38d4bbb34d53edc0796893534763e9eef2f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/518957
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
return
}
+ // Don't try compiling dead hidden closure.
+ if fn.IsDeadcodeClosure() {
+ return
+ }
+
if clo := fn.OClosure; clo != nil && !ir.IsTrivialClosure(clo) {
return // we'll get this as part of its enclosing function
}
fcount := int64(0)
for i := 0; i < len(typecheck.Target.Funcs); i++ {
fn := typecheck.Target.Funcs[i]
- // Don't try compiling dead hidden closure.
- if fn.IsDeadcodeClosure() {
- continue
- }
enqueueFunc(fn)
fcount++
}