[dev.regabi] cmd/compile: simplify typecheckdef
[dev.regabi] cmd/compile: simplify typecheckdef

Reorganize code to be a little clearer. Also allows tightening
typecheckdefstack from []ir.Node to []*ir.Name.

Passes toolstash -cmp.

Change-Id: I43df1a5e2a72dd3423b132d3afe363bf76700269
Reviewed-on: https://go-review.googlesource.com/c/go/+/280649
Run-TryBot: Matthew Dempsky <e56ac2c500064424afac424d4b5e53bd0570a731@google.com>
TryBot-Result: Go Bot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Trust: Matthew Dempsky <e56ac2c500064424afac424d4b5e53bd0570a731@google.com>
Reviewed-by: Cuong Manh Le <54b4457f1dff6823379654eb5867596497ba782f@gmail.com>

CAFxX/go,CAFxX/go,golang/go,cloudflare/go,cloudflare/go,nawawi/go,CAFxX/go,golang/go,cloudflare/go,nawawi/go,CAFxX/go,golang/go,nawawi/go,golang/go,cloudflare/go,nawawi/go,nawawi/go,CAFxX/go,CAFxX/go,nawawi/go,cloudflare/go,CAFxX/go,golang/go,CAFxX/go,cloudflare/go,golang/go,nawawi/go,golang/go,nawawi/go,cloudflare/go,golang/go,cloudflare/go