]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: create "init" function during noding
authorMatthew Dempsky <mdempsky@google.com>
Thu, 24 Aug 2023 10:04:01 +0000 (03:04 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 24 Aug 2023 23:19:42 +0000 (23:19 +0000)
commit88cb17e1069bef854ead49c703262abdf93c9458
tree521b48c02ad60fecddeca0dce59b547c3065c4e2
parentcf6838467453be54d1c6b45f431db35cf95b1eee
cmd/compile: create "init" function during noding

This CL arranges for package-scope initialization statements to be
constructed directly into their eventual "init" function, so we can
eliminate the roundabout solution of using InitTodoFunc.

While here, somewhat simplify and generalize the logic for outlining
map initialization statements.

Change-Id: I8aff042e6b266f7024de436424ec6711b8b69129
Reviewed-on: https://go-review.googlesource.com/c/go/+/522318
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/ir/package.go
src/cmd/compile/internal/noder/reader.go
src/cmd/compile/internal/noder/writer.go
src/cmd/compile/internal/pkginit/init.go
src/cmd/compile/internal/staticinit/sched.go
src/cmd/compile/internal/typecheck/typecheck.go