Also: drop all pretense of support for platforms other than darwin and linux.
This package is just a test of go/ssa, not a portable interpreter, and these
are the only platforms to which I have easy access.
Builds on: freebsd darwin plan9 linux windows
Change-Id: I965abc67b1280d33e933b83607a4372d65e070cf
Reviewed-on: https://go-review.googlesource.com/33163
Reviewed-by: Robert Griesemer <gri@golang.org>
The existing implementation shows a comment after its code block.
This causes confusion regarding how the comment relates to a code block.
Comments have been moved before their relative code blocks.
Fixesgolang/go#16728
Change-Id: Ie07a6dd2f340a2555513662f263d26377060f93b
Reviewed-on: https://go-review.googlesource.com/33279
Reviewed-by: Alan Donovan <adonovan@google.com>
Add identical workaround from gorename to guru. Only affects queries
that typecheck the code first.
Fixesgolang/go#16530
Change-Id: I718cfceb8d26868eea9128c8873b164333c50f53
Reviewed-on: https://go-review.googlesource.com/33359
Reviewed-by: Alan Donovan <adonovan@google.com>
The SHA sums are clearly visible (and copy-pastable) in the expanded section
immediately below it.
Fixesgolang/go#16900.
Change-Id: If1805534b3893f6c38f4170c4b457ff0e935ce28
Reviewed-on: https://go-review.googlesource.com/33290
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
The export data formats (text and binary) emitted by gc in Go 1.7 did
not record the package that "owns" each blank field, even though blank
is an unexported identifier. Before, gcimporter would assume the
package of the export data file owns blank fields within it, even
blank fields reexported from another package. As a result, identical
types would become nonidentical during reexporting.
For bug compatibility with gc, gcimporter now treats blank fields as
if they all belong to the same dummy package, avoiding spurious "can't
assign A to B" errors in tools based on go/types.
Change-Id: I0dbf71491a0ec0f376e9dc8a91efe0376c855a28
Reviewed-on: https://go-review.googlesource.com/33146
Reviewed-by: Robert Griesemer <gri@golang.org>
We already are compatible with the latest format. Update version.
Tested against 1.6, 1.7, and tip.
Fixesgolang/go#17734.
Change-Id: Ia167adf0ed1de371c348329513819fb9e8ca2628
Reviewed-on: https://go-review.googlesource.com/33113
Reviewed-by: Alan Donovan <adonovan@google.com>
We don't support Go1.5 anymore.
Tested with 1.6, 1.7, and tip.
For golang/go#17734.
Change-Id: I718c7996b99f9b98744346e119ee209b4709a070
Reviewed-on: https://go-review.googlesource.com/33111
Reviewed-by: Alan Donovan <adonovan@google.com>
If the name of an archive member is longer than 16 bytes, an ELF archive
file contains a string table of file names under the name "//", and this
member has no mode. Skip such members.
+ Test.
Change-Id: Ib10db1cc42816c9002433be6176240e490678560
Reviewed-on: https://go-review.googlesource.com/32973
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Found by vet.
Follow-up to comments on CL 32682.
Change-Id: I76391e02b9991bc480404f634ea809e75645e9dc
Reviewed-on: https://go-review.googlesource.com/32918
Reviewed-by: Alan Donovan <adonovan@google.com>
...to match the new interface between "go test" and the standard testing
package.
Rather than generate SSA code directly, which was tricky and fragile, we
now generate source just as "go test" does, type-check it, and build an
SSA package from it. crawshaw suggested I do this in the very first
version of testmain.go, but at the time I believed it to be infeasible.
The testMainStartBodyHook mechanism has gone away; installations that
needed it can now achieve the same results more easily by overriding the
templates.
Tested with Go 1.6, 1.7 and 1.8.
Fixesgolang/go#17722
Change-Id: I3ffd25f01157f6fb7a39acd18af46f17e9c07b99
Reviewed-on: https://go-review.googlesource.com/32888
Reviewed-by: Robert Griesemer <gri@golang.org>
Allow extra arguments to be passed to the specified gccgo compiler
when it is called in GccgoInstallation.InitFromDriver. This allows
the call to gccgo to be adjusted depending on the build environment.
For example, some build environments require the
'no-canonical-prefixes' option to prevent gccgo from resolving
symlinks when generating relative prefixes.
Change-Id: I0ecf338ee7a3780f1f65b30e214e69c1698041bb
Reviewed-on: https://go-review.googlesource.com/32874
Reviewed-by: Alan Donovan <adonovan@google.com>
Reason: Decision to back out current alias implementation.
For golang/go#16339 (comment).
Change-Id: Id2a394d78a8661c767bcc05370b81f79d9bfb714
Reviewed-on: https://go-review.googlesource.com/32756
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Chris Manghane <cmang@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This reverts commit 50193ec1c5.
Reason for revert: aliases will not be part of Go 1.8
Change-Id: Idb3b74243eeb8dbeb2a2f4bd69a248c1dafa5348
Reviewed-on: https://go-review.googlesource.com/32835
Reviewed-by: Robert Griesemer <gri@golang.org>
This repo already contains an identical LICENSE.
The README adds little, particularly in golang.org/x.
Update the custom import path comment.
Change-Id: I23fb5e31df6ff4828d298d44dc30dca901b0627b
Reviewed-on: https://go-review.googlesource.com/32682
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This CL copies rsc.io/toolstash verbatim at commit
7508e1dd47d11b2fc45f544415e014e4f25d3f95
to golang.org/x/tools/cmd/toolstash.
There are no code changes to adapt it
to its new home; those will happen in a follow-up CL.
rsc.io/toolstash will be updated to contain only
a README and a doc.go redirecting readers.
Change-Id: Icbef4d72215a8b124f857587905b45902d6cdece
Reviewed-on: https://go-review.googlesource.com/32681
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This reverts commit 9a286cdc33.
Reason for revert: go1.8 code in a go1.7 file.
Change-Id: I5465820c60197f4288243d1b15b1be20531b923d
Reviewed-on: https://go-review.googlesource.com/32733
Reviewed-by: Alan Donovan <adonovan@google.com>
Also:
- always display the value of a constant expr, whether query expr is a
definition, a reference, or an alias.
- eliminate some go1.5 portability code.
- remove go1.8 fork of referrers; no changes are necessary
since I decided not to treat aliases specially.
- add tests.
Tested with Go 1.6, Go 1.7, and tip (Go 1.8).
Change-Id: I94624cff82f4d8c0dcbf12d11c8ce16e8168a7fe
Reviewed-on: https://go-review.googlesource.com/32730
Reviewed-by: Robert Griesemer <gri@golang.org>
+ test
Tested on 1.6, 1.7, and 1.8.
Fixesgolang/go#17731.
Change-Id: I06dff4a72ff08ed5e8ae1d23a1e65fe719c03180
Reviewed-on: https://go-review.googlesource.com/32581
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
The -newexport flag is on by default for 1.7,
no need to special-case it anymore.
Tested against 1.6, 1.7, and 1.8.
Change-Id: I9c4a31f80d1309564e2a01514fca4b17e4378b9c
Reviewed-on: https://go-review.googlesource.com/32582
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This CL only copies files and updates build tags.
Substantive changes will come in follow-ups.
This is a workaround for git's lack of rename/copy tracking.
Tested with go1.6, go1.7, and tip (go1.8).
Change-Id: Id88a05273fb963586b228d5e5dfacab32133a960
Reviewed-on: https://go-review.googlesource.com/32630
Reviewed-by: Robert Griesemer <gri@golang.org>
Most objects are declared by an identifier, so the end position is
start+len(name). However, this heuristic doesn't work for PkgName
objects because a (non-renaming) import creates an object without an
identifier.
Fixes issue github.com/Microsoft/vscode-go#562
Change-Id: I0eb44ca33a643c910d97abbf700ea4c3cd23bb41
Reviewed-on: https://go-review.googlesource.com/32440
Reviewed-by: Robert Griesemer <gri@golang.org>
because its export data doesn't contain file position information.
Change-Id: Ia3ab54ae8a493666b9ad63577aa8fad513385052
Reviewed-on: https://go-review.googlesource.com/32299
Reviewed-by: Robert Griesemer <gri@golang.org>
This is a short-term stop-gap to keep the builders happy.
Change-Id: I87171c20bf44f36fd2c4d7213211217de6110fdd
Reviewed-on: https://go-review.googlesource.com/32293
Reviewed-by: Robert Griesemer <gri@golang.org>
(The first was go-review.googlesource.com/c/31813)
Fixes issue golang/go#17565
Change-Id: I61c124e041af689913aedebdde654197c5526228
Reviewed-on: https://go-review.googlesource.com/32034
Reviewed-by: Robert Griesemer <gri@golang.org>
This package is provided as a stop-gap until gccgo uses the same export
data format as gc. Once that occurs, this package will be deprecated
and eventually deleted. The API is similar to (a subset of) gcexportdata.
Change-Id: I3398dbb8eab508a24d12036bbadaa60c2c1e77b3
Reviewed-on: https://go-review.googlesource.com/31822
Reviewed-by: Robert Griesemer <gri@golang.org>
The standard go/internal/gccgoimporter package is essentially unusable
behind the go/importer.For API, so this change makes a copy of it in
x/tools. A follow-up change will expose a small but usable API to it.
Change-Id: Ica5092267ecafb78e1d983c86aa46e4e0bef02d5
Reviewed-on: https://go-review.googlesource.com/31854
Reviewed-by: Robert Griesemer <gri@golang.org>