]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: add flag to FOR/RANGE to preserve loop semantics across inlines
authorDavid Chase <drchase@google.com>
Wed, 25 Jan 2023 22:08:16 +0000 (17:08 -0500)
committerDavid Chase <drchase@google.com>
Mon, 6 Mar 2023 18:34:53 +0000 (18:34 +0000)
commit5a7793b7b81e1069cc830a14997ede3730295175
treeadc5bd6174deab654d26ddc0eec4025bb65de4bf
parentc20d95916357acf141159d4efc8894bfc14a2cd6
cmd/compile: add flag to FOR/RANGE to preserve loop semantics across inlines

This modifies the loopvar change to be tied to the
package if it is specified that way, and preserves
the change across inlining.

Down the road, this will be triggered (and flow correctly)
if the changed semantics are tied to Go version specified
in go.mod (or rather, for the compiler, by the specified
version for compilation).

Includes tests.

Change-Id: If54e8b6dd23273b86be5ba47838c90d38af9bd1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/463595
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/escape/stmt.go
src/cmd/compile/internal/ir/fmt.go
src/cmd/compile/internal/ir/stmt.go
src/cmd/compile/internal/loopvar/loopvar.go
src/cmd/compile/internal/loopvar/loopvar_test.go
src/cmd/compile/internal/noder/reader.go
src/cmd/compile/internal/noder/writer.go
src/cmd/compile/internal/reflectdata/alg.go
src/cmd/compile/internal/ssagen/ssa.go
src/cmd/compile/internal/walk/complit.go
src/cmd/compile/internal/walk/range.go