diff options
author | Dan Scales <danscales@google.com> | 2021-04-11 09:47:13 -0700 |
---|---|---|
committer | Dan Scales <danscales@google.com> | 2021-04-14 01:28:16 +0000 |
commit | eb433ed5a2ab13567cd5d7f0413308174750d5dd (patch) | |
tree | 46a288276cc027b310388eb3498e07cef9de024e /src/cmd/compile/internal/inline | |
parent | 8dcc071063c0a9f020f0aafd51b7e0a17f0a0746 (diff) | |
download | go-eb433ed5a2ab13567cd5d7f0413308174750d5dd.tar.gz go-eb433ed5a2ab13567cd5d7f0413308174750d5dd.zip |
cmd/compile: set types properly for imported funcs with closures
For the new export/import of node types, we were just missing setting
the types of the closure variables (which have the same types as the
captured variables) and the OCLOSURE node itself (which has the same
type as the Func node).
Re-enabled inlining of functions with closures.
Change-Id: I687149b061f3ffeec3244ff02dc6e946659077a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/308974
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/inline')
-rw-r--r-- | src/cmd/compile/internal/inline/inl.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/inline/inl.go b/src/cmd/compile/internal/inline/inl.go index 4470df1d2a..3cbe932d55 100644 --- a/src/cmd/compile/internal/inline/inl.go +++ b/src/cmd/compile/internal/inline/inl.go @@ -354,7 +354,7 @@ func (v *hairyVisitor) doNode(n ir.Node) bool { return true case ir.OCLOSURE: - if base.Debug.InlFuncsWithClosures == 0 || typecheck.Go117ExportTypes { // TODO: remove latter condition + if base.Debug.InlFuncsWithClosures == 0 { v.reason = "not inlining functions with closures" return true } |