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

165 Commits

Author SHA1 Message Date
Robert Griesemer
a87382e7b3 go/types: New Go type hierarchy implementation for AST.
This CL defines a new, more Go-like representation of
Go types (different structs for different types as
opposed to a single Type node). It also implements
an ast.Importer for object/archive files generated
by the gc compiler tool chain. Besides the individual
type structs, the main difference is the handling of
named types: In the old world, a named type had a
non-nil *Object pointer but otherwise looked no
different from other types. In this new model, named
types have their own representation types.Name. As
a result, resolving cycles is a bit simpler during
construction, at the cost of having to deal with
types.Name nodes explicitly later. It remains to be
seen if this is a good approach. Nevertheless, code
involving types reads more nicely and benefits from
full type checking. Also, the representation seems
to more closely match the spec wording.

Credits: The original version of the gc importer was
written by Evan Shaw (chickencha@gmail.com). The new
version in this CL is based largely on Evan's original
code but contains bug fixes, a few simplifications,
some restructuring, and was adjusted to use the
new type hierarchy. I have added a comprehensive test
that imports all packages found under $GOROOT/pkg (with
a 3s time-out to limit the run-time of the test). Run
gotest -v for details.

The original version of ExportData (exportdata.go) was
written by Russ Cox (rsc@golang.org). The current version
is returning the internal buffer positioned at the beginning
of the export data instead of printing the export data to
stdout.

With the new types package, the existing in-progress
typechecker package is deprecated. I will delete it
once all functionality has been brought over.

R=eds, rog, rsc
CC=golang-dev
https://golang.org/cl/4314054
2011-04-07 21:40:37 -07:00
Russ Cox
2671ddd10b fix build (sorry)
TBR=r
CC=golang-dev
https://golang.org/cl/4378042
2011-04-06 15:13:18 -04:00
Russ Cox
0ea7bf4867 src/pkg/Makefile: trim per-directory make output except on failure
Not committed to this but it sure makes
the output easier to skim.  With this CL:

$ make
install runtime
install sync/atomic
install sync
install unicode
install utf16
install syscall
install os
...
install ../cmd/govet
install ../cmd/goyacc
install ../cmd/hgpatch
$ make test
test archive/tar
test archive/zip
test asn1
test big
test bufio
...
test path
test path/filepath
TEST FAIL reflect
gotest
rm -f _test/reflect.a
6g -o _gotest_.6 deepequal.go type.go value.go
rm -f _test/reflect.a
gopack grc _test/reflect.a _gotest_.6
all_test.go:210: invalid type assertion: reflect.NewValue(tt.i).(*StructValue) (non-interface type reflect.Value on left)
all_test.go:217: cannot type switch on non-interface value v (type reflect.Value)
all_test.go:218: undefined: IntValue
all_test.go:221: cannot use 132 (type int) as type reflect.Value in function argument
all_test.go:223: cannot use 8 (type int) as type reflect.Value in function argument
all_test.go:225: cannot use 16 (type int) as type reflect.Value in function argument
all_test.go:227: cannot use 32 (type int) as type reflect.Value in function argument
all_test.go:229: cannot use 64 (type int) as type reflect.Value in function argument
all_test.go:231: undefined: UintValue
all_test.go:234: cannot use 132 (type int) as type reflect.Value in function argument
all_test.go:234: too many errors
gotest: "/Users/rsc/g/go/bin/6g -I _test -o _xtest_.6 all_test.go tostring_test.go" failed: exit status 1
make[1]: *** [test] Error 2
make: *** [reflect.test] Error 1

R=r, r2
CC=golang-dev
https://golang.org/cl/4343046
2011-04-06 15:06:28 -04:00
Alex Brainman
7f7371e95b pkg/path: enable tests on Windows
Fixes #1107.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4374041
2011-04-06 16:45:20 +10:00
Adam Langley
906b2e7679 crypto/des: cleanups
R=rsc
CC=golang-dev
https://golang.org/cl/4315050
2011-04-05 15:40:48 -04:00
Adam Langley
2db1769d7b crypto/block: remove deprecated package.
R=rsc
CC=golang-dev
https://golang.org/cl/4315051
2011-04-05 15:23:40 -04:00
Rob Pike
fb80f63cf7 gotest: replace the shell script with the compiled program written in go.
Update the make sequence: gotest must now be installed after the packages.

R=rsc
CC=golang-dev
https://golang.org/cl/4323044
2011-03-29 13:29:20 -07:00
Russ Cox
6b3357129a build: add all-qemu.bash, handful of arm fixes
R=r
CC=golang-dev
https://golang.org/cl/4313051
2011-03-27 23:39:42 -04:00
Rob Pike
d406f8f650 testing: set up structure for faster testing using the new -test.short flag.
New make target "testshort" runs "gotest -test.short" and is invoked
by run.bash, which is invoked by all.bash.

Use -test.short to make one package (crypto ecdsa) run much faster.
More changes to come.

Once this is in, I will update the long-running tests to use the new flag.

R=rsc
CC=golang-dev
https://golang.org/cl/4317043
2011-03-25 14:50:44 -07:00
Russ Cox
b47ec598b7 runtime/pprof: cpu profiling support
R=r, bradfitzgo, r2
CC=golang-dev
https://golang.org/cl/4313041
2011-03-23 13:54:31 -04:00
Russ Cox
a34f1bbb22 gofix: new command for updating code to new release
R=bradfitzgo, dsymonds, r, gri, adg
CC=golang-dev
https://golang.org/cl/4282044
2011-03-15 14:15:41 -04:00
Robert Griesemer
c734b50b11 gotype: clean handling of stdin, added tests
- removed uses of global variables
- minor cleanups

R=r
CC=golang-dev
https://golang.org/cl/4277044
2011-03-11 16:15:33 -08:00
Robert Griesemer
dbff0adaa7 gotype: commandline tool to typecheck go programs
First version. Handles scope analysis only at the
moment.

R=rsc, r, eds
CC=golang-dev
https://golang.org/cl/4259065
2011-03-11 10:27:25 -08:00
Brad Fitzpatrick
bbad6900ce http: run tests even with DISABLE_NET_TESTS=1
All tests are now localhost only.

R=rsc
CC=golang-dev
https://golang.org/cl/4271042
2011-03-10 10:19:11 -08:00
Adam Langley
f422242065 crypto/ecdsa: add package.
R=rsc, cw
CC=golang-dev
https://golang.org/cl/4253073
2011-03-10 09:42:34 -05:00
Pascal S. de Kloe
4371e09457 hash: new FNV-1a implementation
R=agl1, rsc
CC=golang-dev
https://golang.org/cl/4257042
2011-03-07 11:11:21 -05:00
Gustavo Niemeyer
70f08b47a0 goinstall: handle $(GOOS) and $(GOARCH) in filenames
This enables goinstall to handle .go and .c files (for cgo)
which are named after the following patterns:

    name_$(GOOS).*
    name_$(GOARCH).*
    name_$(GOOS)_$(GOARCH).*

Files with those names are only included if the $(GOOS) and
$(GOARCH) match the current system.

R=rsc
CC=golang-dev
https://golang.org/cl/4172055
2011-03-07 10:54:53 -05:00
Gustavo Niemeyer
04ca4f8242 path/filepath: new OS-specific path support
The path package now contains only functions which
deal with slashed paths, sensible for any OS when dealing
with network paths or URLs.  OS-specific functionality
has been moved into the new path/filepath package.

This also includes fixes for godoc, goinstall and other
packages which were mixing slashed and OS-specific paths.

R=rsc, gri, mattn, brainman
CC=golang-dev
https://golang.org/cl/4252044
2011-03-06 17:33:23 -05:00
Brad Fitzpatrick
da679db0f1 http: add packages http/cgi and http/httptest
R=rsc, adg, jnw, bradfitzwork
CC=golang-dev
https://golang.org/cl/4247048
2011-03-04 10:55:47 -08:00
Nigel Tao
7483c6ee3c image: add a decoding test for common file formats.
The test image was converted from doc/video-001.png using the
convert command line tool (ImageMagick 6.5.7-8) at -quality 100.

R=r, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/4259047
2011-03-03 20:35:49 +11:00
Russ Cox
22eab1f5c7 sync/atomic: new package
Fixes #170.

R=gri, iant, r, r2
CC=golang-dev
https://golang.org/cl/4241041
2011-02-25 14:29:36 -05:00
Adam Langley
6ca009f58d crypto/openpgp: add package
R=bradfitzgo
CC=golang-dev
https://golang.org/cl/3989052
2011-02-24 20:19:53 -05:00
Adam Langley
bf6939829d compress/bzip2: add package.
This code implements bzip2 decompression only.

R=bradfitzgo, r2, nigeltao, rsc
CC=golang-dev
https://golang.org/cl/4176051
2011-02-23 10:23:28 -05:00
Nigel Tao
658447ab66 compress/lzw: implement a decoder.
R=rsc
CC=bsiegert, golang-dev, mpl
https://golang.org/cl/4182081
2011-02-23 20:52:43 +11:00
Dave Cheney
8a8ecda54a build: reduce the use of subshells in recursive make
Using make -C $* rather than (cd $* ; make) results in a small,
but measurable improvement in build times where compilation is
not the major component. eg.

before - ~/go/src/pkg$ time make
        real	0m1.176s
        user	0m0.639s
        sys	0m0.399s
after - ~/go/src/pkg$ time make
        real	0m0.916s
        user	0m0.571s
        sys	0m0.243s

There are other places in the distribution src/make.common for example
that could also benefit from this change.

R=adg
CC=golang-dev, rsc
https://golang.org/cl/4174055
2011-02-19 10:49:46 +11:00
Gustavo Niemeyer
13c95f452e build: Drop syslog on DISABLE_NET_TESTS=1
Even if local, it requires communication with a daemon
which may not be available.  This is creating problems
for getting an Ubuntu package going in Launchpad's PPA.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/3989062
2011-02-08 23:50:23 -05:00
Russ Cox
6c5e4e1854 build: allow clean.bash to work on fresh checkout
Must be invoked as ./clean.bash --gomake make
(or --gomake gmake, depending on the name of
GNU make).

R=niemeyer
CC=golang-dev
https://golang.org/cl/4023065
2011-02-04 14:33:08 -05:00
Adam Langley
e308d55973 crypto: add package.
The crypto package is added as a common place to store identifiers for
hash functions. At the moment, the rsa package has an enumeration of
hash functions and knowledge of their digest lengths. This is an
unfortunate coupling and other high level crypto packages tend to need
to duplicate this enumeration and knowledge (i.e. openpgp).

crypto pulls this code out into a common location.

It would also make sense to add similar support for ciphers to crypto,
but the problem there isn't as acute that isn't done in this change.

R=bradfitzgo, r, rsc
CC=golang-dev
https://golang.org/cl/4080046
2011-02-01 11:02:48 -05:00
Adam Langley
166008b988 crypto/dsa: add support for DSA
R=bradfitzgo, r, bradfitzwork, nsz, rsc
CC=golang-dev
https://golang.org/cl/3990043
2011-01-25 12:25:53 -05:00
Miek Gieben
40c7449044 encoding/base32: new package
R=rsc
CC=Miek Gieben, golang-dev
https://golang.org/cl/3926041
2011-01-20 12:51:15 -05:00
Wei Guangjing
1aa2d88739 cgo: windows/386 port
R=rsc, peterGo, brainman
CC=golang-dev
https://golang.org/cl/3733046
2011-01-20 10:22:20 -05:00
Rob Pike
89993544c2 runtime/debug: new package
Facilities for printing stack traces from within a running goroutine.

R=rsc
CC=golang-dev
https://golang.org/cl/4031041
2011-01-19 12:28:38 -08:00
Berengar Lehr
1aec7c7f34 crypto: add twofish package
The code was (as annotated in the source code) adopted from Tom's
LibCrypt (public domain code, [1]). It was neither optimised for speed
nor were any security features added.

[1] http://libtom.org/?page=features&newsitems=5&whatfile=crypt

R=rsc, berengarlehr, albert.strasheim, agl1
CC=golang-dev, schulze
https://golang.org/cl/2687042
2011-01-11 20:51:35 -05:00
Adam Langley
66a45b486b encoding/line: add
I needed a way to read lines without worrying about \n and \r\n.

R=r, rsc
CC=golang-dev
https://golang.org/cl/2859041
2011-01-08 10:29:37 -05:00
Adam Langley
eedf5c4529 crypto/tls: support CBC ciphers
This is largely based on ality's CL 2747042.

crypto/rc4: API break in order to conform to crypto/cipher's
Stream interface

cipher/cipher: promote to the default build

Since CBC differs between TLS 1.0 and 1.1, we downgrade and
support only 1.0 at the current time. 1.0 is what most of the
world uses.

Given this CL, it would be trival to add support for AES 256,
SHA 256 etc, but I haven't in order to keep the change smaller.

R=rsc
CC=ality, golang-dev
https://golang.org/cl/3659041
2010-12-15 11:49:55 -05:00
Russ Cox
0c54225b51 remove nacl
The recent linker changes broke NaCl support
a month ago, and there are no known users of it.

The NaCl code can always be recovered from the
repository history.

R=adg, r
CC=golang-dev
https://golang.org/cl/3671042
2010-12-15 11:49:23 -05:00
Wei Guangjing
e04ef7769e Fix windows build.
R=brainman, rsc
CC=golang-dev
https://golang.org/cl/3533041
2010-12-13 16:41:02 +11:00
Balazs Lecz
2bdb2e78fe os/inotify: new package
This patch adds a new package: os/inotify, which
provides a Go wrapper to the Linux inotify system.

R=rsc, albert.strasheim, rog, jacek.masiulaniec
CC=golang-dev
https://golang.org/cl/2049043
2010-12-09 13:11:39 -05:00
Rob Pike
8e609cddef govet: a new static checker for Go programs.
At the moment, and for the forseeable future, it only checks arguments to print calls.

R=rsc, gri, niemeyer, iant2, rog, lstoakes, jacek.masiulaniec, cw
CC=golang-dev
https://golang.org/cl/3522041
2010-12-09 12:37:18 -05:00
Russ Cox
98b2d7062e libcgo: delete (replaced by runtime/cgo)
Move unported files (freebsd*, windows*, nacl*) to runtime/cgo.

Step toward fixing FreeBSD build.

R=r
TBR=r
CC=golang-dev
https://golang.org/cl/3497042
2010-12-08 14:33:17 -05:00
Russ Cox
9042c2ce68 runtime/cgo: runtime changes for new cgo
Formerly known as libcgo.
Almost no code here is changing; the diffs
are shown relative to the originals in libcgo.

R=r
CC=golang-dev
https://golang.org/cl/3420043
2010-12-08 13:53:30 -05:00
Alex Brainman
a2a4e0c01a exec: enable tests on windows
Fixes #1104.

R=golang-dev, mattn, r
CC=Joe Poirier, golang-dev
https://golang.org/cl/3051041
2010-11-13 11:15:09 +11:00
Adam Langley
fb784785f5 crypto/elliptic: add package
elliptic implements several standard elliptic curves over prime fields.

R=r, r2
CC=golang-dev
https://golang.org/cl/3065041
2010-11-12 14:55:32 -05:00
Adam Langley
b5135b34c9 crypto: add cast5
CAST5 is the default OpenPGP cipher.

(This won't make Rob any happier about the size of crypto/, of course.)

It already has dst, src in that order but it doesn't have any users yet so I figure it's better than changing it later.

R=rsc, gri, r
CC=golang-dev
https://golang.org/cl/2762042
2010-11-03 10:39:15 -04:00
Wei Guangjing
035696c59a debug/pe, cgo: add windows support
R=rsc, mattn
CC=golang-dev
https://golang.org/cl/1976045
2010-11-01 17:52:26 -04:00
Rob Pike
4e9cc085d2 testing: eliminate testing/regexp
Rather than updating the stripped-down regexp implementation embedded
in testing, delete it by passing the one function we need from the package
main file created by gotest.

R=rsc
CC=golang-dev
https://golang.org/cl/2761043
2010-10-28 16:54:24 -07:00
Russ Cox
7c2b1597c6 arm: precise float64 software floating point
Adds softfloat64 to generic runtime
(will be discarded by linker when unused)
and adds test for it.  I used the test to check
the software code against amd64 hardware
and then check the software code against
the arm and its simulation of hardware.
The latter should have been a no-op (testing
against itself) but turned up a bug in 5c causing
the vlrt.c routines to miscompile.

These changes make the cmath, math,
and strconv tests pass without any special
accommodations for arm.

R=ken2
CC=golang-dev
https://golang.org/cl/2713042
2010-10-25 17:55:50 -07:00
Russ Cox
079cbddbd8 arm: fix signal handler
R=ken2
CC=golang-dev
https://golang.org/cl/2670042
2010-10-26 01:32:36 +02:00
Russ Cox
1c8f185611 arm: 3 more tests pass
R=ken2
CC=golang-dev
https://golang.org/cl/2666041
2010-10-22 05:53:03 +02:00
Russ Cox
69188ad9bb arm: prop up software floating point
Just enough to make mov instructions work,
which in turn is enough to make strconv work
when it avoids any floating point calculations.
That makes a bunch of other packages pass
their tests.

Should suffice until hardware floating point
is available.

Enable package tests that now pass
(some due to earlier fixes).

Looks like there is a new integer math bug
exposed in the fmt and json tests.

R=ken2
CC=golang-dev
https://golang.org/cl/2638041
2010-10-21 06:56:20 +02:00