1
0
mirror of https://github.com/golang/go synced 2024-11-18 16:44:43 -07:00
Commit Graph

1010 Commits

Author SHA1 Message Date
Andrew Gerrand
8aabc9a084 go.tools/godoc: drop scheme from links
golang.org now serves HTTPS,
so the scripts should work
with either HTTP ot HTTPS.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/111640043
2014-07-25 10:27:31 +10:00
Alan Donovan
935700a081 go.tools/go/loader: apply DisplayPath to working directory of cgo tool.
This transforms the virtualized directory (build.Context).Dir to a physical one,
for proprietary build systems that distinguish them.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/116230043
2014-07-24 14:12:52 -04:00
Alan Donovan
9ffbf29971 go.tools/go/ssa: add hook to testmain.go for proprietary (non-'go test') build systems.
Users need only add an extra file to the package to specify
additional imports and initialization steps in testmain, to
match their build system.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/120090043
2014-07-23 15:37:37 -04:00
Chris Manghane
129869a1a6 go.tools/dashboard: don't do method calls or field lookups on a possibly nil repo
LGTM=mischief, adg
R=adg, mischief
CC=golang-codereviews
https://golang.org/cl/106660043
2014-07-23 10:22:29 -07:00
Alan Donovan
b5528ca070 go.tools/go/pointer: add test file missing from CL 112610043 (rev 32ae05502022)
TBR=gri
R=gri
CC=adg, golang-codereviews
https://golang.org/cl/111580043
2014-07-23 12:28:56 -04:00
Andrew Gerrand
63db0771ef go.tools/godoc: fix search heading anchors
Right now they're all "Global" so you can't click use the table of
contents headings for "Types", "Functions", and "Methods".

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/118100043
2014-07-23 09:59:58 +10:00
Alan Donovan
e5d15a9781 go.tools/go/pointer: add intrinsic for time.startTimer, which is implemented in C.
Without it, no value appears to be sent on NewTicker/NewTimer channels.

+ test

Also:
- add (callgraph.Edge).{Description,Pos} convenience methods
  to simplify client code when Site==nil.

LGTM=gri
R=gri, friestein68503
CC=golang-codereviews
https://golang.org/cl/112610043
2014-07-22 18:30:06 -04:00
Alan Donovan
f9612295cb go.tools/oracle: pointsto: if the queried expression is an lvalue, use the type of its value, not its address.
(Probable regression caused by recent changes to VarValue.)

+ regression test.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/116160044
2014-07-22 18:29:56 -04:00
David Symonds
105b764ad0 benchcmp: Fix invocation instructions.
`go test` takes -run and -bench; the -test.run and -test.bench flags
are only for the test binary itself.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/113390043
2014-07-22 17:50:39 +10:00
Keith Randall
562b65fda7 vet: LEA* opcodes don't need to have matching length source and destination.
LGTM=rsc
R=golang-codereviews, khr, rsc
CC=golang-codereviews
https://golang.org/cl/117950044
2014-07-21 21:15:39 -07:00
Alan Donovan
cd61993a08 go.tools/go/types: move {Type,Object}Of methods from *loader.PackageInfo to *types.Info
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/113750044
2014-07-17 15:10:29 -04:00
Alan Donovan
514bdfb1b7 go.tools/go/ssa: improve generated code for addressable expressions.
If an expression is addressable, we compute its address then load, rather than
extracting the value of subelements.  For aggregates this avoids large copies.
Example:
        var x [2]struct{y [3]int}
        print(x[1].y[2])

Was:
t0 = local [3]struct{x [5]int} (x)                 *[3]struct{x [5]int}
t1 = *t0                                            [3]struct{x [5]int}
t2 = t1[1:int]                                         struct{x [5]int}
t3 = t2.x [#0]                                                   [5]int
t4 = t3[2:int]                                                      int

Now:
t1 = &t0[1:int]                                       *struct{x [5]int}
t2 = &t1.x [#0]                                                 *[5]int
t3 = &t2[2:int]                                                    *int
t4 = *t3                                                            int

Also:
- make emitFieldSelections responsible for calling emitDebugRef, as
  one of its two calls was forgetting to do it.
- relax the specification of (*Program).VarValue because not all
  subexpressions are materalized as values now.
- fix up the objlookup.go test expectations to match.

go/ssa/interp test runs 10% faster.

Thanks to Peter Collingbourne for pointing this out.

LGTM=pcc
R=pcc, gri
CC=golang-codereviews
https://golang.org/cl/109710043
2014-07-17 15:06:09 -04:00
Robert Daniel Kortschak
09286920ba go.tools/cmd/present: move jquery ui code into static
LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/118760043
2014-07-16 16:33:46 +10:00
Andrew Gerrand
cc0b856ebe go.tools/godoc/static: remove unnecessary mainframe wrapper
Fixes golang/go#8300.

LGTM=adonovan
R=golang-codereviews, adonovan, bradfitz
CC=golang-codereviews
https://golang.org/cl/113130044
2014-07-16 09:39:11 +10:00
Alan Donovan
b2ea2e8560 go.tools/go/ssa: permit "for range x"
+ test

Also: don't generate init() functions for packages loaded from export data.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/111200043
2014-07-15 17:34:50 +01:00
Robert Griesemer
e078800d1f go/types: permit "for range x"
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/110630044
2014-07-15 08:54:09 -07:00
Francesc Campoy
bbb1c45ba5 go.tools/present: add support for figure captions
LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/110600043
2014-07-15 08:23:16 -07:00
Alan Donovan
f2db24a319 go.tools/go/loader: use new types.TypeAndValue mode predicates.
PackageInfo:
- deleted IsType
- inlined + deleted: ValueOf, TypeCaseVar, ImportSpecPkg
- on failure, TypeOf accessor now returns nil (was: panic)

go/ssa: avoid extra map lookups by using Uses or Defs directly when safe to do so,
and keeping the TypeAndValue around in expr0().

LGTM=gri
R=gri, pcc
CC=golang-codereviews
https://golang.org/cl/107650043
2014-07-11 10:50:09 +01:00
Robert Griesemer
961ab3ca8d go.tools/go/types: provide TypeAndValue predicates
LGTM=adonovan
R=adonovan, pcc
CC=golang-codereviews
https://golang.org/cl/110880043
2014-07-10 16:59:50 -07:00
Alan Donovan
a16d58355f go.tools: various doc fixes.
LGTM=crawshaw
R=gri, crawshaw
CC=golang-codereviews
https://golang.org/cl/91420044
2014-07-10 07:24:52 -04:00
Alan Donovan
400db89b86 go/types: fix incorrect InitOrder in packages created from multiple calls to (*Checker).Files.
The InitOrder needs to be reset.

+ Test.

This bug manifested itself in duplicate HTML in the godoc -analysis view,
e.g. "f((x)" or "funcfunc f()"

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/107660044
2014-07-10 06:30:01 -04:00
Peter Collingbourne
661e836afb go.tools/go/ssa: introduce a sanity check for dead referrers
This extends the sanity checker to identify and report referrers
which do not appear in the function's instruction lists, and fixes two
bugs in the lifting algorithm which were caught by the sanity check.

LGTM=adonovan
R=adonovan
CC=axwalk, golang-codereviews
https://golang.org/cl/110210045
2014-07-10 06:27:25 -04:00
Shenghou Ma
daba707591 go.tools/playground/socket: fix nacl/arm command line.
nacl_helper_bootstrap_arm doesn't consult $PATH for sel_ldr_arm.

LGTM=adg
R=adg, dan.kortschak
CC=golang-codereviews
https://golang.org/cl/112010044
2014-07-10 00:46:43 -04:00
Peter Collingbourne
4329a10ae7 go.tools/go: separate interface construction from method set construction
We introduce a method (*Interface).Complete(), which is intended
to be called from clients after all embedded interfaces have been
fully defined. For importers, this will definitely be the case
after the import has finished, so each importer have been updated
to do so, with the exception of the gcimporter, which does not use
embedded interfaces, therefore Complete() can be called immediately
after construction.

Building the method set separately from the constructor type caused
some problems with go/importer, which copies the types.Interface
object, leading to there existing two almost-identical interface
types referenced from interface method receivers, only one of which
has been completed. To avoid this situation, the importer has been
modified to construct the interface object only once.

Fixes golang/go#8177.

LGTM=gri
R=gri, dave, gordon.klaus, adonovan
CC=golang-codereviews
https://golang.org/cl/105060044
2014-07-09 20:00:49 -07:00
David Crawshaw
54655402b5 go.tools/dashboard/builder: android cross compiles
LGTM=minux
R=golang-codereviews, minux
CC=golang-codereviews
https://golang.org/cl/112870045
2014-07-09 15:44:17 -04:00
Alan Donovan
99d45c0e8e godoc/analysis: show analysis status in UI (source file view)
Also:
- declare PackageInfo, FileInfo types to simplify API.
- update docs:
        eliminate this TODO item
        document improved analysis times
        state that -analysis=pointer implies -analysis=type

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/112770044
2014-07-09 07:59:55 -04:00
Francesc Campoy
bb2f616e98 go.toosl/cmd/present: Remove border from iframes
If the author wants a border they can add it on their own.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/107590045
2014-07-09 13:14:06 +10:00
Robert Daniel Kortschak
ea9b1bd08b go.tools/playground/socket: add support for Native Client on arm
LGTM=minux
R=adg, minux
CC=golang-codereviews
https://golang.org/cl/110900043
2014-07-08 22:40:37 -04:00
Shenghou Ma
5a340a31b7 godoc/static/analysis/help.html: fix a typo
LGTM=crawshaw, r
R=golang-codereviews, crawshaw, jscrockett01, r
CC=golang-codereviews
https://golang.org/cl/110120044
2014-07-08 22:40:11 -04:00
Robert Daniel Kortschak
063db5971c go.tools/playground/socket: log connections and code snippet run requests
This logs all successful handshakes and all requests to run code snippets;
it is not immediately obvious how to limit this to non-localhost hosts, or
to instances where publicly available playgrounds are allowed without resorting
to addition of a new global. The level of noise on the log should not be too
great.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/112850043
2014-07-09 12:14:27 +10:00
Robert Griesemer
32c9809768 go.tools/go/types: const decls with invalid init expr must not panic
Make sure const objects always have a valid (possibly unknown) value.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/106530044
2014-07-08 13:33:43 -07:00
Alan Donovan
79e0c7b71e go.tools/go/pointer: eliminate TODOs regarding sound treatment of unsafe.Pointer.
Ain't gonna happen.

Also, don't emit a warning when this happens.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/110030044
2014-07-08 10:11:36 -04:00
Robert Daniel Kortschak
f563a1f0f5 go.tools/cmd/present: move dirListTemplate into template file
This change allows the directory front page to be more easily configurable.

Templates are now read only at start-up and stored in a map rather than re-parsed for each page rendering.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/109080044
2014-07-08 15:27:33 +10:00
Robert Daniel Kortschak
34a8e96191 go.tools/playground/socket: add Native Client wrapper handling
LGTM=adg
R=adg, dave, rsc, minux
CC=golang-codereviews
https://golang.org/cl/77240043
2014-07-08 10:44:34 +10:00
Gordon Klaus
3abe688aea undo CL 107160049 / 9abbb23a14f6
This method was deemed unfit for the API.  See the original CL for discussion.

««« original CL description
go.tools/go/loader: Add Program.FilePath convenience method for getting the full path of a source file.

LGTM=gri
R=gri, adonovan
CC=golang-codereviews
https://golang.org/cl/107160049

»»»

LGTM=gri
R=gri, adonovan
CC=golang-codereviews
https://golang.org/cl/107570043
2014-07-07 14:02:32 -07:00
Josh Bleecher Snyder
3e7bc48329 go.tools/cmd/benchcmp: do not generate trailing whitespace
text/tabwriter cells are tab-terminated, not tab-separated. This creates trailing whitespace. However, with left-aligned columns, it is ok not to treat the final element as a cell. Demo: http://play.golang.org/p/m_ajG8SSZe

LGTM=gri
R=golang-codereviews, gobot, gri
CC=golang-codereviews, r
https://golang.org/cl/103650043
2014-07-07 11:55:26 -07:00
Josh Bleecher Snyder
7da5f193b7 go.tools/cmd/vet: detect stupid boolean conditions
This CL introduces two vet checks. Statistics and code below are from a recent 50mb corpus of public code.

1. Check for redundant conjunctions and disjunctions. This check caught 26 instances, of which 20 were clearly copy/paste bugs and 6 appeared to be mere duplication. A typical example:

if xResolution < 0 || xResolution < 0 {
        panic("SetSize(): width < 0 || height < 0")
}

2. Check for expressions of the form 'x != c1 || x != c2' or 'x == c1 && x == c2', with c1 and c2 constant expressions. This check caught 16 instances, of which all were bugs. A typical example:

if rf.uri.Scheme != "http" || rf.uri.Scheme != "ftp" {
        rf.uri.Scheme = "file"
}

Fixes golang/go#7622.

LGTM=rsc, r
R=golang-codereviews, jscrockett01, r, gri, rsc
CC=golang-codereviews
https://golang.org/cl/98120043
2014-07-02 10:39:57 -07:00
Rob Pike
ccb18ed35d go.tools/cmd/goimports: update doc.go to new emacs instructions
LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/103670045
2014-07-01 10:24:22 -07:00
Peter Collingbourne
87301fe3a6 go.tools/go/types: type the append([]byte, string...) builtin more correctly
This builtin is a little weird in this form as it is (to my knowledge)
the only function that takes a variadic argument of non-slice
type. The language provides no syntax to express this, so we pick
a stringification for such arguments that does not appear in the
language. Specifically, use T... instead of ...T to distinguish it
from the normal case where the type is a slice.

This change lets the go/ssa package produce more efficient IR by
avoiding an extra conversion of the second argument.

LGTM=gri
R=gri
CC=adonovan, golang-codereviews
https://golang.org/cl/108230044
2014-06-27 16:00:54 -07:00
Brad Garcia
345b6437fc godoc: Order package results by import count.
Allow searching for packages by directory components.

LGTM=sameer
R=sameer, bradfitz
CC=golang-codereviews
https://golang.org/cl/104220043
2014-06-27 12:47:39 -04:00
Brad Garcia
936715c71c godoc: Strip "/src/pkg/" prefix from identifier keys, so that it's keyed identically to import count.
Intern the documentation strings.

LGTM=sameer
R=sameer, bradfitz
CC=golang-codereviews
https://golang.org/cl/107250043
2014-06-27 10:25:57 -04:00
Peter Collingbourne
969a226d69 go.tools/go/types: correctly type the copy([]byte, string) builtin
LGTM=gri
R=gri, adonovan
CC=golang-codereviews
https://golang.org/cl/104340046
2014-06-26 16:50:12 -07:00
Robert Griesemer
f38fc6a97a go.tools/go/types: add test cases for parenthesized receivers
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/101510043
2014-06-26 09:48:58 -07:00
Aram Hăvărneanu
6cd21e820b go.tools/go/loader: fix Solaris build
Also fix one test that failed on Plan 9.

LGTM=0intro, dave
R=golang-codereviews, 0intro, dave
CC=golang-codereviews
https://golang.org/cl/101370053
2014-06-24 20:47:16 +10:00
Gordon Klaus
3309b0d879 go.tools/go/loader: Add Program.FilePath convenience method for getting the full path of a source file.
LGTM=gri
R=gri, adonovan
CC=golang-codereviews
https://golang.org/cl/107160049
2014-06-23 15:13:07 -07:00
Dmitriy Vyukov
9ba88c9a99 dashboard/app: tag 1.3 release
R=adg
TBR=adg
CC=golang-codereviews
https://golang.org/cl/102590043
2014-06-21 07:48:41 +04:00
Dmitriy Vyukov
b96847cb92 dashboard/builder: fix crash on commits that contain ESC symbol
Currently performance builders crash with:
hg log: unmarshal Mercurial log: XML syntax error on line 4991: illegal character code U+001B

R=adg
CC=golang-codereviews
https://golang.org/cl/110060046
2014-06-21 05:35:07 +04:00
Josh Bleecher Snyder
95a7aeb192 go.tools/cmd/vet: don't panic on commented-out asm
Really two fixes: Don't panic on bad instructions and don't complain about commented out instructions.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/110070044
2014-06-20 16:52:48 -07:00
Josh Bleecher Snyder
9d6cc5fd08 go.tools/cmd/vet: prevent panic on goto without label
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/107260043
2014-06-20 11:08:45 -07:00
Brad Garcia
87e741c38f godoc: add Corpus.ReadIndexFrom, which will be useful for creating a split
indexing/frontend godoc instance.

R=sameer, sameer
CC=golang-codereviews
https://golang.org/cl/78850043
2014-06-20 06:24:12 -04:00