tools/go/packages
Alan Donovan 87312bc3ed go/packages: use effective GOARCH to determine type size function
The typechecker's Sizes function is not currently set correctly.
The correct answer requires information known only to the build
system's query tool (go list, blaze query, etc), and we need to
add a mechanism for it to return this information.

In the meantime, we use this simple workaround: if the GOARCH
environment variable is set, we use that to determine sizes according
to the conventions of gc. Otherwise, we use the architecture for which
the application was compiled. Both could easily be incorrect, but this
is nonetheless progress.

This change should fix the tests of go/analysis/passes/shift,
which are currently broken for GOARCH=386 because the analysistest
driver uses go/packages, which ignores GOARCH.

Change-Id: Iabe3211ad513a9a94eadd6d8f4b2068f7abdd053
Reviewed-on: https://go-review.googlesource.com/c/141757
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-10-12 12:58:16 +00:00
..
gopackages go/packages: remove the Config.Error hook 2018-09-04 20:52:37 +00:00
doc.go go/packages: remove the Config.Error hook 2018-09-04 20:52:37 +00:00
example_test.go go/packages: remove the Config.Error hook 2018-09-04 20:52:37 +00:00
external.go go/packages: do not error out for patterns that match no packages 2018-09-28 12:33:17 +00:00
golist.go go/packages: do not error out for patterns that match no packages 2018-09-28 12:33:17 +00:00
golist_fallback.go go/packages: add ErrorKind field to differentiate error sources 2018-10-03 17:20:41 +00:00
golist_fallback_testmain.go go/packages: add missing test variants to fallback loader 2018-09-25 16:56:39 +00:00
packages.go go/packages: use effective GOARCH to determine type size function 2018-10-12 12:58:16 +00:00
packages110_test.go go/packages: generate test main files from the golist fallback 2018-09-17 22:19:12 +00:00
packages_test.go go/packages: use effective GOARCH to determine type size function 2018-10-12 12:58:16 +00:00
packagescgo_test.go go/packages: skip TestLoadImportsC when Go has been built without cgo 2018-10-05 20:28:39 +00:00
stdlib_test.go go/packages: remove the Config.Error hook 2018-09-04 20:52:37 +00:00
visit.go go/packages: remove the Config.Error hook 2018-09-04 20:52:37 +00:00