Commit Graph

438 Commits

Author SHA1 Message Date
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
Neil Brown
4e6b166696 Fixed implicit mobility to work in the (C++, at least) backend 2008-06-01 19:46:32 +00:00
Neil Brown
e66ce1f810 Added a line to ShowCode for dereferenced variables 2008-06-01 19:25:33 +00:00
Neil Brown
969c04d42b Improved the Rain support in ShowCode a little 2008-06-01 17:58:40 +00:00
Neil Brown
155f58c174 Fixed the Rain parser tests with respect to the new type inference 2008-06-01 16:48:15 +00:00
Neil Brown
c4702a7f6e Added a new helper function, eitherToMaybe in Utils 2008-05-30 17:14:28 +00:00
Neil Brown
01e702acb2 Changed to print out the error context (based on the meta tag) on stderr instead of stdout 2008-05-30 16:40:21 +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
6debf9292f Rework Traversal, and convert all passes to use it.
This changes the Traversal API to the one that I've been working on in
the Polyplate branch, but implemented in terms of Data. The
performance isn't as good as the Polyplate version, but the code is a
lot simpler because it doesn't need all the type constraints (and it
doesn't make GHC struggle).

This also reworks all the passes in Tock to use the new API, including
those that previously used makeGeneric (which I've now removed) or
everywhereM. Most of the passes are simpler because of this, and I
suspect it's fixed a few subtle bugs resulting from missing recursion
in makeGeneric code.

I haven't yet profiled this, but subjectively it seems about the same
as the old Traversal (and thus faster for all the passes that didn't
yet use it).
2008-05-25 20:13:57 +00:00
Neil Brown
d044b51335 Renamed ndType to ndSpecType, as per Trac ticket #59 2008-05-21 13:38:51 +00:00
Neil Brown
35498a4d13 Renamed the "Typed" type-class to "ASTTypeable" as per the Trac ticket 2008-05-21 13:16:45 +00:00
Neil Brown
2300a5c3a7 Added a few extra cases in ShowCode, for some Rain things 2008-05-20 23:42:52 +00:00
Neil Brown
8c78d056b6 Improved display of unknown types (for debugging, really) 2008-05-20 22:07:35 +00:00
Neil Brown
7bbfab34a0 Added simple instances of the Typed class for actuals and formals 2008-05-18 09:42:51 +00:00
Neil Brown
fb090a3618 Hacked the ShowCode module quickly to display a lot more Rain code (stealing from the occam stuff, and twiddling it slightly) 2008-05-17 22:21:18 +00:00
Neil Brown
7d65db43c0 Changed TestHarness to support Rain test files as well as occam 2008-05-17 13:13:52 +00:00
Neil Brown
e6162877af Changed the AST to fix the different unknown/inferred types
The Infer type (used by the occam frontend) is now separated from the "Unknown" types used in type unification that I'm experimenting with in Rain.
2008-05-17 12:47:31 +00:00
Neil Brown
e843ce5022 Added a mapMapWithKeyM function to Utils, and cleaned up some of the whitespace 2008-05-14 12:18:27 +00:00
Neil Brown
962c1477b9 Added a special type for marking the type of numeric literals to be inferred later 2008-05-14 11:59:33 +00:00
Neil Brown
3ca4ee1a5e Added a new helper function to Utils for transforming Map values monadically 2008-05-13 23:24:43 +00:00
Neil Brown
89c25e3f6c Added a type-class for retrieving the (AST) type of things
This patch hides all the old typeOfExpression, typeOfName, typeOfVariable, etc, and unifies them into a single type-class with an "astTypeOf" function.  The type-class is currently named Typed, but that can easily be changed (it's only explicitly referred to in the Types module).  The patch is essentially the type-class with a giant find-and-replace on the other modules.
2008-05-17 11:41:52 +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
9f172865ff Move DataBox into Utils.
AnyDataItem is effectively the same, so we could reuse DataBox for that
too in the future.
2008-05-09 09:50:42 +00:00
Adam Sampson
0886ab9f9b Abstract the set of types that gmapMFor takes out to a type.
(No change in behaviour, yet.)
2008-04-08 23:13:58 +00:00
Adam Sampson
e460032c30 Remove debugging putStr from the QC-HUnit adaptor.
This was what was causing random numbers to appear during testing.

I've also cleaned up the code a bit.
2008-04-08 14:39:43 +00:00
Adam Sampson
9e9459cb4a Clean up EvalLiterals.
In particular, evalSimpleLiteral is now much nicer, and the error
messages should be a bit more comprehensible.

The signed types previously used a different version of fromRead that
passed an extra argument that it then didn't use; I've switched back to
the old version now, since it appears not to need it any more.
2008-04-08 00:29:23 +00:00
Adam Sampson
f1e9ffe230 In the evaluator, handle byte literals of any type. 2008-04-08 00:10:45 +00:00
Adam Sampson
bfd7b079a7 Make unsubscriptType handle Infer. 2008-04-06 18:42:40 +00:00
Adam Sampson
3ab0c30589 When rendering array literals, recompute the dimensions.
This makes sure that literals produced by the constant evaluator will never
contain UnknownDimension. The change looks a lot more complex than it really
is; it already carried the type "downwards", and most of this is just making it
carry it back up to where the A.Literal is being constructured.
2008-04-06 15:40:50 +00:00
Adam Sampson
1640b9ce63 Move applyDimension into Types. 2008-04-06 15:32:35 +00:00
Adam Sampson
b65512b64c Make getConstantName descend into definitions.
This means you don't have to have folded constants throughout the tree/state in
order to evaluate them, which makes the early passes less awkward to manage.
2008-04-06 13:46:48 +00:00
Adam Sampson
1977e7880b Move evalIntExpression into EvalConstants, now that Types doesn't need it.
It now uses the full expression evaluator rather than the literal-only version.
2008-04-06 13:31:37 +00:00
Adam Sampson
9838cf7b8c Use forall to remove some repeated monad constraints. 2008-04-06 11:19:43 +00:00
Adam Sampson
aa3b17b555 Make protocolItems give a more useful error message on failure. 2008-04-06 02:50:46 +00:00
Adam Sampson
e1fca531a0 Rework how OccValue is rendered to an Expression.
The rendering code now takes the type it's aiming for, so it can produce a
value of exactly the same type as the expression that was being folded
originally (rather than trying to work it out for itself).
2008-04-06 02:29:02 +00:00
Adam Sampson
2fdf749be0 Handle Infer in evalSimpleLiteral. 2008-04-06 02:28:43 +00:00
Adam Sampson
71df38813f Make subscriptType and trivialSubscriptType aware of Infer.
Subscripting Infer gives you Infer.

This also makes trivialSubscriptType handle user types in the same way as
subscriptType. (There probably isn't much reason to have both any more, since
subscriptType doesn't do the checks it used to do.)
2008-04-06 02:27:07 +00:00
Adam Sampson
e9d95aa0fd Tidy up OccValue a bit. 2008-04-06 00:48:02 +00:00
Adam Sampson
37b5735de1 When showing occam code, use CHAN/PORT rather than CHAN OF/PORT OF. 2008-04-05 23:19:12 +00:00
Adam Sampson
e52b51b050 Add an Infer type to mark types that should be inferred.
We can then check it's been removed using a property later.
2008-04-04 12:09:33 +00:00
Neil Brown
4ef1ff7196 Changed to a state monad for warnings, and added a runPassM function to remove duplicate code for running passes 2008-04-03 12:21:59 +00:00
Neil Brown
20843f70a4 Corrected all the tests to use the new PassM monad 2008-03-10 17:07:48 +00:00
Neil Brown
d66fb79796 Fixed some unused module import warnings, now that PassM is not build of monad transformers 2008-03-10 17:19:45 +00:00
Adam Sampson
bd9c4dae98 Go back to passing the value to the type-contains function.
This'll make the modification to look at constructors cleaner.
2008-04-02 16:11:13 +00:00
Adam Sampson
f515b5ce55 Change "find" to "targets", for clarity. 2008-04-02 15:16:47 +00:00
Adam Sampson
d9df114909 Rework gmapMFor so it takes a list of type keys.
This means we only need one gmapMFor function, and we do fewer calls to
typeKey, but we have to make typeKey available for use where it's called.
2008-04-02 15:09:07 +00:00
Adam Sampson
aeb2ebd9f4 Fix Haddock. 2008-04-01 13:22:30 +00:00
Adam Sampson
d2bcd0cde5 Use IntMap.keysSet.
(Thanks to Neil for spotting this!)
2008-03-26 23:19: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
Adam Sampson
ef329e3ed0 Check SpecTypes. 2008-03-26 14:20:35 +00:00
Adam Sampson
c9cb7d2bf9 Check Proc calls. 2008-03-26 12:26:04 +00:00
Adam Sampson
6861b22da6 Check timer operations. 2008-03-25 16:45:25 +00:00
Adam Sampson
b3e3308b3e Implement channel IO checks, and refactor OccamTypes (again). 2008-03-25 15:56:03 +00:00
Neil Brown
c68aa42277 Added a sub-type to Timers, to support multiple types 2008-03-23 22:20:16 +00:00
Neil Brown
7830d82c51 Fixed the display of names in ShowCode for Rain 2008-03-23 12:13:55 +00:00
Neil Brown
1bf3f6f0f1 Fixed the type of a function name in buildExpr to fix the tests 2008-03-23 12:08:08 +00:00
Neil Brown
6f76f6385e Added to an error message in Types to help determine the problem 2008-03-23 00:07:48 +00:00
Neil Brown
e767e33190 Added support for some intrinsic (time-related) functions in Rain 2008-03-22 18:58:10 +00:00
Neil Brown
7f28d3dbe3 Added a warnPC function (like diePC) for use with formatCode 2008-03-22 18:34:40 +00:00
Neil Brown
710abd7019 Added support for function calls to the Rain parser 2008-03-22 17:49:21 +00:00
Adam Sampson
60ca26128c More occam typechecks: input/output items, replicators, choices.
Various infrastructure too to support these.

Doing A.ForEach raised an interesting question: what does it work over?  In
plain occam it'd just be arrays, but it should obviously work for lists too.
This suggests that Size and Subscript should work on lists as well, since
ForEach will be implemented in terms of them. I've therefore introduced the
idea of a "sequence" class of types.
2008-03-22 23:47:29 +00:00
Adam Sampson
388f2f38a6 plainSubscriptType doesn't really need to know what the subscript is. 2008-03-22 00:53:46 +00:00
Adam Sampson
56de093739 Add isScalarType. 2008-03-22 00:53:13 +00:00
Adam Sampson
8b2568264d Add more utility functions along the lines of defineConst.
These let you define various sorts of name in the initial state of a pass test.
2008-03-22 00:44:57 +00:00
Adam Sampson
8b5233ba47 Add ShowCode instances for A.Name. 2008-03-22 00:42:00 +00:00
Adam Sampson
cfc5b18e3e Don't show the state when a pass unexpectedly succeeds.
This used not to be a problem, but there's now quite a lot of stuff predefined
in the state when testing the typechecker, so it tends to obscure the real
error...
2008-03-20 23:56:13 +00:00
Neil Brown
025eebf61d Added support for giving ranges an explicit type in Rain 2008-03-21 21:10:47 +00:00
Neil Brown
2189a6c28a Added support for list literals to the Rain parser 2008-03-21 20:03:47 +00:00
Neil Brown
33b04e7646 Tidied up a few unused functions and module imports 2008-03-21 15:16:36 +00:00
Neil Brown
0e3465afc0 Corrected some Rain tests to avoid using the Int type 2008-03-20 16:42:25 +00:00
Neil Brown
a6452f93df Added a ShowOccam and ShowRain instance for lists of things 2008-03-20 16:34:11 +00:00
Neil Brown
ecb82d13a8 Revamped the ShowCode module, transforming it to use the writer monad 2008-03-20 16:20:14 +00:00
Neil Brown
bd26f758b4 Added tests for annotating the types of list literals and ranges in Rain 2008-03-20 14:44:19 +00:00
Neil Brown
123936e71c Changed addOne to use Add not Plus (we can always define a plusOne...) 2008-03-20 12:30:07 +00:00
Neil Brown
713b5c3e5c Added a subExprs helper function to match the rest 2008-03-19 17:52:01 +00:00
Neil Brown
b496912c51 Fixed conflicts with Adam's dimension changes 2008-03-19 17:49:32 +00:00
Neil Brown
35ebd43f79 Fixed some error messages in the Types module 2008-03-19 17:02:45 +00:00
Neil Brown
45c2619307 Changed the rain parser to use ListLiteral for strings 2008-03-19 15:59:23 +00:00
Neil Brown
7baeb318f2 Adjusted the Types module to use the new types in array constructors 2008-03-19 13:21:42 +00:00
Adam Sampson
eb29e65bad Smarter tree traversals: "Scrap Your Uniplate".
This provides gmapMFor and gmapMFor2, which are like gmapM, but know what
they're looking for, and can therefore avoid going down branches of the tree
that won't contain any interesting types.

The basic approach is quite similar to Uniplate's PlateData: there's a function
(containsType) that'll tell you whether one type is contained somewhere within
another. However, unlike Uniplate, we build a static IntMap IntSet of the types
we need to know about, which allows rather quicker lookups. (I did try using
PlateData first.)

The result is that applyDepthM is now much quicker than it was before.
applyDepthM2 is a bit less impressive, which I assume is because it can't
really prune the tree much if it's looking for two types.

Future enhancements:
- convert more passes to use applyDepthM*;
- make gmapMFor* aware of constructors rather than just types, which should
  allow a bit more pruning.
2008-03-20 16:49:24 +00:00
Adam Sampson
e08aac59d3 Move Retypes checking from the occam parser into a pass.
This also fixes a bug in the original algorithm: it used to let you retype
[]INT to BYTE.
2008-03-19 19:38:56 +00:00
Adam Sampson
7f6cb6e0c3 Evaluate "(MOSTNEG INT) \ -1" correctly when evaluating constants.
This actually crashes older versions of GHC:
  Prelude Data.Int> (minBound :: Int32) `div` (-1)
  Floating point exception
2008-03-19 11:12:57 +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
54668d3ba2 Implement the RESCHEDULE intrinsic. 2008-03-15 11:00:11 +00:00
Adam Sampson
6df110dce4 Wrap QuickCheck tests into HUnit tests.
This means all the tests now get run as part of one list, and HUnit keeps track
of the number of failures for us. (The reason I was doing this was so that
tocktest will exit non-zero on QuickCheck test failure too.)

As part of this, I've reworked TestMain's main function quite a bit. It'll now
filter QuickCheck tests into response to options too.
2008-03-12 19:38:02 +00:00
Adam Sampson
8120a75186 Clean up TestUtils.
Reorder functions in categories, and add some folds so it's easier to navigate.
2008-03-12 18:27:30 +00:00
Adam Sampson
808277ca84 Remove now-unused code for running timed tests. 2008-03-12 18:21:22 +00:00
Neil Brown
c778ff0031 Fixed some unused module import warnings, now that PassM is not build of monad transformers 2008-03-10 17:19:45 +00:00
Neil Brown
9f18b348e8 Corrected all the tests to use the new PassM monad 2008-03-10 17:07:48 +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
8030161a90 Changed bytesInType to use the new module for getting the size of the bool and int types 2008-03-07 21:24:20 +00:00
Neil Brown
256ce80ccb Moved all the testPass* functions into the TestMonad, using unsafePerformIO for running them inside QuickCheck 2008-03-05 16:06:14 +00:00
Neil Brown
03eab6c142 Fixed some typing relating to QuickCheck and the TestMonad to avoid type ambiguities in future 2008-03-05 16:04:30 +00:00
Adam Sampson
2f7539bcdb Convert the C backend to the new CIF API (mostly).
Most of this is mechanical: changing function names, and carrying the "wptr"
argument around. I've made the code for computing Expressions from Structureds
a bit more generic too.

The only complex bit is the handling of PAR processes, which I'm not very happy
with at the moment; they used to use the normal C calling convention, but now
you need to pack the arguments into the workspace. I'm handling this at the
moment by generating wrapper functions that do the unpacking, but it would be
better in the future to make the wrapper PROCs that we already generate have
the right interface.

This won't work for programs that use any of the top-level channels yet, since
there are no handlers for them.
2008-03-07 17:50:10 +00:00
Neil Brown
f5022228ba Fixed typeOfSpec to use the recorded type rather than trying to dig it out of the inner expression/variable 2008-02-29 16:33:33 +00:00
Adam Sampson
8f2575819b Initial implementation of the occam-pi preprocessor.
This implements #DEFINE, #UNDEF, #IF, #ELSE and #ENDIF, macro expansion with
##, and TRUE, FALSE, AND, OR, NOT and DEFINED within #IF expressions, with the
same semantics as occ21.

The macro COMPILER.TOCK is always defined by default, so you can now say things
like "#IF NOT DEFINED (COMPILER.TOCK) ... #ENDIF".
2008-02-28 20:27:30 +00:00
Adam Sampson
62b9c9b105 Prefix pass test output with the pass name ++ ": " consistently. 2008-02-28 16:51:53 +00:00
Neil Brown
1afea6c62c Fixed underlyingType not recursing properly into the inner types in arrays 2008-02-27 18:23:53 +00:00
Neil Brown
245e4536bc Fixed signed hexed values in the constant folder 2008-02-27 14:00:28 +00:00
Neil Brown
93a3c81255 Fixed the right-shift in the constant folding to be an unsigned (logical, non sign-extending) shift 2008-02-27 12:45:29 +00:00
Neil Brown
5807c59edf Moved the three Flow modules out to a new flow directory 2008-02-26 15:07:07 +00:00
Neil Brown
decf249c51 Moved AST, CompState and Metadata out to a new data directory (along with the generated OrdAST and TagAST) 2008-02-26 15:02:13 +00:00
Neil Brown
bca3f89872 Adjusted the QuickCheck tests, now that Alt is handled properly 2008-02-26 14:34:46 +00:00
Neil Brown
b4ee07a3a7 Fixed a few comments in FlowAlgorithms 2008-02-26 14:24:33 +00:00
Neil Brown
9ba8d30aa0 Added the handling of ALTs to the control-flow graph 2008-02-26 14:20:45 +00:00
Neil Brown
4dbeabb5dc Added the first group of tests for handling ALTs in the control-flow graph building 2008-02-26 14:19:57 +00:00
Neil Brown
4f05f0126f Made decompN check the constructor, and added a short test accordingly 2008-02-25 13:39:28 +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
caff04c548 Changed the use of everywhereM in underlyingType to use makeGeneric instead 2008-02-24 15:52:09 +00:00
Neil Brown
d5773ee4e0 Changed two uses of gmapQ (const undefined) to the similar glength function in the SYB library 2008-02-24 12:32:25 +00:00
Neil Brown
13c46d1fb2 Moved three pass-related modules out to their own directory 2008-02-24 12:32:21 +00:00
Neil Brown
6d9534f9b9 Made running the properties configurable by a --sanity-check command-line option 2008-02-24 12:15:02 +00:00
Neil Brown
ae49d236d6 Changed findMeta so that it would work even if the Meta data was not the first direct child of an item 2008-02-23 18:33:39 +00:00
Neil Brown
6a3452f8cd Added a useful function to Pass for applying a modification function to the Only parts of a Structured 2008-02-23 18:32:29 +00:00
Neil Brown
e8189e196b Removed the makePasses functions that did not deal with pre- and post- properties 2008-02-19 09:49:14 +00:00
Neil Brown
5cb964092d Added a new module full of properties about the AST, most now with associated validity checks 2008-02-19 09:49:05 +00:00
Neil Brown
2e6718ac50 Changed all the lists of passes to add pre- and post- properties 2008-02-19 09:43:40 +00:00
Neil Brown
859a6286ac Added functions to PassList that build a dependency graph from a list of properties (based on their pre- and post- properties) and use it to return an ordered pass list 2008-02-19 09:43:16 +00:00
Neil Brown
79f67d577f Added functions that allow you to specify the pre- and post- properties for a pass 2008-02-19 09:37:20 +00:00
Neil Brown
2bbcd4ec9a Added Eq and Ord instances for the Pass_ data structure (going solely by pass name) 2008-02-19 09:36:41 +00:00
Neil Brown
360abc195e Moved the enabling/disabling of passes based on CompState from PassList to the point of the declaration of the passes 2008-02-16 11:09:25 +00:00
Neil Brown
3ce0eaf452 Made the first adjustment to the Pass system, ready to introduce properties and a dependency graph. For now passes are still executed in list order 2008-02-16 10:19:14 +00:00
Neil Brown
e76ab116cb Simplified the definition of mkPattern slightly 2008-02-15 17:16:20 +00:00
Neil Brown
cd6e2175f2 Added a new "dump AST" pass 2008-02-14 12:45:11 +00:00
Neil Brown
63af1381f2 Reordered the pass list so that the usage checking happens earlier 2008-02-11 01:16:27 +00:00
Neil Brown
1151fab5ad Changed the error reporting so that we at least print the meta tag if we can't open the file to find the line 2008-02-11 01:15:56 +00:00
Neil Brown
57833f7f26 Fixed the broken QuickCheck tests for node replacement 2008-02-10 21:21:03 +00:00
Neil Brown
5e87aa1e73 Refactored the way the flow-graph building handles the different Structured items, and tweaked some tests accordingly 2008-02-10 20:07:02 +00:00
Neil Brown
c4b7bd1745 Implemented handling of replicated IFs in flow-graphs 2008-02-10 15:16:46 +00:00
Neil Brown
df8f9429e0 Added some tests for building flow-graphs based on replicated IFs 2008-02-10 15:16:30 +00:00
Neil Brown
534fbd8db1 Added a new helper function to Utils, and corrected a comment too 2008-02-09 14:50:56 +00:00
Neil Brown
914e9c3d71 Added a new test framework, based on simple monads, to allow easy unification of HUnit and QuickCheck tests with the minimum of work 2008-02-08 16:56:32 +00:00
Neil Brown
64d7b35cfe Changed all the usage check passes to use CSMR, and thus changed usageCheckPass to be a PassR rather than Pass 2008-02-08 13:43:28 +00:00
Neil Brown
b037b6a8ca Tidied up the new code relating to warnings, and moved it all into the Errors module (out of CompState and Pass) 2008-02-08 13:31:37 +00:00
Neil Brown
f17ff5071c Added a Warn monad for warnings, and incorporated a WriterT monad into the PassM stack to support the Warn monad, then changed all the rest of the code accordingly, including adding a Warn instance for the GenParser parser that hides it in the state 2008-02-08 13:22:23 +00:00
Neil Brown
95cdb39789 Generalised the type of the monad for the excludeConstr function, and correspondingly the functions that use it 2008-02-08 11:33:19 +00:00
Neil Brown
035c526bef Changed the TLP and PrettyShow modules to use CSMR instead of CSM 2008-02-08 11:29:09 +00:00
Neil Brown
c56cc6022a Switched everything in the EvalConstants module to use CSMR rather than CSM 2008-02-08 11:26:35 +00:00
Neil Brown
a3ebd96a86 Changed all the functions in the EvalLiterals, Types and ShowCode modules to use CSMR (instead of CSM) 2008-02-08 11:24:37 +00:00
Neil Brown
5f0eea493e Switched all the appropriate functions in CompState from CSM to CSMR 2008-02-08 11:24:16 +00:00
Neil Brown
de81b0e81c Added a version of PassM that only requires read access to the state (i.e. needs CSMR) called PassMR 2008-02-08 11:21:42 +00:00
Neil Brown
e3e9e912f2 Added a read-only version of CSM, named CSMR 2008-02-08 11:17:50 +00:00
Neil Brown
4299951511 Moved the makeSize function from ArrayUsageCheck into Utils 2008-02-06 23:49:17 +00:00
Neil Brown
1fd85fbe51 Added the -fwarn-missing-signatures option and added all missing type signatures for non-test modules (and most for test modules too) 2008-02-05 23:06:03 +00:00
Neil Brown
673d6a4f76 Reverted a change in the PrettyShow module because I'm no longer confident about it (original behaviour definitely worked) 2008-02-05 22:39:38 +00:00
Neil Brown
445d45752d Fixed the mode for printing out the flow-graph 2008-02-05 22:36:37 +00:00
Neil Brown
005ee78f03 Corrected a couple of bugs in the code for generating flow-graphs for quickcheck tests 2008-02-05 22:24:18 +00:00
Neil Brown
c001455fc2 Added a check for an empty list to oneofL 2008-02-05 22:18:22 +00:00