Commit 25a1d5d0 authored by Matthew Dempsky's avatar Matthew Dempsky

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: 's avatarJosh Bleecher Snyder <josharian@gmail.com>
parent 9330ef86
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment