Commit 6abc8c9a authored by Ian Lance Taylor's avatar Ian Lance Taylor

cmd/compile: change Func.Inldcl from []*Node to *[]*Node

Save a few bytes in Func.

Passes toolstash -cmp.

Update #14473.

Change-Id: I824fa7d5cb2d93f6f59938ccd86114abcbea0043
Reviewed-on: https://go-review.googlesource.com/19968Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 52d9479e
......@@ -150,7 +150,10 @@ func caninl(fn *Node) {
fn.Func.Nname.Func.Inl = fn.Nbody
fn.Nbody = inlcopylist(fn.Func.Nname.Func.Inl)
fn.Func.Nname.Func.Inldcl = inlcopyslice(fn.Func.Nname.Name.Defn.Func.Dcl)
inldcl := inlcopyslice(fn.Func.Nname.Name.Defn.Func.Dcl)
if len(inldcl) > 0 {
fn.Func.Nname.Func.Inldcl = &inldcl
}
fn.Func.Nname.Func.InlCost = int32(maxBudget - budget)
// hack, TODO, check for better way to link method nodes back to the thing with the ->inl
......@@ -569,9 +572,13 @@ func mkinlcall1(np **Node, fn *Node, isddd bool) {
//dumplist("ninit pre", ninit);
var dcl []*Node
if fn.Name.Defn != nil { // local function
dcl = fn.Func.Inldcl // imported function
if fn.Name.Defn != nil {
// local function
if fn.Func.Inldcl != nil {
dcl = *fn.Func.Inldcl
}
} else {
// imported function
dcl = fn.Func.Dcl
}
......
......@@ -153,7 +153,7 @@ type Func struct {
Exit *NodeList
cvars *[]*Node // closure params
Dcl []*Node // autodcl for this func/closure
Inldcl []*Node // copy of dcl for use in inlining
Inldcl *[]*Node // copy of dcl for use in inlining
Closgen int
Outerfunc *Node
Fieldtrack []*Type
......
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