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

2008 Commits

Author SHA1 Message Date
Ken Thompson
f6b93ab432 change floating literal normalization
from word-oriented to bit-oriented.
this will increase fp literal precision
by up to a full word.

R=rsc
CC=golang-dev
https://golang.org/cl/1859044
2010-07-19 16:10:46 -07:00
Russ Cox
2d6ae385e1 linux/386: use Xen-friendly ELF TLS instruction sequence
Fixes #465.

R=iant
CC=golang-dev
https://golang.org/cl/1665051
2010-07-17 16:54:03 -07:00
Ken Thompson
95b93c28e3 1. got 29 (Mpscale) more bits of precision
out of floating constant multiply
2. added rounding code to "const fix=float"
to allow up to 29 (Mpscale) bits of
slop and still get an exact fixed constant.

fixes #931

R=rsc
CC=golang-dev
https://golang.org/cl/1692055
2010-07-17 16:32:40 -07:00
Russ Cox
b693847ea8 gc: print error detail about failure to open import
R=ken2
CC=golang-dev
https://golang.org/cl/1872041
2010-07-16 21:38:51 -07:00
Russ Cox
e692977af3 5l, 6l, 8l: reject invalid input files
Fixes #925.
Fixes #926.
Fixes #927.
Fixes #928.
Fixes #929.
Fixes #930.

R=r
CC=golang-dev
https://golang.org/cl/1752044
2010-07-16 16:16:17 -07:00
Rob Pike
8519134b98 fix typo in lex.c comment
R=rsc
CC=golang-dev
https://golang.org/cl/1862044
2010-07-16 15:08:31 -07:00
Ken Thompson
19d7fc4026 change line pragma from
//line number file
to
	//line file:number

R=rsc
CC=golang-dev
https://golang.org/cl/1868041
2010-07-16 13:34:36 -07:00
Ian Lance Taylor
8a95821694 cgo: If CC is set in environment, use it rather than "gcc".
R=rsc
CC=golang-dev
https://golang.org/cl/1842042
2010-07-16 11:01:04 -07:00
Ken Thompson
444066e56d interpret lines that look like
//line 10 units.y
which is equiv to c
	#line 10 units.y
the purpose is to generate diagnostics
that correctly point to preprocessed source.

R=rsc
CC=golang-dev
https://golang.org/cl/1863042
2010-07-15 20:21:33 -07:00
Russ Cox
4c0de303ce gc: bug294
Fixes #800.

R=ken2
CC=golang-dev
https://golang.org/cl/1855043
2010-07-15 16:42:32 -07:00
Russ Cox
ece6a8c549 gc: bug293
Fixes #846.

R=ken2
CC=golang-dev
https://golang.org/cl/1862042
2010-07-15 16:14:06 -07:00
Russ Cox
cdb446feb5 gc: bug292
Fixes #843.

R=ken2
CC=golang-dev
https://golang.org/cl/1729051
2010-07-15 16:13:47 -07:00
Russ Cox
b2a919fc29 gc: issue 894
Fixes #894.

R=ken2
CC=golang-dev
https://golang.org/cl/1701051
2010-07-15 15:25:32 -07:00
Russ Cox
31c07dfddf gc: issue 901
Fixes #901.

R=ken2
CC=golang-dev
https://golang.org/cl/1674049
2010-07-15 15:22:51 -07:00
Russ Cox
08a263a991 gc: bug291
Fixes #915.

R=ken2
CC=golang-dev
https://golang.org/cl/1856042
2010-07-15 15:17:42 -07:00
Russ Cox
691d765121 gc: bug274
R=ken2
CC=golang-dev
https://golang.org/cl/1742044
2010-07-15 15:05:56 -07:00
Russ Cox
17f90c68c6 gc: fix handling of types inside function bodies
Fixes #849.
Fixes #920.

R=ken2
CC=golang-dev
https://golang.org/cl/1841042
2010-07-15 14:25:50 -07:00
Russ Cox
0432f289f7 cgo: various bug fixes
* remember #defined names, so that C.stdout can refer
  to the real name (on OS X) __stdoutp.
* better handling of #defined constant expressions
* allow n, err = C.strtol("asdf", 0, 123) to get errno as os.Error
* write all output files to current directory
* don't require gcc output if there was no input

Fixes #533.
Fixes #709.
Fixes #756.

R=r
CC=dho, golang-dev, iant
https://golang.org/cl/1734047
2010-07-14 17:17:53 -07:00
Rob Pike
c9f83372d8 add missing argument to usage message.
Fixes #912.

R=rsc
CC=golang-dev
https://golang.org/cl/1819041
2010-07-12 16:31:51 -07:00
Robert Griesemer
d87f7e2392 gofmt: update test script
R=r
CC=golang-dev
https://golang.org/cl/1791041
2010-07-09 13:03:25 -07:00
Russ Cox
44eaaaaa78 ld: fix handling of "". names in #pragma dynimport/dynexport
Fixes #728.

R=r
CC=golang-dev
https://golang.org/cl/1706053
2010-07-01 21:48:13 -07:00
Russ Cox
81c3e8cabc gc: implement new len spec, range bug fix, optimization
Fixes #885.

R=ken2
CC=golang-dev
https://golang.org/cl/1680048
2010-07-01 18:04:25 -07:00
Rob Pike
38f1231f3e strings and bytes.Split: make count of 0 mean 0, not infinite.
Use a count of -1 for infinity.  Ditto for Replace.

R=rsc
CC=golang-dev
https://golang.org/cl/1704044
2010-07-01 14:08:14 -07:00
Russ Cox
285312a05c 6l: drop confusing comment
R=ken2
CC=golang-dev
https://golang.org/cl/1693047
2010-07-01 12:51:00 -07:00
Russ Cox
e5009e29ea 6a: assemble CMPPD as 6l expects
libmach: disassemble CMPPD as 6a expects

R=ken2
CC=Charlie Dorian, golang-dev
https://golang.org/cl/1704046
2010-07-01 12:36:29 -07:00
Russ Cox
bf10982739 6l: implement MOVLQZX as "mov", not "movsxd"
(Here, quoted strings are the official AMD names.)

The amd64 "movsxd" instruction, when invoked
with a 64-bit REX prefix, moves and sign extends
a 32-bit value from register or memory into a
64-bit register.  6.out.h spells this MOVLQSX.

6.out.h also includes MOVLQZX, the zero extending
version, which it implements as "movsxd" without
the REX prefix.  Without the REX prefix it's only sign
extending 32 bits to 32 bits (i.e., not doing anything
to the bits) and then storing in a 32-bit register.
Any write to a 32-bit register zeros the top half of the
corresponding 64-bit register, giving the advertised effect.
This particular implementation of the functionality is
non-standard, because an ordinary 32-bit "mov" would
do the same thing.

Because it is non-standard, it is often mishandled or
not handled by binary translation tools like valgrind.
Switching to the standard "mov" makes the binaries
work better with those tools.

It's probably useful in 6c and 6g to have an explicit
instruction, though, so that the intent of the size
change is clear.  Thus we leave the concept of MOVLQZX
and just implement it by the standard "mov" instead of
the non-standard 32-bit "movsxd".

Fixes #896.

R=ken2
CC=golang-dev
https://golang.org/cl/1733046
2010-07-01 12:18:35 -07:00
Gustavo Niemeyer
ae33032893 goinstall: support for Bazaar+Launchpad
With these changes, goinstall is now able to use branches
maintained with Bazaar located in Launchpad.

Project aliases such as /project and /project/series are
supported in addition to specific user or team branches
such as /~user/project/branch.  Temporary branches under
the +junk special project are also supported.

As a curious side effect, since Launchpad is able to import
code from other locations, they can be indirectly
accessible too if desired.

R=rsc
CC=golang-dev
https://golang.org/cl/1699050
2010-06-30 23:33:49 -07:00
Russ Cox
489494cac3 cgo: use slash-free relative paths for .so references
The Makefile and cgo now rewrite / to _ when creating the path.
The .so for gosqlite.googlecode.com/hg/sqlite is named
cgo_gosqlite.googlecode.com_hg_sqlite.so, and then 6l and 8l
both include a default rpath of $GOROOT/pkg/$GOOS_$GOARCH.
This should make it easier to move binaries from one system
to another.

Fixes #857.

R=iant, r
CC=golang-dev
https://golang.org/cl/1700048
2010-06-30 23:31:27 -07:00
Russ Cox
7c9ed7946c 8g: out of register bug fix
Fixes #868.

R=ken2
CC=golang-dev
https://golang.org/cl/1695049
2010-06-30 20:45:50 -07:00
Russ Cox
ed39c764b8 gc: do not crash on bad [...]T
Fixes #879.

R=ken2
CC=golang-dev
https://golang.org/cl/1678048
2010-06-30 20:34:31 -07:00
Andrew Gerrand
4f340f5051 godoc: canonicalize codewalk paths
R=rsc
CC=golang-dev
https://golang.org/cl/1729046
2010-06-30 17:56:51 +10:00
Russ Cox
829896168c ld: fix implementation of -u
R=r
CC=golang-dev
https://golang.org/cl/1678046
2010-06-29 18:59:48 -07:00
Ken Thompson
1246ad8390 code gen bug in len(nil) and cap(nil)
fixes #892

R=rsc
CC=golang-dev
https://golang.org/cl/1745042
2010-06-29 12:48:24 -07:00
Ken Thompson
2795282b50 compiler fatal error in switch.
fixes #867.

R=rsc
CC=golang-dev
https://golang.org/cl/1691045
2010-06-28 16:30:55 -07:00
Ken Thompson
e5d748a333 8g compiler missing call to splitclean().
fixes #887.

R=rsc
CC=golang-dev
https://golang.org/cl/1675050
2010-06-28 12:19:12 -07:00
Ken Thompson
33da9afc3e optimization of static initialization
R=rsc
CC=golang-dev
https://golang.org/cl/1677049
2010-06-27 17:37:01 -07:00
Russ Cox
6d8b8101ea gc: fix crash for nested complex division
R=ken2
CC=golang-dev
https://golang.org/cl/1720043
2010-06-23 10:55:50 -04:00
Russ Cox
6519a6ba5b ld: add -u flag to check safe bits; discard old -u, -x flags
R=r, r2
CC=golang-dev
https://golang.org/cl/1707043
2010-06-21 18:03:49 -07:00
Russ Cox
2fc0b4f01b gc: include struct field tags in type equality
R=ken2
CC=golang-dev
https://golang.org/cl/1667048
2010-06-21 13:06:39 -07:00
Roger Peppe
3ce29380d5 goinstall: process dependencies for package main
Currently to install a command, you have to manually
goinstall each of the remote packages that it depends on.
This patch lets goinstall P work where P is
contains files in package main.
It does not actually build the package, but
it installs all of its dependencies and prints a message
to that effect.

R=rsc
CC=golang-dev
https://golang.org/cl/1301043
2010-06-21 11:01:20 -07:00
Russ Cox
1b79cd2e71 undo changes accidentally included in 09c5add99d50
R=ken2
CC=golang-dev
https://golang.org/cl/1736042
2010-06-20 12:45:39 -07:00
Russ Cox
45bdf0367e reflect: add Kind, remove Int8Type, Int8Value, etc.
update other code to match.

R=r
CC=golang-dev
https://golang.org/cl/1680044
2010-06-20 12:16:25 -07:00
Russ Cox
9f002f6892 gc: delete debug print
R=ken2
CC=golang-dev
https://golang.org/cl/1732043
2010-06-20 12:15:10 -07:00
Russ Cox
a212d174ac gc: better error messages for interface failures, conversions
x.go:13: cannot use t (type T) as type Reader in assignment:
	T does not implement Reader (Read method requires pointer receiver)
x.go:19: cannot use q (type Q) as type Reader in assignment:
	Q does not implement Reader (missing Read method)
		have read()
		want Read()
x.go:22: cannot use z (type int) as type Reader in assignment:
	int does not implement Reader (missing Read method)

x.go:24: too many arguments to conversion to complex: complex(1, 3)

R=ken2
CC=golang-dev
https://golang.org/cl/1736041
2010-06-20 11:45:53 -07:00
Russ Cox
ceb868bf0a gc: fix build - subnode not addable in complexgen
R=ken2
CC=golang-dev
https://golang.org/cl/1677047
2010-06-20 11:21:43 -07:00
Nigel Tao
93ea2ae362 cmd/gotest: Delete temporary _testmain.go files.
R=rsc
TBR=rsc
CC=golang-dev
https://golang.org/cl/1675047
2010-06-16 13:37:07 +10:00
Russ Cox
d5a80d0ba4 gc: no more ...
various cleanup, deleting unused code

R=ken2
CC=golang-dev
https://golang.org/cl/1663041
2010-06-14 11:24:51 -07:00
Russ Cox
76da2780c3 gc: less aggressive name binding, for better line numbers in errors
Cleans up a few other corner cases too.

R=ken2
CC=golang-dev
https://golang.org/cl/1592045
2010-06-12 11:17:24 -07:00
Russ Cox
9d72aaabda gopack: add S flag to force marking a package as safe
R=r
CC=golang-dev
https://golang.org/cl/1597044
2010-06-12 10:47:42 -07:00
Russ Cox
089da369a3 8l: correct test for sp == top of stack in 8l -K code
R=ken2
CC=golang-dev
https://golang.org/cl/1627042
2010-06-11 16:17:47 -07:00
Russ Cox
ee0bca35a4 gopack: simplify go metadata code
There's only one Go object file per package now,
so there's no need to parse the metadata and merge
metadata from multiple files.  Just save the original
and use it as __.PKGDEF verbatim.

R=r
CC=golang-dev
https://golang.org/cl/1647042
2010-06-11 15:29:19 -07:00
Russ Cox
d20ad1c75a gc: change -u to require imports to be marked safe
R=ken2
CC=golang-dev
https://golang.org/cl/1597043
2010-06-11 15:28:43 -07:00
Ian Lance Taylor
fe43325b30 Pad Go symbol table out to page boundary when linking dynamically.
This avoids a crash when using cgo where glibc's malloc thinks
that it can use some of the memory following the symbol table.
This fails because the symbol table is mapped read-only, which
affects the whole page.

R=rsc
CC=golang-dev
https://golang.org/cl/1616042
2010-06-11 13:41:49 -07:00
Robert Griesemer
ace5269dfe go/scanner: report illegal escape sequences
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1636043
2010-06-09 15:19:22 -07:00
Russ Cox
a2a7d473f4 gc: more cleanup
* disallow surrogate pair runes.
 * diagnose impossible type assertions
 * eliminate another static buffer.
 * do not overflow lexbuf.
 * add -u flag to disable package unsafe.

R=ken2
CC=golang-dev
https://golang.org/cl/1619042
2010-06-09 11:00:55 -07:00
Russ Cox
565b5dc076 gc: new typechecking rules
* Code for assignment, conversions now mirrors spec.
* Changed some snprint -> smprint.
* Renamed runtime functions to separate
  interface conversions from type assertions:
  convT2I, assertI2T, etc.
* Correct checking of \U sequences.

Fixes #840.
Fixes #830.
Fixes #778.

R=ken2
CC=golang-dev
https://golang.org/cl/1303042
2010-06-08 18:50:02 -07:00
Robert Griesemer
4337c7c0bc gofmt: update test script so it can run to completion again
R=rsc
CC=golang-dev
https://golang.org/cl/1621041
2010-06-08 17:25:04 -07:00
Robert Griesemer
98b27814ae gc: better error message when ~ operator is found
Fixes #844.

R=ken2, rsc, ken3
CC=golang-dev
https://golang.org/cl/1593041
2010-06-07 18:27:26 -07:00
Robert Griesemer
0c222d6e49 gc: backslash newline is not a legal escape sequence in strings
Fixes #827.

R=ken2
CC=golang-dev, rsc
https://golang.org/cl/1592041
2010-06-07 18:10:48 -07:00
Daniel Theophanes
129c6c14d1 runtime: finish pchw -> tiny, added gettime for tiny
R=rsc
CC=golang-dev
https://golang.org/cl/1514041
2010-06-07 14:18:42 -07:00
Russ Cox
cd016d7558 gc: fix export of complex types
R=ken2
CC=golang-dev
https://golang.org/cl/1442042
2010-06-01 14:48:57 -07:00
Michael Hoisie
0c77ba96da goinstall: Use 'git pull' instead of 'git checkout' when updating a git repo.
R=rsc
CC=golang-dev
https://golang.org/cl/1395041
2010-06-01 14:27:45 -07:00
Ian Lance Taylor
1192c175fe Correct _cgo_free when C ABI does not pass first arg on stack.
It turns out that _cgo_malloc is used, via cmalloc in
runtime/cgocall.c, which is called by code generated by out.go
for the ·_C_CString function.  I can't find a call to
_cgo_free, but given _cgo_malloc we might as well keep
_cgo_free.  This patch fixes it so that it should work on
amd64.

R=rsc
CC=golang-dev
https://golang.org/cl/1399041
2010-05-30 22:22:47 -07:00
Russ Cox
bb84f4b5d2 changes &x -> x[0:] for array to slice conversion
R=gri
CC=golang-dev
https://golang.org/cl/1326042
2010-05-27 14:51:47 -07:00
Russ Cox
6a060200cc 8g: out of register bug
Fixes #806.

R=ken2
CC=golang-dev
https://golang.org/cl/1281042
2010-05-24 17:22:51 -07:00
Russ Cox
ea941f09bf gc: more accurate error description
R=ken2
CC=golang-dev
https://golang.org/cl/1284041
2010-05-24 17:07:51 -07:00
Russ Cox
8c2bc4419b gc: fix shift/reduce conflict in go.y export syntax
Fixes #771.

R=ken2
CC=golang-dev
https://golang.org/cl/1267042
2010-05-24 16:55:23 -07:00
Russ Cox
9fc9246bf3 gc: bug281 - bad overlap in stack copy
Fixes #807.

R=ken2
CC=golang-dev
https://golang.org/cl/1283041
2010-05-24 16:54:24 -07:00
Russ Cox
d14baee96e 6g: avoid unnecessary conversion in shift bounds check
R=ken2
CC=golang-dev
https://golang.org/cl/1278042
2010-05-24 15:30:53 -07:00
Russ Cox
2e9b67afa6 gc: bug277 - new conversion syntax
R=ken2
CC=golang-dev
https://golang.org/cl/1220046
2010-05-24 15:25:30 -07:00
Russ Cox
43c0a46ac6 gc: bug280
Fixes #808.

R=ken2
CC=golang-dev
https://golang.org/cl/1273042
2010-05-24 15:25:09 -07:00
Russ Cox
5e253645d2 gc: bug278
Fixes #804.

R=ken2
CC=golang-dev
https://golang.org/cl/1224045
2010-05-24 14:22:54 -07:00
Russ Cox
80ac15ec12 gc: fix unsafe.Sizeof on ideal constants
R=ken2
CC=golang-dev
https://golang.org/cl/1280041
2010-05-24 14:18:15 -07:00
Russ Cox
88b308a265 roll back 1193046 - fix build
R=dho
CC=golang-dev
https://golang.org/cl/1257043
2010-05-21 18:29:18 -07:00
Devon H. O'Dell
b94f341bac cgo: better error for no C symbols
R=rsc, iant
CC=golang-dev, graeme.perrow
https://golang.org/cl/1193046
2010-05-21 17:31:18 -07:00
Russ Cox
709c5b2481 gc: handle use of builtin function outside function call
tweaks & tests of last bug fix too.

R=ken2
CC=golang-dev
https://golang.org/cl/1207044
2010-05-20 22:57:08 -07:00
Russ Cox
b03d7f4d8f gc: line number bug fix
R=ken2
CC=golang-dev
https://golang.org/cl/1243044
2010-05-20 22:19:50 -07:00
Ken Thompson
09b2de77b5 fix bug 275
R=rsc
CC=golang-dev
https://golang.org/cl/1198046
2010-05-20 20:56:28 -07:00
Russ Cox
9e497c3656 gc: disallow · in Go programs
Fixes #793.

R=ken2
CC=golang-dev
https://golang.org/cl/1249043
2010-05-20 17:34:22 -07:00
Ken Thompson
b0283611e4 fix issue 798
cannot allocate an audomatic temp
while real registers are allocated.
there is a chance that the automatic
will be allocated to one of the
allocated registers. the fix is to
not registerize such variables.

R=rsc
CC=golang-dev
https://golang.org/cl/1202042
2010-05-20 17:31:28 -07:00
Evan Shaw
d2aa74118c gc: Better error when computing remainder of non-int
Previously the compiler would just emit "internal compiler error" when
trying to compute the remainder of floats or complex types.

R=rsc
CC=golang-dev
https://golang.org/cl/1243041
2010-05-18 22:41:12 -07:00
Roger Peppe
bcdcf395e5 Add Error member to yyLexer type (yyError
has no access to yylex)

R=ken2, ken3
CC=golang-dev
https://golang.org/cl/813047
2010-05-17 12:23:48 -07:00
Robert Griesemer
31f79690f7 gofmt: exclude test w/ illegal syntax from test cases
R=adg
CC=golang-dev
https://golang.org/cl/1228041
2010-05-14 15:45:53 -07:00
Russ Cox
6dbba67214 gc: distinguish array, slice literal in error messages
R=ken2
CC=golang-dev
https://golang.org/cl/1138041
2010-05-06 09:34:12 -07:00
Ken Thompson
a3a0a5fdc3 allow data statements for simple
external variable assignements.

R=rsc
CC=golang-dev
https://golang.org/cl/1094041
2010-05-03 22:51:30 -07:00
Russ Cox
32df678894 gc: bug264
Fixes #692.

R=ken2
CC=golang-dev
https://golang.org/cl/1092041
2010-05-03 17:51:48 -07:00
Russ Cox
b5f54db359 gc: bug267
R=ken2
CC=golang-dev
https://golang.org/cl/1067042
2010-05-03 15:29:59 -07:00
Russ Cox
371b77ad20 gc: error for nested functions, one semicolon problem
R=ken2
CC=golang-dev
https://golang.org/cl/1046042
2010-05-03 15:02:32 -07:00
Russ Cox
1964417e41 fix nacl build
TBR=r
CC=golang-dev
https://golang.org/cl/1063042
2010-05-03 00:04:48 -07:00
Russ Cox
6361f52fc4 gc: be pickier about slice, chan, array, and map sizes
Fixes #589.

R=ken2
CC=golang-dev
https://golang.org/cl/1032044
2010-05-01 13:15:42 -07:00
Russ Cox
c66b49845c 8g: bug272
Fixes #589.

R=ken2
CC=golang-dev
https://golang.org/cl/1043042
2010-04-30 14:04:34 -07:00
Russ Cox
253fd30e66 gc: bug271
Fixes #662.

R=ken2
CC=golang-dev
https://golang.org/cl/978043
2010-04-30 13:27:08 -07:00
Russ Cox
560283c880 gc: bug270
Fixes #746.

R=ken2
CC=golang-dev
https://golang.org/cl/1040042
2010-04-30 13:04:16 -07:00
Russ Cox
74a23646bc 8l: fix absolute path detection on Windows
Fixes #755.

R=ken2
CC=golang-dev
https://golang.org/cl/965047
2010-04-30 12:48:03 -07:00
Alex Brainman
f81d471940 rename GOOS=mingw to GOOS=windows
R=rsc, Joe Poirier
CC=golang-dev
https://golang.org/cl/1015043
2010-04-29 23:45:14 -07:00
Russ Cox
77817e08d5 gc: never include ( ) on singleton func return type
Fixes #749.

R=ken2
CC=golang-dev
https://golang.org/cl/963043
2010-04-29 16:07:14 -07:00
Russ Cox
10eb76b04e gc: bug268
Fixes #745.

R=ken2
CC=golang-dev
https://golang.org/cl/1008045
2010-04-29 15:52:27 -07:00
Russ Cox
000ab98df6 5l, 6l, 8l, runtime: make -s binaries work
5l, 6l, 8l: change ELF header so that strip doesn't destroy binary

Fixes #261.

R=iant, r
CC=golang-dev
https://golang.org/cl/994044
2010-04-27 22:40:26 -07:00
Russ Cox
69a2e1dc52 gc: better windows detection
R=ken2
CC=golang-dev
https://golang.org/cl/944043
2010-04-27 17:19:15 -07:00
Russ Cox
3bcef5ac30 gc: fix islocalname on windows
Fixes #732.

R=ken2
CC=golang-dev
https://golang.org/cl/956050
2010-04-27 13:52:43 -07:00
Christopher Wedgwood
23c064452c godoc: use int64 for timestamps
This fixes a crash seen when viewing a directory list.

Fixes #747.

R=gri
CC=golang-dev, rsc
https://golang.org/cl/1010042
2010-04-27 10:45:33 -07:00
Russ Cox
d6e4e18c8c gc: more specific error for statements at top level
R=ken2, r, ken3
CC=golang-dev
https://golang.org/cl/1006041
2010-04-26 22:35:27 -07:00
Russ Cox
2a591bdf8a godoc: add codewalk support
R=adg, gri
CC=golang-dev, r
https://golang.org/cl/1008042
2010-04-26 22:35:12 -07:00
Russ Cox
c6138efbcb runtime: closures, defer bug fix for Native Client
Enable package tests for Native Client build.

R=r
CC=golang-dev
https://golang.org/cl/957042
2010-04-22 17:52:22 -07:00
Russ Cox
1c0c252880 6l, 8l: include ELF header in PT_LOAD mapping for text segment
Due to page boundary rounding, the header would have
been loaded as part of the text segment already, but this
change placates the "paxctl" tool on so-called hardened
Linux distributions (as if normal distributions weren't already
hard enough to use).

R=r
CC=golang-dev
https://golang.org/cl/954041
2010-04-20 20:39:55 -07:00
Russ Cox
4ba177ae36 gc: print x[y:] correctly
R=ken2
CC=golang-dev
https://golang.org/cl/955041
2010-04-20 17:39:31 -07:00
Russ Cox
d97bbabbaa gc: cmplx typecheck bug fix
Fixes #729.

R=ken2
CC=golang-dev
https://golang.org/cl/875048
2010-04-19 09:21:51 -07:00
Andrei Vieru
fffac8072e "godoc -src pkg_name" excludes duplicates entries
$ godoc xml | grep Copy\(\)
func (c CharData) Copy() CharData
func (c Comment) Copy() Comment
func (d Directive) Copy() Directive
func (p ProcInst) Copy() ProcInst
func (e StartElement) Copy() StartElement
--------------------------------------------
$ godoc -src xml | grep Copy\(\)
func (c CharData) Copy() CharData
--------------------------------------------
$ godoc -src xml Copy
func (c CharData) Copy() CharData { return CharData(makeCopy(c)) }
--------------------------------------------
The command "godoc -src pkg_name" should output the interface of the named package, but it excludes all duplicate entries. Also the command "godoc -src pkg_name method_name" will output the source code only for one method even if there are more of them with the same name in the same package. This patch set fixes this issue.

R=gri
CC=golang-dev
https://golang.org/cl/883051
2010-04-15 09:50:37 -07:00
Kai Backman
df3a544085 synchronize ARM runner environment variable with run-arm
R=rsc
CC=golang-dev
https://golang.org/cl/912041
2010-04-15 12:47:49 +03:00
Evan Shaw
30f981d980 8l: add DOS stub to PE binaries
R=rsc
CC=golang-dev
https://golang.org/cl/915041
2010-04-13 16:13:53 -07:00
Russ Cox
d9254d00f9 gc: zero unnamed return values on entry if func has defer
R=ken2
CC=golang-dev
https://golang.org/cl/891050
2010-04-12 14:28:27 -07:00
Russ Cox
c9293f0cc7 gc: compile s == "" as len(s) == 0
R=ken2
CC=golang-dev
https://golang.org/cl/840043
2010-04-11 15:24:44 -07:00
Russ Cox
9475cafa73 gc: distinguish fatal compiler bug from error+exit
R=ken2
CC=golang-dev
https://golang.org/cl/902044
2010-04-11 14:52:06 -07:00
Russ Cox
fe7826858c gc: make sure main.main has correct type
R=ken2
CC=golang-dev
https://golang.org/cl/883049
2010-04-11 14:51:35 -07:00
Christopher Wedgwood
094732f7eb godoc: change od.Dir -> os.FileInfo in comments
R=gri, r
CC=golang-dev, rsc
https://golang.org/cl/819042
2010-04-11 10:17:45 -07:00
Russ Cox
6363542695 runtime: delete malx, skip_depth argument to malloc
remove internal functions from traces in gopprof instead.

R=r
CC=golang-dev
https://golang.org/cl/855046
2010-04-09 15:30:40 -07:00
Ian Lance Taylor
12e7ce95c6 Add //export to cgo.
The new //export comment marks a Go function as callable from
C.  The syntax is "//export NAME" where NAME is the name of
the function as seen from C.  If such a comment is seen, cgo
will generate two new files: _cgo_export.h and _cgo_export.c.
The _cgo_export.h file provides declarations which C code may
use to call Go functions.  The _cgo_export.c file contains
wrappers, and is to be compiled with gcc.

The changes to Make.pkg support using this from a Go Makefile,
though it could probably be more convenient.

R=rsc
CC=golang-dev
https://golang.org/cl/853042
2010-04-09 13:31:05 -07:00
Rob Pike
3ddeef8153 rename os.Dir to os.FileInfo
R=rsc
CC=golang-dev
https://golang.org/cl/902042
2010-04-09 11:36:40 -07:00
Rob Pike
00eb56c15b gotest: update URL printed by failure message.
Fixes #677.

R=rsc
CC=golang-dev
https://golang.org/cl/834046
2010-04-07 20:30:55 -07:00
Roger Peppe
6c3befc824 Change goyacc to be reentrant.
Instead of calling the package scope Lex function,
Parse now takes an argument which is used to
do the lexing.
I reverted to having the generated switch
code inside Parse rather than a separate function because
the function needs 7 arguments or a context structure,
which seems unnecessary.
I used yyrun(), not the original $A so that
it's possible to run the backquoted code through gofmt.

R=rsc, ken2, ken3
CC=golang-dev
https://golang.org/cl/879041
2010-04-06 13:29:27 -07:00
Kai Backman
29c6c09f71 replace original float instruction with jump to make branches
to float instructions work correctly.

R=rsc
CC=golang-dev
https://golang.org/cl/870044
2010-04-06 22:17:24 +03:00
Russ Cox
6c196015e0 runtime: various arm fixes
* correct symbol table size
  * do not reorder functions in output
  * traceback
  * signal handling
  * use same code for go + defer
  * handle leaf functions in symbol table

R=kaib, dpx
CC=golang-dev
https://golang.org/cl/884041
2010-04-05 12:51:09 -07:00
Russ Cox
2379fdec04 gc: good syntax error for defer func() {} - missing final ()
R=ken2
CC=golang-dev
https://golang.org/cl/855044
2010-04-04 23:27:26 -07:00
Russ Cox
f75d0d224f runtime: turn run time errors checks into panics
R=ken2, r
CC=golang-dev
https://golang.org/cl/871042
2010-04-01 22:31:27 -07:00
Russ Cox
5d230418c7 gc: fix alignment on non-amd64
R=ken2
CC=golang-dev
https://golang.org/cl/870041
2010-03-31 16:04:03 -07:00
Russ Cox
9b1507b050 gc: implement panic and recover
R=ken2, r, ken3
CC=golang-dev
https://golang.org/cl/831042
2010-03-31 11:46:01 -07:00
Robert Griesemer
e8e4987ba3 godoc: support for title and subtitle headers when serving .html docs
and use it to show version (date) of go spec

Fixes #68.

R=rsc
CC=golang-dev, r
https://golang.org/cl/848042
2010-03-30 17:37:42 -07:00
Robert Griesemer
6a71a4639e godoc: don't print package clause in -src command-line mode with filtering
R=rsc
CC=golang-dev
https://golang.org/cl/844041
2010-03-30 11:19:58 -07:00
Russ Cox
01eaf780a8 gc: add panic and recover (still unimplemented in runtime)
main semantic change is to enforce single argument to panic.

runtime: change to 1-argument panic.
use String method on argument if it has one.

R=ken2, r
CC=golang-dev
https://golang.org/cl/812043
2010-03-30 10:53:16 -07:00
Russ Cox
c7122a3c58 simplify various code using new map index rule
R=r
CC=golang-dev
https://golang.org/cl/833044
2010-03-30 10:51:11 -07:00
Russ Cox
5b257732ac godefs: fix handling of negative constants
R=r
CC=golang-dev
https://golang.org/cl/849041
2010-03-30 10:42:13 -07:00
Russ Cox
00f9f0c056 single argument panic
note that sortmain.go has been run through hg gofmt;
only the formatting of the day initializers changed.
i'm happy to revert that formatting if you'd prefer.

stop on error in doc/progs/run

R=r
CC=golang-dev
https://golang.org/cl/850041
2010-03-30 10:34:57 -07:00
Russ Cox
5d0ec6c076 gc: flush warnings, if any
R=ken2
CC=golang-dev
https://golang.org/cl/811042
2010-03-29 23:34:59 -07:00
Robert Griesemer
671919d19a godoc: support for filtering of command-line output in -src mode
+ various minor cleanups

Usage: godoc -src math Sin

R=rsc
CC=golang-dev
https://golang.org/cl/791041
2010-03-29 18:06:53 -07:00
Russ Cox
3908c16ffe gc: bug265
Fixes #700.

R=ken2
CC=golang-dev
https://golang.org/cl/839041
2010-03-29 15:27:59 -07:00
Russ Cox
bd1690ce5e fix build
R=gri
CC=golang-dev
https://golang.org/cl/837041
2010-03-29 13:30:32 -07:00
Russ Cox
a709876767 runtime: more malloc statistics
expvar: default publishings for cmdline, memstats
godoc: import expvar

R=r
CC=golang-dev
https://golang.org/cl/815041
2010-03-29 13:06:26 -07:00
Dean Prichard
55b145e32a arm: fix build
R=rsc
CC=golang-dev
https://golang.org/cl/800041
2010-03-26 23:27:24 -07:00
Russ Cox
97d0e8fe6c gc: allow taking address of out parameters
Fixes #186.

R=ken2
CC=golang-dev
https://golang.org/cl/793041
2010-03-26 18:01:02 -07:00
Russ Cox
f375791a91 fix build
TBR=r
CC=golang-dev
https://golang.org/cl/785041
2010-03-26 15:01:29 -07:00
Russ Cox
bc83042b07 godoc: export pprof debug information
R=gri
CC=golang-dev
https://golang.org/cl/784041
2010-03-26 14:48:04 -07:00
Russ Cox
c72fb37425 prof: install gopprof too
This is a modified version of the open source pprof
from code.google.com/p/google-perftools.
That version is likely to catch up to this one,
but it's still useful to ship our own copy since
we only need the one script from that project,
not all the C++ libraries.

R=r
CC=golang-dev
https://golang.org/cl/783041
2010-03-26 14:20:50 -07:00
Rob Pike
9e481e2905 fix spelling of align
R=rsc
CC=golang-dev
https://golang.org/cl/778041
2010-03-26 09:56:57 -07:00
Russ Cox
7fbf9fcba9 make alignment rules match 8g, just like 6c matches 6g.
R=ken2
CC=golang-dev
https://golang.org/cl/760042
2010-03-25 14:05:54 -07:00
Russ Cox
78c27ed650 gc: more syntax errors
R=r
CC=golang-dev
https://golang.org/cl/731041
2010-03-25 12:47:43 -07:00
Ian Lance Taylor
732f3919ab Support #pragma dynexport on OS X.
R=rsc
CC=golang-dev
https://golang.org/cl/733041
2010-03-25 11:45:18 -07:00
Ken Thompson
623dfd1b07 depricate panicln
R=rsc
CC=golang-dev
https://golang.org/cl/743041
2010-03-24 16:53:54 -07:00
Rob Pike
325cf8ef21 delete all uses of panicln by rewriting them using panic or,
in the tests, println+panic.
gofmt some tests too.

R=rsc
CC=golang-dev
https://golang.org/cl/741041
2010-03-24 16:46:53 -07:00
Robert Griesemer
acfd6d5f05 godoc: show relative file names without leading '/' (per r's request)
- change the various url-xxx formatters to return a relative URL path
- make the leading '/' for URLs explicit in the template
- on the way change some |html formatters to |html-esc
  (html should only be used for formatting AST nodes)

R=rsc, r
CC=golang-dev
https://golang.org/cl/740041
2010-03-24 16:28:59 -07:00
Robert Griesemer
60482f06d0 godoc: use http GET for remote search instead of rpc
(this will allow the use of golang.org for remote
searches)

R=rsc
CC=golang-dev
https://golang.org/cl/734041
2010-03-24 14:51:55 -07:00
Russ Cox
1c7cc5bd7a cc: fix typo
R=iant
CC=golang-dev
https://golang.org/cl/720041
2010-03-24 08:59:09 -07:00
Dean Prichard
72bc37c122 arm: fix build
R=kaib, rsc
CC=golang-dev
https://golang.org/cl/627045
2010-03-23 18:13:20 -07:00
Andrey Mirtchovski
456642adb5 cmd/goinstall: include command name in error reporting (usually missing software or incorrect $PATH)
R=rsc
CC=golang-dev
https://golang.org/cl/695041
2010-03-23 18:13:16 -07:00
Russ Cox
eaf45f2d56 gc: fix build in France
Fixes #626.

R=ken2
CC=golang-dev
https://golang.org/cl/714041
2010-03-23 18:11:21 -07:00
Ian Lance Taylor
9e0ae94e72 Add support for #pragma dynexport.
R=rsc
CC=golang-dev
https://golang.org/cl/661043
2010-03-23 06:46:30 -07:00
Ian Lance Taylor
f54d73b880 Rename dynld to dynimport throughout.
Cgo users will need to rerun cgo.

R=rsc
CC=golang-dev
https://golang.org/cl/692041
2010-03-22 19:58:55 -07:00
Russ Cox
4408659e81 gc: various map-related bug fixes
Fixes #687.

R=ken2
CC=golang-dev
https://golang.org/cl/680042
2010-03-22 18:51:14 -07:00
Russ Cox
2e5fe5a14c goinstall: let git/hg/svn create the final directory element
R=r
CC=golang-dev
https://golang.org/cl/634044
2010-03-20 22:38:06 -07:00
Ken Thompson
8021296179 issue 682
complex DATA statement fo
initialization of complex variables.

R=rsc
CC=golang-dev
https://golang.org/cl/634045
2010-03-20 18:50:01 -07:00
Robert Griesemer
6c8fdbe8c7 godoc: line numbers for all remote search results
Instead of returning the index lookup result via
RPC which has to be corrected for the client,
simply render it on the server and return the
final output.

R=rsc, r
CC=golang-dev
https://golang.org/cl/669041
2010-03-19 22:48:08 -07:00
Russ Cox
e8fb0b014c godoc: revert change 5089, per gri's instructions
R=gri
CC=golang-dev
https://golang.org/cl/630043
2010-03-19 17:46:18 -07:00
Robert Griesemer
b037bfa684 godoc: proper file path conversion for remote search
R=rsc
CC=golang-dev
https://golang.org/cl/664041
2010-03-19 17:07:16 -07:00
Robert Griesemer
fa462f37e3 godoc: show (some) line numbers for remote search
- show build version
- use build goroot when possible

R=rsc
CC=golang-dev
https://golang.org/cl/656043
2010-03-19 15:20:20 -07:00
Ken Thompson
60c2e5f453 issue 608
error compiling if(long long) in 6c compiler

R=rsc
CC=golang-dev
https://golang.org/cl/657042
2010-03-19 14:20:15 -07:00
Robert Griesemer
90f7209548 godoc: improved comment formatting: recognize URLs
and highlight special words, if provided. Also:

- related cleanups in src/pkg/go/doc/comment.go
- fix typos in src/cmd/goinstall/doc.go

Fixes #672.

R=rsc
CC=adg, golang-dev
https://golang.org/cl/601042
2010-03-19 13:01:45 -07:00
Robert Griesemer
17e0351404 godoc: implemented command-line search
The command-line search is using a running webserver
as index server; i.e., the search result is reflecting
the index at the server. See the documentation for
details.

Usage: godoc -q query1 query2 ...

Known issue: Results don't show the all-important
line numbers yet due to the way the index is organized.
Next CL.

R=rsc, r
CC=golang-dev
https://golang.org/cl/648041
2010-03-19 12:46:43 -07:00
Andrew Gerrand
67148530d2 goinstall doc: fix link to godashboard/package
R=rsc
CC=golang-dev
https://golang.org/cl/607041
2010-03-17 11:40:05 +11:00
Robert Griesemer
53f3d0733c gofmt: more consistent formatting of const/var decls
- gofmt -w src misc
- only manually modified file: src/pkg/go/printer/nodes.go

R=rsc
CC=golang-dev, r
https://golang.org/cl/606041
2010-03-16 16:45:54 -07:00
Robert Griesemer
74fac99d05 godoc: initial support for showing popup information
for identifiers in Go source code

- at the moment just show identifier kind (var, func, etc.) and name
  (eventually should show declaration, type, etc.)
- JavaScript parts by adg

R=rsc
CC=adg, golang-dev
https://golang.org/cl/578042
2010-03-16 14:17:42 -07:00
Robert Griesemer
b32f22b3f8 gofmt: fix for gofmt rewrite feature
Fixes #643.

R=rsc
CC=golang-dev
https://golang.org/cl/576041
2010-03-15 15:42:09 -07:00
Robert Griesemer
226c2ec256 godoc: support for multiple packages in a directory
- smartly select the "right" package
- provide a list of other packages

R=rsc
CC=golang-dev
https://golang.org/cl/466042
2010-03-12 18:16:21 -08:00
Robert Griesemer
3e24f2d6df godoc: fix formatting of -src output
- go/filter.go: make MergePackageFiles smarter
- go/printer.go: handle positions from multiple files

R=rsc
CC=golang-dev
https://golang.org/cl/460042
2010-03-11 16:44:56 -08:00
Robert Griesemer
799609e0b4 godoc: change -x to -src, update doc.go (missed in previous CL)
R=rsc
CC=golang-dev
https://golang.org/cl/384044
2010-03-10 15:41:36 -08:00
Robert Griesemer
35aec6c7f7 godoc: provide mode which shows exported interface in "source form"
- on the commandline: godoc -x big
- in a webpage: provide form parameter ?m=src

Known issues:
- Positioning of comments incorrect in several cases. Separate CL.
- Need a link/menu to switch between different modes of presentation
  in the web view.

R=rsc
CC=golang-dev
https://golang.org/cl/376041
2010-03-10 15:22:22 -08:00
Russ Cox
16e6df9807 fix 386 a[i] = cmplx(r, j)
R=ken2
CC=golang-dev
https://golang.org/cl/384043
2010-03-10 13:06:35 -08:00
Ken Thompson
2edb02b41e 1. decommit complex(float) conversion
2. add complex algorithm for map/chan
3. test for use of complex in
   array, slice, field, chan, map,
   field, pointer.

R=rsc
CC=golang-dev
https://golang.org/cl/384041
2010-03-09 17:51:30 -08:00
Russ Cox
529369e452 gc: remove duplicate errors, give better error for I.(T)
R=ken2
CC=golang-dev
https://golang.org/cl/370041
2010-03-09 15:09:37 -08:00
Ken Thompson
38ad41c317 fix bugs compiling things like
c = cmplx(imag(c), real(c))
without a temporary

R=rsc
CC=golang-dev
https://golang.org/cl/360043
2010-03-09 13:39:45 -08:00
Ken Thompson
f229c8b546 identical complex implementation
for 6g and 8g. can also be used
for 5g. 5g is still a stub.

R=rsc
CC=golang-dev
https://golang.org/cl/362041
2010-03-09 12:49:24 -08:00
Dean Prichard
5b1a196c37 arm: cleanup build warnings
trivial stuff
lex.c: these prototypes are in a.h
asm.c: unused variables
arm-pass.txt deal w/ sieve.go rename and addition of sieve2.go

R=kaib, rsc
CC=golang-dev
https://golang.org/cl/244041
2010-03-08 18:13:19 -08:00
Dean Prichard
f015c53ada gc: avoid fixed length buffer cleanbuf
R=rsc
CC=golang-dev
https://golang.org/cl/302042
2010-03-08 17:00:14 -08:00
Russ Cox
4ac011a011 gc: simplify complex typecheck
do not convert to float prematurely.

R=ken2
CC=golang-dev
https://golang.org/cl/311041
2010-03-08 15:44:18 -08:00
Russ Cox
4f89dcdf99 5g/6g/8g: fix double function call in slice
Fixes #654.

R=ken2
CC=golang-dev
https://golang.org/cl/310041
2010-03-08 14:19:28 -08:00
Ken Thompson
426099f42e 6g complex type usable
8g and 5g have stubs to ignore complex

R=rsc
CC=golang-dev
https://golang.org/cl/257042
2010-03-05 20:16:04 -08:00
Russ Cox
a9b9afa930 gc: fix crash on complicated arg to make slice.
Fixes #615.

R=ken2
CC=golang-dev
https://golang.org/cl/255043
2010-03-05 19:29:14 -08:00
Russ Cox
ac499ed7a5 gc: better compilation of floating point +=
R=ken2
CC=golang-dev
https://golang.org/cl/255042
2010-03-05 15:35:09 -08:00
Russ Cox
3e4e4ec704 goinstall: an experiment in (external) package installation
R=adg, r
CC=cw, golang-dev
https://golang.org/cl/224043
2010-03-04 17:04:50 -08:00
Russ Cox
36c5c5bf40 cc: disallow ... argument unless NOSPLIT is set.
check that NOSPLIT functions don't use too much stack.
correct some missing NOSPLITs in the runtime library.

Fixes bug reported in
https://groups.google.com/group/golang-nuts/t/efff68b73941eccf

R=ken2
CC=golang-dev
https://golang.org/cl/236041
2010-03-04 15:34:25 -08:00
Russ Cox
f1550482fa gc: fix imported and not used message - show path
R=ken2
CC=golang-dev
https://golang.org/cl/229046
2010-03-03 17:23:47 -08:00
Ken Thompson
7d4b1e4c0d more on type complex.
getting close.

R=rsc
CC=golang-dev
https://golang.org/cl/224105
2010-03-02 18:32:11 -08:00
Robert Griesemer
305f5433f3 gofmt: fix alignment of multi-line var declarations
- gofmt -w src misc

R=rsc, r
CC=golang-dev
https://golang.org/cl/223101
2010-03-02 17:23:07 -08:00
Robert Griesemer
f44fa9b4c7 gofmt: experiment: align values in map composites where possible
- gofmt -w src misc
- looking for feedback

R=rsc, r
CC=golang-dev
https://golang.org/cl/223076
2010-03-02 13:46:51 -08:00
Andrew Gerrand
6d0f1fedbf gotest: set $AS to $GOBIN/$AS
May address issue 624.

R=rsc
CC=golang-dev
https://golang.org/cl/223083
2010-02-28 21:49:06 -08:00
Russ Cox
bc6878331a 8g: fix out of register bug in byte(x) code
R=ken2
CC=golang-dev
https://golang.org/cl/223070
2010-02-26 14:21:52 -08:00
Ian Lance Taylor
e6443f6255 Add -r option to 6l/8l/5l.
This permits more flexibility with cgo and swig in cases where
the program is run on a machine other than the one on which it
is built.  Rather than storing the absolute path to the shared
library in the DT_NEEDED entry, we can store just the name,
and let the dynamic linker find it using DT_RUNPATH or the
LD_LIBRARY_PATH environment variable.

R=rsc
CC=golang-dev
https://golang.org/cl/223068
2010-02-26 14:03:52 -08:00
Russ Cox
ba50599e46 8g: make a[byte(x)] truncate x
R=ken2
CC=golang-dev
https://golang.org/cl/223069
2010-02-26 13:15:29 -08:00
Robert Griesemer
d177539877 go/printer, gofmt: align comments in multi-line expression lists
- gofmt -w src misc
- improves several lists and fixes minor degradation introduced
  with the fix for issue 628
- removed some dead code (stringList)

R=rsc
CC=golang-dev
https://golang.org/cl/223058
2010-02-25 16:07:55 -08:00
Russ Cox
9750adbbad strings: delete Runes, Bytes
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench
gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench
delete unused imports

R=r
CC=golang-dev
https://golang.org/cl/224062
2010-02-25 16:01:29 -08:00
Russ Cox
3910161307 gc: implement []int(string) and []byte(string)
R=ken2
CC=golang-dev
https://golang.org/cl/224060
2010-02-25 15:11:07 -08:00
Robert Griesemer
ef0be41e20 go/ast: streamline representation of field lists
- always include position information about opening/closing parens/braces
- replace uses of []*ast.Field with *ast.FieldList

Fixes #473.

R=rsc
CC=golang-dev
https://golang.org/cl/223043
2010-02-24 16:17:11 -08:00
Rob Pike
38202de114 goyacc: fix handling of / and comments in goyacc
Fixes #618.

R=rsc
CC=golang-dev
https://golang.org/cl/217094
2010-02-23 16:00:14 +11:00
Ken Thompson
458b53ea7d all done except -
complex divide
float(complex) conversion
8g 5g etc
tests

R=rsc
CC=golang-dev
https://golang.org/cl/218044
2010-02-21 17:51:39 -08:00
Russ Cox
ed13d39972 gc: minor const simplifications
R=ken2
CC=golang-dev
https://golang.org/cl/217069
2010-02-21 11:18:09 -08:00
Ken Thompson
f59cb49a5a fixed bug in mpconst float multiply by 0.
more complex -- constants, variables and print.

R=rsc
CC=golang-dev
https://golang.org/cl/217061
2010-02-19 20:42:50 -08:00
Robert Griesemer
aaec61555a godoc: fix path resolution for command-line one more time (sigh...)
R=rsc
CC=golang-dev
https://golang.org/cl/217058
2010-02-19 16:23:19 -08:00
Robert Griesemer
8e714aab2b - removed exp/parser (support for old semicolon syntax)
- go/ast: removed StringList (not needed anymore)
- go/ast: changed import path and field list tag to a single string
- updated all dependencies

R=rsc
CC=golang-dev
https://golang.org/cl/217056
2010-02-19 16:01:31 -08:00
Robert Griesemer
cf743c1be6 godoc: make commandline use work again
R=rsc
CC=golang-dev
https://golang.org/cl/216054
2010-02-19 11:41:48 -08:00
Russ Cox
80a14df122 gc: double-initialization
R=ken2
CC=golang-dev
https://golang.org/cl/217044
2010-02-18 23:33:57 -08:00
Evan Shaw
4af0a58ea9 8a/8l: Added FCMOVcc instructions
Thanks to Charles Dorian for the help.

R=rsc
CC=Charlie Dorian, golang-dev
https://golang.org/cl/207049
2010-02-18 23:33:06 -08:00
Russ Cox
c2dea2196c exec: add dir argument to Run.
fix, test MergeWithStdout

R=r
CC=golang-dev
https://golang.org/cl/214046
2010-02-18 18:32:33 -08:00
Russ Cox
4589c34580 gc: fix this morning's bug fix
R=ken2
CC=golang-dev
https://golang.org/cl/216043
2010-02-18 18:31:13 -08:00
Ken Thompson
fc010adcd7 complex constant multiply and divide
R=rsc
CC=golang-dev
https://golang.org/cl/217041
2010-02-18 17:55:11 -08:00
Robert Griesemer
d17ffb9753 godoc: path cleanups, fixed a race condition, initial support for a menu on pages
R=rsc
CC=adg, golang-dev
https://golang.org/cl/215050
2010-02-18 17:40:50 -08:00
Ken Thompson
713e3e1541 more complex - constants
import and export

R=rsc
CC=golang-dev
https://golang.org/cl/214050
2010-02-18 14:46:28 -08:00
Russ Cox
1734cb02e7 gc: recursive interface embedding
Fixes #287.

R=ken2
CC=golang-dev
https://golang.org/cl/215048
2010-02-18 11:15:36 -08:00
Russ Cox
cf015fd0b8 5g/8g: fix build
R=ken2
CC=golang-dev
https://golang.org/cl/215042
2010-02-17 22:41:04 -08:00
Ken Thompson
33d6a260c1 new types complex, complex64 and complex128
only front-end compiler work.
best to do thin in 3 steps
1. frontend
2. backend
3. lib

R=rsc
CC=golang-dev
https://golang.org/cl/214042
2010-02-17 22:08:30 -08:00
Russ Cox
fb5506600f 8g: respect ullman numbers in float comparison
Fixes #602.

R=ken2
CC=golang-dev
https://golang.org/cl/212045
2010-02-17 15:28:45 -08:00
Russ Cox
7b5789b584 gc: undo attempt at fixing recursive interface embedding
Fixes #582.

Update #287
Status: Accepted
Bug fix was too intrusive; undo and reopen issue.

R=ken2
CC=golang-dev
https://golang.org/cl/209044
2010-02-16 17:44:15 -08:00
Russ Cox
401062f720 gc: fix build (signed char bug)
R=ken2
CC=golang-dev
https://golang.org/cl/210043
2010-02-16 17:30:33 -08:00
Russ Cox
cfff862862 gc: disallow NUL byte, catch more invalid UTF-8, test
R=ken2, ken3
CC=golang-dev
https://golang.org/cl/209041
2010-02-16 16:47:39 -08:00
Robert Griesemer
db9a9662a1 godoc: updated documentation
R=r
CC=golang-dev
https://golang.org/cl/207112
2010-02-16 15:36:55 -08:00
Robert Griesemer
ca075494a6 godoc: initialize vars depending on flags after parsing the flags.
R=rsc
CC=golang-dev
https://golang.org/cl/206109
2010-02-16 12:49:41 -08:00
Robert Griesemer
ffd0961313 godoc: fix initialization issue
R=rsc
CC=golang-dev
https://golang.org/cl/207111
2010-02-16 11:54:12 -08:00
Giles Lean
0b4d8c19af cc: use "cpp" anywhere in path, not "/bin/cpp"
R=rsc
CC=golang-dev
https://golang.org/cl/206077
2010-02-16 11:32:41 -08:00
Robert Griesemer
5883c6ef1f godoc support for directories outside $GOROOT
Example use: godoc -path=/home/user1:/home/build/foo -http=:6666
will start a local godoc that maps urls starting with /pkg/user1 or
/pkg/foo to the respective roots specified in the path.

Missing: Handling of overlapping package directories, multiple
packages per directory.

R=rsc
CC=golang-dev
https://golang.org/cl/206078
2010-02-16 11:20:55 -08:00
Russ Cox
e7fc5c2789 gc: test & fix handling of very long string constants
R=ken2
CC=golang-dev
https://golang.org/cl/207106
2010-02-16 10:16:24 -08:00
Robert Griesemer
fba50ee5ed update gofmt test script
R=adg
CC=golang-dev
https://golang.org/cl/207088
2010-02-12 15:28:11 -08:00
Russ Cox
5ab8f00bf8 gc: diagnose invalid array bounds
Fixes #587.

R=ken2
CC=golang-dev
https://golang.org/cl/207085
2010-02-12 13:59:02 -08:00
Robert Griesemer
a75ebe192e correct meaning of "absolute" and "relative"
(implementation was swapped)

R=adg
CC=golang-dev, rsc
https://golang.org/cl/207069
2010-02-11 13:59:10 -08:00
Robert Griesemer
a91fa9d52e Steps towards more flexible godoc:
The Mapping object implements a flexible
mapping of relative to absolute paths and
vice versa.

R=rsc
CC=golang-dev
https://golang.org/cl/206067
2010-02-11 10:01:03 -08:00
Kai Backman
494bcc80e4 stop the 5c optimizer from clobbering extern static registers.
R=rsc, ken2
CC=golang-dev
https://golang.org/cl/204064
2010-02-10 22:42:05 -08:00
Russ Cox
66cdc699b2 arm: fix build on android
R=kaib
CC=golang-dev
https://golang.org/cl/206059
2010-02-10 15:01:02 -08:00
Alex Brainman
3b1a71862e 8l: pe executable building code changed to include import table for kernel32.dll functions
Fixes #586.

R=rsc
CC=golang-dev
https://golang.org/cl/203060
2010-02-10 00:47:52 -08:00
Russ Cox
1ca39fb1fd gc: fix mkopnames and color grep interaction
Fixes #406.

R=adg
CC=golang-dev
https://golang.org/cl/207053
2010-02-10 00:44:43 -08:00
Russ Cox
f9f66b97e2 ld: unused variable
R=adg
CC=golang-dev
https://golang.org/cl/207050
2010-02-10 00:44:22 -08:00
Ken Thompson
d4ad8e8ce3 bug fix in 6c/8c/5c mis-aligned
function arguments.

R=rsc
CC=golang-dev
https://golang.org/cl/206054
2010-02-09 17:26:04 -08:00
Evan Shaw
baea3e946d 8a/8l: Added CMOVcc instructions
R=rsc
CC=golang-dev
https://golang.org/cl/204067
2010-02-09 13:33:07 -08:00
Fazlul Shahriar
96476b4c3e make units compile
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/206044
2010-02-09 13:20:22 -08:00
Russ Cox
9e2c9bb0ca gc: fix method expression bug
R=ken2
CC=golang-dev
https://golang.org/cl/206043
2010-02-08 21:40:35 -08:00
Andrew Gerrand
b4fb00b69b *l/*c: add -V flag to display version number
R=rsc
CC=golang-dev
https://golang.org/cl/204044
2010-02-08 09:46:53 -08:00
Ken Thompson
ce85868a00 bug in const float divide
R=rsc
CC=golang-dev
https://golang.org/cl/204042
2010-02-05 15:18:32 -08:00
Rob Pike
cd2ecfb7b3 Ugly hack to provide some mechanism for printing documentation about
Go source outside $GOROOT.

If the argument is a path starting with / or ., disregard $GOROOT.
Also, disable the check for package name matching the directory,
which is counterproductive in this case.

Apologies for the violence to the code but we need some help documenting
Go code outside the standard repository.

R=gri
CC=golang-dev
https://golang.org/cl/201064
2010-02-06 08:53:46 +11:00
Dean Prichard
0e47c75f60 5a/6a/8a/5c/6c/8c: remove fixed-size arrays for -I and -D options
R=rsc
CC=golang-dev
https://golang.org/cl/198044
2010-02-05 01:40:58 -08:00
Andrew Gerrand
8ec9ffc742 6l: move mapped symbol table lower in memory
Allows binary to run on some Linux system.

Fix for issue 365.

R=rsc
CC=golang-dev
https://golang.org/cl/199096
2010-02-04 12:46:11 -08:00
Kai Backman
2f1a321d4f search for runtime.a in the package path instead of hardcoding
the location. remove last remnants of broken -l flag.

R=rsc
CC=golang-dev
https://golang.org/cl/201042
2010-02-03 22:31:38 -08:00
Russ Cox
00f4c6a1b5 ld: include main and runtime in the library loop
Fixes #585.

R=r
CC=golang-dev
https://golang.org/cl/195075
2010-02-03 16:30:45 -08:00
Russ Cox
8bef7fdc39 bug252: make ... vs ...T crossing an error, at least for now
R=r
CC=golang-dev
https://golang.org/cl/199066
2010-02-02 15:00:13 -08:00
Russ Cox
44898c7b76 gc: bug250, bug251 - recursive interface types
Fixes #287.

R=ken2
CC=golang-dev
https://golang.org/cl/199057
2010-02-01 23:58:49 -08:00
Russ Cox
674458e1c4 gc: bug246
R=ken2
CC=golang-dev
https://golang.org/cl/198057
2010-02-01 23:05:15 -08:00
Russ Cox
0bd41e2ff0 gc: bug242
R=ken2
CC=golang-dev
https://golang.org/cl/198053
2010-02-01 22:18:51 -08:00
Russ Cox
45515011cc gc: final ...T bug for the day
R=ken2
CC=golang-dev
https://golang.org/cl/199046
2010-02-01 16:22:16 -08:00
Robert Griesemer
e37495368c don't report a couple of meaningless errors in command-line mode
R=rsc
CC=golang-dev
https://golang.org/cl/199045
2010-02-01 16:13:58 -08:00
Rob Pike
d2fc5d68da Change type of Printf's args to ... interface{}
R=rsc
CC=golang-dev
https://golang.org/cl/197043
2010-02-02 10:53:37 +11:00
Russ Cox
1f11ece67f nacl: fix build, finally fixed 8l convergence bug
R=r
CC=golang-dev
https://golang.org/cl/199042
2010-02-01 15:20:19 -08:00
Russ Cox
bea730d1f9 gc: ... T corner cases
more to come, but should suffice for Printf work.

R=ken2
CC=golang-dev
https://golang.org/cl/197044
2010-02-01 10:49:24 -08:00
Russ Cox
68796b0270 gc: add ... T, rework plain ...
No longer a distinct type; now a property of func types.

R=ken2
CC=golang-dev
https://golang.org/cl/197042
2010-02-01 00:25:59 -08:00
Rob Pike
20195bbe61 Fix redirection if the page is in a subdirectory.
Fixes buggy links in the devel subdirectory.
Code from rsc; tested by me.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/197041
2010-02-01 17:17:25 +11:00
Russ Cox
05f26366e5 two minor build fixes
Fixes #572.
Fixes #570.

R=r
CC=golang-dev
https://golang.org/cl/194134
2010-01-28 18:18:40 -08:00
Dean Prichard
77053797e0 avoid overflow of symb buffer in 5a/6a/8a/5c/6c/8c
R=rsc
CC=golang-dev
https://golang.org/cl/194099
2010-01-28 16:11:38 -08:00
Russ Cox
288c1c83d9 gc: tweak error messages, avoid internalization settings in bison
R=r
CC=golang-dev
https://golang.org/cl/194129
2010-01-28 15:57:44 -08:00
Ken Thompson
424f9ca6ab change print print buffer size
to go with the full path names

R=rsc
CC=golang-dev
https://golang.org/cl/195079
2010-01-27 15:37:46 -08:00
Russ Cox
a186b77b03 gc: implement defer print/println/panic/panicln
Fixes #219.

R=ken2, r
CC=golang-dev
https://golang.org/cl/194097
2010-01-27 15:37:08 -08:00
Robert Griesemer
f39dc9fff2 More steps towards tracking of identifier scopes.
- provide scope to parse functions; if non-nil, parser uses the scope
  to declare and lookup identifiers
- resolve forward references where possible

R=rsc
CC=golang-dev
https://golang.org/cl/194098
2010-01-27 09:44:28 -08:00
Russ Cox
2a01d72878 gc: improved syntax errors
* example-based syntax errors (go.errors)

* enable bison's more specific errors
  and translate grammar token names into
  tokens like ++

* test cases

R=ken2, r, ken3
CC=golang-dev
https://golang.org/cl/194085
2010-01-26 23:13:22 -08:00
Russ Cox
cb58ed75d2 cgo: update for package global name space
Fixes #560.

R=r
CC=golang-dev
https://golang.org/cl/195051
2010-01-26 18:20:15 -08:00
Russ Cox
5f4c052e2d gc: do not treat .6 different from .a anymore
R=ken2
CC=golang-dev
https://golang.org/cl/195050
2010-01-26 16:12:50 -08:00
Icarus Sparry
7c1841fb2a gotest still assumes that gopack is in your PATH
If your $PATH does not include $GOBIN then
the build fails at the first *.a file, which
is probably when running the tests for tar

R=rsc
CC=golang-dev
https://golang.org/cl/193066
2010-01-26 13:15:59 -08:00
Robert Griesemer
2dd3622bc7 Allow func() func().
Update gofmt test script.

R=rsc
CC=golang-dev
https://golang.org/cl/195044
2010-01-26 11:49:49 -08:00
Russ Cox
7abb4b3a96 gc: fix chan <- chan precedence.
also allow func() func().

R=ken2
CC=golang-dev
https://golang.org/cl/194078
2010-01-26 10:40:28 -08:00
Kai Backman
3884f7321f salvaging 183105 from dead client
a number of fixes for arm elf generation in 5l. -T now works as
advertised, -D now works properly.

R=rsc
CC=golang-dev
https://golang.org/cl/194076
2010-01-25 21:38:27 -08:00
Russ Cox
60a6ec1c93 ld: typo
R=ken2
CC=golang-dev
https://golang.org/cl/194073
2010-01-25 18:48:18 -08:00
Russ Cox
7263bfc73b cc: correct handling of leading ·
R=ken2
CC=golang-dev
https://golang.org/cl/193081
2010-01-25 18:31:44 -08:00
Russ Cox
531e6b77c8 eliminate package global name space
R=ken2
CC=golang-dev
https://golang.org/cl/194071
2010-01-25 18:31:35 -08:00
Russ Cox
1912632019 runtime, type switch: eliminate package global name space assumption
bonus: type switch now detects multiple uses of identical interface types.
bonus: interface types are now order-independent, following the spec.

R=ken2
CC=golang-dev
https://golang.org/cl/194053
2010-01-25 18:23:20 -08:00
Russ Cox
3b1a0355b6 5l, 6l, 8l: accept only one object file
(package main; others are pulled in automatically)

R=ken2
CC=golang-dev
https://golang.org/cl/194069
2010-01-25 17:53:43 -08:00
Russ Cox
69e244a104 ld: do not load the same object file multiple times.
eliminates spurious multiple initialization errors.

give more information in the multiple init errors that remain.

Fixes #87.

R=r
CC=golang-dev
https://golang.org/cl/194052
2010-01-25 08:53:27 -08:00
Russ Cox
1cecac8134 gc: record full package paths in runtime type data
detect compilation of special package runtime with
compiler flag instead of package name.

R=ken2
CC=golang-dev
https://golang.org/cl/193080
2010-01-24 23:33:59 -08:00
Russ Cox
d1b14a6fb0 gc: bug247, reported by rob
R=ken2
CC=golang-dev
https://golang.org/cl/194051
2010-01-24 22:42:18 -08:00
Russ Cox
fd150e77e1 gc: cut some dead code, fix 6g -S output
R=ken2
CC=golang-dev
https://golang.org/cl/193079
2010-01-24 22:36:26 -08:00
Russ Cox
758f2bc556 eliminate the package global name space assumption in object files
5g/6g/8g: add import statements to export metadata, mapping package path to package name.
	recognize "" as the path of the package in export metadata.
	use "" as the path of the package in object symbol names.

5c/6c/8c, 5a/6a/8a: rewrite leading . to "". so that ·Sin means Sin in this package.

5l/6l/8l: rewrite "" in symbol names as object files are read.

gotest: handle new symbol names.

gopack: handle new import lines in export metadata.

Collectively, these changes eliminate the assumption of a global
name space in the object file formats.  Higher level pieces such as
reflect and the computation of type hashes still depend on the
assumption; we're not done yet.

R=ken2, r, ken3
CC=golang-dev
https://golang.org/cl/186263
2010-01-22 17:06:20 -08:00
Dean Prichard
07d3e0dce4 5a/6a/8a: avoid fixed-sized file name buffer
R=rsc
CC=golang-dev
https://golang.org/cl/186279
2010-01-22 16:59:17 -08:00
Russ Cox
ce7f345cd1 gc: do not build builtin.c automatically; use golden copy instead.
R=r
CC=golang-dev
https://golang.org/cl/190104
2010-01-22 16:58:33 -08:00
Christopher Wedgwood
2a57a5c9c7 Trim space on input to make searching more robust.
R=rsc, r, gri
CC=golang-dev
https://golang.org/cl/186255
2010-01-22 14:26:15 +11:00
Ken Thompson
cd47c903e2 part 2 of sudoaddable optimization
R=rsc
CC=golang-dev
https://golang.org/cl/190088
2010-01-20 13:07:14 -08:00
Russ Cox
a6736fa4ff cleanup toward eliminating package global name space
* switch to real dot (.) instead of center dot (·) everywhere in object files.
    before it was half and half depending on where in the name it appeared.
  * in 6c/6a/etc identifiers, · can still be used but turns into . immediately.
  * in export metadata, replace package identifiers with quoted strings
    (still package names, not paths).

R=ken2, r
CC=golang-dev
https://golang.org/cl/190076
2010-01-19 21:34:44 -08:00
Ken Thompson
dfc0ed9559 start of better addressing of
arrays/slices in structures

R=rsc
CC=golang-dev
https://golang.org/cl/190077
2010-01-19 19:59:57 -08:00
Russ Cox
fe01d4c8a1 gc: const debug bool = false
R=ken2
CC=golang-dev
https://golang.org/cl/186232
2010-01-19 15:25:44 -08:00
Russ Cox
ae3e8eb2ec ld: unused variable
R=r
CC=golang-dev
https://golang.org/cl/186229
2010-01-19 13:09:27 -08:00
Russ Cox
4f8117d9eb build: move GOOS, GOARCH, GOROOT lookup into central library.
bake default values in during build.

R=r
CC=golang-dev
https://golang.org/cl/186173
2010-01-18 21:46:46 -08:00
Russ Cox
ff6e310b00 gc: bug245
Fixes #529.

R=ken2
CC=golang-dev
https://golang.org/cl/186215
2010-01-18 17:30:15 -08:00
Russ Cox
8e996304f3 gc: multiple return value at top-level invoked multiple times
Fixes #402.

R=ken2
CC=golang-dev
https://golang.org/cl/186214
2010-01-18 17:00:38 -08:00
Russ Cox
e0059ae811 gc: bug243
Fixes #481.

R=ken2
CC=golang-dev
https://golang.org/cl/186213
2010-01-18 16:52:18 -08:00
Russ Cox
5a5799f613 gc: more precise handling of import .
Fixes #455.

R=ken2
CC=golang-dev
https://golang.org/cl/186212
2010-01-18 16:26:40 -08:00
Russ Cox
07fc145744 gc: be more specific about copy type errors
Fixes #539.

R=ken2
CC=golang-dev
https://golang.org/cl/190043
2010-01-18 16:00:13 -08:00
Ian Lance Taylor
c332ff42fe Don't check array bounds if we have been told not to.
Fixes range.go test for 6g.

R=rsc
CC=golang-dev
https://golang.org/cl/189093
2010-01-15 13:51:57 -08:00
Robert Griesemer
01b4f2dd23 Steps towards tracking scopes for identifiers.
- Identifiers refer now to the language entity (Object)
	  that they denote. At the moment this is at best an
	  approximation.

	- Initial data structures for language entities (Objects)
          and expression types (Type) independent of the actual
	  type notations.

	- Initial support for declaring and looking up identifiers.

	- Updated various dependent files and added support functions.

	- Extensively tested to avoid breakage. This is an AST change.

R=rsc
CC=golang-dev, rog
https://golang.org/cl/189080
2010-01-15 13:27:45 -08:00
Russ Cox
da9bc7ae7d runtime: add demo running Go on raw (emulated) hw
8l: add GOOS=pchw, stop spelling out all the elf numbers.

R=r
CC=golang-dev
https://golang.org/cl/186144
2010-01-13 19:51:59 -08:00
Devon H. O'Dell
e8afb6d87f cgo: Only allow numeric / string / character type constants for references
to #defined things.

Fixes #520.

R=rsc, rsaarelm
CC=golang-dev
https://golang.org/cl/186138
2010-01-13 16:48:14 -08:00
Robert Griesemer
27be2915f3 Distinguish between html generation and html quoting in godoc formatters.
Replacement for CL 184084; originally by Roger Peppe (rogpeppe@gmail.com).

R=rsc
CC=golang-dev, rog
https://golang.org/cl/189059
2010-01-13 15:18:56 -08:00
Russ Cox
1c6c0eee20 godoc: skip template wrapping for complete HTML files
demo at http://wreck:8080/doc/
click on go_talk-20100112.html

R=gri
CC=golang-dev
https://golang.org/cl/186137
2010-01-13 13:09:33 -08:00
Devon H. O'Dell
14a74378f4 cgo: handle C99 bool type
Fixes #307.

R=rsc
CC=golang-dev
https://golang.org/cl/186073
2010-01-13 10:25:28 -08:00
Rob Pike
ccbcefe2b6 ignore $GOARCH inside the compiler and linker.
by definition, they know what they are building for.
makes it easier to switch architectures when testing.

% 6g x.go
% 6l x.6
% 6.out
"Wed Jan 13 10:57:46 EST 2010"
% 8g x.go
% 8l x.8
% 8.out
"Wed Jan 13 10:57:46 EST 2010"
% echo $GOARCH

%

R=rsc
CC=golang-dev
https://golang.org/cl/186116
2010-01-13 14:39:16 +11:00
Roger Peppe
9d4d7d8f99 Fix bug that prevented the gofmt test script being run on more
than one explicitly named file.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/186095
2010-01-12 09:45:11 -08:00
Rob Pike
2f63eb243c delete debugging prints
R=rsc
CC=golang-dev
https://golang.org/cl/186079
2010-01-11 17:35:51 -08:00
Rob Pike
ba5d0f2098 delete debugging prints
R=rsc
CC=golang-dev
https://golang.org/cl/186079
2010-01-11 17:35:06 -08:00
Rob Pike
937caef8fa add pprof output format to prof.
amd64 linux only.

R=rsc
CC=golang-dev
https://golang.org/cl/186077
2010-01-11 16:53:45 -08:00
Devon H. O'Dell
bc82aaddb6 cgo: Make constants #define'd in C available to Go (as consts)
Fixes #435

R=rsc
CC=golang-dev
https://golang.org/cl/181161
2010-01-11 13:05:26 -08:00
Yongjian Xu
d668d4fbbd gc: clean opnames.h
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/181186
2010-01-11 13:03:01 -08:00
Robert Griesemer
5dee91001b Remove -oldprinter flag from gofmt; all code is
now printed using the semicolon-free style.

Removed NoSemis flag and mechanism dealing with
optional semicolons from go/printer.

Updated all go/printer output files using the
semi-colon free style.

Changes have no formatting impact on checked in
go code under src and misc.

R=rsc, r
CC=golang-dev
https://golang.org/cl/184068
2010-01-11 12:58:13 -08:00
Russ Cox
307a899d5b gc: bug238
Fixes #471.

R=ken2
CC=golang-dev
https://golang.org/cl/181184
2010-01-08 00:01:03 -08:00
Russ Cox
1b1f39eb86 gc: bug219, bug239, bug240
Fixes #475.

R=ken2
CC=golang-dev
https://golang.org/cl/183157
2010-01-07 23:24:48 -08:00
Russ Cox
c6f4d68667 gc: bug241
Fixes #495.

R=ken2
CC=golang-dev
https://golang.org/cl/183156
2010-01-07 23:20:00 -08:00
Evan Shaw
a551ffe809 8g: float->uint64 conversion optimization
Using FUCOMIP instead of the FUCOMP-FSTSW-SAHF sequence gives better performance and saves code space.

R=rsc
CC=golang-dev
https://golang.org/cl/183139
2010-01-06 19:28:19 -08:00
Russ Cox
ee7c64efe5 8c: only refer to extern register variables in MOVL instructions
R=ken2
https://golang.org/cl/183136
2010-01-06 18:18:07 -08:00
Russ Cox
e0763ba8e7 godoc: serve index.html in place of directory listing, when present
R=gri
CC=golang-dev
https://golang.org/cl/181155
2010-01-06 15:59:03 -08:00
Devon H. O'Dell
690fcacdd3 cgo: Use -fno-eliminate-unused-debug-types when calling gcc to for dwarf stabs.
This keeps debug symbols in for e.g. unreferenced enums.

Fixes #479

R=rsc
CC=golang-dev, waltermundt
https://golang.org/cl/181102
2010-01-06 15:45:08 -08:00
Evan Shaw
5107aa82a1 8a, 8l: Add FCOMI, FCOMIP, FUCOMI, FUCOMIP instructions
Fixes #447

R=rsc
CC=golang-dev
https://golang.org/cl/183047
2010-01-05 17:06:41 -08:00
Robert Griesemer
50442290bb Simplified parser interface.
R=rsc, r
CC=golang-dev, rog
https://golang.org/cl/183116
2010-01-04 17:26:01 -08:00
Robert Griesemer
2aefb8d930 Fix bug in godoc tab conversion filter:
tabs after an empty line where not converted.

Also, made it more robust in the presence of
(unexpected) ' ' and '\v' chars in indentation
mode.

R=r
CC=golang-dev
https://golang.org/cl/181085
2009-12-28 17:24:53 -08:00
Russ Cox
5f132b93eb gc: various C nits, found by plan 9 compiler.
reported by erik quanstrom.

R=ken2
https://golang.org/cl/181071
2009-12-27 09:32:30 -08:00
Rob Pike
8c557962de make 6prof (sic) architecture-independent.
for now, it's amd64 and 386 only but it's trivial to add more.

Fixes #385.

(why couldn't it have been issue 386?)

tested for amd64 and 386 on darwin.

R=rsc
CC=golang-dev
https://golang.org/cl/182043
2009-12-24 07:17:49 +11:00
Devon H. O'Dell
7c9111434a cgo: don't overwrite p.Crefs
It's expected to be shared between all files so that all types are output.
Fixes bug reported on mailing list by Peter Froehlich.

R=rsc, phf
CC=golang-dev
https://golang.org/cl/183043
2009-12-23 09:26:21 -08:00
Robert Griesemer
d2a398610e update test.sh so it can run to completion again
R=r
CC=golang-dev
https://golang.org/cl/179120
2009-12-21 15:05:50 -08:00
Russ Cox
4ab0ce107a 8g: add TESTL etc to reg opt
Fixes #436.

R=ken2
https://golang.org/cl/180105
2009-12-21 11:02:18 -08:00
Russ Cox
c276d87c6c cgo: interpret $CGOPKGDIR as absolute path if rooted
R=dho
CC=golang-dev
https://golang.org/cl/180099
2009-12-21 08:31:02 -08:00
Russ Cox
0d668259dc gc: method expressions on concrete types
R=ken2
https://golang.org/cl/180092
2009-12-18 17:24:58 -08:00
Russ Cox
044ebae2f0 cgo: include line number information to keep go/printer happy
Fixes #443.

R=dho
CC=golang-dev
https://golang.org/cl/179095
2009-12-17 17:04:48 -08:00
Kai Backman
d85bb81878 first stub for softfloats, intercepts float instructions and skips
them in the stream.

R=rsc
https://golang.org/cl/174052
2009-12-17 16:08:42 -08:00
Robert Griesemer
4ddcb0ea73 fix for gofmt rewrite matcher bug
R=rsc
CC=golang-dev
https://golang.org/cl/179096
2009-12-17 15:23:19 -08:00
Russ Cox
6a4b2492b3 gc: fix compiler crash
R=ken2
CC=dho
https://golang.org/cl/179097
2009-12-17 15:08:55 -08:00
Robert Griesemer
7fcf422181 use new tab indentation format in godoc, but convert
leading tabs into spaces to ensure a good outcome in
most browsers

R=rsc
https://golang.org/cl/165051
2009-12-17 14:10:49 -08:00
Devon H. O'Dell
9277b02537 Allow cgo to accept multiple .go inputs for a package
Fixes #342.

R=rsc
CC=golang-dev
https://golang.org/cl/179062
2009-12-17 13:20:56 -08:00
Devon H. O'Dell
7a5f4be97e Use BitSize instead of the field's type native ByteSize when calculating
structs containing bitfields.

Fixes #163.

R=rsc
CC=golang-dev
https://golang.org/cl/180059
2009-12-17 12:38:29 -08:00
Robert Griesemer
59a3cae402 - Parse expressions as opposed to statements for gofmt rewrite patterns.
Allows stand-alone types (e.g. []int as patterns) and doesn't require
a semicolon at the end (which are now mandatory terminators).

- Fix a matcher bug.

R=rsc
CC=golang-dev
https://golang.org/cl/179088
2009-12-16 16:53:56 -08:00
Moriyoshi Koizumi
a8fbf5dc2c This patch enables cgo utility to correctly convert enums in the C source
into consts in the resulting Go source.  Previously known as issue 161047,
which I deleted accidentally.  Fixes issue 207.

R=rsc
https://golang.org/cl/166059
2009-12-15 21:24:17 -08:00
Russ Cox
c715b58dad gc: fix import name resolution
Fixes #403.

R=ken2
https://golang.org/cl/180052
2009-12-15 16:44:28 -08:00
Russ Cox
5d754bfaea gc: bug fixes.
* better error for lookup of unexported field
  * do not assign "ideal string" type to typed string literal
  * do not confuse methods and fields during interface check

Fixes #410.
Fixes #411.
Fixes #426.

R=ken2
https://golang.org/cl/179069
2009-12-15 16:22:04 -08:00
Russ Cox
101f499fa5 gc: allow ... in method lists
R=ken2
https://golang.org/cl/179070
2009-12-15 16:20:37 -08:00
Robert Griesemer
5a1d3323fe 1) Change default gofmt default settings for
parsing and printing to new syntax.

                  Use -oldparser to parse the old syntax,
                  use -oldprinter to print the old syntax.

               2) Change default gofmt formatting settings
                  to use tabs for indentation only and to use
                  spaces for alignment. This will make the code
                  alignment insensitive to an editor's tabwidth.

                  Use -spaces=false to use tabs for alignment.

               3) Manually changed src/exp/parser/parser_test.go
                  so that it doesn't try to parse the parser's
                  source files using the old syntax (they have
                  new syntax now).

               4) gofmt -w src misc test/bench

	       1st set of files.

R=rsc
CC=agl, golang-dev, iant, ken2, r
https://golang.org/cl/180047
2009-12-15 15:33:31 -08:00
Russ Cox
d122bb2193 gc: double-check usage of ...
Fixes #423.

R=ken2
https://golang.org/cl/180045
2009-12-15 14:26:50 -08:00
Russ Cox
0282cc5e74 gc: var x, ok = m[y]
Fixes #384.

R=ken2
https://golang.org/cl/179061
2009-12-15 14:26:33 -08:00
Robert Griesemer
8793f622e6 don't show semicolons anymore with godoc
R=rsc
https://golang.org/cl/174078
2009-12-14 09:14:00 -08:00
Hector Chu
977e19d69f 8l: add support for PE output.
R=rsc
https://golang.org/cl/166080
2009-12-13 12:39:20 -08:00
Hector Chu
31645cc0bb Ported godefs to Windows.
R=rsc
https://golang.org/cl/164049
2009-12-13 12:21:44 -08:00
Russ Cox
978c3e96d1 gc: fix comment
R=gri
CC=golang-dev
https://golang.org/cl/174077
2009-12-13 12:11:56 -08:00
Rob Pike
f646296185 Update goyacc to new syntax, still with semicolons.
Update units.y too.
Fixes #417.

R=rsc
CC=golang-dev
https://golang.org/cl/176063
2009-12-14 06:34:51 +11:00
Ken Thompson
bedfc2c2f1 more on the optimizer
trying to get alizses
to optimize

R=rsc
https://golang.org/cl/176061
2009-12-12 14:36:52 -08:00
Robert Griesemer
222462ed4f Various cleanups:
- no need to replace comments for stand-alone blocks
- always print string concatenations with interspersed "+"
  (remove option)
- minor cleanups

R=rsc
https://golang.org/cl/174076
2009-12-11 16:42:14 -08:00
Russ Cox
3997495dc3 gc: semicolons
Fixes #89.
Fixes #92.
Fixes #118.
Fixes #182.
Fixes #328.
Fixes #340.

R=ken2, ken3
CC=golang-dev
https://golang.org/cl/172049
2009-12-11 15:59:41 -08:00
Ken Thompson
cd00bc78da bug in 6g optimizer
8g still needs fixing

R=rsc
https://golang.org/cl/176057
2009-12-11 15:55:09 -08:00
Devon H. O'Dell
857d4cf1a9 Remove GOBIN in PATH dependency; don't assume cwd is $GOROOT/src
This change removes the necessity to have GOBIN in $PATH,
and also doesn't assume that the build is being run from
$GOROOT/src. This is a minimal set of necessary changes
to get Go to build happily from the FreeBSD ports
collection.

R=rsc
CC=golang-dev
https://golang.org/cl/171044
2009-12-11 15:14:09 -08:00
Yongjian Xu
8b3b1edc04 mkbuiltin: generate builtin.c directly
R=golang-dev, rsc
https://golang.org/cl/173041
2009-12-11 12:41:33 -08:00
Robert Griesemer
67aa1399d6 - make make test working again
- some factoring for easier experimentation

R=rsc
https://golang.org/cl/174048
2009-12-10 19:07:10 -08:00
Robert Griesemer
bda2074193 New flags for gofmt:
- oldparser            parse old syntax (required semicolons)
- oldprinter           print old syntax (required semicolons)

By default, these flags are enabled for now.
Setting -oldparser=false has no effect until go/parser is changed
to accept the new syntax.

Enabled exp/parser in Makefile; update dependent exp/eval.

R=rsc
https://golang.org/cl/174051
2009-12-10 19:03:28 -08:00
Robert Griesemer
295ceb4526 remove uses of string concatenation from src and misc directory
R=rsc
https://golang.org/cl/172041
2009-12-09 16:54:07 -08:00
Charles L. Dorian
3ca1b1d27f Continuation of issue 221 fix. When 8g or 6g or 5g are called with a
UTF-8 string, Yconv() converts it into an octal sequence. If the
string converted to more than 30 bytes, the str buffer would
overflow. For example, 4 Greek runes became 32 bytes, 3 Hiragana
runes became 36 bytes, and 2 Gothic runes became 32 bytes. In
8l, 6l and 5l the function is Sconv(). For some reason, only 5l uses
the constant STRINGSZ (defined as 200) for the buffer size.

R=rsc
https://golang.org/cl/168045
2009-12-09 11:56:45 -08:00
Russ Cox
b73b43ea31 6l, 8l: make string buffer big enough for 8 chars (and then some)
Fixes #221.

R=ken2
https://golang.org/cl/165086
2009-12-07 22:01:59 -08:00
Russ Cox
33649bd278 runtime: introduce unsafe.New and unsafe.NewArray
to provide functionality previously hacked in to
    reflect and gob.

R=r
https://golang.org/cl/165076
2009-12-07 15:51:58 -08:00
Roger Peppe
80e17d6797 the AST walker currently provides no way to find out how the
nodes in the tree are nested with respect to one another.
a simple change to the Visitor interface makes it possible
to do this (for example to maintain a current node-depth, or a
knowledge of the name of the current function).

Visit(nil) is called at the end of a node's children;
this make possible the channel-based interface below,
amongst other possibilities.

It is still just as simple to get the original behaviour - just
return the same Visitor from Visit.

Here are a couple of possible Visitor types.

// closure-based
type FVisitor func(n interface{}) FVisitor
func (f FVisitor) Visit(n interface{}) Visitor {
	return f(n);
}

// channel-based
type CVisitor chan Visit;
type Visit struct {
	node interface{};
	reply chan CVisitor;
};
func (v CVisitor) Visit(n interface{}) Visitor
{
	if n == nil {
		close(v);
	} else {
		reply := make(chan CVisitor);
		v <- Visit{n, reply};
		r := <-reply;
		if r == nil {
			return nil;
		}
		return r;
	}
	return nil;
}

R=gri
CC=rsc
https://golang.org/cl/166047
2009-12-07 10:33:45 -08:00
Russ Cox
864c757a1c gc/runtime: pass type structure to makeslice.
* inform garbage collector about memory with no pointers in it

1.9s	gcc reverse-complement.c

reverse-complement.go
4.5s / 3.5s	original, with/without bounds checks
3.5s / 3.3s	bounds check reduction
3.3s / 2.8s	smarter garbage collector
2.6s / 2.3s		assembler bytes.IndexByte
2.5s / 2.1s	even smarter garbage collector (this CL)

R=r
https://golang.org/cl/165064
2009-12-04 21:44:05 -08:00
Russ Cox
6f14cada11 gc: walk pointer in range on slice/array
R=ken2
https://golang.org/cl/166071
2009-12-04 20:40:21 -08:00
Russ Cox
7c4aeec868 6g/8g optimizer fix: throw functions now in runtime
R=ken2
https://golang.org/cl/166070
2009-12-04 20:37:32 -08:00
Russ Cox
d7402cea8c gotest: stop if the // gotest commands fail
R=r
https://golang.org/cl/166067
2009-12-04 18:34:59 -08:00
Russ Cox
01f0f16ebc gotest: ignore *_test.pb.go
R=r
https://golang.org/cl/166064
2009-12-04 17:08:54 -08:00
Russ Cox
f2c7a20142 8l: fix print line number format, buffer overflow
R=ken2
https://golang.org/cl/165059
2009-12-03 23:29:48 -08:00
Russ Cox
9da6666a8a gc: check for assignment to private fields during initialization
R=ken2
https://golang.org/cl/165055
2009-12-03 22:09:58 -08:00
Ken Thompson
62be24d949 6g code gen bug
R=rsc
https://golang.org/cl/166052
2009-12-03 20:28:24 -08:00
Christopher Wedgwood
7e7008fa5e gc: Allow allow data types up to 1GB
R=rsc
https://golang.org/cl/164095
2009-12-03 12:46:34 -08:00
Russ Cox
c6e316a4b9 gc: handle _ = <-c in select.
Fixes #238.

R=ken2
https://golang.org/cl/163098
2009-12-03 01:30:19 -08:00
Russ Cox
05a1eb1ab0 gc: recursive type error
Fixes #245.

R=ken2
https://golang.org/cl/164094
2009-12-03 01:12:02 -08:00
Russ Cox
41861a8812 gc: better diagnosis of initialization loops
Fixes bug 292.

R=ken2
https://golang.org/cl/164093
2009-12-03 00:51:03 -08:00
Russ Cox
e733766dda gc: minor import grammar bug fixes
Fixes #364.

R=ken2
https://golang.org/cl/164092
2009-12-03 00:10:32 -08:00
Russ Cox
272d156357 gc: function argument ordering bug
Fixes #370.

R=ken2
https://golang.org/cl/163097
2009-12-02 23:54:51 -08:00
Russ Cox
8777759f59 gc: make 'invalid rune in string' a little less cryptic
Fixes #371.

R=ken2
https://golang.org/cl/164091
2009-12-02 23:23:11 -08:00
Rob Pike
b0683bd77a move ReadFile, WriteFile, and ReadDir into a separate io/ioutil package.
this breaks the dependency of package io on package bytes.

R=rsc
CC=golang-dev
https://golang.org/cl/163085
2009-12-02 22:02:14 -08:00
Robert Griesemer
c0efa07c65 updated documentation for gofmt
R=rsc
https://golang.org/cl/164085
2009-12-02 19:32:15 -08:00
Russ Cox
69c0edd59b 8g: discard tempalloc/tempfree experiment
in favor of tempname.
allows optimizer to do more.
unfortunately, optimizer seems to be broken; disable it.

R=ken2
https://golang.org/cl/163091
2009-12-02 18:31:29 -08:00
Russ Cox
fdb030d86f 6g etc: groundwork for eliminating redundant bounds checks.
drop check in range over array.
	drop check in [256]array indexed by byte.

R=ken2
https://golang.org/cl/163088
2009-12-02 17:30:07 -08:00
Robert Griesemer
dc7355a974 Add flag -tabindent to gofmt: forces use of
tabs for indentation even if -spaces is set.

Changes to gofmt:
- added -tabindent flag
- don't recompute parser and printer mode repeatedly

Changes to go/printer:
- provide new printing mode TabIndent

Changes to tabwriter:
- implement new mode TabIndent to use tabs independent
  of the actual padding character for leading empty columns
- distinguish between minimal cell width and tab width
  (tabwidth is only used if the output contains tabs,
  minwidth and padding are always considered)
- fixed and added more comments
- some additional factoring

By default, -tabindent is disabled and the default gofmt
behavior is unchanged. By setting -spaces and -tabindent,
gofmt will use tabs for indentation but do any other
alignment with spaces. This permits a user to change the
visible indentation by simply changing the editor's tab
width and the code will remain properly aligned without
the need to rerun gofmt.

R=rsc
https://golang.org/cl/163068
2009-12-02 16:57:15 -08:00
Fazlul Shahriar
0aa13c999b gofmt: race condition in error reporting and setting exit code
How to reproduce:

	$ mkdir /tmp/foo
	$ cp /dev/null /tmp/foo/bar.go
	$ chmod -r /tmp/foo/bar.go
	$ gofmt /tmp/foo
	open /tmp/foo/bar.go: permission denied
	$ echo $?		# should echo 2
	0
	$

Maybe you need to put a call to time.Sleep at the beginning of report().

R=gri
CC=golang-dev
https://golang.org/cl/164073
2009-12-02 13:02:42 -08:00
Evan Shaw
1664e81585 8g: Match sgen definition to declaration
R=rsc
CC=golang-dev
https://golang.org/cl/164069
2009-12-01 21:42:35 -08:00
Devon H. O'Dell
fd7e1a2d87 FreeBSD needs #!/usr/bin/env bash (fixes broken build on FreeBSD)
R=gri
https://golang.org/cl/163067
2009-12-01 19:30:17 -08:00
Charles L. Dorian
e1c347ca59 8g: fix 386 floating point stack bug
Also fixes issue 310 comment 5 error.
Fixes #310.

R=rsc
https://golang.org/cl/163042
2009-12-01 15:53:50 -08:00
Robert Griesemer
749da968e4 make test.sh work again
R=rsc
https://golang.org/cl/164059
2009-12-01 13:08:36 -08:00
Rob Pike
67dc2ae3a6 a couple of usage fixups in prof
R=rsc
https://golang.org/cl/161050
2009-12-01 11:35:34 -08:00
Fazlul Shahriar
db18ce2f53 gofmt: use os.Stdin instead of opening /dev/stdin
Opening /dev/stdin can sometimes fail. For example, in the acme editor,
executing "Edit ,|gofmt" fails with:

	open /dev/stdin: no such device or address

Executing "Edit ,|ls -l /dev/stdin /proc/self/fd/0" gives:

	lrwxrwxrwx 1 root root  15 2009-09-07 02:17 /dev/stdin -> /proc/self/fd/0
	lrwx------ 1 fhs  users 64 2009-11-26 22:05 /proc/self/fd/0 -> socket:[5528230]

(This is my first change, and I've signed the individual contributor license agreement.)

R=rsc, gri
CC=golang-dev
https://golang.org/cl/162041
2009-12-01 09:32:22 -08:00
Robert Griesemer
9e450880e9 some godoc cleanup:
- simplified dealing with parse errors: no need to intersperse them in the source
- improve visibility of highlighted identifiers by showing them in bold

R=rsc
https://golang.org/cl/163051
2009-12-01 09:15:05 -08:00
Eden Li
354b100567 cgo: use C type void for opaque types if dwarf.Common().Type returns nothing
Ideally, the C name would come from the typedef or pointer that
references the Size<0 type, but we can't easily generate this without
performing a look-ahead to see if any referencing type will become opaque.

Fixes #334.
Fixes #281.

R=rsc
https://golang.org/cl/161056
2009-11-29 18:14:39 -08:00
Russ Cox
b7c4314ecb gc: correct type check for x, ok map assignment
Fixes #288.

R=ken2
https://golang.org/cl/157162
2009-11-24 16:11:48 -08:00
Robert Griesemer
001a8b11ff Change to container/vector interface:
- removed New(len int) in favor of new(Vector).Resize(len, cap)
- removed Init(len int) in favor of Resize(len, cap)
- runs all.bash

Fixes #294.

R=rsc, r, r1
https://golang.org/cl/157143
2009-11-24 13:43:18 -08:00
Russ Cox
7c9acae2f1 godoc: plug file descriptor leak
R=gri
CC=r
https://golang.org/cl/157149
2009-11-24 13:21:14 -08:00
Eden Li
a9d0da75f1 cgo translates empty function arguments into void instead of dying with 'unexpected type: ...'.
Fixes #162.

R=rsc
https://golang.org/cl/157147
2009-11-23 22:02:12 -08:00
Sergio Luis O. B. Correia
6fc820729e go: makes it build for the case $GOROOT has whitespaces
the bash scripts and makefiles for building go didn't take into account
the fact $GOROOT / $GOBIN could both be directories containing whitespaces,
and was not possible to build it in such a situation.

this commit adjusts the various makefiles/scripts to make it aware of that
possibility, and now it builds successfully when using a path with whitespaces
as well.

Fixes #115.

R=rsc, dsymonds1
https://golang.org/cl/157067
2009-11-23 17:32:51 -08:00
Sergio Luis O. B. Correia
2b1133ff86 cmd/cc: change getquoted() to accept whitespaces.
getquoted() currently checks for whitespaces and returns nil
if it finds one. this prevents us from having go in a path
containing whitespaces, as the #pragma dynld directives are
processed through the said function.

this commit makes getquoted() accept whitespaces, and this is
also needed for solving issue #115.

R=rsc
https://golang.org/cl/157066
2009-11-23 16:00:26 -08:00
Russ Cox
edf7485a6e gofmt -r: documentation and minor fixes
fix a few paren insertion bugs in the printer too.

R=gri, r
CC=golang-dev
https://golang.org/cl/157119
2009-11-23 15:44:27 -08:00
Russ Cox
e69f12ae1d two more if(h<0) that gcc 4.3 -O2 miscompiles
R=r
https://golang.org/cl/160044
2009-11-23 14:23:14 -08:00
Russ Cox
dc30800c28 8g: call throwindex for array out of bounds
R=ken2
https://golang.org/cl/160043
2009-11-23 12:58:28 -08:00
Russ Cox
28e392d4bd gofmt: add -r flag to rewrite source code according to pattern
a little slow, but usable (speed unchanged when not using -r)

tweak go/printer to handle nodes without line numbers
more gracefully in a couple cases.

R=gri
https://golang.org/cl/156103
2009-11-20 15:09:54 -08:00
Russ Cox
9ac4449cb2 gofmt -r 'α[β:len(α)] -> α[β:]' -w src/cmd src/pkg
R=r, gri
CC=golang-dev
https://golang.org/cl/156115
2009-11-20 11:45:05 -08:00