aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/reflectdata/alg.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2023-08-16 19:45:12 -0700
committerGopher Robot <gobot@golang.org>2023-08-17 19:36:28 +0000
commit4e411e7bc44378422fa52f478927d9f71c39f385 (patch)
tree410b861e3c9cfe39adb8a64127536aaad09371f4 /src/cmd/compile/internal/reflectdata/alg.go
parent5c6fbd2c3ee4a71493d3a7aa6f09a70ddcf0b230 (diff)
downloadgo-4e411e7bc44378422fa52f478927d9f71c39f385.tar.xz
cmd/compile: cleanup Func construction
This CL moves more common Func-setup logic into ir.NewFunc. In particular, it now handles constructing the Name and wiring them together, setting the Typecheck bit, and setting Sym.Func. Relatedly, this CL also extends typecheck.DeclFunc to append the function to typecheck.Target.Funcs, so that callers no longer need to do this. Change-Id: Ifa0aded8df0517188eb295d0dccc107af85f1e8a Reviewed-on: https://go-review.googlesource.com/c/go/+/520338 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/reflectdata/alg.go')
-rw-r--r--src/cmd/compile/internal/reflectdata/alg.go2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/reflectdata/alg.go b/src/cmd/compile/internal/reflectdata/alg.go
index a561c1e8b5..edfd92fb40 100644
--- a/src/cmd/compile/internal/reflectdata/alg.go
+++ b/src/cmd/compile/internal/reflectdata/alg.go
@@ -243,7 +243,6 @@ func hashFunc(t *types.Type) *ir.Func {
})
fn.SetNilCheckDisabled(true)
- typecheck.Target.Funcs = append(typecheck.Target.Funcs, fn)
return fn
}
@@ -632,7 +631,6 @@ func eqFunc(t *types.Type) *ir.Func {
// neither of which can be nil, and our comparisons
// are shallow.
fn.SetNilCheckDisabled(true)
- typecheck.Target.Funcs = append(typecheck.Target.Funcs, fn)
return fn
}