1
0
mirror of https://github.com/golang/go synced 2024-11-26 01:17:57 -07:00

[dev.regabi] cmd/compile: split out package pkginit [generated]

[git-generate]
cd src/cmd/compile/internal/gc
rf '
	mv fninit Task
	mv init.go initorder.go cmd/compile/internal/pkginit
'

Change-Id: Ie2a924784c7a6fa029eaef821384eef4b262e1af
Reviewed-on: https://go-review.googlesource.com/c/go/+/279479
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Russ Cox 2020-12-23 01:08:27 -05:00
parent 3f04d964ab
commit 3d8a3cb06b
3 changed files with 6 additions and 5 deletions

View File

@ -16,6 +16,7 @@ import (
"cmd/compile/internal/ir"
"cmd/compile/internal/logopt"
"cmd/compile/internal/noder"
"cmd/compile/internal/pkginit"
"cmd/compile/internal/reflectdata"
"cmd/compile/internal/ssa"
"cmd/compile/internal/ssagen"
@ -223,7 +224,7 @@ func Main(archInit func(*ssagen.ArchInfo)) {
base.ExitIfErrors()
// Build init task.
if initTask := fninit(); initTask != nil {
if initTask := pkginit.Task(); initTask != nil {
typecheck.Export(initTask)
}

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package gc
package pkginit
import (
"cmd/compile/internal/base"
@ -13,13 +13,13 @@ import (
"cmd/internal/obj"
)
// fninit makes and returns an initialization record for the package.
// Task makes and returns an initialization record for the package.
// See runtime/proc.go:initTask for its layout.
// The 3 tasks for initialization are:
// 1) Initialize all of the packages the current package depends on.
// 2) Initialize all the variables that have initializers.
// 3) Run any init functions.
func fninit() *ir.Name {
func Task() *ir.Name {
nf := initOrder(typecheck.Target.Decls)
var deps []*obj.LSym // initTask records for packages the current package depends on

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package gc
package pkginit
import (
"bytes"