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:
Robert Griesemer 2017-04-19 10:03:35 -07:00
parent ff7994ac10
commit ec241db2fd
8 changed files with 45 additions and 42 deletions

View file

@ -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(&copy)) // 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(&copy)) // must not die
types.PkgList = savedPkgs
types.PkgMap = savedPkgMap
} else {
size = export(bout.Writer, Debug_export != 0)
}