1
0
mirror of https://github.com/golang/go synced 2024-11-18 10:54:40 -07:00
Commit Graph

2019 Commits

Author SHA1 Message Date
Alan Donovan
574d60b05a refactor/rename: skip TestDiff on plan9, whose diff has no -u
Change-Id: I372591ad3f2804dcd20f0ab3b5a91ddda762cba8
Reviewed-on: https://go-review.googlesource.com/33586
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-28 18:25:41 +00:00
Alan Donovan
89662b06bc go/ssa/interp: add several intrinsics for Darwin
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>
2016-11-28 17:49:04 +00:00
Alan Donovan
167995c67f go/ssa: avoid no-arg println(), for gccgo compatibility
Change-Id: I5f789ae492ff0f0ad62d89e3ae762ece6c867d20
Reviewed-on: https://go-review.googlesource.com/33573
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-11-23 22:44:20 +00:00
Luigi Riefolo
a829d47117 cmd/godoc: show comment before code block
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.

Fixes golang/go#16728

Change-Id: Ie07a6dd2f340a2555513662f263d26377060f93b
Reviewed-on: https://go-review.googlesource.com/33279
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-11-23 22:16:29 +00:00
Rebecca Stambler
e64f1a4c63 cmd/guru: add workaround to handle inconsistency between go/types and gc
Add identical workaround from gorename to guru. Only affects queries
that typecheck the code first.

Fixes golang/go#16530

Change-Id: I718cfceb8d26868eea9128c8873b164333c50f53
Reviewed-on: https://go-review.googlesource.com/33359
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-11-23 20:09:00 +00:00
Chris Stockton
4c6345e8dc imports: respect ignoredDirs for symlinks
Fixes golang/go#17916

Added tests.

Change-Id: Ie44e4bcbec267b6c16249336c5d48bae86acc2b5
Reviewed-on: https://go-review.googlesource.com/33246
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-23 02:24:47 +00:00
Chris Broadfoot
8b84dae173 godoc/dl: remove the tiny, unselectable SHA sums from Featured Downloads
The SHA sums are clearly visible (and copy-pastable) in the expanded section
immediately below it.

Fixes golang/go#16900.

Change-Id: If1805534b3893f6c38f4170c4b457ff0e935ce28
Reviewed-on: https://go-review.googlesource.com/33290
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-15 22:46:22 +00:00
Alan Donovan
5e2ae75eb7 go/ssa/interp: add syscall.Readlink intrinsic, needed by os package
Change-Id: Ie408fd5ffb2be2d60773eb3fda91912887df0a7e
Reviewed-on: https://go-review.googlesource.com/33147
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-11 21:41:07 +00:00
Alan Donovan
22ba3f367c go/gcimporter15: pretend blank fields have same owner
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>
2016-11-11 21:27:08 +00:00
Robert Griesemer
a69656e0e2 go/gcimporter: update export data format version
We already are compatible with the latest format. Update version.

Tested against 1.6, 1.7, and tip.

Fixes golang/go#17734.

Change-Id: Ia167adf0ed1de371c348329513819fb9e8ca2628
Reviewed-on: https://go-review.googlesource.com/33113
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-11-11 18:00:05 +00:00
Robert Griesemer
c959b77b38 go/gcimporter15: update build tags and comments
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>
2016-11-11 17:55:17 +00:00
Alan Donovan
5061f921c7 go/gccgoexportdata: correctly handle archive files containing string tables
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>
2016-11-09 21:28:38 +00:00
Josh Bleecher Snyder
44b4c5d044 cmd/toolstash: fix format string arguments
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>
2016-11-08 20:54:22 +00:00
Alan Donovan
7ce0cddaad go/ssa: synthesize Go 1.8-compatible test main package
...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.

Fixes golang/go#17722

Change-Id: I3ffd25f01157f6fb7a39acd18af46f17e9c07b99
Reviewed-on: https://go-review.googlesource.com/32888
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-08 18:33:05 +00:00
Samuel Tan
09079c88dc go/gccgoexportdata: plumb additional arguments to gccgo compiler
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>
2016-11-07 23:39:01 +00:00
Robert Griesemer
46c63f3841 go/gcimporter15: revert user-visible changes related to aliases
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>
2016-11-05 01:00:22 +00:00
Alan Donovan
58ec10c513 go/ssa/interp: handle nil *hashmap cleanly
Change-Id: I2cb8eef79bc011b209b3df0b859bcddefd4c8337
Reviewed-on: https://go-review.googlesource.com/32818
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-04 21:49:12 +00:00
Alan Donovan
2e348630fd go/loader: fix fragile example test
Change-Id: Ib6313cdba54da8911b8a2ec9e1bc115c30ea6afe
Reviewed-on: https://go-review.googlesource.com/32817
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-04 21:44:43 +00:00
Alan Donovan
701d657347 tools: remove go1.8-tagged files
Change-Id: Ib52b85e1c981b6fca55c472120371a0cd37d2dc9
Reviewed-on: https://go-review.googlesource.com/32816
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-04 21:29:52 +00:00
Alan Donovan
be0bbf2399 refactor/...: remove go1.8-tagged files
Change-Id: I7df485b71ba87670d9e70e5b44e2110fd8f6a815
Reviewed-on: https://go-review.googlesource.com/32815
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-04 21:29:48 +00:00
Alan Donovan
fe1fa38300 go/ssa: remove go1.8 tagged files
Change-Id: Iac37a0dba27459f0484aa4e286c21bb618116619
Reviewed-on: https://go-review.googlesource.com/32836
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-04 21:18:10 +00:00
Alan Donovan
0e041570eb cmd/guru: revert support for Go 1.8 aliases
Change-Id: I8ba368d5036be47b6d64e3576f366eb0301d2d5b
Reviewed-on: https://go-review.googlesource.com/32831
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-04 21:18:07 +00:00
Alan Donovan
188d338f0b godoc: revert support for Go 1.8 aliases
Change-Id: Ibb3afede1121bd53567f3ff70b886b02dd81399f
Reviewed-on: https://go-review.googlesource.com/32832
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-04 21:17:32 +00:00
Alan Donovan
e2e4d7aa62 go/ast/astutil: revert support for Go 1.8 type aliases
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>
2016-11-04 21:17:24 +00:00
Alan Donovan
d268a2ba76 imports: revert support for Go 1.8 aliases
Change-Id: I8f7c0ff2c544fa51686b2e178ba82a486398651c
Reviewed-on: https://go-review.googlesource.com/32834
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-04 21:17:16 +00:00
Alan Donovan
8cbea6846d cmd/bundle: revert support for Go 1.8 aliases
Change-Id: I2b3bcc7653507e392b243dbe0610adc6be6967bd
Reviewed-on: https://go-review.googlesource.com/32833
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-04 21:17:06 +00:00
Josh Bleecher Snyder
c74ac01963 cmd/toolstash: adapt to golang.org/x/tools
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>
2016-11-04 00:31:34 +00:00
Josh Bleecher Snyder
133d2e05a6 cmd/toolstash: import from rsc.io
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>
2016-11-04 00:31:11 +00:00
Alan Donovan
55f54c0061 Revert "cmd/stringer: reject Go 1.8 type aliases"
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>
2016-11-03 22:16:55 +00:00
Alan Donovan
242b5dc780 godoc: changes to support aliases
Fixes golang.org/go#17763

Change-Id: I18012dcfd878db916cbb940c3a361a89341b9209
Reviewed-on: https://go-review.googlesource.com/32711
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-03 21:57:37 +00:00
Alan Donovan
d15da3015c cmd/guru: describe Go 1.8 aliases
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>
2016-11-03 21:55:02 +00:00
Alan Donovan
50193ec1c5 go/ast/astutil: support Go 1.8 type aliases
Change-Id: I67d561755c1c06c0438f2b42e6a13efb024558c4
Reviewed-on: https://go-review.googlesource.com/32732
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-03 21:54:53 +00:00
Alan Donovan
9a286cdc33 cmd/stringer: reject Go 1.8 type aliases
Change-Id: I56e615bf202ca2018602c93e66ecdbc2577335e2
Reviewed-on: https://go-review.googlesource.com/32731
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-03 21:54:35 +00:00
Alan Donovan
4d145add37 cmd/ssadump: fix typo that broke -run
Change-Id: I6cc618a3cf1036f4dffb2acad766d86c14d658cd
Reviewed-on: https://go-review.googlesource.com/32645
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-03 16:19:08 +00:00
Robert Griesemer
f08d70c2ed go/gcimporter15: support export/import of invalid aliases
+ test

Tested on 1.6, 1.7, and 1.8.

Fixes golang/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>
2016-11-03 15:57:31 +00:00
Robert Griesemer
c3ce94f8a8 go/gcimporter15: update importer test (fix build)
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>
2016-11-02 23:36:01 +00:00
Robert Griesemer
d54c98191e go/loader: fix ExampleConfig_Import (fix build)
TBR=adonovan

Tested against 1.6, 1.7, and 1.8.

Change-Id: Ifd8e02a83e7b92c00a746f10475ab725801199e2
Reviewed-on: https://go-review.googlesource.com/32638
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-11-02 23:31:09 +00:00
Matthew Dempsky
d4397e8931 go/gcimporter15: backport double-export fix for aliased objects
Backport of https://golang.org/cl/32575.

Change-Id: Ic4b0794ee440b7ac6275f0ef7dacda20de4fdad0
Reviewed-on: https://go-review.googlesource.com/32577
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-02 20:38:00 +00:00
Robert Griesemer
a829b5068d go/gcimporter15: remove support for Go1.5
Change-Id: I183090131a675237be42cc005719554399704f8d
Reviewed-on: https://go-review.googlesource.com/32541
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-11-02 18:31:16 +00:00
Robert Griesemer
a4fe4f6140 go/gcimporter15: implement support for exporting aliases
Tested with 1.6, 1.7, 1.8.

Change-Id: Ib0f751484c360b02aa34c993ce795cb94656705f
Reviewed-on: https://go-review.googlesource.com/32540
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-11-02 18:30:30 +00:00
Robert Griesemer
5b3db00587 go/gcimporter15: implement support for importing aliases
- backport of changes made to std lib:
  https://go-review.googlesource.com/32350/
  https://go-review.googlesource.com/32538

- factored out newAlias for non-Go1.8 builds

- tested against 1.6, 1.7, 1.8

Change-Id: I538b2d4a0f0c93c517a7aaa3b1562aa3afd154dd
Reviewed-on: https://go-review.googlesource.com/32470
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-11-02 17:35:51 +00:00
Alan Donovan
4549178751 x/tools: clone some files in preparation for alias changes
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>
2016-11-02 16:57:37 +00:00
Alan Donovan
1529f889eb cmd/guru: report start and end positions for non-PkgName Objects
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>
2016-10-31 16:37:29 +00:00
Alan Donovan
b814a3b030 go/internal/gccgoimporter: use 0 not io.SeekStart for Go 1.6 compatibility.
Change-Id: I396e221217c7fac5e7a9d66cbd97ef51782b0dd8
Reviewed-on: https://go-review.googlesource.com/32298
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-10-28 18:18:45 +00:00
Alan Donovan
f24fea3cd4 go/gcexportdata: suppress example_test.go on Go 1.6
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>
2016-10-28 18:18:30 +00:00
Alan Donovan
6d7cee0134 go/gcimporter15: read v3 export data not containing type aliases
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>
2016-10-28 16:05:56 +00:00
Alan Donovan
0db92ca630 go/gcexportdata: make example portable to MS Windows, 2nd attempt
(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>
2016-10-25 20:54:37 +00:00
Alan Donovan
17d0fe57ec go/gccgoexportdata: lost edits from review of CL 31822
Change-Id: I4d1eb36c2da5c7ad51989a1c9ab09b03019fd8f0
Reviewed-on: https://go-review.googlesource.com/31971
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-10-25 15:10:52 +00:00
Alan Donovan
5e7fa1cbaa go/gccgoexporter: an API for parsing gccgo export data
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>
2016-10-25 15:07:10 +00:00
Alan Donovan
20055e012d go/internal/gccgoimporter: fork go/internal/gccgoimporter
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>
2016-10-24 21:32:26 +00:00