This exposed a bug: we weren't creating Functions for methods
of imported named types.
Also:
- simplification: 'candidate' no longer contains 'concrete *Function'.
We look this up on demand.
NB: this CL contains a copy of CL 10935047 (use of typemap);
will submit/sync/resolve soon.
R=gri
CC=golang-dev
https://golang.org/cl/11051043
Yields a ~20% improvement in SSA construction time.
Also: better names for promotion wrapper functions.
R=gri
CC=golang-dev
https://golang.org/cl/11050043
go/types.Type has an equivalence relation (IsIdentical) that
is not consistent with the equivalence relation implemented by
Go's == operator for Types. Therefore extra work is required
to build a map whose keys are types. This package does that
work.
Has simple unit test. More tests might be good.
R=gri
CC=golang-dev
https://golang.org/cl/9649044
This requires a little more tree rewriting to put a block around the if of an "else if".
More tests too.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/11042045
- consolited remainign assignment check routines
- removed more dead code
- fixed incorrect scope hierarchy in case of errors for some statements
- fixed scope of key iteration variable for range clauses
R=adonovan
CC=golang-dev
https://golang.org/cl/10694044
Details:
- reintroduce interp.asUint64: it's not sound to use only the
low 32 bits of y, which is what asInt gives us, when GOARCH=386.
- instead, emit a uint64 conversion when y is not unsigned
(i.e. a signed var, or an untyped constant).
Tested on 386 & x86-64.
R=gri
CC=golang-dev
https://golang.org/cl/11023043
Various bug fixes:
- don't allow := to redeclare non-variables
- don't permit a comma-ok expression as a two-value function return
Lots of dead code removed.
Fixesgolang/go#5500.
R=adonovan
CC=golang-dev
https://golang.org/cl/10792044
We use the new field to determine whether or not a function is
synthetic, not Pos() == 0, so synthetic functions can have
positions too.
R=gri
CC=golang-dev
https://golang.org/cl/10916044
Instead of passing around iota everywhere, keep track of the
current value in the checker, and update it when entering
different declarations. This is less explicit, but the improvement
over all code is so significant that it is worth it.
R=adonovan
CC=golang-dev
https://golang.org/cl/10814044
- moved ident and typ expr checking into typexpr.go
- as a result, fewer parameters are needed for expr checking
- forward-chain type decls of the form type ( A B; B C; C *A) etc.
so that cycles are getting the right types in all cases
- fixed several corner case bugs, added more test cases
R=adonovan
CC=golang-dev
https://golang.org/cl/10773043
Fixed one aspect of issue 5090. Fixing it completely
requires a bit more work around the representation of
interface types.
R=adonovan
CC=golang-dev
https://golang.org/cl/10678045
Removed special case for testdata/test.go file in favor of
a simpler, more flexible, and explicit flag for one-off test
packages.
R=adonovan
CC=golang-dev
https://golang.org/cl/10618044
Before, all values received on some channel by Select would
flow to an empty interface, creating a spurious confluence for
flow analyses. Now, the tuple returned by Select has one
component for each 'receive' case.
Also, fixes:
- Removed workarounds for now-fixed typechecker bug in FuncLit+TypeAssert.
- sanity check that all Value Instructions have non-nil Type().
- Convert: document and sanity-check that at least one of the types is basic.
Also, other things to help clients:
- Define CallInstruction interface: common parts of Call, Go, Defer.
- Add CallCommon.Signature() method.
- Literal.Pos() is now populated.
R=gri
CC=golang-dev
https://golang.org/cl/10505043
Need the ./ for the path. Quick fix to get the build green, but what really is the right answer for Windows?
R=golang-dev
CC=golang-dev
https://golang.org/cl/10359044
Test the statistics work as expected for a simple program, which can be extended as needed. This is all a bit meta.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/10392050