Commit Graph

2343 Commits

Author SHA1 Message Date
Neil Brown
936382a3ca Renamed labelFunctions to labelUsageFunctions, to make it clearer what the functions are for 2008-06-05 20:16:02 +00:00
Neil Brown
ac3d1ed42a Reordered the type parameters for the FNode' type in the flow graph, and made it a functor over the label 2008-06-05 20:11:13 +00:00
Neil Brown
64e86b22fe Fixed some StructureOccam tests that were broken recently by the change in the Token type 2008-06-06 13:14:34 +00:00
Adam Sampson
ab416326ad Make Token a real data type.
Previously it was a tuple, which meant it couldn't have sensible
custom instances. Token and TokenType now have Show instances, so we
get more useful output when parsing fails.
2008-06-05 09:46:52 +00:00
Neil Brown
069cfd9a9f Fixed the pulling up of replicators when they are free names (something that was broken in the original Rep change) 2008-06-04 19:06:05 +00:00
Neil Brown
e2dac3aa76 Simplified freeNamesIn by removing what is an unnecessary case for replicators 2008-06-04 19:05:31 +00:00
Neil Brown
cfbdfc555e Fixed a discrepancy between the C and C++ backends over generating the code for replicators 2008-06-04 18:53:42 +00:00
Neil Brown
4c726352a4 Removed an obsolete failing Rain test 2008-06-04 18:44:07 +00:00
Neil Brown
5bc88ec1fc Fixed another test that was broken during the change to Rep 2008-06-04 18:43:50 +00:00
Neil Brown
a417708cda Fixed some of the flow graph tests that were broken by the change to Rep 2008-06-04 18:32:16 +00:00
Neil Brown
41ff60cb78 Removed the Rep constructor from Structured and instead added a Rep constructor to SpecType
This way, all replicators are declared like other names, and their scope is considered replicated.  This simplifies the code a little.

Fixes #55
2008-06-04 17:00:43 +00:00
Neil Brown
9066d4112b Removed all the PassR and PassMR stuff, now we just have Pass and PassM 2008-06-03 16:30:10 +00:00
Neil Brown
21329287e2 Fixed a problem with GHC 6.6 and the new pass mechanism by removing all the dollars that were confusing the type-checker 2008-06-03 16:16:26 +00:00
Adam Sampson
f2352019ab Implement INITIAL and RESULT abbreviations.
This adds the passes to transform INITIAL into the correct form.

Fixes #42.
2008-06-03 14:57:24 +00:00
Adam Sampson
6ee21f76c9 Initial work on supporting INITIAL and RESULT abbreviations.
This fixes the AST, parser and typechecker, and adds a pass to
transform Result back into Abbrev, but doesn't transform Initial yet.
(It actually works for trivial stuff anyway, but it won't do the right
thing for complex types or PROC parameters.)

It appears (to me) to make sense to support INITIAL/RESULT reshaping
and retyping too, so this does.

Refs #42.
2008-06-02 20:41:37 +00:00
Adam Sampson
f811d2cdc9 Clean up some remaining messy code after the passes rework. 2008-06-02 17:04:30 +00:00
Adam Sampson
13668f6e32 Change the property-checking code to use Neil's new pass structure. 2008-06-02 17:03:41 +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
Neil Brown
6f6538ed57 Added more helper functions to the Pass module for constructing passes 2008-06-02 14:21:56 +00:00
Neil Brown
59e0922263 Added a new operator to Utils (>.>, the flipped version of <.<) 2008-06-02 14:09:33 +00:00
Neil Brown
0adbdda126 Moved all the pass information about the Rain passes into their definition (rather than the pass list at the top)
As part of this patch, I have also introduced a helper function that fiddles the type system for those passes that must run at the top-level (i.e. on A.AST) rather than on any Data t.  They will give an error if not applied at the top-level.
2008-06-02 12:51:14 +00:00
Adam Sampson
3e56aa0671 Reenable the --sanity-check option.
The code now adds extra passes to check that properties hold when sanity
checking is enabled.
2008-06-02 14:55:56 +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
13ea7f2c4b Resolve conflicts after merge. 2008-06-02 10:28: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
77a718f078 Remove another obsolete comment. 2008-05-30 14:13:24 +00:00
Adam Sampson
9749d58f09 Remove an obsolete comment. 2008-05-30 12:24:46 +00:00
Neil Brown
104bdf5d0a Fixed genBytesIn for mobile and list types in the C backend 2008-06-01 19:50:53 +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
5301b83148 Added code to actually make the implicit mobility decisions take effect in the tree 2008-06-01 19:28:22 +00:00
Neil Brown
231d037cb3 Added a pass to turn all List types into Mobile List 2008-06-01 19:26:40 +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
4b6fa48cd3 Labelled some of the data type parameters better in the FlowUtils module 2008-06-01 17:58:01 +00:00
Neil Brown
3aecc9be3f Quickly fixed an old broken GenerateC test for lists 2008-06-01 17:29:36 +00:00
Neil Brown
d4938a166c Fixed some more Rain tests related to the old method of inferring types 2008-06-01 17:21:14 +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
edbfea163f Changed FlowGraphTest to compile against my latest changes 2008-05-30 19:44:26 +00:00
Neil Brown
fe525fa088 Simplified the deriving clause for Var in UsageCheckUtils, effectively using the GHC NewTypeDeriving extension 2008-05-30 18:39:59 +00:00
Neil Brown
600ce667cb Refactored the code for making and printing out the move/copy decisions in the ImplicitMobility module 2008-05-30 18:28:40 +00:00
Neil Brown
46ef8e7e65 Annotated the move Rain testcase with the expected results 2008-05-30 18:28:19 +00:00
Neil Brown
a7944ddf9f Changed the move testcase to use the correct Rain TLP interface 2008-05-30 17:32:06 +00:00
Neil Brown
947f252e66 Corrected the implicit mobility so that it now works properly on the Rain move testcase 2008-05-30 17:29:21 +00:00
Neil Brown
a5fca4816b Added the beginnings of support for implicit mobility for Rain (just printing out the decisions for now) 2008-05-30 17:16:10 +00:00
Neil Brown
0746219984 Added support for recording terminator nodes (as well as root nodes) while building the flow graph 2008-05-30 17:15:52 +00:00
Neil Brown
f444d81f89 Changed flowAlgorithm to give a better error message when something internal goes wrong 2008-05-30 17:14:42 +00:00
Neil Brown
c4702a7f6e Added a new helper function, eitherToMaybe in Utils 2008-05-30 17:14:28 +00:00
Neil Brown
1a1e78a9c4 Added a dummy Show instance for UsageLabel 2008-05-30 16:41:08 +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
Neil Brown
d623c82b3b Removed some of the bad uses of findMeta (where no meta tag would be found) from the Rain parser 2008-05-30 16:39:58 +00:00