mirror of
https://github.com/golang/go
synced 2024-11-19 17:14:44 -07:00
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: Robert Griesemer <gri@golang.org>
This commit is contained in:
parent
d7691d055a
commit
c26fac88d4
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user