1
0
mirror of https://github.com/golang/go synced 2024-10-03 23:21:22 -06:00
Commit Graph

1003 Commits

Author SHA1 Message Date
Russ Cox
3f335f80b4 gc: fix unsafe.Sizeof
Fixes #1608.
Fixes #1787.

R=ken2
CC=golang-dev
https://golang.org/cl/4530045
2011-05-10 17:00:15 -04:00
Russ Cox
8133cb3565 gc: preserve original expression for errors
Fixes #1722.

R=ken2
CC=golang-dev
https://golang.org/cl/4442099
2011-04-28 13:14:35 -04:00
Lorenzo Stoakes
b6f0632e93 gc: correctly handle fields of pointer type to recursive forward references
Previously, whether declaring a type which copied the structure of a type it was referenced in via a pointer field would work depended on whether you declared it before or after the type it copied, e.g. type T2 T1; type T1 struct { F *T2 } would work, however type T1 struct { F *T2 }; type T2 T1 wouldn't.

Fixes #667.

R=rsc
CC=golang-dev
https://golang.org/cl/4313064
2011-04-28 00:13:49 -04:00
Russ Cox
4684df520f gc: explain why invalid receiver types are invalid
Fixes #1680.

R=ken2
CC=golang-dev
https://golang.org/cl/4446061
2011-04-25 17:16:44 -04:00
Russ Cox
3a1fdc655e gc: fix import width bug
Fixes #1705.

R=ken2
CC=golang-dev
https://golang.org/cl/4443060
2011-04-25 12:08:48 -04:00
Robert Hencke
883d68f885 gc: allow complex types to be receiver types
Fixes #1716.

R=golang-dev, rsc1, rsc
CC=golang-dev
https://golang.org/cl/4439068
2011-04-25 12:02:54 -04:00
Russ Cox
c0a895fc0a gc: fix conversion of user-defined string type to []byte
Fixes #1709.

R=ken2
CC=golang-dev
https://golang.org/cl/4438068
2011-04-23 10:55:32 -04:00
Russ Cox
815a1b84c7 gc: fix return variable named _
Fixes #1712.

R=ken2
CC=golang-dev
https://golang.org/cl/4445055
2011-04-23 10:54:19 -04:00
Russ Cox
7879d3118c gc: fix line number at EOF
Fixes #1474.

R=ken2
CC=golang-dev
https://golang.org/cl/4432061
2011-04-23 10:54:05 -04:00
Quan Yong Zhai
256df10eae gc: fix copy([]int, string) error message
R=rsc
CC=golang-dev
https://golang.org/cl/4433064
2011-04-21 12:09:29 -04:00
Russ Cox
f10a7882c6 gc: another pointer to interface message
R=ken2
CC=golang-dev
https://golang.org/cl/4444056
2011-04-21 08:20:29 -04:00
Russ Cox
5ff3336490 gc: correct handling of unexported method names in embedded interfaces
go/types: update for export data format change
reflect: require package qualifiers to match during interface check
runtime: require package qualifiers to match during interface check
test: fixed bug324, adapt to be silent

Fixes #1550.
Issue 1536 remains open.

R=gri, ken2, r
CC=golang-dev
https://golang.org/cl/4442071
2011-04-21 08:14:50 -04:00
Russ Cox
ec735c4ec8 gc: fix error for +string
Fixes #1710.

R=ken2
CC=golang-dev
https://golang.org/cl/4444054
2011-04-20 16:12:47 -04:00
Russ Cox
3bac16a6bf reflect: allow Slice of arrays
R=r
CC=golang-dev
https://golang.org/cl/4444049
2011-04-18 20:00:42 -04:00
Russ Cox
beb64bbd6e gc: fix complex move again
R=ken2
CC=golang-dev
https://golang.org/cl/4443047
2011-04-18 13:22:31 -04:00
Russ Cox
3d36a81fcc undo 4439044
cannot use regalloc with floating point on 386.
will redo some other way.

R=ken2
CC=golang-dev
https://golang.org/cl/4439045
2011-04-15 19:17:16 -04:00
Russ Cox
a12d70f60d gc: fix complex move bug
R=ken2
CC=golang-dev
https://golang.org/cl/4439044
2011-04-15 16:16:33 -04:00
Russ Cox
de5616fbb4 gc: print of unsafe.Pointer
Got lost when I introduced TUNSAFEPTR.

R=ken2
CC=golang-dev
https://golang.org/cl/4442046
2011-04-15 16:16:20 -04:00
Russ Cox
db7a2024f9 gc: printing of multiple assignment
R=ken2
CC=golang-dev
https://golang.org/cl/4429043
2011-04-15 10:34:55 -04:00
Rob Pike
a89c0ff39e for GCC4.6: fix a bunch of set-and-not-used errors.
R=rsc
CC=golang-dev
https://golang.org/cl/4406048
2011-04-14 13:31:37 -07:00
Russ Cox
bd77eedacf gc: fix use of typekind array in error messages
Fixes #1697.

R=ken2
CC=golang-dev
https://golang.org/cl/4395045
2011-04-14 09:33:53 -04:00
Russ Cox
017e73c1b2 gc: fix func syntax error
Fixes #1685.

R=ken2
CC=golang-dev
https://golang.org/cl/4414042
2011-04-13 22:48:21 -04:00
Russ Cox
1bc84b7e18 ld: 25% faster
The ld time was dominated by symbol table processing, so
  * increase hash table size
  * emit fewer symbols in gc (just 1 per string, 1 per type)
  * add read-only lookup to avoid creating spurious symbols
  * add linked list to speed whole-table traversals

Breaks dwarf generator (no idea why), so disable dwarf.

Reduces time for 6l to link godoc by 25%.

R=ken2
CC=golang-dev
https://golang.org/cl/4383047
2011-04-09 09:44:20 -04:00
Russ Cox
e7c4a6dfca gc: fix weird error message
Fixes #1670.

R=ken2
CC=golang-dev
https://golang.org/cl/4386045
2011-04-08 13:53:32 -04:00
Russ Cox
35c880b1e2 gc: bug327
Fixes #1674.

R=ken2
CC=golang-dev
https://golang.org/cl/4368057
2011-04-07 18:53:47 -04:00
Russ Cox
6865cc0e8e gc: avoid saying same error 3 times
R=ken2
CC=golang-dev
https://golang.org/cl/4316051
2011-04-01 20:52:38 -04:00
Ian Lance Taylor
2795b13156 gc: remove interim ... error which rejects valid code.
It's been six months.

R=rsc
CC=golang-dev
https://golang.org/cl/4289073
2011-03-25 18:31:55 -07:00
Ken Thompson
61c83b6407 sinit.c: recursion in sinit
fixes #1617

R=rsc
CC=golang-dev
https://golang.org/cl/4277059
2011-03-17 16:47:00 -07:00
Russ Cox
e39dc76884 gc: fix crash when using -u
R=ken2
CC=golang-dev
https://golang.org/cl/4278056
2011-03-16 21:05:40 -04:00
Russ Cox
66f09fd459 gc: diagnose unused labels
R=ken2
CC=golang-dev
https://golang.org/cl/4287047
2011-03-15 14:05:37 -04:00
Russ Cox
e6f3aa6c36 gc: include all dependencies in export metadata
This change records more metadata about what
influenced the creation of the object file.
Specifically, if a package imports, say, "fmt" but does not
need to describe any fmt types in its own export data,
that package's object file did not mention the dependency
on "fmt" before.  Now it does.

Listing the import is purely informational.
It has no effect on which files are opened or consulted
when importing a package.

Import lines are marked indirect when they are needed
to explain the API but were not imported directly.
For example http imports crypto/tls and exports
a struct with a field of type tls.ConnectionState,
which contains an x509.Certificate.  Since http does
not import x509 but needs to explain the x509.Certificate
type in its export data, the import of x509 is marked
as indirect.  These import lines were always present;
marking them with the indirect comment makes clear
which were imported directly and which are incidental.

R=ken2
CC=golang-dev
https://golang.org/cl/4295048
2011-03-14 13:22:34 -04:00
Russ Cox
8bf34e3356 gc, runtime: replace closed(c) with x, ok := <-c
R=ken2, ken3
CC=golang-dev
https://golang.org/cl/4259064
2011-03-11 14:47:26 -05:00
Lorenzo Stoakes
fe8639a9fb gc: fix comments in go.h
Trivial fix to '// n' comments against etype enum in go.h, as these have
got out of sync.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4240097
2011-03-09 08:35:18 -08:00
Russ Cox
4c052844dd gc: fix handling of return values named _
Fixes #1586.

R=ken2
CC=golang-dev
https://golang.org/cl/4244057
2011-03-07 19:36:17 -05:00
Russ Cox
5c2666c18c gc: unsafe.Pointer is not a pointer
Change unsafe.Pointer to be its own kind of
type, instead of making it equivalent to *any.
The change complicates import and export
but avoids the need to find all the places that
operate on pointers but should not operate on
unsafe.Pointer.

Fixes #1566. (a different way)
Fixes #1582.

R=ken2
CC=golang-dev
https://golang.org/cl/4264050
2011-03-07 15:10:01 -05:00
David Symonds
633df67b66 gc, gopack: add some missing flags to the docs.
R=rsc, r
CC=golang-dev
https://golang.org/cl/4260051
2011-03-04 20:21:26 -08:00
Russ Cox
44fd7573aa gc, ld: reflect support for PtrTo
R=ken2
CC=golang-dev
https://golang.org/cl/4245055
2011-03-03 13:17:54 -05:00
Gustavo Niemeyer
daffc2d2ef gc: fix init of packages named main
This change removes the special case which existed
for handling the initalization of the main package,
so that other modules named 'main' get properly
initialized when imported.

Note that gotest of main packages will break in most
cases without this.

R=rsc
CC=golang-dev
https://golang.org/cl/4190050
2011-03-02 16:18:17 -05:00
Russ Cox
7da86983a8 gc: bug325 / issue 1566
Fixes #1566.

R=ken2
CC=golang-dev
https://golang.org/cl/4259041
2011-02-28 17:16:44 -05:00
Russ Cox
8d36a78440 reflect: add pointer word to CommonType
The pointer will eventually let us find *T given T.
This CL just makes room for it, always storing a zero.

R=r, r2
CC=golang-dev
https://golang.org/cl/4221046
2011-02-24 17:11:20 -05:00
Russ Cox
52943bfe4d gc: require if condition
R=ken2, r2
CC=golang-dev
https://golang.org/cl/4195045
2011-02-22 18:23:29 -05:00
Russ Cox
6e03ed32c7 gc: interface error message fixes
Fixes #1526.

R=ken2
CC=golang-dev
https://golang.org/cl/4190051
2011-02-17 16:33:26 -05:00
Jeff R. Allen
3a2d64789b gc: make string const comparison unsigned
Make compile-time string const comparison match semantics
of runtime.cmpstring.

Fixes #1515.

R=rsc
CC=golang-dev, rog
https://golang.org/cl/4172049
2011-02-16 17:57:15 -05:00
Lorenzo Stoakes
b57ac97c27 gc: correct receiver in method missing error
Fixes #1324.

R=rsc1, r, rsc
CC=golang-dev
https://golang.org/cl/3435042
2011-02-11 17:47:58 -05:00
Russ Cox
c1a695c160 gc, ld: package name main no longer reserved
R=ken2
CC=golang-dev
https://golang.org/cl/4128054
2011-02-03 14:17:20 -05:00
Russ Cox
3f61184e1b gc, ld: detect stale or incompatible object files
The object files begin with a header that is

        $GOARCH

on a line by itself.  This CL changes that header to

        go object $GOOS $GOARCH release.2011-01-01 4567+

where the final two fields are the most recent release
tag and the current hg version number.

All objects imported into a Go compilation or linked into an
executable must have the same header line, and that header
line must match the compiler and linker versions.

The effect of this will be that if you update and run all.bash
and then try to link in objects compiled with an earlier version
of the compiler (or invoke the wrong version of the compiler),
you will get an error showing the different headers instead
of perhaps silent incompatibility.

Normal usage with all.bash should be unaffected, because
all.bash deletes all the object files in $GOROOT/pkg/$GOOS_$GOARCH
and cleans all intermediate object files before starting.

This change is intended to diagnose stale objects arising when
users maintaining alternate installation directories forget to
rebuild some of their files after updating.

It should help make the adoption of $GOPATH (CL 3780043)
less error-prone.

R=ken2, r
CC=golang-dev
https://golang.org/cl/4023063
2011-02-03 13:51:43 -05:00
Eoghan Sherry
cf63e34b1d gc: correct rounding of denormal constants
Fixes #1463.

R=rsc
CC=golang-dev
https://golang.org/cl/4079060
2011-02-02 22:36:54 -05:00
Russ Cox
8a2891fc56 gc: select receive bug fix
Affects receive using := when new variable escapes to heap.

Fixes #1468.

R=ken2
CC=golang-dev
https://golang.org/cl/4119052
2011-02-02 18:34:09 -05:00
Russ Cox
05b9050bda gc: handle invalid name in type switch
Fixes #1453.

R=ken2
CC=golang-dev
https://golang.org/cl/4125043
2011-02-01 14:00:36 -05:00
Russ Cox
0e47460915 gc: fix send precedence
Test and fix case found by Robert.
Add receive inside send to tree too.

R=ken2
CC=golang-dev
https://golang.org/cl/3973052
2011-02-01 08:29:21 -05:00