]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: use named fields in newnamel
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 18 Apr 2019 17:05:33 +0000 (10:05 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 18 Apr 2019 17:27:12 +0000 (17:27 +0000)
CL 172579 added field names in nodl. See that CL for an explanation.
Cuong Manh Le pointed out that we should do the same in newnamel.

This cuts 40k off the cmd/compile binary.

Change-Id: I427b117531c59630dee36f1257aad8975626b2c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/172604
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/compile/internal/gc/subr.go

index 5e74bee0315725767bbd1efca56088de7578f570..55b96e5c9bae6788e0b38d511e628cd01c8f6488 100644 (file)
@@ -347,13 +347,13 @@ func newnamel(pos src.XPos, s *types.Sym) *Node {
        }
 
        var x struct {
-               Node
-               Name
-               Param
+               Node
+               Name
+               Param
        }
-       n := &x.Node
-       n.Name = &x.Name
-       n.Name.Param = &x.Param
+       n := &x.n
+       n.Name = &x.m
+       n.Name.Param = &x.p
 
        n.Op = ONAME
        n.Pos = pos