mirror of
https://github.com/golang/go
synced 2024-11-18 04:04:49 -07: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
@ -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
|
||||
|
@ -342,7 +342,6 @@ func nod(op Op, nleft *Node, nright *Node) *Node {
|
||||
}
|
||||
n = &x.Node
|
||||
n.Func = &x.Func
|
||||
n.Func.SetIsHiddenClosure(Curfn != nil)
|
||||
case ONAME:
|
||||
var x struct {
|
||||
Node
|
||||
|
Loading…
Reference in New Issue
Block a user