1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:54:42 -07:00
go/importer
Alan Donovan 3d82e7e94a go.tools/ssa: fix crash in SSA builder when using GCImporter to satisfy imports (ssadump -build=G).
Packages were not being created for all types.Packages,
specifically, indirectly imported packages were missing.
(*Program).CreatePackages now iterates over the type-checker's
package map too.

Also: removed all concurrency from importer.  I think it was
incorrect (and hard to fix).

Also: change LoadInitialPackages so that all named packages
are loaded from source.  This happens regardless of whether
GCImporter is used to satisfy imports.

Details:
- importer.Config.SourceImports flag determines whether to
  load all packages from *.go source.
  (Before, this was indicated by Config.Build != nil.)
- importer.Config.Build field effectively defaults to
  &go/build.Default.  A zero importer.Config is now usable.
- importer.Importer.Config field is now exported.
- LoadPackage renamed to ImportPackage since the resulting
  packages may come from GCImporter (and be incomplete).
- doImport and ImportPackage fused.

Fixes golang/go#7028

R=gri, axwalk
CC=golang-codereviews
https://golang.org/cl/48770043
2014-01-09 14:11:54 -05:00
..
testdata go.tools/importer: add unit test of LoadInitialPackages. 2013-09-10 10:39:51 -04:00
importer_test.go go.tools/ssa: fix crash in SSA builder when using GCImporter to satisfy imports (ssadump -build=G). 2014-01-09 14:11:54 -05:00
importer.go go.tools/ssa: fix crash in SSA builder when using GCImporter to satisfy imports (ssadump -build=G). 2014-01-09 14:11:54 -05:00
pkginfo.go go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
source_test.go go.tools/ssa: fix crash in SSA builder when using GCImporter to satisfy imports (ssadump -build=G). 2014-01-09 14:11:54 -05:00
util.go go.tools/importer: don't pass srcDir=os.Getwd to go/build.Import(). 2013-10-31 10:56:33 -04:00