Commit Graph

26 Commits

Author SHA1 Message Date
Adam Sampson
b1416bb0cf Change A.Dimension to take an Expression, not an Int.
This touches an awful lot of code, but cgtest07/17 (arrays and retyping) pass.

This is useful because there are going to be places in the future where we'll
want to represent dimensions that are known at runtime but not at compile time
-- for example, mobile allocations, or dynamically-sized arrays. It simplifies
the code in a number of places.

However, we do now need to be careful that expressions containing variables do
not leak into the State, since they won't be affected by later passes.

Two caveats (marked as FIXMEs in the source):

- Retypes checking in the occam parser is disabled, since the plan is to move
  it out to a pass anyway.
- There's some (now very obvious) duplication, particularly in the backend, of
  bits of code that construct expressions for the total size of an array
  (either in bytes or elements); this should be moved to a couple of helper
  functions that everything can use.
2008-03-18 16:45:38 +00:00
Neil Brown
5c43172e46 Added an annotation to array subscripts to indicate whether they should have a run-time check added or not 2008-03-09 14:30:19 +00:00
Neil Brown
ba75f5b06c Removed the initialiser expression on the Declaration item in the AST 2008-03-09 00:23:13 +00:00
Neil Brown
6d4f1dd702 Added labels to all the top-level tests that didn't have one 2008-02-28 16:11:01 +00:00
Neil Brown
86c17fed99 Added a pass for pulling up the replicator counts in SEQs so that the count is constant for the whole loop 2008-02-27 19:33:44 +00:00
Neil Brown
9b521c9b07 Added tests for testing that testTransformProtocolInput transformed protocol inputs in ALTs 2008-02-27 17:19:47 +00:00
Neil Brown
5c7bb1296b Altered transformProtocolInput to only bother flattening inputs with more than one item 2008-02-27 17:01:19 +00:00
Neil Brown
9b570996ca Added a pass to flatten protocol inputs down into multiple sequential input statements 2008-02-27 16:45:27 +00:00
Neil Brown
f9625ce495 Adjusted the tests for functionsToProcs to include the new style of functions 2008-02-25 22:02:21 +00:00
Neil Brown
1edaacae89 Altered the AST to allow a function to be either an ExpressionList (classical occam) or a Process (Rain/proposed new occam) 2008-02-24 19:29:31 +00:00
Neil Brown
74f3cb7fc2 Removed the export of "m" in TestUtils, instead moving the definition to each module that uses it (less confusing that way) 2008-02-24 18:55:44 +00:00
Neil Brown
acd57d74de Changed the A.Structured type to be parameterised
This patch is actually an amalgam of multiple (already large) patches.  Those patches conflicted (parameterised Structured vs. changes to usage checking and FlowGraph) and encountered a nasty bug in darcs 1 involving exponential time (see http://wiki.darcs.net/DarcsWiki/ConflictsFAQ for more details).  Reasoning that half an hour (of 100% CPU use) was too long to apply patches, I opted to re-record the parameterised Structured changes as this new large patch.  Here are the commit messages originally used for the patches (which, as mentioned, were already large patches):

A gigantic patch switching all the non-test modules over to using parameterised A.Structured
Changed the FlowGraph module again to handle any sort of Structured you want to pass to it (mainly for testing)
A further gigantic patch changing all the tests to work with the new parameterised Structured
Fixed a nasty bug involving functions being named incorrectly inside transformInputCase
Added a hand-written instance of Data for Structured that allows us to use ext1M properly
Fixed a few warnings in the code
2008-02-05 19:40:27 +00:00
Neil Brown
bdda623d7e Added types to all the cases where the monomorhpism restriction applied 2008-01-26 20:51:11 +00:00
Neil Brown
26dd2fa5c4 Renamed the TestUtil and TreeUtil modules to TestUtils and TreeUtils, to be consistent with the Utils module 2007-12-13 19:05:29 +00:00
Neil Brown
7fe77146d0 Added some more documentation in the PassTest module. 2007-11-12 18:03:25 +00:00
Neil Brown
6b95827cab Added an optional initialiser-expression to Declaration in the AST, and changed the rest of the code accordingly 2007-10-24 23:50:00 +00:00
Neil Brown
acca3d03fd Removed the A.Main item from the AST entirely 2007-10-17 13:43:40 +00:00
Neil Brown
d98cb21415 Added support for transforming ALT guards to the input-case -> case pass 2007-10-13 23:56:36 +00:00
Neil Brown
8b2e14f3bd Added tests and implementation for a new pass for transforming input-case statements into case statements 2007-10-13 23:28:41 +00:00
Neil Brown
443b648d73 Corrected the pass that creates abbreviations for output expressions to also work on OutputCase statements 2007-10-13 20:52:42 +00:00
Neil Brown
73ee9319e1 Added more tests for the outExprs pass in PassTest 2007-10-11 00:12:08 +00:00
Neil Brown
c7fe2431db Added a test for the new outExprs pass 2007-10-10 23:46:58 +00:00
Neil Brown
38c409d378 Added the -fwarn-unused-imports compiler option to warn about unused imports, and then set about pruning and ordering (mostly in my code) the import lists for all the modules 2007-09-27 13:13:46 +00:00
Neil Brown
a5c2dedb24 Changed the testPass* functions in TestUtil to return Assertion instead of Test 2007-09-15 13:35:51 +00:00
Neil Brown
000270f4a8 Created a new module for tests in the common directory (named CommonTest) and moved testIsSafeConversion across 2007-09-11 23:34:45 +00:00
Neil Brown
2ff46a9041 Rearranged the Rain source files, renamed a couple of Rain files, and changed the Makefile accordingly. 2007-09-10 17:28:57 +00:00