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

3446 Commits

Author SHA1 Message Date
Francisco Souza
34976b985a cmd/go: skipping relative paths on go test -i ./...
Fixes #3896.

R=rsc, rogpeppe, r
CC=golang-dev
https://golang.org/cl/6457075
2012-08-15 07:32:49 -07:00
Robert Hencke
16a82828a2 5l: trivial whitespace cleanup
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/6446131
2012-08-15 10:32:44 +10:00
Robert Griesemer
f597fa67c1 godoc: report error for directories with multiple packages
Fixes #3922.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/6453094
2012-08-09 16:10:46 -07:00
Shenghou Ma
af92b29fe6 cmd/5l: add PT_PAX_FLAGS ELF header
Although I don't use PAX enabled ARM kernels, PAX
does have support for ARM, so we're better off add
PT_PAX_FLAGS now in case people use PAX kernels.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6453092
2012-08-09 08:47:43 +08:00
Shenghou Ma
0cb04168d3 cmd/5l: dwarf line number support for Linux/ARM
Part of issue 3747.

R=dave, lvd, rsc
CC=golang-dev
https://golang.org/cl/6084044
2012-08-07 10:09:24 +08:00
Shenghou Ma
df623d03ab cmd/go: remove $WORK paths in generated binaries
Fixes #3748.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6357064
2012-08-07 10:00:58 +08:00
Rémy Oudompheng
77f3e189d2 runtime: faster string equality.
benchmark                                old ns/op    new ns/op    delta
BenchmarkCompareStringEqual                     51           35  -30.20%
BenchmarkCompareStringIdentical                 51            7  -85.71%
BenchmarkCompareStringSameLength                25           18  -28.29%
BenchmarkCompareStringDifferentLength            2            2   +1.46%

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/6450092
2012-08-05 21:35:41 +02:00
Dmitriy Vyukov
2f2df2aceb cmd/go: allow to use syso files with cgo
I have C functions implemented in .syso file (rather than .so or inlined in .go file).
W/o this change the gcc invocation fails with undefined symbols.

R=minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6352076
2012-08-04 18:02:12 +03:00
Dmitriy Vyukov
8be5e8a419 cmd/cc: allow to call nested packages from within C code
E.g. sync/atomic.LoadInt32() can be called as sync»atomic·LoadInt32()

R=rsc
CC=golang-dev
https://golang.org/cl/6448057
2012-08-04 16:11:53 +04:00
Ian Lance Taylor
6fa38e5e0a cmd/go, go/build, misc/swig: add SWIG support to Go tool
R=adg, rsc, franciscossouza, seb.binet, gen.battle
CC=golang-dev
https://golang.org/cl/5845071
2012-08-03 18:08:43 -07:00
Michał Derkacz
dee5adcf74 5a, 5l, math: Add support for ABSD, ABSF floating point instructions.
R=golang-dev, dave, rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6225051
2012-08-03 16:15:11 -04:00
Rémy Oudompheng
823962c521 cmd/8g: fix miscompilation due to BADWIDTH.
Fixes #3899.

R=rsc
CC=golang-dev, remy
https://golang.org/cl/6453084
2012-08-03 22:05:51 +02:00
Rémy Oudompheng
f4f1ba2b1e cmd/gc: accept switches on comparable arrays.
The compiler is incorrectly rejecting switches on arrays of
comparable types. It also doesn't catch incomparable structs
when typechecking the switch, leading to unreadable errors
during typechecking of the generated code.

Fixes #3894.

R=rsc
CC=gobot, golang-dev, r, remy
https://golang.org/cl/6442074
2012-08-03 21:47:26 +02:00
Russ Cox
3f34248a77 cmd/ld: add PT_PAX_FLAGS ELF header
PAX systems are Linux systems that are more paranoid about memory permissions.
These flags tell them to relax when running Go binaries.

Fixes #47.

R=iant
CC=golang-dev
https://golang.org/cl/6326054
2012-08-03 15:27:35 -04:00
Rémy Oudompheng
b6ea905ed9 cmd/gc: fix inlining bug with receive operator.
The receive operator was given incorrect precedence
resulting in incorrect deletion of parentheses.

Fixes #3843.

R=rsc
CC=golang-dev, remy
https://golang.org/cl/6442049
2012-08-01 00:45:26 +02:00
Shenghou Ma
9de61e7c8c cmd/5l, cmd/ld: add support for R_ARM_GOT_PREL
Android NDK's gcc 4.6 generates this relocation for runtime/cgo.

R=rsc
CC=golang-dev
https://golang.org/cl/6450056
2012-07-30 18:48:00 -04:00
Shenghou Ma
dd62bb4753 cmd/cgo: use 1 as last entry for __cgodebug_data
LLVM-based gcc will place all-zero data in a zero-filled
        section, but our debug/macho can't handle that.
        Fixes #3821.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6444049
2012-07-30 18:44:48 -04:00
Rémy Oudompheng
6cbf35c172 cmd/gc: fix initialization order involving method calls.
They were previously ignored when deciding order and
detecting dependency loops.
Fixes #3824.

R=rsc, golang-dev
CC=golang-dev, remy
https://golang.org/cl/6455055
2012-07-30 09:14:49 +02:00
Russ Cox
7711e61031 cmd/go: show $GOPATH in 'go env' output
Also, sort output.

R=golang-dev, patrick, dave, iant
CC=golang-dev, patrick
https://golang.org/cl/6446064
2012-07-30 00:22:42 -04:00
Daniel Morsing
dd166b9437 cmd/gc: point "no new variables" error at right line number.
Fixes #3856.

R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/6455056
2012-07-29 22:24:19 -04:00
Ian Lance Taylor
24ae7e686d cgo: fix declarations in _cgo_export.c
Declare crosscall2.  Declare the functions passed to it as
returning void, rather than relying on implicit return type.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6432060
2012-07-25 14:14:37 -07:00
Dave Cheney
fba47dc3b1 cmd/godoc: delete -path flag
Fixes #3453.

R=golang-dev, gri, jeff, bradfitz
CC=golang-dev
https://golang.org/cl/6350086
2012-07-25 10:49:50 -07:00
Ian Lance Taylor
b575a98121 cgo: add -gccgopkgpath option to match gccgo -fgo-pkgpath
R=golang-dev, r, iant
CC=golang-dev
https://golang.org/cl/6416056
2012-07-20 16:58:08 -07:00
Rob Pike
f49b7b0acf cmd/vet: provide flags to control which tests to run
By default, all are still run, but a particular test can be
selected with the new flags.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6395053
2012-07-16 14:03:11 -07:00
Rémy Oudompheng
656b192c16 cmd/gc: reject use of ... with multiple-valued expressions.
Fixes #3334.

R=golang-dev, r
CC=golang-dev, remy
https://golang.org/cl/6350103
2012-07-13 08:05:41 +02:00
Rémy Oudompheng
1ca7bc268b cmd/gc: avoid an internal error on invalid type switch.
The error was caused by a call to implements() even when
the type switch variable was not an interface.

Fixes #3786.

R=golang-dev, r
CC=golang-dev, remy
https://golang.org/cl/6354102
2012-07-12 23:31:36 +02:00
Rémy Oudompheng
bd0bb2bc39 cmd/gc: fix error message for type errors involving conversions.
Fixes #3818.

R=golang-dev, rsc, r
CC=golang-dev, remy
https://golang.org/cl/6352106
2012-07-12 23:26:52 +02:00
Dave Cheney
eb1c03eacb cmd/pack: remove unused paging logic
This is the remainder of https://golang.org/cl/4601051.

Partially addresses issue 2705.

R=golang-dev, r, bradfitz, minux.ma
CC=golang-dev
https://golang.org/cl/6354066
2012-07-12 10:14:07 +10:00
Pieter Droogendijk
34b10d7482 cmd/dist: Make verbose messages print to stderr
Made the following changes:
 - Export errprintf() from all three OS-specific modules
 - Added errprintf() to a.h
 - Moved errprintf() in windows.c under xprintf(), since they are so similar
 - Replaced all instances of xprintf() with errprintf() where a vflag check is done
Fixes #3788.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/6346056
2012-07-06 15:00:18 +10:00
Shenghou Ma
a49172663c cmd/cgo: make typedef map traversal order consistent
So that _cgo_gotypes.go will be the same for the same source
        code.

R=nigeltao
CC=golang-dev
https://golang.org/cl/6357067
2012-07-05 15:24:33 -04:00
Nigel Tao
18e86644a3 cmd/gc: cache itab lookup in convT2I.
There may be further savings if convT2I can avoid the function call
if the cache is good and T is uintptr-shaped, a la convT2E, but that
will be a follow-up CL.

src/pkg/runtime:
benchmark                  old ns/op    new ns/op    delta
BenchmarkConvT2ISmall             43           15  -64.01%
BenchmarkConvT2IUintptr           45           14  -67.48%
BenchmarkConvT2ILarge            130          101  -22.31%

test/bench/go1:
benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17    8588997000   8499058000   -1.05%
BenchmarkFannkuch11      5300392000   5358093000   +1.09%
BenchmarkGobDecode         30295580     31040190   +2.46%
BenchmarkGobEncode         18102070     17675650   -2.36%
BenchmarkGzip             774191400    771591400   -0.34%
BenchmarkGunzip           245915100    247464100   +0.63%
BenchmarkJSONEncode       123577000    121423050   -1.74%
BenchmarkJSONDecode       451969800    596256200  +31.92%
BenchmarkMandelbrot200     10060050     10072880   +0.13%
BenchmarkParse             10989840     11037710   +0.44%
BenchmarkRevcomp         1782666000   1716864000   -3.69%
BenchmarkTemplate         798286600    723234400   -9.40%

R=rsc, bradfitz, go.peter.90, daniel.morsing, dave, uriel
CC=golang-dev
https://golang.org/cl/6337058
2012-07-03 09:09:05 +10:00
Shenghou Ma
a732cbb593 cmd/gc: add missing case for OCOM in defaultlit()
Fixes #3765.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6349064
2012-07-02 09:33:22 +08:00
Amir Mohammad Saied
35030a9966 cmd/go: httpGet function does not use global variable httpClient
No change, just for consistency.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6346048
2012-06-30 12:27:57 -07:00
Pieter Droogendijk
735780c27e cmd/dist: Make windows.c's fatal() print to stderr
Generating env.bat using dist env -wp > env.bat failed silently
if case of an error, because the message was redirected to env.bat.
Verbose messages still go to stdout, causing problems, but that's
a seperate change.
Made errprintf() identical to xprintf(), except for the output handle.
Yes, it's duplicate code, but most of the function is unpacking
the argument list and preparing it for WriteFile(), which has to be
done anyway.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/6343047
2012-07-01 00:27:05 +10:00
Shenghou Ma
33d2b495c5 cmd/cgo: generate definitions for GoSlice
Fixes #3741.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6308076
2012-06-30 12:40:07 +08:00
Robert Griesemer
96a609c2d7 gofmt: handle comments correctly in rewrites
R=rsc
CC=golang-dev
https://golang.org/cl/6294076
2012-06-25 13:58:28 -07:00
Robert Griesemer
277e7e57ca go/ast: minor comment maps API change
This is a new, not yet committed API.

- Changed NewCommentMap to be independent of
  *File nodes and more symmetric with the
  Filter and Comments methods.

- Implemented Update method for use in
  AST modifications.

- Implemented String method for debugging

R=rsc
CC=golang-dev
https://golang.org/cl/6303086
2012-06-25 11:27:54 -07:00
Nigel Tao
8f84328fdc cmd/gc: inline convT2E when T is uintptr-shaped.
GOARCH=amd64 benchmarks

src/pkg/runtime
benchmark                  old ns/op    new ns/op    delta
BenchmarkConvT2ESmall             10           10   +1.00%
BenchmarkConvT2EUintptr            9            0  -92.07%
BenchmarkConvT2EBig               74           74   -0.27%
BenchmarkConvT2I                  27           26   -3.62%
BenchmarkConvI2E                   4            4   -7.05%
BenchmarkConvI2I                  20           19   -2.99%

test/bench/go1
benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17    5930908000   5937260000   +0.11%
BenchmarkFannkuch11      3927057000   3933556000   +0.17%
BenchmarkGobDecode         21998090     21870620   -0.58%
BenchmarkGobEncode         12725310     12734480   +0.07%
BenchmarkGzip             567617600    567892800   +0.05%
BenchmarkGunzip           178284100    178706900   +0.24%
BenchmarkJSONEncode        87693550     86794300   -1.03%
BenchmarkJSONDecode       314212600    324115000   +3.15%
BenchmarkMandelbrot200      7016640      7073766   +0.81%
BenchmarkParse              7852100      7892085   +0.51%
BenchmarkRevcomp         1285663000   1286147000   +0.04%
BenchmarkTemplate         566823800    567606200   +0.14%

I'm not entirely sure why the JSON* numbers have changed, but
eyeballing the profile suggests that it could be spending less
and more time in runtime.{new,old}stack, so it could simply be
stack-split boundary noise.

R=rsc, dave, bsiegert, dsymonds
CC=golang-dev
https://golang.org/cl/6280049
2012-06-14 10:43:20 +10:00
Robert Griesemer
8140cd9149 godoc: show comments in various filtered views
Fixes #3454.

R=rsc
CC=golang-dev
https://golang.org/cl/6305069
2012-06-13 13:32:59 -07:00
Russ Cox
0c2f0cca7c cmd/api: handle empty API file, ignore -next in release
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6298063
2012-06-08 13:44:13 -04:00
Dave Cheney
072e36d5ef cmd/5c, cmd/5g, cmd/5l: fix cross compilation failure on darwin
Fixes #3708.

The fix to allow 5{c,g,l} to compile under clang 3.1 broke cross
compilation on darwin using the Apple default compiler on 10.7.3.

This failure was introduced in 9b455eb64690.

This has been tested by cross compiling on darwin/amd64 to linux/arm using

* gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
* clang version 3.1 (branches/release_31)

As well as on linux/arm using

* gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
* Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM 3.0)
* Debian clang version 3.1-4 (branches/release_31) (based on LLVM 3.1)

R=consalus, rsc
CC=golang-dev
https://golang.org/cl/6307058
2012-06-08 13:13:02 +10:00
Shenghou Ma
a0084b3494 cmd/5a, cmd/5l: add MULW{T,B} and MULAW{T,B} support for ARM
Supported in ARMv5TE and above.
        Also corrected MULA disassembly listing.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6265045
2012-06-08 02:42:28 +08:00
Russ Cox
f51390b23c cmd/cgo: make Go code order deterministic
The type declarations were being generated using
a range over a map, which meant that successive
runs produced different orders. This will make sure
successive runs produce the same files.

Fixes #3707.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6300062
2012-06-07 12:37:50 -04:00
Russ Cox
b185de82a4 cmd/gc: limit data disassembly to -SS
This makes -S useful again.

R=ken2
CC=golang-dev
https://golang.org/cl/6302054
2012-06-07 12:05:34 -04:00
Russ Cox
2a9410c19c cmd/gc: fix LEAQ $0, SI bug
Cannot take effective address of constant.

Fixes #3670.

R=ken2
CC=golang-dev
https://golang.org/cl/6299055
2012-06-07 11:59:18 -04:00
Russ Cox
9fe424737b cmd/gc: run escape analysis in call graph dependency order
If there are mutually recursive functions, there is a cycle in
the dependency graph, so the order is actually dependency order
among the strongly connected components: mutually recursive
functions get put into the same batch and analyzed together.
(Until now the entire package was put in one batch.)

The non-recursive case (single function, maybe with some
closures inside) will be able to be more precise about inputs
that escape only back to outputs, but that is not implemented yet.

R=ken2
CC=golang-dev, lvd
https://golang.org/cl/6304050
2012-06-07 03:15:09 -04:00
Russ Cox
6363fc5aa6 cmd/gc: fix type checking loop
CL 4313064 fixed its test case but did not address a
general enough problem:

type T1 struct { F *T2 }
type T2 T1
type T3 T2

could still end up copying the definition of T1 for T2
before T1 was done being evaluated, or T3 before T2
was done.

In order to propagate the updates correctly,
record a copy of an incomplete type for re-execution
once the type is completed. Roll back CL 4313064.

Fixes #3709.

R=ken2
CC=golang-dev, lstoakes
https://golang.org/cl/6301059
2012-06-07 03:06:40 -04:00
Russ Cox
f18ced3fc9 cmd/gc: delete dead code
R=ken2
CC=golang-dev
https://golang.org/cl/6307050
2012-06-07 02:15:23 -04:00
Russ Cox
744b23fe48 cmd/gc: do not crash on struct with _ field
Fixes #3607.

R=ken2
CC=golang-dev
https://golang.org/cl/6296052
2012-06-07 02:05:08 -04:00
Russ Cox
ee5f59ab4f cmd/gc: preserve side effects during inlining of function with _ argument
Fixes #3593.

R=ken2
CC=golang-dev, lvd
https://golang.org/cl/6305061
2012-06-07 01:54:07 -04:00