1
0
mirror of https://github.com/golang/go synced 2024-10-01 05:28:33 -06:00
Commit Graph

709 Commits

Author SHA1 Message Date
Alan Donovan
1f29e74bfa go.tools/go/types: remove Type.MethodSet() method.
Method-set caching is now performed externally using a MethodSetCache (if desired), not by the Types themselves.

This a minor deoptimization due to the extra maps, but avoids a situation in which method-sets are computed and frozen prematurely. (See b/7114)

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/61430045
2014-02-11 16:49:27 -05:00
Robert Griesemer
fc1d9c5505 go.tools/go/types: adjust 3-index slice tests
The parser is now checking the presence of the 2nd and 3rd
index of 3-index slice expressions. See also:

https://golang.org/cl/58950045/
http://golang.org/issue/7305

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/58500045
2014-02-11 13:40:59 -08:00
Alan Donovan
ee92efc193 go.tools/ssa: tweaks to CreateTestMainPackage.
Move mutation of program to the final step.
+ 2 assertions;
+ switches.go: comment fix.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/61510044
2014-02-11 15:59:20 -05:00
Alan Donovan
ddfef020d1 go.tools/go/ssa/interp: add missing case to fake reflect function.
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/61410049
2014-02-11 15:36:41 -05:00
Andrew Gerrand
1a5e5b083b go.tools/godoc/redirect: remove race detector blog post redirect
Update golang/go#7275

LGTM=minux.ma, dvyukov
R=dvyukov, minux.ma
CC=golang-codereviews
https://golang.org/cl/60900044
2014-02-11 09:26:17 +11:00
Brad Fitzpatrick
a0c2140b91 imports: fix a case where we weren't gofmt-compatible
Because goimports also sorts stdlib-vs-external differently
(whereas gofmt just sorts string-wise), we need to put a blank
line between imports of different classes. This happened in
some cases, but not all.

Fixes golang/go#7132

LGTM=kamil.kisiel
R=golang-codereviews, kamil.kisiel
CC=golang-codereviews
https://golang.org/cl/60870047
2014-02-07 17:03:34 -08:00
Alan Donovan
b3dbe56610 go.tools/go/ssa: support 3-operand x[lo:hi:max] slices.
+ very basic test ($GOROOT/test/slice3.go needs unsafe.Pointer)

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/60030043
2014-02-05 17:54:51 -05:00
Robert Griesemer
c37c5f6f46 go.tools/go/types: internal cleanup (resolve a TODO)
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/59560046
2014-02-04 11:06:00 -08:00
Robert Griesemer
5351a1ccd2 go.tools/godoc: don't associate builtin nil with a type
Special case for (fake) package builtin: don't associate
any constant, variable, or factory function with a type.

Fixes golang/go#6645.

LGTM=bgarcia
R=bgarcia, r, bradfitz
CC=golang-codereviews
https://golang.org/cl/54820044
2014-02-04 10:26:38 -08:00
Robert Griesemer
20efc5ba73 go.tools/go/types: use init cycle tracking for all const and var cycles
Also rename types.Assertable -> types.AssertableTo per adonovan.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/59680044
2014-02-03 16:02:56 -08:00
Robert Griesemer
4dcaee97b2 go.tools/cmd/vet: use new Assertable predicate (fix build)
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/59210045
2014-02-03 11:39:10 -08:00
Gordon Klaus
3e68d08251 go.tools/go/types: export Comparable and Assertable, simplify Implements
The "static bool" parameter to Implements was confusing; typically we think about interface implementation and type assertion as separate but related concepts, but here they were merged.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/58540044
2014-02-03 11:21:01 -08:00
Robert Griesemer
ed1b894ade go.tools/go/types: print cyles of recursive type declarations
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/59140043
2014-02-03 10:34:06 -08:00
Josh Bleecher Snyder
285f6fe2f6 go.tools/cmd/benchcmp: add benchcmp
This is intended to replace the awk-based misc/benchcmp.
It mostly matches the existing misc/benchcmp.
Notable changes:

* Written in Go.
* Minor whitespace changes in the output; the tabular nature of the
  output is preserved, as is most number formatting and verbiage.
* Comparisons within each section are sorted from highest change to lowest.
* Proper handling of multiple benchmarks with the same name (issue 7016).
* Does not omit benchmark comparisons for which the new value is zero.
* Adds -changed flag to only show benchmarks whose value have changed.
  Useful for memory-oriented, large-scale benchmark comparisons.
* Has tests.
* Formats small ns measurements with extra precision.

Updates golang/go#7016.

LGTM=r
R=golang-codereviews, dave, dvyukov, oleku.konko, bradfitz, gobot, r
CC=golang-codereviews
https://golang.org/cl/47980043
2014-01-31 15:39:59 -08:00
Robert Griesemer
caced9f304 go.tools/go/ssa: remove windows test exclusion
Issue 7189 was likely fixed with revision ed6ecfe1bc4e .

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/59230044
2014-01-31 15:31:10 -08:00
Robert Griesemer
91159eb214 go.tools/go/types: don't type-check methods twice
- Centralize "visited" check in check.objDecl.
- Assert that object-specific declX functions
are only called with objects that have no
type associated with them, yet.
- Added test case.

Thanks to Richard Musiol (neelance@gmail.com) for
finding the bug and providing an easy test case.

For a discussion of the bug see the issue.

Fixes golang/go#7245.

TBR=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/59210043
2014-01-31 15:12:05 -08:00
Alex Brainman
269daf307c go.tools/go/ssa: skip broken TestStdlib on windows
Update golang/go#7189

LGTM=dave
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/49640049
2014-01-31 17:46:15 +11:00
Alex Brainman
69f7b061bd go.tools/go/ssa: stop if error in TestStdlib
Update golang/go#7189

LGTM=dave
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/58910043
2014-01-31 17:30:37 +11:00
Brad Garcia
d682175c6e godoc: test fixes for recent cmdline changes.
Tests broken by:
https://code.google.com/p/go/source/detail?r=1666da2583f4&repo=tools

R=gri, adonovan
CC=golang-codereviews
https://golang.org/cl/58780043
2014-01-30 15:32:23 -05:00
Robert Griesemer
9cd9226d63 go.tools/go/types: fix type cycle tracking
Fixes golang/go#7236.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/58430043
2014-01-30 09:46:03 -08:00
Brad Garcia
f97ec06d2c godoc: forward /pkg/C links to /cmd/cgo.
Fixes golang/go#5651.

R=bradfitz
CC=golang-codereviews
https://golang.org/cl/58660043
2014-01-30 07:07:12 -05:00
Brad Garcia
2ca2bfc172 godoc: Fix commandline mode output.
Fix output of packages with multiple files.
Remove extra output when filter is requested.
Fixes golang/go#7115.

R=bradfitz, adg
CC=golang-codereviews
https://golang.org/cl/52750044
2014-01-30 06:28:19 -05:00
Robert Griesemer
bf4d636dc9 go.tools/go/types: cleanup handling of forward chains of underlying types
- consistently set underlying types of incoming named types in typInternal
- use underlying() helper function to resolve forward chains
- related consistency cleanups

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/53870044
2014-01-29 14:24:54 -08:00
Robert Griesemer
c4535ece1b go.tools/go/types: various cleanups - no semantic changes
- split resolver.go into resolver.go and decl.go
- renamed types.go -> type.go
- renamed objects.go -> object.go

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/58010043
2014-01-29 10:53:49 -08:00
Brad Garcia
efd232e270 godoc: set expvar for http.ResponseWriter errors.
R=bradfitz
CC=adg, golang-codereviews
https://golang.org/cl/56680044
2014-01-29 10:53:45 -05:00
Alan Donovan
744d7e68b1 go.tools/go/ssa: use bytes.Buffer instead of io.Writer.
This is (a) more efficient and (b) avoids the need for
constant error handling, since buffer writes can't fail.

Also:
- added WriteFunction and WritePackage functions,
  similar to types.WriteFoo.
- *Function and *Package now implement io.WriterTo.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/57930044
2014-01-28 17:48:10 -05:00
Robert Griesemer
83cdd9ba10 go.tools/go/types: export ConvertibleTo
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/57950043
2014-01-28 14:28:10 -08:00
Alan Donovan
d0efad3082 go.tools/go/ssa: use types.WriteSignature
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/57930043
2014-01-28 17:04:41 -05:00
Alan Donovan
64ec206bfd go.tools/go/types: combine Info.{Types,Values} maps.
This results in significant improvement to type-checking time:
it reduces by 4% the entire running time of ssa/stdlib_test
(GOMAXPROCS=8, n=7).

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/57770043
2014-01-28 16:46:24 -05:00
Robert Griesemer
e5e20e3af5 go.tools/go/types: make WriteType cycle-resistent
Also:
- expose WriteSignature
- s/identicalInternal/identical/g

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/57860043
2014-01-28 13:42:46 -08:00
Robert Griesemer
7dbf7c000d go.tools/go/types: internal cleanup - nil out objmap when done with it
Also: print package path with quotes.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/55520046
2014-01-28 12:56:33 -08:00
Robert Griesemer
ebfa4efbc4 go.tools/go/types: cleanup: more consistent exported predicate names
Renamed predicates:
IsIdentical -> Identical
IsAssignableTo -> AssignableTo
Signature.IsVariadic -> Signature.Variadic
Object.IsExported -> Object.Exported

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/53370043
2014-01-28 10:57:56 -08:00
Robert Griesemer
aea9f68811 go.tools/go/types: set array type even if length is invalid
This avoids some follow-up errors due to invalid
array declarations.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/57640043
2014-01-28 09:40:12 -08:00
Robert Griesemer
ffc6416213 go.tools/go/types: print local types unqualified in error/debugging output
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/57630044
2014-01-28 09:22:53 -08:00
Brad Garcia
7ecad5bf71 godoc: periodically refresh package directory and search index.
R=adg, bradfitz
CC=golang-codereviews
https://golang.org/cl/55080043
2014-01-28 09:30:23 -05:00
Andrew Gerrand
8aae138131 go.tools/dashboard/app: update bad builder list
LGTM=r
R=r, minux.ma
CC=golang-codereviews
https://golang.org/cl/57580043
2014-01-28 17:59:29 +11:00
Andrew Gerrand
5cb6365d33 go.tools/dashboard/app: show sub-repository build history
LGTM=cmang
R=adonovan, gobot, cmang
CC=golang-codereviews
https://golang.org/cl/56410043
2014-01-28 14:30:48 +11:00
Alan Donovan
4dcb74e810 go.tools/go/ssa/interp: implement reflection over callstack (now that we have access to it).
+ tests.

Fixes golang/go#6041

Also: move global var _sizes to a field of interpreter.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/56530046
2014-01-27 15:39:17 -05:00
Alan Donovan
fbb3d81367 go.tools/ssa/interp: add intrinsics for (*sync.Pool).{Get,Put}.
Since Put() makes a dynamic function call, this CL includes a long-overdue change to supply a *frame (and thus the call
stack and the interpreter) to intrinsics too.

This fixes the tests that were broken by (sound) revision e4a4cb47c141.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/57350043
2014-01-27 13:11:16 -05:00
Brad Fitzpatrick
eda00ba4ec imports: bake in the standard library again
Fast path for the common case. Avoids scanning GOPATH usually.

LGTM=r, crawshaw
R=david.crawshaw, adg, r, crawshaw
CC=golang-codereviews
https://golang.org/cl/56820043
2014-01-26 09:47:31 -08:00
Andrew Gerrand
3b2989e9ea go.tools/dashboard: update CL on build failure
Only send mail to golang-dev if updating the CL fails.

R=golang-codereviews, dvyukov, minux.ma, rsc
CC=golang-codereviews
https://golang.org/cl/43760043
2014-01-24 14:52:23 +11:00
Andrew Gerrand
3342856161 go.tools/dashboard/app: sort builder columns in a more useful manner
Supported operating systems first, then race builders, then the rest.

R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/56190043
2014-01-24 09:13:34 +11:00
Alan Donovan
87b29f65dc go.tools/go/ssa/interp: fix broken import paths.
Fixes golang/go#7166

R=gri
CC=golang-codereviews
https://golang.org/cl/55710045
2014-01-22 17:19:25 -05:00
Alan Donovan
0dcaae1610 go.tools/go/loader: permit Create* methods to specify the ad-hoc package's path
CL 49530047 made the (over-)simplifying assumption that the
Path of an ad-hoc (Created) package should default to its
Name, i.e. package declaration.

With this change, the Name is still always computed from the
package declaration (by go/types) but the Path may be
specified by the loader.Config.  If "", the value of the Name
is used, which is not globally unique.

R=gri, axwalk
CC=golang-codereviews
https://golang.org/cl/55180043
2014-01-22 09:59:19 -05:00
Robert Griesemer
074bd4ac9c go.tools/go/types: cleanup: remove unnecessary receiver
R=adonovan
CC=golang-codereviews
https://golang.org/cl/53810044
2014-01-17 11:17:43 -08:00
Alan Donovan
2845638157 go.tools/go/ssa: simplify builder.exprN now that go/types emits correct types.
(Follow-up to fix of issue 7060.)

Also: comment fixes.

R=gri
CC=golang-codereviews
https://golang.org/cl/47670043
2014-01-17 09:38:25 -05:00
Robert Griesemer
2d6b34a0f5 go.tools/go/types: report rhs type for comma-ok expressions
Fixes golang/go#7060.

R=adonovan
CC=golang-codereviews
https://golang.org/cl/53520043
2014-01-16 19:33:51 -08:00
Robert Griesemer
0b4b877c72 go.tools/go/types: remove size from Basic
More localized computation of sizes.

R=adonovan
CC=golang-codereviews
https://golang.org/cl/53460043
2014-01-16 14:47:26 -08:00
Robert Griesemer
9b91992c8c go.tools/go/loader: add missing argument to fmt.Errorf call
R=adonovan
CC=golang-codereviews
https://golang.org/cl/53360043
2014-01-16 13:20:02 -08:00
Robert Griesemer
184bc0cc8c go.tools/go/gccgoimporter: remove dead code
R=adonovan
CC=golang-codereviews
https://golang.org/cl/53340043
2014-01-16 13:19:39 -08:00