diff options
author | Matthew Dempsky <mdempsky@google.com> | 2021-01-12 12:25:33 -0800 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2021-01-12 23:23:14 +0000 |
commit | d9acf6f3a3758c3096ee5ef5a24c2bc5df9d9c8b (patch) | |
tree | ede376d622212051cd966fa8c6de2a0feee86757 /src/cmd/compile/internal/noder/noder.go | |
parent | 41352fd401f4f22eceeca375361e018ea787f0fd (diff) | |
download | go-d9acf6f3a3758c3096ee5ef5a24c2bc5df9d9c8b.tar.gz go-d9acf6f3a3758c3096ee5ef5a24c2bc5df9d9c8b.zip |
[dev.regabi] cmd/compile: remove Func.ClosureType
The closure's type always matches the corresponding function's type,
so just use one instance rather than carrying around two. Simplifies
construction of closures, rewriting them during walk, and shrinks
memory usage.
Passes toolstash -cmp.
Change-Id: I83b8b8f435b02ab25a30fb7aa15d5ec7ad97189d
Reviewed-on: https://go-review.googlesource.com/c/go/+/283152
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/noder/noder.go')
-rw-r--r-- | src/cmd/compile/internal/noder/noder.go | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/noder/noder.go b/src/cmd/compile/internal/noder/noder.go index ec0debdbbd..edd30a1fc1 100644 --- a/src/cmd/compile/internal/noder/noder.go +++ b/src/cmd/compile/internal/noder/noder.go @@ -1856,7 +1856,6 @@ func fakeRecv() *ir.Field { func (p *noder) funcLit(expr *syntax.FuncLit) ir.Node { xtype := p.typeExpr(expr.Type) - ntype := p.typeExpr(expr.Type) fn := ir.NewFunc(p.pos(expr)) fn.SetIsHiddenClosure(ir.CurFunc != nil) @@ -1867,7 +1866,6 @@ func (p *noder) funcLit(expr *syntax.FuncLit) ir.Node { fn.Nname.Defn = fn clo := ir.NewClosureExpr(p.pos(expr), fn) - fn.ClosureType = ntype fn.OClosure = clo p.funcBody(fn, expr.Body) |