This changes makes constant propagation compare 'from' values using node
pointers rather than symbol names when checking to see whether a set
operation is redundant. When a function is inlined multiple times in a
calling function its arguments will share symbol names even though the values
are different. Prior to this fix the bug409 test would hit a case with 6g
where an LEAQ instruction was incorrectly eliminated from the second inlined
function call. 8g appears to have had the same bug, but the test did not fail
there.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5646044
- convert from nil pointers to the nil interface{}
- dereference non-nil pointers
- convert from nil interface{}s to nil pointers
- allocate pointers for non-nil interface{}s
- tests for all of the above
R=golang-dev, bradfitz, rsc, rogpeppe
CC=golang-dev
https://golang.org/cl/5630052
encoding/xml: handle time.Time as recognized type
The long term plan is to define an interface that time.Time
can implement and that encoding/xml can call, but we are
not going to try to define that interface before Go 1.
Instead, special-case time.Time in package xml, because
it is such a fundamental type, as a stop-gap.
The eventual methods will behave this way.
Fixes#2793.
R=golang-dev, r, r, n13m3y3r
CC=golang-dev
https://golang.org/cl/5634051
This also changes the behavior of attribute marshalling so
that strings and byte slices are marshalled even if empty.
The omitempty flag may be used to obtain the previous behavior.
Fixes#2899.
R=rsc
CC=golang-dev
https://golang.org/cl/5645050
The function has a bizarre signature: it was the only public function there
that exposed the reflect package. Also, its definition is peculiar and hard to
explain. It doesn't merit being exported.
This is an API change but really, it should never have been exported and
it's certain very few programs will depend on it: it's too weird.
Fixes#2846.
R=golang-dev, gri, bradfitz
CC=golang-dev
https://golang.org/cl/5639054
It complicates the interface unnecessarily.
Document this in go1.html.
Also update the go/doc Makefile.
Fixes#2836.
R=golang-dev, gri, bradfitz
CC=golang-dev
https://golang.org/cl/5642054
Be careful when printing line comments with incorrect
position information. Maintain additional state
impliedSemi: when set, a comment containing a newline
would imply a semicolon and thus placement must be
delayed.
Precompute state information pertaining to the next
comment for faster checks (the printer is marginally
faster now despite additional checks for each comment).
No effect on existing src, misc sources.
Fixes#1505.
R=rsc
CC=golang-dev
https://golang.org/cl/5598054
Also bring the names in doc.go in line with the source.
More radical resolutions are possible but require substantial internal
changes for very little benefit. Fixing it this way lets us keep the
embedding, which has a huge simplifying effect, and guarantees
binary compatibility.
Fixes#2848.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5644045
Commands such as "dist version > VERSION" will cause
the shell to create an empty VERSION file and set dist's
stdout to its fd. dist in turn looks at VERSION and uses
its content if available, which is empty at this point.
Fix that by ignoring VERSION if it's empty.
Also prevent cmdversion from running findgoversion a
second time. It was already loaded by init.
R=adg, gustavo, rsc
CC=golang-dev
https://golang.org/cl/5639044
There's no reason to set GOROOT as the tools will have the path baked
into it with GOROOT_FINAL.
R=bradfitz, bytbox, gustavo, rsc
CC=golang-dev
https://golang.org/cl/5576064
Specifically, remove simply where it is claiming that the
code or the action to be carried out is simple, since the
reader might disagree.
R=golang-dev, bradfitz, gri
CC=golang-dev
https://golang.org/cl/5637048
As a convenience to people working on the tools,
leave Makefiles that invoke the go dist tool appropriately.
They are not used during the build.
R=golang-dev, bradfitz, n13m3y3r, gustavo
CC=golang-dev
https://golang.org/cl/5636050
This is the same heuristic that build.ScanDir uses.
It avoids considering 'resource fork' files on OS X;
the resource for x.go is ._x.go.
R=gri
CC=golang-dev
https://golang.org/cl/5616073
Unexports runtime.MemStats and rename MemStatsType to MemStats.
The new accessor requires passing a pointer to a user-allocated
MemStats structure.
Fixes#2572.
R=bradfitz, rsc, bradfitz, gustavo
CC=golang-dev, remy
https://golang.org/cl/5616072