]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: change Func.Inldcl from *[]*Node to Nodes
authorIan Lance Taylor <iant@golang.org>
Thu, 10 Mar 2016 18:42:28 +0000 (10:42 -0800)
committerIan Lance Taylor <iant@golang.org>
Thu, 10 Mar 2016 19:56:55 +0000 (19:56 +0000)
Change-Id: I055e986c3f27d5c07badcd1684f4fe1d65a917a9
Reviewed-on: https://go-review.googlesource.com/20523
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/compile/internal/gc/inl.go
src/cmd/compile/internal/gc/syntax.go

index a1bb17752e54660e66e0a4fed448118dd3d63be7..35df490600f85492422aad5fd9c526ba7a929a8b 100644 (file)
@@ -151,9 +151,7 @@ func caninl(fn *Node) {
        fn.Func.Nname.Func.Inl.Set(fn.Nbody.Slice())
        fn.Nbody.Set(inlcopylist(fn.Func.Nname.Func.Inl.Slice()))
        inldcl := inlcopylist(fn.Func.Nname.Name.Defn.Func.Dcl)
-       if len(inldcl) > 0 {
-               fn.Func.Nname.Func.Inldcl = &inldcl
-       }
+       fn.Func.Nname.Func.Inldcl.Set(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
@@ -565,9 +563,7 @@ func mkinlcall1(np **Node, fn *Node, isddd bool) {
        var dcl []*Node
        if fn.Name.Defn != nil {
                // local function
-               if fn.Func.Inldcl != nil {
-                       dcl = *fn.Func.Inldcl
-               }
+               dcl = fn.Func.Inldcl.Slice()
        } else {
                // imported function
                dcl = fn.Func.Dcl
index 6bc795beba5f153953f504366a9940c9980098b0..e36ae2d722da8f23f9f4ec7cc682028d72bceee0 100644 (file)
@@ -151,9 +151,9 @@ type Func struct {
        Shortname  *Node
        Enter      Nodes // for example, allocate and initialize memory for escaping parameters
        Exit       Nodes
-       Cvars      Nodes    // closure params
-       Dcl        []*Node  // autodcl for this func/closure
-       Inldcl     *[]*Node // copy of dcl for use in inlining
+       Cvars      Nodes   // closure params
+       Dcl        []*Node // autodcl for this func/closure
+       Inldcl     Nodes   // copy of dcl for use in inlining
        Closgen    int
        Outerfunc  *Node
        Fieldtrack []*Type