Neil Brown
46a1cc311f
Moved a couple of fields related to Rain type checking out of CompState and into a temporary StateT monad for the appropriate pass
2008-12-02 20:59:26 +00:00
Neil Brown
80c99d3bd7
Fixed another use of Map.lookup in the tests
2008-11-28 11:38:29 +00:00
Neil Brown
b48129d4e5
Fixed some uses of Map.lookup that used the old system of it working with any monad (in GHC 6.10, it's always Maybe)
2008-11-28 11:38:06 +00:00
Neil Brown
ee62c604fc
Renamed our permutations function to permutation to avoid a conflict with a new GHC 6.10 function
2008-11-28 11:28:39 +00:00
Neil Brown
09e0e46ec2
Added some comments to my changes to GenericUtils
2008-11-25 18:06:14 +00:00
Neil Brown
77b75e3134
Fixed a couple of outdated comments by checkUnusedVar
2008-11-25 17:43:16 +00:00
Neil Brown
ce03f2ca27
Fixed the nasty hack of checking for _sizes by checking the new NameSource field instead
...
To avoid problems with removing _sizes variables, we simply don't remove any nonce variables.
2008-11-25 17:42:00 +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
7fdef8f75a
Added the checkUnusedVar check to the standard pass list
2008-11-25 17:36:23 +00:00
Neil Brown
393bb75eb4
Corrected the accum stuff to rebuild after substitute is called
2008-11-24 10:47:00 +00:00
Neil Brown
5bb528fbc3
Changed from using monoid (which always concatenated) to using prepending, but I'm not sure it's any faster
2008-11-24 10:41:30 +00:00
Neil Brown
4af8845142
Changed checkUnusedVar to use the new forAnyASTStructBottomUpAccum function
2008-11-24 10:30:30 +00:00
Neil Brown
0eab9a216d
Got the forAnyASTStructBottomUpAccum function working properly, but I think list concatenation is a bit slow
2008-11-24 10:29:38 +00:00
Neil Brown
140eda94ee
Shifted some instances for CheckOptASTM to the more general CheckOptASTM'
2008-11-24 10:26:08 +00:00
Neil Brown
c79a1ca94c
Added a missing header include in tock_support.h that the newer GCC complains about
2008-11-23 19:44:37 +00:00
Neil Brown
5167535766
Got a messy version of applyAccum to compile, but now need to wire it up and test it
2008-11-23 12:48:15 +00:00
Neil Brown
0275615f5e
Generalised CheckOptFlowM to have the accumulation mechanism, but left it largely unused for now
2008-11-21 21:04:10 +00:00
Neil Brown
373214efb5
Renamed the forAnyAST functions to indicate their top-down nature and refactored doTree/apply slightly
2008-11-21 20:32:04 +00:00
Neil Brown
40318ac152
Changed checkUnusedVar to an incredibly slow version using "fastListify"
...
The problem is that it runs fastListify on a name's scope for every node it encounters, so something like O(M*N). This needs fixing, obviously.
2008-11-21 19:23:37 +00:00
Neil Brown
d529d78846
Added a slightly hacky fastListify function built on top of applyDepthM
2008-11-21 18:54:23 +00:00
Neil Brown
ae7557d623
Corrected a bug in varsTouchedAfter that was related to flowAlgorithm and was causing the odd bug in checkUnusedVar
2008-11-20 15:39:28 +00:00
Neil Brown
be6c57ce5b
Corrected some of my documentation of flowAlgorithm that has repeatedly confused me ever since I wrote it
2008-11-20 15:39:06 +00:00
Neil Brown
e117422c31
Added a couple more tests for checkUnusedVar which has revealed two bugs
...
One of these bugs is that array variables are counted as unused when they are used subscripted. I think that should be solved when we flip back to the listify approach.
The second bug is more interesting, as it is triggered only in a certain arrangement with an IF. It's either a bug in the flow-graph building or in the varsTouchedAfter code.
2008-11-20 15:06:36 +00:00
Neil Brown
5f9bd6b829
Fixed checkUnusedVar to also remove the unused variable from the compiler state
2008-11-20 14:31:29 +00:00
Neil Brown
f60eee19d5
Added some MonadState instances to allow access to the compiler state in the CheckOptM and similar monads
2008-11-20 14:31:16 +00:00
Neil Brown
432d98eaee
Swapped testUnusedVar over to the new occam EDSL, which revealed a flaw in the pass that it was not removing the names from the state
2008-11-20 14:21:36 +00:00
Neil Brown
5f01f12d43
Adjusted testOccamPassWarn to enable all warnings when testing a pass
2008-11-20 14:20:36 +00:00
Neil Brown
558ceec4c2
Wired up the enabling and disabling of warnings
2008-11-20 14:17:11 +00:00
Neil Brown
6cbdc0e13b
Finally merged the list of warnings into CompState rather than having its own StateT monad
2008-11-20 13:35:44 +00:00
Neil Brown
a455676fa9
Added all the necessary command-line options for enabling and disabling warnings in the Main module
2008-11-20 13:26:45 +00:00
Neil Brown
f88c671cf7
Added a set of enabled warnings to CompState
2008-11-20 13:17:05 +00:00
Neil Brown
53240825dd
Changed checkInitVar to use the new CheckFramework stuff, and forAnyFlow (it still passes all its tests)
2008-11-20 13:02:38 +00:00
Neil Brown
0733eb6c11
Added a CheckOptFlowM monad, and a few functions for working with this monad (scanning each node of the AST in turn)
2008-11-20 13:01:48 +00:00
Neil Brown
3638e7b974
Renamed CheckOptM' (which was always a bad name) to CheckOptASTM
2008-11-19 18:24:04 +00:00
Neil Brown
38374320a3
Moved the remainder of the checkInitVar tests over to the new system
2008-11-19 17:25:02 +00:00
Neil Brown
3b57d43eb6
Moved more of the checkInitVar tests to the new system
2008-11-19 17:08:17 +00:00
Neil Brown
810c798dac
Added some copies of the checkInitVar tests that use the new occam EDSL testing instead of the old method
2008-11-19 16:53:13 +00:00
Neil Brown
f4ff507543
Moved wrapProcSeq into the TestUtils module
2008-11-19 16:09:31 +00:00
Neil Brown
3b166490f1
Commented out the debugging output in the check framework and tests
2008-11-19 16:04:25 +00:00
Neil Brown
d81810e506
Tidied up some of the code in the CheckFramework module
2008-11-15 00:23:45 +00:00
Neil Brown
5e909affbb
Corrected the traversal mechanism to continually iterate the function until a fixpoint is reached (indicated by an Either mechanism, rather than an equality test, since the user must substitute explicitly)
2008-11-15 00:04:51 +00:00
Neil Brown
0340fae4ad
Simplified the monad, modification and restart mechanism to both modify the state and modify in place
2008-11-14 23:20:43 +00:00
Neil Brown
fec7510f3a
Stopped warning about the _sizes variables being unused (but do remove them)
2008-11-14 19:30:11 +00:00
Neil Brown
bf2409d311
Got the unused variables pass working, but only by restarting from the root of the AST every time, rather than by navigating to the right spot
2008-11-14 19:23:12 +00:00
Neil Brown
c055b35d68
Simplified the code slightly, since I was wrapping some things in a Maybe that didn't really need to be
2008-11-14 16:45:50 +00:00
Neil Brown
e5ed7e07b7
Fixed the apply function, which (mainly due to having the wrong type signature, but also its use of extTransformRoute) was not as polymorphic as it should have been, which was breaking the traversal (I think it would only work on one Structured type)
2008-11-14 15:30:02 +00:00
Neil Brown
9be287f157
Fixed the C++CSP backend's use of channels (this fixes occam but probably breaks Rain, but I can come back to it later)
2008-11-13 21:00:56 +00:00
Neil Brown
377233b4b0
Switched checkUnusedVar over to use forAnyASTStruct
2008-11-13 20:12:45 +00:00
Neil Brown
16a2be40b4
Made the doTree and similar functions more polymorphic, and added forAnyASTStruct
2008-11-13 20:10:43 +00:00
Neil Brown
048bd26be3
Moved the holding of the route out from RestartT (which now just deals with restarting) and into CheckOptM' (which was previously a fairly needless wrapper)
2008-11-13 19:59:41 +00:00