]> Cypherpunks repositories - gostls13.git/log
gostls13.git
16 years agoruntime nits: variable name and comments
Russ Cox [Mon, 13 Apr 2009 22:22:36 +0000 (15:22 -0700)]
runtime nits: variable name and comments

R=r
DELTA=10  (0 added, 0 deleted, 10 changed)
OCL=27374
CL=27388

16 years agoworking checkpoint.
Russ Cox [Mon, 13 Apr 2009 20:28:53 +0000 (13:28 -0700)]
working checkpoint.

add comment describing new web server tree.
make room for command line interface.
use new path package to get rid of doubled slashes.
use new Chdir function to avoid goroot + everything.

implement new /pkg/ tree instead of using regexps.

R=gri
DELTA=267  (103 added, 72 deleted, 92 changed)
OCL=27150
CL=27367

16 years agoadd strconv.Unquote
Russ Cox [Mon, 13 Apr 2009 20:27:39 +0000 (13:27 -0700)]
add strconv.Unquote

R=r
DELTA=229  (227 added, 0 deleted, 2 changed)
OCL=27200
CL=27366

16 years agofix stringrange test
Russ Cox [Mon, 13 Apr 2009 12:31:44 +0000 (05:31 -0700)]
fix stringrange test

R=ken
OCL=27353
CL=27353

16 years agotweak
Ken Thompson [Mon, 13 Apr 2009 05:34:36 +0000 (22:34 -0700)]
tweak

R=r
OCL=27344
CL=27344

16 years agofix string range to have full unicode range (up to 10FFFF).
Rob Pike [Mon, 13 Apr 2009 00:01:17 +0000 (17:01 -0700)]
fix string range to have full unicode range (up to 10FFFF).
add test for string range.

test has minor failure: after loop the index == len(s); should be len(s)-1
in this case.  according to spec, vars are left at position at last
iteration.

R=ken,rsc
DELTA=259  (161 added, 96 deleted, 2 changed)
OCL=27343
CL=27343

16 years agochange replacement rune to its correct value, fffd
Rob Pike [Sun, 12 Apr 2009 23:13:34 +0000 (16:13 -0700)]
change replacement rune to its correct value, fffd

R=ken
OCL=27342
CL=27342

16 years agorange over strings
Ken Thompson [Sat, 11 Apr 2009 02:49:31 +0000 (19:49 -0700)]
range over strings

R=r
OCL=27332
CL=27332

16 years agobug142 is fixed
Rob Pike [Sat, 11 Apr 2009 00:58:10 +0000 (17:58 -0700)]
bug142 is fixed

R=rsc
OCL=27331
CL=27331

16 years agoFixed optab to support SWI with long constant (the mode used
Kai Backman [Fri, 10 Apr 2009 23:44:01 +0000 (16:44 -0700)]
Fixed optab to support SWI with long constant (the mode used
for linux system calls).

R=rsc
APPROVED=rsc
DELTA=3  (3 added, 0 deleted, 0 changed)
OCL=27325
CL=27328

16 years agoAdding ARM elf support to the 5l linker.
Kai Backman [Fri, 10 Apr 2009 23:35:36 +0000 (16:35 -0700)]
Adding ARM elf support to the 5l linker.

R=rsc
APPROVED=rsc
DELTA=312  (312 added, 0 deleted, 0 changed)
OCL=27133
CL=27326

16 years agobug in stack size used in
Ken Thompson [Fri, 10 Apr 2009 22:23:19 +0000 (15:23 -0700)]
bug in stack size used in
extending segmented stack

R=r
OCL=27319
CL=27319

16 years agotest for new string bug
Russ Cox [Fri, 10 Apr 2009 13:22:41 +0000 (06:22 -0700)]
test for new string bug

TBR=r
OCL=27306
CL=27306

16 years agofix typo breaking linux build
Rob Pike [Fri, 10 Apr 2009 09:50:22 +0000 (02:50 -0700)]
fix typo breaking linux build

R=rsc
OCL=27304
CL=27304

16 years agobug 142
Ken Thompson [Fri, 10 Apr 2009 02:11:24 +0000 (19:11 -0700)]
bug 142
order of evaluation && and ||

R=r
OCL=27294
CL=27294

16 years agochange representation of strings
Ken Thompson [Fri, 10 Apr 2009 01:16:21 +0000 (18:16 -0700)]
change representation of strings

R=r
OCL=27293
CL=27293

16 years agoStart list of default formatters for template variables.
Rob Pike [Thu, 9 Apr 2009 07:10:46 +0000 (00:10 -0700)]
Start list of default formatters for template variables.
The HTML one here is just a stub - should use an HTML library to do the right thing.

R=rsc
DELTA=54  (47 added, 2 deleted, 5 changed)
OCL=27250
CL=27250

16 years agomove template into its own directory so it can have more files
Rob Pike [Thu, 9 Apr 2009 06:43:02 +0000 (23:43 -0700)]
move template into its own directory so it can have more files

R=rsc
DELTA=1421  (736 added, 685 deleted, 0 changed)
OCL=27249
CL=27249

16 years agomessages changed; updated golden.out for bug037
Rob Pike [Thu, 9 Apr 2009 06:34:44 +0000 (23:34 -0700)]
messages changed; updated golden.out for bug037

R=rsc
OCL=27248
CL=27248

16 years agoadd support for variable formatters
Rob Pike [Thu, 9 Apr 2009 06:33:31 +0000 (23:33 -0700)]
add support for variable formatters

R=rsc
DELTA=134  (75 added, 41 deleted, 18 changed)
OCL=27245
CL=27247

16 years agoyet another attempt at auto-linking
Russ Cox [Thu, 9 Apr 2009 05:45:33 +0000 (22:45 -0700)]
yet another attempt at auto-linking

store only the original import path string (+ .a)
if 6g resolves it to an archive file.
let 6l re-resolve the .a at link time.

this lets libraries build against an archive
in the current directory but get used
against an installed archive.

R=r
OCL=27244
CL=27244

16 years agoundo workaround pending real fix
Rob Pike [Thu, 9 Apr 2009 05:24:40 +0000 (22:24 -0700)]
undo workaround pending real fix

R=rsc
OCL=27243
CL=27243

16 years agowork around link bug
Rob Pike [Thu, 9 Apr 2009 05:17:09 +0000 (22:17 -0700)]
work around link bug

R=rsc
OCL=27242
CL=27242

16 years agoFirst cut at templating library for text generation
Rob Pike [Thu, 9 Apr 2009 05:08:55 +0000 (22:08 -0700)]
First cut at templating library for text generation

R=rsc
DELTA=663  (663 added, 0 deleted, 0 changed)
OCL=27239
CL=27241

16 years agoAdd new functions to the iterable package:
David Symonds [Thu, 9 Apr 2009 04:50:40 +0000 (21:50 -0700)]
Add new functions to the iterable package:
- Filter
- Find
- Partition

R=rsc
APPROVED=rsc
DELTA=117  (92 added, 17 deleted, 8 changed)
OCL=27135
CL=27240

16 years agobug142
Russ Cox [Wed, 8 Apr 2009 06:30:59 +0000 (23:30 -0700)]
bug142

R=ken
OCL=27202
CL=27202

16 years agofunc f() (int, int);
Russ Cox [Wed, 8 Apr 2009 05:20:37 +0000 (22:20 -0700)]
func f() (int, int);
x := f();

used to give
fatal error: dowidth fn struct struct { int; int }

now gives
assignment count mismatch: 1 = 2

R=ken
OCL=27198
CL=27201

16 years agofumbly fingers + non-working ^C
Russ Cox [Wed, 8 Apr 2009 04:53:39 +0000 (21:53 -0700)]
fumbly fingers + non-working ^C
submitted CL without applying edits.

make changes from CL 27142 review

R=r
DELTA=26  (17 added, 3 deleted, 6 changed)
OCL=27155
CL=27199

16 years agothrow away . and .. in directory listings
Russ Cox [Tue, 7 Apr 2009 07:40:50 +0000 (00:40 -0700)]
throw away . and .. in directory listings

R=r
DELTA=13  (11 added, 0 deleted, 2 changed)
OCL=27147
CL=27154

16 years agoChdir
Russ Cox [Tue, 7 Apr 2009 07:40:36 +0000 (00:40 -0700)]
Chdir

R=r
DELTA=17  (17 added, 0 deleted, 0 changed)
OCL=27146
CL=27153

16 years agoadd path.Clean and other utilities.
Russ Cox [Tue, 7 Apr 2009 07:40:07 +0000 (00:40 -0700)]
add path.Clean and other utilities.

use path.Clean in web server to sanitize URLs.

http://triv/go/../../../etc/passwd

no longer serves the password file.
it redirects to

http://triv/etc/passwd

which then gets a 404.

R=r
DELTA=288  (286 added, 0 deleted, 2 changed)
OCL=27142
CL=27152

16 years agoadd error case in doc for Index. simplify code slightly.
Rob Pike [Tue, 7 Apr 2009 07:32:16 +0000 (00:32 -0700)]
add error case in doc for Index. simplify code slightly.

R=rsc
DELTA=5  (1 added, 0 deleted, 4 changed)
OCL=27148
CL=27151

16 years agonot a bug by current understanding, so delete this file.
Rob Pike [Tue, 7 Apr 2009 07:15:49 +0000 (00:15 -0700)]
not a bug by current understanding, so delete this file.
6g says: bug138.go:8: constant -1 overflows uint
gccgo says: bug138.go:8:16: error: integer constant overflow

R=rsc
DELTA=19  (0 added, 19 deleted, 0 changed)
OCL=27099
CL=27149

16 years agoset line number for errors produced during walkstate.
Russ Cox [Tue, 7 Apr 2009 05:17:46 +0000 (22:17 -0700)]
set line number for errors produced during walkstate.

R=ken
OCL=27145
CL=27145

16 years agomake NewBufRead etc. idempotent
Rob Pike [Tue, 7 Apr 2009 04:42:14 +0000 (21:42 -0700)]
make NewBufRead etc. idempotent

R=rsc
DELTA=63  (59 added, 0 deleted, 4 changed)
OCL=27143
CL=27143

16 years agoadd method Value() Value to InterfaceValue.
Russ Cox [Tue, 7 Apr 2009 04:28:04 +0000 (21:28 -0700)]
add method Value() Value to InterfaceValue.
use Value() in print to print underlying value
from interface.

before:
package main
import "fmt"
func main() {
x := []interface{} {1, "hello", 2.5};
fmt.Println(x[0], x[1], x[2], x);
}

1 hello 2.5 [<non-nil interface> <non-nil interface> <non-nil interface>]

after:
1 hello 2.5 [1 hello 2.5]

R=r
DELTA=44  (22 added, 16 deleted, 6 changed)
OCL=27139
CL=27141

16 years agoan early 6g limitation forced the use of
Russ Cox [Tue, 7 Apr 2009 04:14:38 +0000 (21:14 -0700)]
an early 6g limitation forced the use of
string(b)[0:n]
instead of the more direct string(b[0:n]).
convert to the more direct form.

R=r
DELTA=5  (0 added, 0 deleted, 5 changed)
OCL=27082
CL=27140

16 years agoExtremely minor fix to ByteBuffer.
Peter McKenzie [Tue, 7 Apr 2009 00:03:07 +0000 (17:03 -0700)]
Extremely minor fix to ByteBuffer.

R=r
APPROVED=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=27123
CL=27130

16 years agoAdd an Iterable package with handy functions like All, Any and Map.
David Symonds [Mon, 6 Apr 2009 05:40:40 +0000 (22:40 -0700)]
Add an Iterable package with handy functions like All, Any and Map.

Add a Data method to vector.Vector.

R=r,rsc
APPROVED=rsc
DELTA=173  (170 added, 0 deleted, 3 changed)
OCL=26980
CL=27098

16 years agofix both of anton's bugs:
Russ Cox [Sat, 4 Apr 2009 06:20:51 +0000 (23:20 -0700)]
fix both of anton's bugs:
* make([100]int) was being compiled to
make([]int), kind of.
* []this = [100]that was working for any this, that.

turned up a typo in pipe_test.go

R=ken
OCL=27081
CL=27081

16 years agoDaily snapshot.
Robert Griesemer [Fri, 3 Apr 2009 23:19:22 +0000 (16:19 -0700)]
Daily snapshot.
- godoc now supports the following url prefixes:
  /doc/ for package documentation
  /file/ for files (directories, html, and .go files)
  /spec for the spec
  /mem for the memory model
- formatting of comments has been fixed
- tons of minor cleanups (still more to do)

Still missing:
- pretty printing of source is not as pretty as it used to be
(still a relict from the massive AST cleanup which has't quite made it's way everywhere)
- documentation entries should be sorted
- comments in code is not printed or not properly printed

TBR=r
DELTA=416  (182 added, 100 deleted, 134 changed)
OCL=27078
CL=27078

16 years agochange in negation
Robert Griesemer [Fri, 3 Apr 2009 06:26:55 +0000 (23:26 -0700)]
change in negation

R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=27061
CL=27061

16 years agoan attempt at simpler yet more correct semicolon rules.
Rob Pike [Fri, 3 Apr 2009 06:03:41 +0000 (23:03 -0700)]
an attempt at simpler yet more correct semicolon rules.
(i'd be happy to drop the paren one as well, reducing it to one case)

DELTA=4  (0 added, 3 deleted, 1 changed)
OCL=27058
CL=27060

16 years agorequire ";" separator after function literals
Robert Griesemer [Fri, 3 Apr 2009 05:59:57 +0000 (22:59 -0700)]
require ";" separator after function literals

R=rsc
DELTA=1  (1 added, 0 deleted, 0 changed)
OCL=27057
CL=27059

16 years ago- don't show methods of non-exported types
Robert Griesemer [Fri, 3 Apr 2009 05:39:52 +0000 (22:39 -0700)]
- don't show methods of non-exported types
(even if the methods are exported)

R=rsc
OCL=27056
CL=27056

16 years ago- renamed hasPostfix -> hasSuffix
Robert Griesemer [Fri, 3 Apr 2009 05:24:52 +0000 (22:24 -0700)]
- renamed hasPostfix -> hasSuffix
- fixed printing of function literals (require separating ";")

R=rsc
OCL=27055
CL=27055

16 years ago- moved functions before types in doc output (per rsc)
Robert Griesemer [Fri, 3 Apr 2009 04:59:37 +0000 (21:59 -0700)]
- moved functions before types in doc output (per rsc)
- use /src and /doc prefix in URL to distinguish output type (per rsc)
- fixed a bug in an internal string function
- ignore files ending in _test.go (consider them test files)

R=rsc
OCL=27054
CL=27054

16 years agospecial case check for this situation
Russ Cox [Fri, 3 Apr 2009 04:46:19 +0000 (21:46 -0700)]
special case check for this situation

; cat >http.go
package main
import "http"  // intended the library, not this file
^D
; 6g http.go
; 6g http.go
http.go:4: export/package mismatch: init
;

new error:

http.6:7 http.go:3: cannot import package main

R=ken
OCL=27053
CL=27053

16 years agotype n t;
Russ Cox [Fri, 3 Apr 2009 04:38:11 +0000 (21:38 -0700)]
type n t;
was copying a bit too much about t into n,
like whether the signature was queued to be printed.
(bug reported by anton)

was also editing t, meaning you could do
type T int;
func (p int) Meth() { }

both fixed.

R=ken
OCL=27052
CL=27052

16 years agouse _f007·filename for func literals.
Russ Cox [Fri, 3 Apr 2009 01:32:57 +0000 (18:32 -0700)]
use _f007·filename for func literals.
this avoids problems people have run into with
multiple closures in the same package.

when preparing filename, only cut off .go, not .anything.
this fixes a bug tgs ran into with foo.pb.go and foo.go
in the same package.

also turn bad identifier chars from filename into
underscores: a-b.pb.go => a_b_pb

R=ken
OCL=27050
CL=27050

16 years agoDaily snapshot:
Robert Griesemer [Fri, 3 Apr 2009 01:25:18 +0000 (18:25 -0700)]
Daily snapshot:
first round of cleanups:
- removed extra .html templates (reduced to one)
- removed dependencies on various local files
- minor fixes throughout

Basic docserver is now operational: Automatically finds all
(multi-file) packages under a root and serves either file
or package documentation.

R=r
OCL=27049
CL=27049

16 years agocompiler falut for forgetting
Ken Thompson [Fri, 3 Apr 2009 01:06:43 +0000 (18:06 -0700)]
compiler falut for forgetting
the assignment on a type switch

R=r
OCL=27048
CL=27048

16 years agouse separate lex buf for better errors:
Russ Cox [Fri, 3 Apr 2009 00:59:09 +0000 (17:59 -0700)]
use separate lex buf for better errors:

package main
func main() { func(){}() + + }

x.go:2: syntax error near _f001

becomes

x.go:2: syntax error near func

R=ken
OCL=27047
CL=27047

16 years agoturn gc of unused data/code back on in loaders.
Russ Cox [Fri, 3 Apr 2009 00:56:23 +0000 (17:56 -0700)]
turn gc of unused data/code back on in loaders.

turned it off while debugging 8 runtime problem,
checked in the change accidentally.

R=r
DELTA=4  (0 added, 0 deleted, 4 changed)
OCL=27040
CL=27046

16 years agoimplement some more 8g
Russ Cox [Thu, 2 Apr 2009 23:48:06 +0000 (16:48 -0700)]
implement some more 8g

package main
func main() {
println("hello,", 123);
}

R=ken
OCL=27043
CL=27043

16 years agoclarification suggested by rob
Russ Cox [Thu, 2 Apr 2009 23:41:53 +0000 (16:41 -0700)]
clarification suggested by rob

R=r
DELTA=4  (4 added, 0 deleted, 0 changed)
OCL=26983
CL=27041

16 years ago- adjustments for changed AST
Robert Griesemer [Thu, 2 Apr 2009 22:58:58 +0000 (15:58 -0700)]
- adjustments for changed AST
- renamed gds -> godoc
- functionality to find and serve packages
  (to get a list of packages provide dir path + "?p")

Next steps: cleanups, better formatting, fine-tuning of output

R=r
OCL=27037
CL=27039

16 years ago- Ident node now takes a string Value instead of a []bytes
Robert Griesemer [Thu, 2 Apr 2009 22:58:38 +0000 (15:58 -0700)]
- Ident node now takes a string Value instead of a []bytes
(this removes a lot of string() conversions down the road)
- a few minor adjustments

R=rsc
DELTA=11  (0 added, 0 deleted, 11 changed)
OCL=27029
CL=27038

16 years agoAdjustements related to AST changes.
Robert Griesemer [Thu, 2 Apr 2009 17:16:17 +0000 (10:16 -0700)]
Adjustements related to AST changes.

R=r
OCL=27026
CL=27028

16 years agoSome AST tuning:
Robert Griesemer [Thu, 2 Apr 2009 17:15:58 +0000 (10:15 -0700)]
Some AST tuning:
- have explicit XSpec nodes for declarations
- have a general GenDecl node instead of DeclList

R=rsc
DELTA=164  (52 added, 52 deleted, 60 changed)
OCL=27005
CL=27027

16 years agoAdd a DeepEqual function to the reflect package
Daniel Nadasi [Thu, 2 Apr 2009 05:20:18 +0000 (22:20 -0700)]
Add a DeepEqual function to the reflect package

R=r,rsc
APPROVED=rsc
DELTA=167  (166 added, 0 deleted, 1 changed)
OCL=26982
CL=27017

16 years agotypeswitch - expression evaluated
Ken Thompson [Thu, 2 Apr 2009 04:28:59 +0000 (21:28 -0700)]
typeswitch - expression evaluated
twice instead of once.

R=r
OCL=27015
CL=27015

16 years agouse range in vector iterator
Rob Pike [Wed, 1 Apr 2009 23:34:25 +0000 (16:34 -0700)]
use range in vector iterator

R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=27003
CL=27003

16 years agoMore gds functionality:
Robert Griesemer [Wed, 1 Apr 2009 22:00:22 +0000 (15:00 -0700)]
More gds functionality:
- package headers
- constants
- variables
- formatted comments

Next steps:
- sorted output
- collection of all files belonging to a package
- fine-tuning of output

R=r
OCL=26997
CL=26997

16 years agochange smoketest from parser.go to astprinter.go,
Russ Cox [Wed, 1 Apr 2009 10:32:44 +0000 (03:32 -0700)]
change smoketest from parser.go to astprinter.go,
the largest remaining source file in this directory.

TBR=gri
OCL=26984
CL=26984

16 years agofix runtime stack overflow bug that gri ran into:
Russ Cox [Wed, 1 Apr 2009 07:26:00 +0000 (00:26 -0700)]
fix runtime stack overflow bug that gri ran into:
160 - 75 was just barely not enough for deferproc + morestack.

added enum names and bumped to 256 - 128.
added explanation.

changed a few mal() (garbage-collected) to
malloc()/free() (manually collected).

R=ken
OCL=26981
CL=26981

16 years agoBail out of gotest immediately if compiling fails.
David Symonds [Wed, 1 Apr 2009 05:35:55 +0000 (22:35 -0700)]
Bail out of gotest immediately if compiling fails.

R=rsc
APPROVED=rsc
DELTA=4  (2 added, 2 deleted, 0 changed)
OCL=26978
CL=26978

16 years ago- also associate factory methods to a type in documentation
Robert Griesemer [Wed, 1 Apr 2009 01:46:21 +0000 (18:46 -0700)]
- also associate factory methods to a type in documentation

R=r
OCL=26974
CL=26976

16 years agotest for and fix bug involving reflect v.Interface() and ==.
Russ Cox [Wed, 1 Apr 2009 00:33:04 +0000 (17:33 -0700)]
test for and fix bug involving reflect v.Interface() and ==.

R=r
DELTA=156  (149 added, 2 deleted, 5 changed)
OCL=26973
CL=26973

16 years agodaily snapshot:
Robert Griesemer [Tue, 31 Mar 2009 23:53:58 +0000 (16:53 -0700)]
daily snapshot:
- adjustments to match new ast/parser interface
- removed printer.go; functionality now in astprinter.go and docprinter.go
  (more cleanups pending)
- enabled new doc printing in gds
  (lots of fine tuning missing, but pieces falling into place; e.g. methods
  associated with types. Consts, Vars, to come. Collection of all files
  belonging to a package to come)

R=r
OCL=26970
CL=26972

16 years ago1) Move parser.go into src/lib/go
Robert Griesemer [Tue, 31 Mar 2009 23:53:37 +0000 (16:53 -0700)]
1) Move parser.go into src/lib/go
   - minor adjustments as suggested by rsc
2) Added parser_test fragment
3) Renamed some types in AST.go per rsc request

R=rsc
DELTA=2053  (2027 added, 0 deleted, 26 changed)
OCL=26963
CL=26971

16 years agomore 386 runtime:
Russ Cox [Tue, 31 Mar 2009 22:45:12 +0000 (15:45 -0700)]
more 386 runtime:
remove use of _subv in vlrt.c
darwin/386/signal.c
darwin/386/*
linux/386/* (forgotten before)

can run empty program on darwin/386 now.

R=r
DELTA=1140  (1021 added, 114 deleted, 5 changed)
OCL=26942
CL=26968

16 years agomultiple bugs in bitfield handling
Russ Cox [Tue, 31 Mar 2009 22:44:43 +0000 (15:44 -0700)]
multiple bugs in bitfield handling

R=r
DELTA=6  (3 added, 0 deleted, 3 changed)
OCL=26944
CL=26967

16 years ago- incorporation of suggestions by rsc
Robert Griesemer [Tue, 31 Mar 2009 20:28:01 +0000 (13:28 -0700)]
- incorporation of suggestions by rsc

R=rsc
OCL=26959
CL=26959

16 years agominimal 8g. can compile
Russ Cox [Tue, 31 Mar 2009 07:22:59 +0000 (00:22 -0700)]
minimal 8g.  can compile

package main
func main() {
}

and not much else.

R=ken
OCL=26943
CL=26943

16 years ago* move go-specific loader code
Russ Cox [Tue, 31 Mar 2009 07:20:07 +0000 (00:20 -0700)]
* move go-specific loader code
into gc directory, where it gets included as ../gc/ldbody
this is similar to the assemblers including ../cc/lexbody
and ../cc/macbody.

* hook go-specific loader code into 8l.

* make current 8.out.h and 6.out.h backward compatible
with plan 9's versions.  i had added some constants in
the middle of enums and have now moved them to the end.
this keeps us from invalidating old .8 and .6 files.
not sure how much it really matters, but easy to do.

R=r
DELTA=1314  (667 added, 623 deleted, 24 changed)
OCL=26938
CL=26941

16 years agomove tiny gsubr functions together at the top of the file.
Russ Cox [Tue, 31 Mar 2009 07:19:38 +0000 (00:19 -0700)]
move tiny gsubr functions together at the top of the file.
delete unused mkenam file

R=ken
OCL=26940
CL=26940

16 years agoSeparate the alignment of a field from the alignment of the
Ian Lance Taylor [Tue, 31 Mar 2009 06:19:31 +0000 (23:19 -0700)]
Separate the alignment of a field from the alignment of the
type of the field.  Use the field alignment to compute the
size of a structure.

This may help 8g but is mainly for gccgo.  gccgo maintains the
standard C/C++ ABI for structure field alignment.  For the
i386, this requires that a float64 field in a struct be
aligned on a 32-bit boundary, although for efficiency a
variable of type float64 or []float64 should be aligned on a
64-bit boundary.

I also removed the unused size field from structField.

R=r
DELTA=117  (75 added, 2 deleted, 40 changed)
OCL=26842
CL=26936

16 years agofix http://b/1748082
Russ Cox [Tue, 31 Mar 2009 05:26:00 +0000 (22:26 -0700)]
fix http://b/1748082

package main
var f = func(a, b int) int { return a + b }

R=ken
OCL=26935
CL=26935

16 years agofix build (moved decl to go.h earlier
Russ Cox [Tue, 31 Mar 2009 04:39:10 +0000 (21:39 -0700)]
fix build (moved decl to go.h earlier
and changed vlong to int64).

R=ken
OCL=26934
CL=26934

16 years agomove portable object routines (especially
Russ Cox [Tue, 31 Mar 2009 04:31:29 +0000 (21:31 -0700)]
move portable object routines (especially
signature generation) into gc.

R=ken
OCL=26933
CL=26933

16 years agoclosure bug: carry along outnamed flag.
Russ Cox [Tue, 31 Mar 2009 02:21:36 +0000 (19:21 -0700)]
closure bug: carry along outnamed flag.

R=ken
OCL=26930
CL=26930

16 years agomove portable code generation (basic statements) to gc.
Russ Cox [Tue, 31 Mar 2009 02:15:07 +0000 (19:15 -0700)]
move portable code generation (basic statements) to gc.

R=ken
OCL=26929
CL=26929

16 years agolog.Stderr should actually go to stderr.
David Symonds [Tue, 31 Mar 2009 02:01:59 +0000 (19:01 -0700)]
log.Stderr should actually go to stderr.

R=r
APPROVED=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=26926
CL=26928

16 years agomove some portable pieces of 6g/gsubr.c into gc/subr.c
Russ Cox [Tue, 31 Mar 2009 00:52:21 +0000 (17:52 -0700)]
move some portable pieces of 6g/gsubr.c into gc/subr.c

int brcom(int);
int brrev(int);
void setmaxarg(Type*);
Sig* lsort(Sig*, int(*)(Sig*, Sig*));
int dotoffset(Node*, int*, Node**);
void stringpool(Node*);
void tempname(Node*, Type*);

R=ken
OCL=26922
CL=26922

16 years agodelete dregs: inarggen, genpanic, regret
Russ Cox [Tue, 31 Mar 2009 00:15:54 +0000 (17:15 -0700)]
delete dregs: inarggen, genpanic, regret

R=ken
OCL=26916
CL=26918

16 years agodaily snapshot:
Robert Griesemer [Tue, 31 Mar 2009 00:13:11 +0000 (17:13 -0700)]
daily snapshot:
- separating printing of AST and documentation
- astprinter: will subsume ast printing functionality of printer
- docprinter: will subsume doc printing functionality of printer
        also: more logic to collect all the documentation pertaining
      to all files of a package
- parser: some cleanups, stricter syntax checks
- gds: hooks to test new doc printer (disabled)

R=r
OCL=26915
CL=26915

16 years agomove alignment calculations into gc
Russ Cox [Tue, 31 Mar 2009 00:09:28 +0000 (17:09 -0700)]
move alignment calculations into gc

R=ken
OCL=26914
CL=26914

16 years agodon't crash on
Russ Cox [Tue, 31 Mar 2009 00:07:30 +0000 (17:07 -0700)]
don't crash on
unsafe.Alignof(struct{x float}{0}.x)

R=ken
OCL=26911
CL=26913

16 years agomove bits.c from 6g to gc
Russ Cox [Mon, 30 Mar 2009 23:13:11 +0000 (16:13 -0700)]
move bits.c from 6g to gc

R=ken
OCL=26909
CL=26909

16 years agofix last 3 references to 'type guards'
Rob Pike [Mon, 30 Mar 2009 23:08:41 +0000 (16:08 -0700)]
fix last 3 references to 'type guards'

R=gri
DELTA=3  (0 added, 0 deleted, 3 changed)
OCL=26908
CL=26908

16 years agotests changed - throw calls panic directly now
Russ Cox [Mon, 30 Mar 2009 07:28:08 +0000 (00:28 -0700)]
tests changed - throw calls panic directly now
instead of dereferencing nil, so no more SIGSEGVs.

R=r
DELTA=28  (0 added, 14 deleted, 14 changed)
OCL=26881
CL=26881

16 years agonew tool godefs.
Russ Cox [Mon, 30 Mar 2009 07:21:25 +0000 (00:21 -0700)]
new tool godefs.
uses gcc to determine system header layouts and
emits simple C or Go.  see comment in main.c.

R=r
DELTA=1069  (1067 added, 0 deleted, 2 changed)
OCL=26682
CL=26880

16 years agodon't write cmp's output to the c file.
Russ Cox [Mon, 30 Mar 2009 07:12:56 +0000 (00:12 -0700)]
don't write cmp's output to the c file.
cope better with p4 not found.

R=r
DELTA=3  (0 added, 0 deleted, 3 changed)
OCL=26877
CL=26879

16 years agomore 386 runtime - can run tiny c programs.
Russ Cox [Mon, 30 Mar 2009 07:01:07 +0000 (00:01 -0700)]
more 386 runtime - can run tiny c programs.

R=r
DELTA=1926  (1727 added, 168 deleted, 31 changed)
OCL=26876
CL=26878

16 years ago- receiver syntax verification
Robert Griesemer [Sat, 28 Mar 2009 06:11:54 +0000 (23:11 -0700)]
- receiver syntax verification
- removed left-over panic() call
- fixed a couple of bugs

R=r
OCL=26856
CL=26856

16 years agoSignificant parser cleanup:
Robert Griesemer [Sat, 28 Mar 2009 02:27:09 +0000 (19:27 -0700)]
Significant parser cleanup:
- commented public interface
- much better and very precise error messages
- much better tracing output
- many more checks (still permits more than just syntactically legal
  programs, but much more is checked that can be checked w/o semantic information)
- updated with respect to updated AST
- general cleanup throughout

Parser almost ready for move into lib/go.

R=r
OCL=26853
CL=26855

16 years ago- have explicit KeyValueExpr node instead of BinaryExpr ':' (as discussed)
Robert Griesemer [Sat, 28 Mar 2009 02:26:03 +0000 (19:26 -0700)]
- have explicit KeyValueExpr node instead of BinaryExpr ':' (as discussed)
- remove ':' token from operator precedence levels

R=rsc
DELTA=25  (13 added, 8 deleted, 4 changed)
OCL=26850
CL=26854

16 years agoVerify that "byte" is an alias for "uint8".
Ian Lance Taylor [Fri, 27 Mar 2009 20:43:50 +0000 (13:43 -0700)]
Verify that "byte" is an alias for "uint8".

R=r
DELTA=6  (6 added, 0 deleted, 0 changed)
OCL=26836
CL=26841

16 years ago- minor tweak to composite literal production:
Robert Griesemer [Fri, 27 Mar 2009 20:43:28 +0000 (13:43 -0700)]
- minor tweak to composite literal production:
renamed PairExpr -> KeyValueExpr and PairExprList -> KeyValueList
(to match corresponding nodes in AST per rsc' suggestion)

- added a couple of TODOs

R=r,rsc
DELTA=10  (2 added, 0 deleted, 8 changed)
OCL=26837
CL=26840