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

3187 Commits

Author SHA1 Message Date
Shenghou Ma
df3a841021 doc: elaborate available checks for cmd/vet
R=golang-dev, r, ality, r
CC=golang-dev
https://golang.org/cl/5709053
2012-03-01 02:22:35 +08:00
Robert Griesemer
b1b0ed1e60 go/printer: replace multiline logic
This CL mostly deletes code.

Using existing position information is
just as good to determine if a new section
is needed; no need to track exact multi-
line information. Eliminates the need to
carry around a multiLine parameter with
practically every function.

Applied gofmt -w src misc resulting in only
a minor change to godoc.go. In return, a couple
of test cases are now formatted better.

Not Go1-required, but nice-to-have as it will
simplify fixes going forward.

R=rsc
CC=golang-dev
https://golang.org/cl/5706055
2012-02-29 08:38:31 -08:00
Russ Cox
6e2ae0a12c runtime/pprof: support OS X CPU profiling
Work around profiling kernel bug with signal masks.
Still broken on 64-bit Snow Leopard kernel,
but I think we can ignore that one and let people
upgrade to Lion.

Add new trivial tools addr2line and objdump to take
the place of the GNU tools of the same name, since
those are not installed on OS X.

Adapt pprof to invoke 'go tool addr2line' and
'go tool objdump' if the system tools do not exist.

Clean up disassembly of base register on amd64.

Fixes #2008.

R=golang-dev, bradfitz, mikioh.mikioh, r, iant
CC=golang-dev
https://golang.org/cl/5697066
2012-02-28 16:18:24 -05:00
Shenghou Ma
26daf6a03f cmd/dist: force line-buffering stdout/stderr on Unix
If stdout and stderr are indeed the same file (not a tty), which is
        often the case, fully-buffered stdout will make it harder to see
        progresses, for example, ./make.bash 2>&1 | tee log

R=r, rsc
CC=golang-dev
https://golang.org/cl/5700070
2012-02-29 02:22:28 +08:00
Rob Pike
7201b0c27c tutorial: delete
Instead we'll point people at the Tour and beef up code.html.

Fixes #3107.

R=golang-dev, bradfitz, r, adg
CC=golang-dev
https://golang.org/cl/5697077
2012-02-28 13:35:58 +11:00
David Symonds
9dd746c4cb encoding/json: drop MarshalForHTML; gofix calls to Marshal.
I've elected to omit escaping the output of Marshalers for now.
I haven't thought through the implications of that;
I suspect that double escaping might be the undoing of that idea.

Fixes #3127.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5694098
2012-02-28 11:41:16 +11:00
Rob Pike
5573fa3bc5 cmd/go: mention examples in docs for -test.run
Missed in my last round. These things sure appear
in a lot of places.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5699096
2012-02-28 08:55:25 +11:00
Rob Pike
ec15046a8d cmd/go: drop -example, apply -run to examples
Once more, with feeling.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5698080
2012-02-28 08:33:06 +11:00
Robert Griesemer
ab169c6e3f godoc: don't show directories w/o packages in flat dir mode
The main change is simple: Both the Directory and DirEntry
struct have an extra field 'HasPkg' indicating whether the
directory contains any package files. The remaining changes
are more comments and adjustments to the template files.

Fixes #3121.

R=golang-dev, bradfitz, sameer
CC=golang-dev
https://golang.org/cl/5699072
2012-02-27 11:18:00 -08:00
Shenghou Ma
56ae9032b2 cmd/go: test -i should not disable -c
Fixes #3104.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5699088
2012-02-27 12:33:14 -05:00
Rob Pike
5876b4eb28 testing: add -test.example flag to control execution of examples
Also, don't run examples if -test.run is set.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5697069
2012-02-27 12:49:10 +11:00
Rob Pike
b49dcb9d37 cmd/go: explain x... vs. x/... in help importpath
Fixes #3110.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5696083
2012-02-27 09:51:58 +11:00
Shenghou Ma
bdca78e1a7 cmd/yacc/units.y: update comment, give better error messages when $GOROOT not set
R=r, golang-dev
CC=golang-dev
https://golang.org/cl/5698062
2012-02-26 01:36:26 +08:00
Robert Griesemer
5c7799f108 go: fix help text documenting example functions
R=adg, r
CC=golang-dev
https://golang.org/cl/5695062
2012-02-24 15:42:25 -08:00
Rob Pike
1086dd7cfb cmd/go: in list, don't print blank lines for no output
Otherwise
        go list -f "{{if .Stale}}{{.ImportPath}}{{end}}" all
and similar commands can print pages of empty lines.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5696058
2012-02-25 08:00:55 +11:00
Anthony Martin
dc38756ce1 gc: reject import paths containing special characters
Also allow multiple invalid import statements in a
single file.

Fixes #3021. The changes to go/parser and the
language specifcation have already been committed.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/5672084
2012-02-24 14:48:36 -05:00
Shenghou Ma
04f110e530 cmd/vet: don't give error for Printf("%+5.2e", x)
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5696048
2012-02-25 01:16:17 +08:00
Russ Cox
075eef4018 gc: fix escape analysis + inlining + closure bug
R=ken2
CC=golang-dev, lvd
https://golang.org/cl/5693056
2012-02-23 23:09:53 -05:00
Russ Cox
15d8b05f0c ld: fix alignment of rodata section
We were not aligning the code size,
so read-only data, which follows in the same
segment, could be arbitrarily misaligned.

Fixes #2506.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5693055
2012-02-23 23:01:36 -05:00
Russ Cox
9984a5bca4 cmd/cc: grow some global arrays
Avoids global array buffer overflows if they are
indexed using some of the values between NTYPE
and NALLTYPE.  It is entirely likely that not all of these
are necessary, but this is the C compiler and not worth
worrying much about.  This change takes up only a
few more bytes of memory and makes the behavior
deterministic.

Fixes #3078.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5693052
2012-02-23 22:45:55 -05:00
Scott Lawrence
7ae6872fc0 dist: treat CC as one unit
Fixes #3112.

R=golang-dev, 0xe2.0x9a.0x9b, ality, rsc, rsc
CC=golang-dev
https://golang.org/cl/5700044
2012-02-23 15:38:07 -05:00
Robert Griesemer
999c77d78a godoc: don't show testdata directories
R=golang-dev, bradfitz, dsymonds, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/5700043
2012-02-23 12:23:17 -08:00
Anthony Martin
436f297d1e cc: fix an out of bounds array access
Alternatively, we could expand the ewidth array
in [568]c/txt.c to have NALLTYPES elements and
give all types above NTYPE a width of -1.

I don't think it's worth it since TDOT and TOLD
are the only two type values above NTYPE that
are passed to typ:

$ /tmp/cctypes
cc/dcl.c:683: 			t->down = typ(TOLD, T);
cc/dcl.c:919: 		return typ(TDOT, T);
$

Fixes #3063.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5694047
2012-02-23 14:28:16 -05:00
Adam Langley
36d3707009 6a/6l: add IMUL3Q and SHLDL
Although Intel considers the three-argument form of IMUL to be a
variant of IMUL, I couldn't make 6l able to differentiate it without
huge changes, so I called it IMUL3.

R=rsc
CC=golang-dev
https://golang.org/cl/5686055
2012-02-23 10:51:04 -05:00
Robert Griesemer
cbaf7ca032 godoc: remove dead code
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5698044
2012-02-22 23:38:18 -08:00
Robert Griesemer
548591b77d go cmd: print more than one error when running go test
Fixes #3055.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5683079
2012-02-22 22:33:45 -08:00
Russ Cox
123130f789 5a: fix same arm bug
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/5689073
2012-02-22 17:36:25 -05:00
Russ Cox
a5bc16d619 5c, 5g, 5l: fix arm bug
Using reg as the flag word was unfortunate, since the
default value is not 0 but NREG (==16), which happens
to be the bit NOPTR now.  Clear it.

If I say this will fix the build, it won't.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5690072
2012-02-22 16:29:14 -05:00
Russ Cox
37decab5a3 cmd/dist: fix install cmd/5g on non-arm system
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5689072
2012-02-22 16:29:05 -05:00
Robert Griesemer
775f0058ac godoc: proper index range checking when extracting example code
Fixes #3092.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5683075
2012-02-22 11:25:21 -08:00
Gustavo Niemeyer
024df9f6c4 cgo: fix definition of opaque types
Fixes #3082.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5683074
2012-02-22 17:10:25 -02:00
Robert Griesemer
0c2f3b7ffd go/doc: move firstSentence into go/doc
- renamed firstSentence -> Synopsis
- also deal with common abbreviations

R=rsc
CC=golang-dev
https://golang.org/cl/5676088
2012-02-22 10:49:37 -08:00
Robert Griesemer
d74680ea1c godoc: fix potential index out-of-bounds error
R=golang-dev, bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/5683072
2012-02-21 22:50:00 -08:00
Russ Cox
c2cd0d09c2 ld: get symbol table letters right
Have to assign them before we create the symbol table.
ARM debugging.

TBR=r
CC=golang-dev
https://golang.org/cl/5689067
2012-02-22 01:30:04 -05:00
Russ Cox
e29d3dfc49 gc: new, less strict bool rules
R=ken2
CC=golang-dev
https://golang.org/cl/5688064
2012-02-22 00:29:37 -05:00
Russ Cox
6c7daca236 gc: never crash during a debugging print
TBR=lvd
CC=golang-dev
https://golang.org/cl/5686063
2012-02-22 00:29:23 -05:00
Russ Cox
d1e1367cad cmd/go: add tool -n flag
As in gdb $(go tool -n 6g).

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5689066
2012-02-22 00:06:50 -05:00
David Symonds
6d35302704 cmd/fix: remove os.Wait gofix.
The os.Wait function has been removed entirely, so there's no point in fixing code that called it.

R=r
CC=golang-dev
https://golang.org/cl/5685078
2012-02-22 15:46:31 +11:00
Russ Cox
433e47dc03 ld: only set SNOPTRBSS during load
dodata will convert to SNOPTRDATA if appropriate.
Should fix arm build (hope springs eternal).

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5687074
2012-02-21 23:04:38 -05:00
Russ Cox
a457fa500d gc: return of ideal bool
This is a manual undo of CL 5674098.
It does not implement the even less strict spec
that we just agreed on, but it gets us back where
we were at the last weekly.

R=ken2
CC=golang-dev
https://golang.org/cl/5683069
2012-02-21 22:54:07 -05:00
Russ Cox
5bcad92f07 ld: add NOPTRBSS for large, pointer-free uninitialized data
cc: add #pragma textflag to set it
runtime: mark mheap to go into noptr-bss.
        remove special case in garbage collector

Remove the ARM from.flag field created by CL 5687044.
The DUPOK flag was already in p->reg, so keep using that.

Otherwise test/nilptr.go creates a very large binary.
Should fix the arm build.
Diagnosed by minux.ma; replacement for CL 5690044.

R=golang-dev, minux.ma, r
CC=golang-dev
https://golang.org/cl/5686060
2012-02-21 22:08:42 -05:00
Robert Griesemer
7b22e46282 godoc: fix absolute->relative mapping
Fixes #3096.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5690063
2012-02-21 18:12:37 -08:00
Bobby Powers
d36426995a cmd/dist: fix pprof permissions
When installing pprof into the tools directory, it needs to
have execute permissions on unix-like systems.

Fixes issues 3077.

R=golang-dev, rsc, minux.ma
CC=golang-dev
https://golang.org/cl/5675095
2012-02-21 16:49:30 -05:00
Mike Rosset
e5013e89f1 cmd/go: pass 2, remove reference to incomplete -file flag
R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/5686058
2012-02-21 15:42:03 -05:00
Mike Rosset
7507f3f257 cmd/go: 'go help test' remove documentation for incomplete -file flag
R=golang-dev, rsc, r, r
CC=golang-dev
https://golang.org/cl/5673093
2012-02-21 13:23:33 -05:00
Adam Langley
3053778965 cmd/*: add -d option to bison.
Without -d, bison doesn't generate y.tab.h.

R=rsc
CC=golang-dev
https://golang.org/cl/5685065
2012-02-21 10:50:58 -05:00
Rémy Oudompheng
d75023e1d1 cmd/api: record return type of functions for variable typecheck.
Also cleanup the resolveName method.

Fixes failure on go/build declaration:
        var ToolDir = filepath.Join(...)

R=golang-dev, bradfitz
CC=golang-dev, remy
https://golang.org/cl/5681043
2012-02-21 07:37:25 +01:00
Rémy Oudompheng
f2ad374ae6 cmd/gc: don't believe that variables mentioned 256 times are unused.
Such variables would be put at 0(SP), leading to serious
corruptions at zero initialization.
Fixes #3084.

R=golang-dev, r
CC=golang-dev, remy
https://golang.org/cl/5683052
2012-02-21 16:38:01 +11:00
Rob Pike
ccacab641a os: replace non-portable Waitmsg with portable ProcessState
Use methods for key questions.
Provide access to non-portable pieces through portable methods.
Windows and Plan 9 updated.

R=golang-dev, bradfitz, bradfitz, r, dsymonds, rsc, iant, iant
CC=golang-dev
https://golang.org/cl/5673077
2012-02-21 14:10:34 +11:00
Russ Cox
8998835543 5g, 6g, 8g: flush modified globals aggressively
The alternative is to record enough information that the
trap handler know which registers contain cached globals
and can flush the registers back to their original locations.
That's significantly more work.

This only affects globals that have been written to.
Code that reads from a global should continue to registerize
as well as before.

Fixes #1304.

R=ken2
CC=golang-dev
https://golang.org/cl/5687046
2012-02-20 13:41:44 -05:00