aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/reflectdata/alg.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2023-08-20 16:14:50 -0700
committerGopher Robot <gobot@golang.org>2023-08-22 21:17:13 +0000
commit08a08083c13c1e5dfc320f71d3a1602b5c628599 (patch)
tree0c13394deca5d72daa482c3f10233c569f350b1d /src/cmd/compile/internal/reflectdata/alg.go
parentc6dd97e533d480d9a972682c9357a07fc87b51ab (diff)
downloadgo-08a08083c13c1e5dfc320f71d3a1602b5c628599.tar.xz
cmd/compile/internal/typecheck: merge SubstArgTypes into LookupRuntime
LookupRuntime is the only reason for using SubstArgTypes, and most callers to LookupRuntime need to immediately call it anyway. So might as well fuse them together. Change-Id: Ie0724ed164b949040e898a2a77bea632801b64fd Reviewed-on: https://go-review.googlesource.com/c/go/+/521415 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
Diffstat (limited to 'src/cmd/compile/internal/reflectdata/alg.go')
-rw-r--r--src/cmd/compile/internal/reflectdata/alg.go12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/cmd/compile/internal/reflectdata/alg.go b/src/cmd/compile/internal/reflectdata/alg.go
index 32af785feb..c52cb2c4df 100644
--- a/src/cmd/compile/internal/reflectdata/alg.go
+++ b/src/cmd/compile/internal/reflectdata/alg.go
@@ -249,9 +249,7 @@ func hashFunc(t *types.Type) *ir.Func {
}
func runtimeHashFor(name string, t *types.Type) *ir.Name {
- n := typecheck.LookupRuntime(name)
- n = typecheck.SubstArgTypes(n, t)
- return n
+ return typecheck.LookupRuntime(name, t)
}
// hashfor returns the function to compute the hash of a value of type t.
@@ -647,9 +645,7 @@ func eqFunc(t *types.Type) *ir.Func {
func EqFor(t *types.Type) (ir.Node, bool) {
switch a, _ := types.AlgType(t); a {
case types.AMEM:
- n := typecheck.LookupRuntime("memequal")
- n = typecheck.SubstArgTypes(n, t, t)
- return n, true
+ return typecheck.LookupRuntime("memequal", t, t), true
case types.ASPECIAL:
fn := eqFunc(t)
return fn.Nname, false
@@ -667,7 +663,5 @@ func anyCall(fn *ir.Func) bool {
}
func hashmem(t *types.Type) ir.Node {
- n := typecheck.LookupRuntime("memhash")
- n = typecheck.SubstArgTypes(n, t)
- return n
+ return typecheck.LookupRuntime("memhash", t)
}