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
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
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
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.
Fixesgolang/go#8177.
LGTM=gri
R=gri, dave, gordon.klaus, adonovan
CC=golang-codereviews
https://golang.org/cl/105060044
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
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
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
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
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
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"
}
Fixesgolang/go#7622.
LGTM=rsc, r
R=golang-codereviews, jscrockett01, r, gri, rsc
CC=golang-codereviews
https://golang.org/cl/98120043
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
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
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
+ regression test.
Fixesgolang/go#8172
Also: return error (not panic) when called with empty input.
LGTM=gri
R=crawshaw, gri
CC=golang-codereviews, jon
https://golang.org/cl/104270043
Also:
- increase sparsity of sets in benchmarks.
- removed TODO in forEach. Subword masks had no benefit.
- minor cleanup.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/103470049
Clients such as compilers need this information in order
to correctly link against imported packages.
This also adds support for the condensed import data format
where the priority information is stored as a suffix of the
condensed import data, as well as support for archive files.
LGTM=gri
R=gri
CC=golang-codereviews, iant
https://golang.org/cl/78740043
"PATH" and "path" are one and the same environment variable
on windows. We set PATH variable, while "path" is set to its
original value. Windows might use either for the sub-process.
LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/109980043
Bare init functions omit calls to dependent init functions and the
use of an init guard. They are useful in cases where the client uses
a different calling convention for init functions, or cases where
it is easier for a client to analyze bare init functions.
LGTM=adonovan
R=adonovan
CC=golang-codereviews, iant
https://golang.org/cl/78780043
This reduces solver time by about 40%.
See hvn.go for detailed description.
Also in this CL:
- Update package docs.
- Added various global opt/debug options for maintainer convenience.
- Added logging of phase timing.
- Added stdlib_test, disabled by default, that runs the analysis
on all tests in $GOROOT.
- include types when dumping solution
LGTM=crawshaw
R=crawshaw, dannyb
CC=golang-codereviews
https://golang.org/cl/96650048
New invariant: all user-defined objects have an associated package.
Added a check of this invariant to stdlib_test.
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/104170043
Previously, statements such as:
type T struct { a, b int }
[...]
x = T{}
x = T{b: 1}
would only affect the aggregate members mentioned in the composite
literal and leave the other members unchanged. This change causes us
to write a zero value to the target in cases where the target is not
already known to hold a zero value and the number of initializers in
the composite literal differs from the number of elements in its type.
Author: Peter Collingbourne. (hg clpatch got confused)
LGTM=pcc
R=pcc
CC=golang-codereviews
https://golang.org/cl/107980045