cmd/compile: move Node.Curfn into both Node.Func and Node.Name

$ sizeof -p cmd/compile/internal/gc Node
Node 168
$

Change-Id: If624a2d72ec04ef30a1bc7ce76c0d61a526d8a37
Reviewed-on: https://go-review.googlesource.com/10532
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Russ Cox 2015-05-27 07:31:56 -04:00
parent 3c3019aa51
commit fd2154f906
11 changed files with 72 additions and 78 deletions

View file

@ -211,7 +211,7 @@ func declare(n *Node, ctxt uint8) {
gen = vargen
}
pushdcl(s)
n.Curfn = Curfn
n.Name.Curfn = Curfn
}
if ctxt == PAUTO {
@ -383,6 +383,7 @@ func newname(s *Sym) *Node {
func newfuncname(s *Sym) *Node {
n := newname(s)
n.Func = new(Func)
n.Func.FCurfn = Curfn
return n
}
@ -555,6 +556,7 @@ func ifacedcl(n *Node) {
}
n.Func = new(Func)
n.Func.FCurfn = Curfn
dclcontext = PPARAM
markdcl()
Funcdepth++