]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/noder: remove inlined closure naming hack
authorMatthew Dempsky <mdempsky@google.com>
Thu, 17 Aug 2023 04:16:29 +0000 (21:16 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 17 Aug 2023 19:36:29 +0000 (19:36 +0000)
commitf4e6815652cf3c4803001dd9ab7f0d7f125a466c
tree5ae59cbf9e4055a08d1f8e594ade2c806cc840b7
parent4e411e7bc44378422fa52f478927d9f71c39f385
cmd/compile/internal/noder: remove inlined closure naming hack

I previously used a clumsy hack to copy Closgen back and forth while
inlining, to handle when an inlined function contains closures, which
need to each be uniquely numbered.

The real solution was to name the closures using r.inlCaller, rather
than r.curfn. This CL adds a helper method to do exactly this.

Change-Id: I510553b5d7a8f6581ea1d21604e834fd6338cb06
Reviewed-on: https://go-review.googlesource.com/c/go/+/520339
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/noder/reader.go
test/closure3.dir/main.go