mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/gc: remove a Curfn dependency from nod
Change-Id: I5daeb8f00044c86bb10510afbc6886898e61ba15 Reviewed-on: https://go-review.googlesource.com/38570 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
9330ef869c
commit
25a1d5d0f4
2 changed files with 2 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ import (
|
|||
// function literals aka closures
|
||||
func closurehdr(ntype *Node) {
|
||||
n := nod(OCLOSURE, nil, nil)
|
||||
n.Func.SetIsHiddenClosure(Curfn != nil)
|
||||
n.Func.Ntype = ntype
|
||||
n.Func.Depth = funcdepth
|
||||
n.Func.Outerfunc = Curfn
|
||||
|
|
@ -209,6 +210,7 @@ func makeclosure(func_ *Node) *Node {
|
|||
|
||||
// create the function
|
||||
xfunc := nod(ODCLFUNC, nil, nil)
|
||||
xfunc.Func.SetIsHiddenClosure(Curfn != nil)
|
||||
|
||||
xfunc.Func.Nname = newfuncname(closurename(func_))
|
||||
xfunc.Func.Nname.Sym.SetExported(true) // disable export
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue