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

895 Commits

Author SHA1 Message Date
Russ Cox
2609731736 delay range processing. old2new is gone
R=ken
OCL=32780
CL=32780
2009-08-05 02:33:30 -07:00
Russ Cox
54b403723b delay := processing
R=ken
OCL=32772
CL=32772
2009-08-05 00:42:44 -07:00
Russ Cox
ebdbbe0f49 fix amd64 build
R=ken
OCL=32771
CL=32771
2009-08-05 00:11:24 -07:00
Russ Cox
a121410541 make Syms smaller.
collapse a lot of duplication in dcl.c
switch to NodeList* from Dcl*

R=ken
OCL=32770
CL=32770
2009-08-04 22:59:23 -07:00
Russ Cox
4dec8ef35a get function calls out of the way before
allocating registers in shift and div.

fix behavior when res == a reserved register.

R=ken
OCL=32765
CL=32767
2009-08-04 19:16:57 -07:00
Russ Cox
aa347c4a0d move various bits of code around
and delete some dead code.
no actual changes here.

R=ken
OCL=32764
CL=32764
2009-08-04 18:43:32 -07:00
Russ Cox
d169dcee3b fix division bug
R=ken
OCL=32760
CL=32760
2009-08-04 17:59:10 -07:00
Russ Cox
dbe004efe4 delayed evaluation of var blocks
R=ken
OCL=32750
CL=32753
2009-08-04 16:53:06 -07:00
Rob Pike
b8732215c3 fix build
R=gri,rsc
OCL=32748
CL=32748
2009-08-04 15:35:58 -07:00
Russ Cox
f7a867e1a6 move select into its own file.
split into typecheck + walk

R=ken
OCL=32726
CL=32726
2009-08-04 12:57:48 -07:00
Russ Cox
d8c19c80dc type checking of assignments, switch, if, for
R=ken
OCL=32716
CL=32720
2009-08-04 10:26:29 -07:00
Rob Pike
7deeb5bd78 print profile to stderr. sheesh.
R=rsc
DELTA=40  (0 added, 0 deleted, 40 changed)
OCL=32694
CL=32698
2009-08-03 21:03:40 -07:00
Rob Pike
f17c6bcafb this time really clean up a TODO
R=rsc
DELTA=28  (0 added, 20 deleted, 8 changed)
OCL=32676
CL=32684
2009-08-03 15:27:15 -07:00
Russ Cox
9dc22b6d6f more 6g reorg; checkpoint.
typecheck.c is now responsible for all type checking
except for assignment and function argument "..."

R=ken
OCL=32661
CL=32667
2009-08-03 11:58:52 -07:00
Robert Griesemer
178089056e printer.go:
- emit line tag id's in html mode
- support for general html tags
- better names for a few identifiers

godoc.go:
- emit links from exported names to source code
  (actual placement needs fine-tuning)

R=rsc
DELTA=108  (68 added, 4 deleted, 36 changed)
OCL=32639
CL=32654
2009-08-03 09:53:00 -07:00
Robert Griesemer
62718fb5d4 printer:
- prepare for generation of HTML id tags and links
- do HTML-escaping in central print routine
- move tabwriter setup into printer
- fixed various TODOs

godoc:
- removed tabwriter setup, need for various HTML-escaping

R=rsc
DELTA=210  (107 added, 36 deleted, 67 changed)
OCL=32612
CL=32616
2009-07-31 18:04:53 -07:00
Russ Cox
9953c48dc4 missed in last checkin
R=ken
OCL=32581
CL=32581
2009-07-31 09:45:39 -07:00
Russ Cox
a2b8e38766 checkpoint; still plenty to clean up
R=ken
OCL=32576
CL=32580
2009-07-31 09:29:28 -07:00
Robert Griesemer
9299ae461d - don't call String method of AST nodes when converting them to text
- make token.Position.String more robust

TBR=rsc
DELTA=20  (10 added, 6 deleted, 4 changed)
OCL=32564
CL=32564
2009-07-30 19:39:47 -07:00
Russ Cox
b754b4348f delete some code from walkexpr that is now
handled by typecheck.

second switch is gone

move floating point minus into back end

R=ken
OCL=32558
CL=32558
2009-07-30 18:56:44 -07:00
Robert Griesemer
90e6656c51 go/ast/filter.go:
- more orthogonal functionality of filter functions for better re-use

go/doc/doc.go:
- simplified interface
- collect filenames of packages so that they can be shown

godoc:
- removed TODO, show list of package (linked) files used to create documentation

R=rsc
DELTA=130  (68 added, 24 deleted, 38 changed)
OCL=32549
CL=32552
2009-07-30 18:13:55 -07:00
Russ Cox
ff3a73b407 typechecking checkpoint.
started to move typechecking to another file.
can build entire tree still, but lots of work
is duplicated.  much to clean up.

R=ken
OCL=32536
CL=32543
2009-07-30 16:53:08 -07:00
Russ Cox
517e3457cc fix build on amd64
R=ken
OCL=32521
CL=32521
2009-07-30 11:03:58 -07:00
Robert Griesemer
312bd7a1fc parser:
- Changed filter function for parser.ParsePackage to
  take an *os.Dir instead of a filename for more
  powerful filters

- Removed TODO in ast.PackageInterface: Now collect
  package comments from all package files

- Cleanups in godoc: Use the new ParsePackage and
  PackageInterface functions; as a result computing
  package information is much simpler now.

R=rsc
DELTA=285  (80 added, 110 deleted, 95 changed)
OCL=32473
CL=32486
2009-07-29 17:01:09 -07:00
Russ Cox
2946069e3f break and continue fixes
labeled break/continue was using
first loop with any label,
not first loop with the right label.

R=ken
OCL=32453
CL=32458
2009-07-29 14:49:01 -07:00
Russ Cox
9271c6402e introduce typecheck pass before walkexpr.
not complete but compiler still works.

R=ken
OCL=32424
CL=32426
2009-07-29 12:47:51 -07:00
Russ Cox
056940d84b convert walkexpr to take Node**; drop indir
R=ken
OCL=32421
CL=32421
2009-07-29 12:00:34 -07:00
Russ Cox
4152b925f9 expression printer; %#N
R=ken
OCL=32419
CL=32419
2009-07-29 11:51:34 -07:00
Russ Cox
9346c6d901 make every func literal expression allocate,
so that == on func means that the
functions originated in the same
execution of a func literal or definition.

before, there was an inconsistency:

	func() {x++} != func() {x++}

but

	func() {} == func() {}

this CL makes the second case != too,
just like

	make(map[int]int) != make(map[int]int)

R=r
DELTA=202  (71 added, 62 deleted, 69 changed)
OCL=32393
CL=32398
2009-07-28 20:01:00 -07:00
Russ Cox
189153ed13 fix error that gcc thinks is a warning
R=ken
OCL=32264
CL=32386
2009-07-28 17:02:05 -07:00
Russ Cox
123ff2ebb8 bug177: anonymous struct fields in reflect
(reported by iant)

R=r
DELTA=50  (32 added, 12 deleted, 6 changed)
OCL=32263
CL=32385
2009-07-28 17:01:46 -07:00
Robert Griesemer
2210a643b7 Intersperse comments nicely when printing an AST.
gofmt formatted source code looks pretty good already;
with a bit more fine-tuning it should be great.

printer.go:
- Implemented comment intersperse algorithm.
  The approach is a result of many trial-and-error
  experiments but at this point reasonably simple
  and open to arbitrary fine-tuning.

parser.go:
- Simplified handling of lead and line comments
  (formerly called leading and trailing comments).
- Use a comments list instead of an array (I may
  change this back - this is not obviously better
  and uses more space).

doc.go:
- Remove comments from AST nodes that have been
  'consumed' in the documentation to avoid duplicate
  printing of them. Allows for better control of
  what is printed w/o use of printing control flags
  (which are hard to use and not fine-grained enough).

Corresponding adjustments to various clients of these
files.

R=rsc
DELTA=478  (275 added, 108 deleted, 95 changed)
OCL=32185
CL=32380
2009-07-28 16:38:59 -07:00
Phil Pennock
d6f89c69c4 Support use of $GOBINDIR to override $HOME/bin
R=r,gri,rsc
APPROVED=rsc
DELTA=53  (12 added, 6 deleted, 35 changed)
OCL=31822
CL=32282
2009-07-28 11:23:24 -07:00
Russ Cox
18840f5429 constant keys for array initializers
R=ken
OCL=32261
CL=32261
2009-07-27 17:58:25 -07:00
Russ Cox
b7dd312c93 bug170; fix test for bug175
R=ken
OCL=32255
CL=32255
2009-07-27 17:24:07 -07:00
Russ Cox
a587d9a73f multiple return in := bug
R=ken
OCL=32253
CL=32253
2009-07-27 16:59:10 -07:00
Russ Cox
059bbdd340 print(1<<x)
R=ken
OCL=32252
CL=32252
2009-07-27 16:17:09 -07:00
Russ Cox
30228a3bc6 avoid register computing len(x), cap(x)
for slice or string x.

R=ken
OCL=32249
CL=32249
2009-07-27 15:55:27 -07:00
Russ Cox
811e59f2fa named string type bugs
R=ken
OCL=32244
CL=32244
2009-07-27 15:16:28 -07:00
Russ Cox
03b25a92a3 catch
a := true;
	a |= a;
in the front end.

R=ken
OCL=32240
CL=32243
2009-07-27 14:55:14 -07:00
Russ Cox
0b2683d1ee do not insert implicit "return;" in empty function body
R=ken
OCL=32239
CL=32239
2009-07-27 14:36:32 -07:00
Russ Cox
335b3855c6 a little more 6l cleanup
R=r
DELTA=51  (14 added, 24 deleted, 13 changed)
OCL=31968
CL=31971
2009-07-21 17:18:32 -07:00
Russ Cox
5a74c0b6ba do not use ONONAMEs for line number information,
just like ONAME etc.

R=ken
OCL=31964
CL=31964
2009-07-21 16:38:56 -07:00
Rob Pike
304b7954e8 add a .interp section and fix vaddr in INTERP prog.
R=rsc
DELTA=16  (9 added, 3 deleted, 4 changed)
OCL=31956
CL=31963
2009-07-21 16:31:35 -07:00
Rob Pike
3d42e691b9 make 6l produce dynamically linked binaries (although they are fully statically linked as far
as go is concerned).  the -d flag is now flipped; as on the mac, -d disables dynamic.

much remains to be improved to move the output closer to the gcc format.

R=rsc
DELTA=366  (310 added, 30 deleted, 26 changed)
OCL=31929
CL=31951
2009-07-21 15:10:47 -07:00
Russ Cox
1d51978fed fix cut-and-paste bugs in error messages
R=ken
OCL=31890
CL=31890
2009-07-20 17:41:18 -07:00
Russ Cox
6e1ad041f7 avoid strncat in formatters.
the n argument to strncat is the maximum
number of bytes to read from the src,
not the total size of the destination.

R=ken
OCL=31871
CL=31875
2009-07-20 14:16:25 -07:00
Russ Cox
f664d0e904 explain selectsend problem
R=ken
OCL=31865
CL=31867
2009-07-20 13:29:56 -07:00
Rob Pike
f687fb7e73 6l cleanup: last set of magic numbers for elf64 moved to ld/elf64*.
R=rsc
DELTA=68  (21 added, 28 deleted, 19 changed)
OCL=31857
CL=31864
2009-07-20 13:19:47 -07:00
Rob Pike
fe734d8630 clean up generation of exec header.
make endianness explicit when writing values.

R=rsc
DELTA=129  (37 added, 7 deleted, 85 changed)
OCL=31826
CL=31854
2009-07-20 10:08:48 -07:00