[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>
This commit is contained in:
Russ Cox 2020-12-04 11:37:54 -05:00
parent dcc640e839
commit ef5964dd6b
6 changed files with 195 additions and 175 deletions

View file

@ -114,6 +114,8 @@ func NewFunc(pos src.XPos) *Func {
return f
}
func (f *Func) isStmt() {}
func (f *Func) Func() *Func { return f }
func (f *Func) Body() Nodes { return f.body }
func (f *Func) PtrBody() *Nodes { return &f.body }