]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/gc: use functype instead of OTFUNC
authorMatthew Dempsky <mdempsky@google.com>
Fri, 7 Apr 2017 22:39:36 +0000 (15:39 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 15 Feb 2018 21:41:39 +0000 (21:41 +0000)
Slightly simpler.

Change-Id: Ic3a96675c56cc8c2e336b932536c2247f8cbb96d
Reviewed-on: https://go-review.googlesource.com/39996
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/alg.go
src/cmd/compile/internal/gc/subr.go
src/cmd/compile/internal/gc/walk.go

index e98df71b34b678b9a55f029f82e7703ae32c97d0..cdb21a7d4b06281005b5038d39ce1b25e7da22bd 100644 (file)
@@ -343,12 +343,12 @@ func hashfor(t *types.Type) *Node {
 
        n := newname(sym)
        n.SetClass(PFUNC)
-       tfn := nod(OTFUNC, nil, nil)
-       tfn.List.Append(anonfield(types.NewPtr(t)))
-       tfn.List.Append(anonfield(types.Types[TUINTPTR]))
-       tfn.Rlist.Append(anonfield(types.Types[TUINTPTR]))
-       tfn = typecheck(tfn, Etype)
-       n.Type = tfn.Type
+       n.Type = functype(nil, []*Node{
+               anonfield(types.NewPtr(t)),
+               anonfield(types.Types[TUINTPTR]),
+       }, []*Node{
+               anonfield(types.Types[TUINTPTR]),
+       })
        return n
 }
 
index 5143c3e3d53eb0658314c94967b0ee8157ed3618..86d5539ca2e0b925117e9008b357da8fb4154602 100644 (file)
@@ -1803,13 +1803,13 @@ func hashmem(t *types.Type) *Node {
 
        n := newname(sym)
        n.SetClass(PFUNC)
-       tfn := nod(OTFUNC, nil, nil)
-       tfn.List.Append(anonfield(types.NewPtr(t)))
-       tfn.List.Append(anonfield(types.Types[TUINTPTR]))
-       tfn.List.Append(anonfield(types.Types[TUINTPTR]))
-       tfn.Rlist.Append(anonfield(types.Types[TUINTPTR]))
-       tfn = typecheck(tfn, Etype)
-       n.Type = tfn.Type
+       n.Type = functype(nil, []*Node{
+               anonfield(types.NewPtr(t)),
+               anonfield(types.Types[TUINTPTR]),
+               anonfield(types.Types[TUINTPTR]),
+       }, []*Node{
+               anonfield(types.Types[TUINTPTR]),
+       })
        return n
 }
 
index 872b20925e27189d5a50d714ee39ed33f2d11844..51def75a3333d83bf11a94963c2ac7a67c52f3ce 100644 (file)
@@ -3215,12 +3215,12 @@ func eqfor(t *types.Type) (n *Node, needsize bool) {
                sym := typesymprefix(".eq", t)
                n := newname(sym)
                n.SetClass(PFUNC)
-               ntype := nod(OTFUNC, nil, nil)
-               ntype.List.Append(anonfield(types.NewPtr(t)))
-               ntype.List.Append(anonfield(types.NewPtr(t)))
-               ntype.Rlist.Append(anonfield(types.Types[TBOOL]))
-               ntype = typecheck(ntype, Etype)
-               n.Type = ntype.Type
+               n.Type = functype(nil, []*Node{
+                       anonfield(types.NewPtr(t)),
+                       anonfield(types.NewPtr(t)),
+               }, []*Node{
+                       anonfield(types.Types[TBOOL]),
+               })
                return n, false
        }
        Fatalf("eqfor %v", t)