Commit c26fac88 authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile/internal/gc: use functype instead of OTFUNC

Slightly simpler.

Change-Id: Ic3a96675c56cc8c2e336b932536c2247f8cbb96d
Reviewed-on: https://go-review.googlesource.com/39996
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
parent d7691d05
...@@ -343,12 +343,12 @@ func hashfor(t *types.Type) *Node { ...@@ -343,12 +343,12 @@ func hashfor(t *types.Type) *Node {
n := newname(sym) n := newname(sym)
n.SetClass(PFUNC) n.SetClass(PFUNC)
tfn := nod(OTFUNC, nil, nil) n.Type = functype(nil, []*Node{
tfn.List.Append(anonfield(types.NewPtr(t))) anonfield(types.NewPtr(t)),
tfn.List.Append(anonfield(types.Types[TUINTPTR])) anonfield(types.Types[TUINTPTR]),
tfn.Rlist.Append(anonfield(types.Types[TUINTPTR])) }, []*Node{
tfn = typecheck(tfn, Etype) anonfield(types.Types[TUINTPTR]),
n.Type = tfn.Type })
return n return n
} }
......
...@@ -1803,13 +1803,13 @@ func hashmem(t *types.Type) *Node { ...@@ -1803,13 +1803,13 @@ func hashmem(t *types.Type) *Node {
n := newname(sym) n := newname(sym)
n.SetClass(PFUNC) n.SetClass(PFUNC)
tfn := nod(OTFUNC, nil, nil) n.Type = functype(nil, []*Node{
tfn.List.Append(anonfield(types.NewPtr(t))) anonfield(types.NewPtr(t)),
tfn.List.Append(anonfield(types.Types[TUINTPTR])) anonfield(types.Types[TUINTPTR]),
tfn.List.Append(anonfield(types.Types[TUINTPTR])) anonfield(types.Types[TUINTPTR]),
tfn.Rlist.Append(anonfield(types.Types[TUINTPTR])) }, []*Node{
tfn = typecheck(tfn, Etype) anonfield(types.Types[TUINTPTR]),
n.Type = tfn.Type })
return n return n
} }
......
...@@ -3215,12 +3215,12 @@ func eqfor(t *types.Type) (n *Node, needsize bool) { ...@@ -3215,12 +3215,12 @@ func eqfor(t *types.Type) (n *Node, needsize bool) {
sym := typesymprefix(".eq", t) sym := typesymprefix(".eq", t)
n := newname(sym) n := newname(sym)
n.SetClass(PFUNC) n.SetClass(PFUNC)
ntype := nod(OTFUNC, nil, nil) n.Type = functype(nil, []*Node{
ntype.List.Append(anonfield(types.NewPtr(t))) anonfield(types.NewPtr(t)),
ntype.List.Append(anonfield(types.NewPtr(t))) anonfield(types.NewPtr(t)),
ntype.Rlist.Append(anonfield(types.Types[TBOOL])) }, []*Node{
ntype = typecheck(ntype, Etype) anonfield(types.Types[TBOOL]),
n.Type = ntype.Type })
return n, false return n, false
} }
Fatalf("eqfor %v", t) Fatalf("eqfor %v", t)
......
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