]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: arrange for typecheck1 to end in switch
authorRuss Cox <rsc@golang.org>
Fri, 4 Dec 2020 16:37:54 +0000 (11:37 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 7 Dec 2020 20:40:21 +0000 (20:40 +0000)
commitef5964dd6b092f7e0d9bd4332a5d258eb80ecef8
tree8d0acc8858e73a3859329beaa0747018aaaae566
parentdcc640e8391d6d022b595a3b53124bbcbd985c76
[dev.regabi] cmd/compile: arrange for typecheck1 to end in switch

Ending typecheck1 in the switch makes it safe for each case
to do an appropriate type assertion. The main change is dropping
the computation of "ok" and using the syntax nodes themselves
to decide what's OK.

Passes buildall w/ toolstash -cmp.

Change-Id: I2a1873a51e3f1194d74bb87a6653cb9857a02a1b
Reviewed-on: https://go-review.googlesource.com/c/go/+/275444
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/typecheck.go
src/cmd/compile/internal/ir/expr.go
src/cmd/compile/internal/ir/func.go
src/cmd/compile/internal/ir/name.go
src/cmd/compile/internal/ir/stmt.go
test/used.go