Commit Graph

10 Commits

Author SHA1 Message Date
Adam Sampson
51ecf04a90 Move assignment simplification into a pass.
This is the code that expands array and record assignments out into multiple
assignments. Having it done as a pass means it can do a better job -- this
fixes some problems with cgtest56 where the old version of the code couldn't
handle record assignments from literals.

This is the first pass that's had to add a replicator to the tree, so this also
introduces a helper function for generating new replicator counters.
2007-08-22 19:55:52 +00:00
Neil Brown
96f6bc39fd Added a signed 8-bit type and unsigned 16-,32- and 64-bit types to the AST, adjusting all other code accordingly
The types have been added to the AST.  Beyond the obvious trivial changes (extra cases in functions, etc), the only
significant change was that isSafeConversion needed to be changed.  I took the opportunity to totally rewrite the 
function into a graph-like mechanism rather than just using a list.  To demonstrate its correctness I also wrote an
exhaustive test for it.
2007-08-21 12:43:00 +00:00
Neil Brown
3b14eec036 Added direction specifiers and further attributes (such as whether the channel is shared) to the Chan type in the AST 2007-08-21 10:35:18 +00:00
Adam Sampson
c8d5a4ff40 Add licensing information.
The compiler itself is under the GPLv2+; the support code that gets built into
user programs is under the LGPLv2+. This matches the existing practice for the
KRoC project.

(As with Occade, I've used the new GPLv3-style license header in the source
files, though, since that avoids having to update the FSF's postal address.)
2007-08-18 20:42:11 +00:00
Neil Brown
feebea4473 Changed the AST to distinguish reading a timer from reading a channel 2007-08-13 16:26:03 +00:00
Adam Sampson
6047836456 Add a first shot at the assembly analyser, and make GenerateC use it.
This does about the minimum necessary for assembly analysis to work. It assumes
that any function it hasn't been able to analyse itself needs 512 bytes (most
need far less); it doesn't do any flow analysis; it doesn't do a lot of sanity
checking. However, it produces sensible numbers, and works with the demos I've
tried so far.

I was originally going to make this a separate tool, but there are a number of
bits of the code can be nicely reused, so it's a separate "operating mode" in
the existing program (as is parse-only mode now).
2007-08-08 19:39:47 +00:00
Adam Sampson
2cf3579446 Fix an unused-bind warning -- rhsSizes isn't used when retyping 2007-08-06 23:24:12 +00:00
Adam Sampson
687f6a10f6 Make it possible to inherit operations from GenerateC in other backends.
... and update GenerateCPPCSP to do so. This works by having a structure of
operations (GenOps) through which all the recursive calls go, and having
GenerateCPPCSP replace only the operations that it wants to override.
2007-08-01 22:42:00 +00:00
Neil Brown
33e3123148 Minor Haddock-related fixes
Fixes a few minor things in the code that were confusing the Haddock parser during "make haddock"
2007-07-25 14:00:48 +00:00
Adam Sampson
50731d0b75 Give tock its own repo -- i.e. remove everything else and move tock up 2007-07-16 21:48:55 +00:00