mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 19:02:28 +00:00
compiler: process packages in deterministic order
This commit is contained in:
parent
b771d2d024
commit
6f2759be3a
7 changed files with 72 additions and 1 deletions
|
@ -74,6 +74,9 @@ type codegen struct {
|
|||
// mainPkg is a main package metadata.
|
||||
mainPkg *loader.PackageInfo
|
||||
|
||||
// packages contains packages in the order they were loaded.
|
||||
packages []string
|
||||
|
||||
// Label table for recording jump destinations.
|
||||
l []int
|
||||
}
|
||||
|
@ -1486,6 +1489,7 @@ func (c *codegen) newLambda(u uint16, lit *ast.FuncLit) {
|
|||
|
||||
func (c *codegen) compile(info *buildInfo, pkg *loader.PackageInfo) error {
|
||||
c.mainPkg = pkg
|
||||
c.analyzePkgOrder()
|
||||
funUsage := c.analyzeFuncUsage()
|
||||
|
||||
// Bring all imported functions into scope.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue