1
0
mirror of https://github.com/golang/go synced 2024-11-07 11:46:17 -07:00
Commit Graph

3980 Commits

Author SHA1 Message Date
Robert Obryk
91b1b28499 go.tools/cmd/vet: fix a panic on invalid AddInt
Ignore calls to various flavours of atomic.AddInt with a wrong
number of arguments.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/91370045
2014-05-14 12:16:58 -07:00
Alex Brainman
d52b449ed7 go.tools/cmd/godoc: prevent duplicate GOROOT/GOPATH in environment in TestTypeAnalysis
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/94430044
2014-05-14 12:39:20 +10:00
Alex Brainman
63a1026f64 go.tools/godoc/analysis: convert path to url (fixes windows build)
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/94440043
2014-05-14 12:38:43 +10:00
Dmitriy Vyukov
240540d096 dashboard: database updater for performance dashboard (server part)
This CL moves code from code.google.com/p/dvyukov-go-perf-dashboard,
which was previously reviewed.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/96170043
2014-05-13 11:02:19 +04:00
Dmitriy Vyukov
904c4641c7 dashboard: server app UI changes for performance dashboard
This CL moves code from code.google.com/p/dvyukov-go-perf-dashboard,
which was previously reviewed.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/96180043
2014-05-13 11:01:50 +04:00
Dmitriy Vyukov
9bb1e09cc4 dashboard: database updater for performance dashboard
This CL moves code from code.google.com/p/dvyukov-go-perf-dashboard,
which was previously reviewed.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/97250044
2014-05-13 11:01:38 +04:00
Dmitriy Vyukov
828191dc1e dashboard: server app changes for performance dashboard
This CL moves code from code.google.com/p/dvyukov-go-perf-dashboard,
which was previously reviewed.
UI part will be submitted separately.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/97260043
2014-05-13 11:00:32 +04:00
Dmitriy Vyukov
d2a9e7164e dashboard: builder changes for performance dashboard
This CL moves code from code.google.com/p/dvyukov-go-perf-dashboard,
which was previously reviewed.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/95190043
2014-05-13 11:00:11 +04:00
Andrew Gerrand
a41b4fc37a go.tools/cmd/present: update docs after move
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/99060043
2014-05-13 09:17:18 +10:00
Robert Griesemer
51d8ee0ff8 go.tools/go/types: report init dependencies via method values
- one-line fix
- comprehensive set of test cases added

Fixes golang/go#7963.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/100320043
2014-05-09 13:57:38 -07:00
Alan Donovan
4700b7a612 go/callgraph: fix asymptote trap in DeleteSyntheticNodes.
The previous implementation would cause the graph to contain
many duplicate edges resulting in very large cross products,
so that for some inputs (and random map iteration orders) the
running time of DeleteSyntheticNodes was many minutes---more
than the pointer analysis!

Duplicate edges can arise from an interface call that
dispatches to several different wrapper functions each
wrapping the same declared method.

For example, in the callgraph for go/types, a call to
Object.Pos() dispatches to the synthetic functions (*Type).Pos
and (*Var).Pos, each of which wrap (*object).Pos().  After
DeleteSyntheticNodes, Object.Pos() appeared to call
(*object).Pos() twice.

This change builds the set of all edges and avoids adding
edges already in the set.

Also, document findings.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/96100043
2014-05-08 14:03:06 -04:00
Alan Donovan
c212b356b8 go.tools/go/types: add API test of Selection mechanism.
Also: fixed a crash in (*Selection).String() for FieldVal of a
non-function type.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/93830043
2014-05-07 18:35:43 -04:00
Josh Bleecher Snyder
e6020f7229 go.tools/godoc/static: fix import path doc typo
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/98970043
2014-05-05 17:42:00 -07:00
Andrew Gerrand
ca18093fea go.tools/cmd/present: add present tool
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/97030045
2014-05-05 14:55:27 -07:00
Robert Griesemer
9f1412014f go.tools/go/types: added test case for channel make
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/95910044
2014-05-05 10:12:50 -07:00
Andrew Gerrand
3d0528640b go.tools/playground/socket: require origin to set up socket handler
This prevents cross-site request forgery attacks.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/95030044
2014-05-05 08:42:12 -07:00
Robert Griesemer
30b1abe2f7 go.tools: fix various typos
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/97920045
2014-05-02 14:38:08 -07:00
Robert Griesemer
f84e8b3f03 go.tools/cmd/godex: print correct type for const/var decls
The old code printed the underlying type; e.g., the type
of time.Millisecond was reported to be int64 rather than
time.Duration.

Testsuite (and corresponding tests) in progress (another CL).

LGTM=adonovan
R=adonovan, dsymonds
CC=golang-codereviews
https://golang.org/cl/94770045
2014-04-29 19:58:47 -07:00
Stephen Weinberg
55d5722095 imports, cmd/goimports: add missing package main if func main exists
Assuming:
        1) package declaration does not exist
        2) the Fragment option is set
        3) a main function exists

We will assume it is a main package and add the declaration.

This change also sets the Fragment option in goimports.

LGTM=crawshaw, bradfitz
R=bradfitz, crawshaw
CC=golang-codereviews
https://golang.org/cl/96850044
2014-04-28 17:15:33 -04:00
Alan Donovan
6e03bb4eb4 go.tools: remove dead code
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/90320043
2014-04-25 15:08:13 -04:00
Alan Donovan
8e263c554d go.tools/go/types: fix incorrect receiver in (*Selection).Type().
Method expressions T.f are reported as having type (T)func(T),
i.e. T appears twice, as a receiver and a regular parameter.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/96780044
2014-04-25 12:08:31 -04:00
Alan Donovan
c288136f0c go.tools/cmd/eg: Use Print, not Printf, to print Help string.
Fixes golang/go#7861

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/95770043
2014-04-25 12:03:38 -04:00
Alan Donovan
7d1d69032b go.tools/go/ssa: don't attempt fusion on single-pred blocks with φ-nodes
During block optimization, degenerate conditional logic such
as "false && x" may result in single-predecessor blocks
containing φ-nodes.  (Ideally such φ-nodes would be replaced
by their sole operand, but that requires Referrers information
which isn't computed until later.)  It is obviously not safe
to fuse such blocks, so now we don't.

Fixes golang/go#7840

LGTM=gri
R=gri
CC=golang-codereviews, pcc
https://golang.org/cl/90620043
2014-04-24 09:08:21 -04:00
Shenghou Ma
35875c1a92 go.tools/cmd/godoc/static: fix text template for variable examples.
Fixes golang/go#7771.

LGTM=bgarcia
R=golang-codereviews, bradfitz, bgarcia
CC=golang-codereviews
https://golang.org/cl/87180044
2014-04-22 18:46:26 -04:00
Robert Griesemer
4bc2f4e34b go.tools/go/types: fix doc comment
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/90100043
2014-04-21 16:35:40 -07:00
Alan Donovan
8eccac8f9a go.tools/refactor/eg: avoid nonstandard 'diff -N' option.
(To fix broken Solaris test)

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/90080044
2014-04-21 18:35:16 -04:00
Alan Donovan
f1247de572 go.tools/cmd/doc: make filename logic separator-agnostic
(Speculative fix for broken cmd/godoc test on Windows.)

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/90090043
2014-04-21 18:34:22 -04:00
Alan Donovan
4a9f74ad65 cmd/godoc: wait up to 500ms for results of -analysis=type.
(The test thread is racing with the analysis thread, which
takes around 4ms on this input.)

LGTM=gri
R=gri, bradfitz
CC=golang-codereviews
https://golang.org/cl/89780044
2014-04-21 17:56:06 -04:00
Peter Collingbourne
feafa74756 go.tools/go/types: address and slice operations are not addressable
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/89380044
2014-04-21 11:38:43 -07:00
Peter Collingbourne
998b73a2e9 go.tools/go/types: result of make and new builtins are not addressable
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/89390045
2014-04-21 11:20:54 -07:00
Alan Donovan
379e0e7704 go.tools/go/types: x,y:=0,0 is a Use (not Def) of x if it is already defined.
+ test.

Fixes golang/go#7827

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/89600045
2014-04-21 14:05:25 -04:00
Alan Donovan
1ae1c63748 go.tools/go/ssa/interp: add wrappers for Sysctl{,Uint32} intrinsics on FreeBSD
(Speculative fix---I can't test it directly.)

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/89320043
2014-04-18 15:58:12 -04:00
Robert Griesemer
de6fbfe0ea go.tools/cmd/godex: make relative package paths work
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/89160044
2014-04-18 12:44:23 -04:00
Andrew Wilkins
f8200537d8 go.tools/go/gccgoimporter: use gccgo -dumpversion
GccgoInstallation.InitFromDriver currently parses
the output of gccgo -### to get the gcc version,
target triple, and library paths. At least with
Ubuntu's stock libgo5 package, the search path for
.gox files derived from the version is incorrect.

gccgo uses the DEFAULT_TARGET_VERSION macro when
constructing the search path; this value can be
retrieved from gccgo via the "-dumpversion" flag.

Fixes golang/go#7772.

LGTM=iant, gri
R=golang-codereviews, iant, gri
CC=golang-codereviews
https://golang.org/cl/88150043
2014-04-17 13:40:42 -07:00
Alan Donovan
4843aaee02 godoc: add very basic integration test of godoc -analysis=type.
Also: fix careless regression introduced yesterday.

LGTM=bgarcia
R=bgarcia
CC=golang-codereviews
https://golang.org/cl/88880043
2014-04-17 15:51:27 -04:00
Robert Griesemer
a7ddb1e509 godex: improved printing of numeric constants
TODO: Add testing code (another CL).

LGTM=adonovan
R=golang-codereviews, adonovan
CC=golang-codereviews
https://golang.org/cl/88090044
2014-04-17 11:28:24 -07:00
Alan Donovan
066bab1496 go.tools/refactor/eg: move misplaced comment
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/88100046
2014-04-16 16:50:19 -04:00
Alan Donovan
503140c72e godoc: documentation of -analysis features.
The text and images are "baked in" to the godoc executable's
rodata section (~300KB) and are accessible from the godoc
server itself at /lib/godoc/analysis/help.html.

In due course, the page will become visible at
http://golang.org/lib/godoc/analysis/help.html, which will be
the canonical location for this doc (in announcements, etc).

The page is temporarily visible here, for those on the Google corp network:
http://172.26.104.127:7777/lib/godoc/analysis/help.html

Also:
- add link to new doc from source view pages.
- document -analysis flag in cmd/godoc/doc.go
- fix indentation of -analysis flag's help string

LGTM=gri
R=gri, bgarcia, r
CC=golang-codereviews
https://golang.org/cl/87110045
2014-04-16 16:35:08 -04:00
Robert Griesemer
1961019b8c go.tools/go/exact: tweaked documentation
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/88630043
2014-04-16 13:07:59 -07:00
Alan Donovan
83a7488b3d go.tools/godoc: remove nil deference panic on loading error
Also:
- remove stale comment about line numbers.
- log a warning if file's package root not found.

LGTM=bgarcia
R=bgarcia
CC=golang-codereviews
https://golang.org/cl/88510044
2014-04-16 15:01:23 -04:00
Alan Donovan
9531aca448 go.tools/go/pointer: add TODO comment.
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/87810046
2014-04-15 15:41:02 -04:00
Alan Donovan
6ec40d9aac go.tools/oracle: don't discard /usr/bin/diff's stderr
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/87980045
2014-04-15 15:39:38 -04:00
Alan Donovan
5421af34cc go.tools/go/types: fix typo in comment.
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/88200044
2014-04-15 15:39:24 -04:00
Alan Donovan
b3970ee159 go.tools/go/oracle: show import path (not just name) when describing an import.
+ test.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/88190044
2014-04-15 15:37:44 -04:00
Alan Donovan
bc722df585 go.tools/go/ssa/interp: minor cleanup
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/88080044
2014-04-15 15:37:32 -04:00
Josh Bleecher Snyder
6157b5a256 go.tools/cmd/benchcmp: expand documentation
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/85390044
2014-04-14 17:00:04 -07:00
Alan Donovan
647d17e45f go.tools/go/ssa/interp: add no-op intrinsic sync.runtime_registerPoolCleanup
Also, compute correct index of struct field sync.Pool.New, which just changed.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/87780043
2014-04-14 17:53:58 -04:00
Robert Griesemer
b5d07c813b go.tools/go/types: tweak test exceptions
Per feedback from rsc.

LGTM=rsc, adonovan
R=adonovan, rsc
CC=golang-codereviews
https://golang.org/cl/86310043
2014-04-10 10:39:00 -07:00
Alan Donovan
ccb0e9ab88 go.tools/.hgignore: don't ignore test-generated files, clean them up.
(Includes rollback of CL 83680043.)

LGTM=gri
R=gri
CC=golang-codereviews, rsc
https://golang.org/cl/86430045
2014-04-10 13:17:20 -04:00
Josh Bleecher Snyder
3bca0c7d87 imports: use chan struct{} for disk semaphore
Update golang/go#7747

LGTM=bradfitz
R=bradfitz, iant
CC=golang-codereviews
https://golang.org/cl/86280043
2014-04-09 17:40:05 -07:00