Simplify the code, and prevent creating ONAME node with nil Func.
Passes toolstash-check.
Change-Id: I5e5be660510dc0ef5521d278c6b9214a80b994eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/436958
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
}
func hashmem(t *types.Type) ir.Node {
- sym := ir.Pkgs.Runtime.Lookup("memhash")
-
- // TODO(austin): This creates an ir.Name with a nil Func.
- n := typecheck.NewName(sym)
- ir.MarkFunc(n)
- n.SetType(types.NewSignature(nil, []*types.Field{
- types.NewField(base.Pos, nil, types.NewPtr(t)),
- types.NewField(base.Pos, nil, types.Types[types.TUINTPTR]),
- types.NewField(base.Pos, nil, types.Types[types.TUINTPTR]),
- }, []*types.Field{
- types.NewField(base.Pos, nil, types.Types[types.TUINTPTR]),
- }))
+ n := typecheck.LookupRuntime("memhash")
+ n = typecheck.SubstArgTypes(n, t)
return n
}
func interequal(p, q unsafe.Pointer) bool
func nilinterequal(p, q unsafe.Pointer) bool
-func memhash(p unsafe.Pointer, h uintptr, size uintptr) uintptr
+func memhash(x *any, h uintptr, size uintptr) uintptr
func memhash0(p unsafe.Pointer, h uintptr) uintptr
func memhash8(p unsafe.Pointer, h uintptr) uintptr
func memhash16(p unsafe.Pointer, h uintptr) uintptr
typs[123] = newSig(params(typs[3], typs[3], typs[5]), params(typs[6]))
typs[124] = newSig(params(typs[3], typs[3]), params(typs[6]))
typs[125] = newSig(params(typs[7], typs[7]), params(typs[6]))
- typs[126] = newSig(params(typs[7], typs[5], typs[5]), params(typs[5]))
+ typs[126] = newSig(params(typs[3], typs[5], typs[5]), params(typs[5]))
typs[127] = newSig(params(typs[7], typs[5]), params(typs[5]))
typs[128] = newSig(params(typs[22], typs[22]), params(typs[22]))
typs[129] = newSig(params(typs[24], typs[24]), params(typs[24]))