[dev.regabi] cmd/compile: add ir.Closure, ir.ClosureRead

Closures are another reference to Funcs,
and it cleans up the code quite a bit to be clear about types.

OCLOSUREVAR is renamed to OCLOSUREREAD to make
clearer that it is unrelated to the list Func.ClosureVars.

Passes buildall w/ toolstash -cmp.

Change-Id: Id0d28df2d4d6e9954e34df7a39ea226995eee937
Reviewed-on: https://go-review.googlesource.com/c/go/+/274098
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>
This commit is contained in:
Russ Cox 2020-11-26 00:47:44 -05:00
parent e84b27bec5
commit 4eaef981b5
11 changed files with 82 additions and 51 deletions

View file

@ -53,8 +53,8 @@ type Func struct {
body Nodes
iota int64
Nname *Name // ONAME node
OClosure Node // OCLOSURE node
Nname *Name // ONAME node
OClosure *ClosureExpr // OCLOSURE node
Shortname *types.Sym