]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: use explicit block statements for init
authorRuss Cox <rsc@golang.org>
Tue, 1 Dec 2020 04:49:25 +0000 (23:49 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 2 Dec 2020 23:18:21 +0000 (23:18 +0000)
commit64bc656aed3ba7539a85f6b52f2aa933c9ce8130
tree8fc8158489549fd2264a20c50c5a70ac88f56089
parentecc8d15bc5f48916176c4bba809b327a72b66e2c
[dev.regabi] cmd/compile: use explicit block statements for init

For statements like goto that don't need an init, use an
explicit block statement instead of forcing them to have one.

There is also one call to addinit that is being replaced with
a block. That call is the source of much of my confusion
regarding init statements: walkstmt calls addinit on a statement,
whereas all the other uses of addinit are on expressions.

After this CL, they're all expressions.

Passes buildall w/ toolstash -cmp.

Change-Id: Ifdef9d318c236dc1a7567f9e9ef4a6bedd3fe81f
Reviewed-on: https://go-review.googlesource.com/c/go/+/274597
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/inl.go
src/cmd/compile/internal/gc/walk.go