mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: move and rename mkpkg to types.NewPkg
That's where it belongs. Also, moved pkgMap and pkgs globals. Change-Id: I531727fe5ce162c403efefec82f4cc90afa326d7 Reviewed-on: https://go-review.googlesource.com/41071 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
ff7994ac10
commit
ec241db2fd
8 changed files with 45 additions and 42 deletions
|
|
@ -173,13 +173,13 @@ func dumpexport() {
|
|||
|
||||
// verify that we can read the copied export data back in
|
||||
// (use empty package map to avoid collisions)
|
||||
savedPkgMap := pkgMap
|
||||
savedPkgs := pkgs
|
||||
pkgMap = make(map[string]*types.Pkg)
|
||||
pkgs = nil
|
||||
Import(mkpkg(""), bufio.NewReader(©)) // must not die
|
||||
pkgs = savedPkgs
|
||||
pkgMap = savedPkgMap
|
||||
savedPkgMap := types.PkgMap
|
||||
savedPkgs := types.PkgList
|
||||
types.PkgMap = make(map[string]*types.Pkg)
|
||||
types.PkgList = nil
|
||||
Import(types.NewPkg(""), bufio.NewReader(©)) // must not die
|
||||
types.PkgList = savedPkgs
|
||||
types.PkgMap = savedPkgMap
|
||||
} else {
|
||||
size = export(bout.Writer, Debug_export != 0)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue