-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/compile/internal/pkginit: separate "init" and "inittask" logic
This CL splits the creation of the "init" function responsible for executing package-scope variable initialization statemens from the creation of the "inittask" record that tells the runtime how to sequence all program-wide package initialization. Longer term, this is desirable because sorting variable initialization is already handled by types2 (with Info.InitOrder), so we might as well reuse that. As a more immediate impetus, for unified IR, I want to defer method wrapper generation until after inlining (to know which wrappers are needed). But the staticinit optimization used to decide whether to emit the inittask calls into reflectdata, which in turn tries to generate its own method wrappers. So separating the work allows to create the "init" function early and then emit "inittask" after inlining is done. Change-Id: Ice1d421f92feecaaeafdf7da6b9647c0f27e3571 Reviewed-on: https://go-review.googlesource.com/c/go/+/346629 Trust: Matthew Dempsky <[email protected]> Run-TryBot: Matthew Dempsky <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Cuong Manh Le <[email protected]>
- Loading branch information
Showing
3 changed files
with
85 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters