]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: cleanup Func construction
authorMatthew Dempsky <mdempsky@google.com>
Thu, 17 Aug 2023 02:45:12 +0000 (19:45 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 17 Aug 2023 19:36:28 +0000 (19:36 +0000)
commit4e411e7bc44378422fa52f478927d9f71c39f385
tree410b861e3c9cfe39adb8a64127536aaad09371f4
parent5c6fbd2c3ee4a71493d3a7aa6f09a70ddcf0b230
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>
12 files changed:
src/cmd/compile/internal/inline/inl.go
src/cmd/compile/internal/ir/func.go
src/cmd/compile/internal/noder/reader.go
src/cmd/compile/internal/pkginit/init.go
src/cmd/compile/internal/reflectdata/alg.go
src/cmd/compile/internal/ssa/export_test.go
src/cmd/compile/internal/ssagen/abi.go
src/cmd/compile/internal/typecheck/dcl.go
src/cmd/compile/internal/typecheck/export.go
src/cmd/compile/internal/typecheck/syms.go
src/cmd/compile/internal/typecheck/typecheck.go
src/cmd/compile/internal/types/scope.go [deleted file]