]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/typecheck: refactor and simplify DeclFunc
authorMatthew Dempsky <mdempsky@google.com>
Sat, 19 Aug 2023 00:43:15 +0000 (17:43 -0700)
committerGopher Robot <gobot@golang.org>
Sun, 20 Aug 2023 05:56:49 +0000 (05:56 +0000)
commit009ca22fe2936c9a7a5a9e5364fe061688b27697
treed1cd37133b0d33da091f35d3047b71a611ce2d39
parentb581e447394b4ba7a08ea64b214781cae0f4ef6c
cmd/compile/internal/typecheck: refactor and simplify DeclFunc

This CL refactors typecheck.DeclFunc to require the caller to have
already constructed the ir.Func and signature type using ir.NewFunc
and types.NewSignature, and simplifies typecheck.DeclFunc to simply
return the slices of param and results ONAMEs.

typecheck.DeclFunc was the last reason that ir.Field still exists, so
this CL also gets rid of that.

Change-Id: Ib398420bac2fd135a235810b8af1635fa754965c
Reviewed-on: https://go-review.googlesource.com/c/go/+/520977
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/ir/type.go
src/cmd/compile/internal/pkginit/init.go
src/cmd/compile/internal/reflectdata/alg.go
src/cmd/compile/internal/ssagen/abi.go
src/cmd/compile/internal/staticinit/sched.go
src/cmd/compile/internal/typecheck/dcl.go
src/cmd/compile/internal/typecheck/subr.go