[PATCH] [llgo] llgoi: Fix type identity for imported binary packages.
Peter Collingbourne
peter at pcc.me.uk
Wed Mar 18 01:23:35 PDT 2015
================
Comment at: cmd/llgoi/llgoi.go:101
@@ -100,3 +100,3 @@
origImporter := in.copts.Importer
- in.copts.Importer = func(pkgmap map[string]*types.Package, pkgpath string) (*types.Package, error) {
- if pkg, ok := in.inputPkgmap[pkgpath]; ok {
+ in.copts.Importer = func(_ map[string]*types.Package, pkgpath string) (*types.Package, error) {
+ if pkg, ok := in.pkgmap[pkgpath]; ok && pkg.Complete() {
----------------
axw wrote:
> I'd prefer if we stuck to the contract of go/types.Importer (as before), and instead just set go/types.Config.Packages to the same map each time. I understand that the package map is only read/updated by the importer currently, but I'm not sure if that's guaranteed to be the case forever. Perhaps I'm being paranoid?
Seems reasonable, done.
http://reviews.llvm.org/D8409
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list