]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: simplify CaptureVars
authorMatthew Dempsky <mdempsky@google.com>
Tue, 5 Jan 2021 02:28:55 +0000 (18:28 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 5 Jan 2021 12:31:18 +0000 (12:31 +0000)
commiteb626409d152caabac418eccbe86b49d1fc6a6f5
tree454f3865cdca81592f2a4e8fdef3756fcf23e9a6
parentc28ca67a961a0c1d149a249918a15ed74c61af27
[dev.regabi] cmd/compile: simplify CaptureVars

CaptureVars is responsible for deciding whether free variables should
be captured by value or by reference, but currently it also makes up
for some of the short-comings of the frontend symbol resolution /
type-checking algorithms. These are really separate responsibilities,
so move the latter into type-checking where it fits better.

Passes toolstash -cmp.

Change-Id: Iffbd53e83846a9ca9dfb54b597450b8543252850
Reviewed-on: https://go-review.googlesource.com/c/go/+/281534
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/typecheck/func.go