Austin Clements [Wed, 26 Aug 2009 00:57:40 +0000 (17:57 -0700)]
Make the expression compiler not use the AST visitor. The
statement compiler will be fixed in a later CL.
The input and output of the expression compiler are now
clearly distinguished. In the process, I made the individual
expression compilers operate on the compiled form of their
children instead of AST nodes. As a result, there are now
fewer places where I hand-craft intermediate expression nodes.
The diff looks scarier than it is, mostly because exprCompiler
has been split into the input and output types, resulting in
lots of little renames.
Russ Cox [Mon, 24 Aug 2009 23:15:21 +0000 (16:15 -0700)]
first attempt at real FFI support.
in a .6 file, an export line
//ffi T localfib remotefib remote.so
means the dynamic linker should initialize
localfib, always a pointer, to the address of
remotefib, either text (T) or data (D) after
loading remote.so.
the C compiler will generate an export section
when given the pragmas
#pragma package fib
#pragma ffi T localfib remotefib remote.so
needing #pragma package is a bit of a kludge
and hopefully could go away later.
this is just the 6 tool chain support.
other architectures will happen once 6 settles down.
Austin Clements [Mon, 24 Aug 2009 20:48:16 +0000 (13:48 -0700)]
Make it only necessary to exit blocks, not scopes. Allow
variables to be given initial values in some cases, to make
building global scopes more convenient.
Ian Lance Taylor [Sat, 22 Aug 2009 00:41:18 +0000 (17:41 -0700)]
If the compiler dumps core, bash will print a useless error
message with the full path of the errchk script. Catch that
by wrapping the if statement which invokes the compiler in a
subshell. Use the $TMPOUT file as a flag to let the main
shell know whether the subshell ran. Since the compiler
stdout and stderr are redirected, if the if statement produces
any output, then the compiler crashed, and we report that.
Kai Backman [Fri, 21 Aug 2009 23:29:19 +0000 (16:29 -0700)]
mostly 64 bit support.
- fixed a number of places where we tried to allocate 64bit
regs. added honeypot in regalloc to catch these in the future.
- implemented quad copying in sgen
- cgen64.c, add, mul
- clearfat done
- D_REGREG output from 5g (linker already knew about them)
- gmove done
- optoas almost done, last bit probably not needed
- D_SHIFT support in list.c
Ian Lance Taylor [Fri, 21 Aug 2009 23:09:17 +0000 (16:09 -0700)]
Test composite literals with undeclared types. This crashed
gccgo in a few different places, and crashes 6g as of this
writing. Note that the index in a composite literal must be
looked up in a different namespace if the composite literal
type turns out to be a struct.
Ian Lance Taylor [Fri, 21 Aug 2009 22:43:23 +0000 (15:43 -0700)]
Enable these tests. Fix divconst.go and modconst.go to
compile with the current compiler. Adjust expected error
message in method1.go to match 6g output.
Russ Cox [Fri, 21 Aug 2009 20:08:11 +0000 (13:08 -0700)]
linker work
* remove now-unused D_SBIG (was for typestrings)
* rename elf64.[ch] to elf.[ch]
* pull in elf headers from FreeBSD instead of writing our own
* emit non-header ELF data in data section
* stub out a few more ELF sections needed for dynamic loading
Russ Cox [Thu, 20 Aug 2009 23:09:38 +0000 (16:09 -0700)]
FFI step 2: can ask for libc.so.6.
introduced explicit "data" symbol instead of etext
to mark beginning of data, so that using larger
alignment (i.e. 4MB like GNU loader) doesn't
confuse garbage collector.
split dodata into dodata and dobss in preparation
for putting the dynamic data + headers in the data
segment instead of stuffed at the beginning of the binary.
Russ Cox [Thu, 20 Aug 2009 18:11:03 +0000 (11:11 -0700)]
introduce meaningful section names, so that
go_spec.html#Return_statements
can be used to link to spec sections. passes hlint.
renamed final section to simply "Implementation differences"
to shorten the name, but otherwise no non-formatting changes
Ian Lance Taylor [Wed, 19 Aug 2009 21:40:48 +0000 (14:40 -0700)]
With the changes to support automatic forward declarations of
type names, gccgo no longer reports redefinition errors for
:=, because it no longer knows at parse time whether the type
has changed. Adjust this test to not match "redefinition",
and to instead match gccgo's current output.
declbad.go:19:3: error: variables redeclared but no variable is new
declbad.go:34:3: error: variables redeclared but no variable is new
declbad.go:39:3: error: variables redeclared but no variable is new
declbad.go:44:3: error: variables redeclared but no variable is new
declbad.go:49:3: error: variables redeclared but no variable is new
declbad.go:24:3: error: incompatible types in assignment
declbad.go:29:3: error: incompatible types in assignment
declbad.go:39:3: error: incompatible types in assignment
Bill Neubauer [Tue, 18 Aug 2009 05:21:48 +0000 (22:21 -0700)]
Removing dead tests from chan.c
Since pres != nil was already checked and the routine sets *pres to false
and returns, the subsequent tests are unneeded.
Robert Griesemer [Sat, 15 Aug 2009 18:43:54 +0000 (11:43 -0700)]
snapshot:
- renamed Z -> Int
- made Int ops methods on *Int
- "install" assembly routines dynamically
- replace mulVW functions with mulAddVWW
of equivalent performance but symmetric functionality
to divWVW
- implemented scanN
status:
- need mulNN (trivial)
- need division/modulo after which the set of
elementary operations is complete
- to/from string conversion working
Robert Griesemer [Fri, 14 Aug 2009 18:53:27 +0000 (11:53 -0700)]
First cut at a more realistic multi-precision package:
- implemented low-level operations on word vectors
- implemented corresponding amd64 assembly routines for word vector operations
- implemented first set of operations on unsigned integers
- implemented first set of operations on signed integers
- implemented systematic test cases for each data type