1
0
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:
Matthew Dempsky 2017-03-23 15:26:10 -07:00
parent 9330ef869c
commit 25a1d5d0f4
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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