Commit Graph

42 Commits

Author SHA1 Message Date
Neil Brown
c8b724d2be Merged the latest set of changes from the trunk into the Polyplate branch
I also added the import list to all the Data.Generics imports in the tests (as I did for the other modules recently)
2009-04-10 20:38:29 +00:00
Neil Brown
ddbec737f2 Got all the tests compiling again after recent changes
For some reason, the usage check tests are now very slow to run (perhaps because of all the operator definitions added to each one?), which needs further investigation.
2009-04-10 19:29:40 +00:00
Neil Brown
56e5b8da8e A mega-patch that gets tocktest compiling again
However, around a quarter of the tests currently fail...
2009-03-31 17:56:56 +00:00
Neil Brown
936dc29fde Fixed some of the tests, and added another testcase for array passing, based on one of Carl's examples 2009-03-20 12:59:16 +00:00
Neil Brown
6afbb80e9f Fixed some of the test modules to work with the new array literals and constructors 2009-02-03 11:19:21 +00:00
Neil Brown
4f83187549 Fixed up all the tests in light of the new recursive procs 2009-01-29 00:56:32 +00:00
Neil Brown
1f4796e07f Fixed all the tests to reflect the new channel-end system, such that they all pass again
This is the last patch (for now) of the set implementing the new channel-end system
2009-01-20 17:41:44 +00:00
Neil Brown
0e7a6c5b98 Added a NameSource field for NameDef that indicates where a name comes from 2008-11-25 17:36:42 +00:00
Neil Brown
ba66cce89f Moved all the remaining pass information to be with the passes themselves, and adjusted the tests accordingly
All the passes now have their information (name, pre-requisites and post- properties) stored at the point where the pass is declared, which means the pass lists are just a simple list of pass functions.

The main consequence of this change was that the tests had to be changed.  Now, instead of taking a "pass applied to data" item (type: PassM b), they take both the pass (type: Pass) and source data (type: b), and apply them later.  This was the decision that involved the simplest changes to the existing tests (simply unbracketing the application of the pass to the source).  I also had to include a few old-style versions though (testPass', testPassShouldFail') for where the functions were being used to test things that weren't actually passes (mainly StructureOccam).

Fixes #48
2008-06-02 14:31:19 +00:00
Adam Sampson
cf79f9c284 Get rid of the nasty ghost names hack.
Rather than prefixing the names, there's now a set of ghost names in
CompState.

Fixes #66.
2008-06-02 10:58:26 +00:00
Adam Sampson
36e7353ee7 Take NameType out of NameDef.
NameType is only really needed in the parser, so this takes it out of
NameDef, meaning that later passes defining names no longer need to
set an arbitrary NameType for them. The parser gets slightly more
complicated (because some productions now have to return a SpecType
and a NameType too), but lots of other code gets simpler.

The code that removed free names was the only thing outside the parser
using NameType, and it now makes a more sensible decision based on the
SpecType. Since unscoped names previously didn't have a SpecType at
all, I've added an Unscoped constructor to it and arranged matters
such that unscoped names now get a proper entry in csNames.

Fixes #61.
2008-06-02 10:13:14 +00:00
Adam Sampson
8b3eba594d Add SubscriptCheck field to SubscriptFromFor etc.
This makes it possible to mark a slice as not needing runtime
checking, which is immediately useful for _sizes arrays.

This fixes cgtest03, which was previously failing to compile because
the _sizes array for one of the constants in it contained a runtime
check and thus wasn't itself constant. I've added a testcase file for
the relevant bit of code.
2008-05-26 17:36:26 +00:00
Adam Sampson
d8d6ab12cc Generate size arrays using IsExpr rather than Is.
This wasn't actually wrong, but everywhere else uses IsExpr for Val
abbreviations.
2008-05-26 17:19:25 +00:00
Neil Brown
d044b51335 Renamed ndType to ndSpecType, as per Trac ticket #59 2008-05-21 13:38:51 +00:00
Neil Brown
3daf82d318 Merged Alternative and AlternativeCond into a single Alternative item that always has a pre-condition 2008-04-03 14:52:37 +00:00
Adam Sampson
3283b7db41 Remove the Type/AbbrevMode information from Actual*.
It's redundant, since you can always compute them from the variable, and it
makes the code that deals with actuals rather cleaner.

On the other hand, it slightly complicates some of the tests, because any names
you use in an Actual need to be defined...
2008-03-26 18:16:09 +00:00
Neil Brown
bbdb429498 Changed transformWaitFor (and its tests) to transform the new InputTimerFor into InputTimerAfter 2008-03-24 15:09:05 +00:00
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
Adam Sampson
3996a1379b Update BackendPassesTest to match my last _sizes change. 2008-03-13 10:52:23 +00:00
Neil Brown
dd14f6b62a Fixed one of the tests for declareSizesArray that had not been updated 2008-03-09 16:57: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
5a42b7eb0c Corrected a test for abbreviating array variables 2008-03-07 15:52:05 +00:00
Neil Brown
bf17347ba2 Added some tests for IsExpr with a statically sized array 2008-03-06 17:51:28 +00:00
Neil Brown
c21fee44d4 Added test for adding sizes to an Is array abbreviation 2008-03-06 17:50:19 +00:00
Neil Brown
264149ef3f Added some more tests for dynamically sized arrays 2008-03-06 01:49:33 +00:00
Neil Brown
8b3edc90ce Added some limited tests for the addSizesActualParameters pass 2008-03-05 23:39:54 +00:00
Neil Brown
3481a3f51d Finished the tests for the addSizesFormalParameters pass 2008-03-05 22:09:51 +00:00
Neil Brown
6c629b33f7 Added a few types in BackendPassesTest to remove a monomorphism restriction warning 2008-03-05 21:04:42 +00:00
Neil Brown
1fef1e64ed Added the beginnings of testing for adding _sizes parameters to PROC definitions (formals) 2008-03-05 17:31:14 +00:00
Neil Brown
6a784bffd9 Switch the tests for declareSizesArray to be QuickCheck tests rather than HUnit tests 2008-03-05 16:35:37 +00:00
Neil Brown
30f1b6ecab Added tests for the declaring of _sizes arrays for record fields 2008-03-04 15:22:03 +00:00
Neil Brown
41303eb993 Altered the code and the tests for declareSizesArray to approach what it should be doing 2008-03-03 17:50:57 +00:00
Neil Brown
81ea069707 Added a dummy implementation of a new pass, declareSizesArray, and the tests for it 2008-03-03 15:02:07 +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
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
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
7d175b1d0d Added more documentation to the testing frameworks in the backends directory. 2007-11-12 17:51:54 +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
e2ab43af3f Tidied up the new BackendPassesTest module, removing some old code that was not intended to be in there, and tidying up the imports list 2007-09-27 13:13:07 +00:00
Neil Brown
8d95b65f00 Added support for the new AlternativeWait guards to the C backend
This was not as straightforward as the C++ backend.  CIF has no capability for supporting waiting *for* a specified time as an ALT guard; only waiting until (AFTER, in occam) a specified time.  This is further complicated by the fact that when you disable an ALT timer guard in CIF, you have to be able to supply the timeout value that you waited on in the enable sequence.

Therefore, I added a pass that transforms all WaitFor guards into WaitUntil guards, by declaring nonce time variables, getting the time, and adding on the delay that we want to wait for; these actions occur just before the ALT.

This new pass is in the new BackendPasses module, into which I also moved the identifyParProcs pass.  I also wrote tests for my new pass that live in the new BackendPassesTest module.
2007-09-27 11:48:04 +00:00