Commit Graph

96 Commits

Author SHA1 Message Date
Adam Sampson
2c4ccfbf39 Update all the copyright notices.
I've checked these all against the Darcs history using a script
(check-copyright, in my misccode collection). Anything Neil or I did as
part of our PhDs is copyright University of Kent; more recent work
belongs to us, as appropriate.
2011-07-21 11:38:13 +00:00
Neil Brown
d98c5079ca Cleaned up all the warnings in Tock's code (most unused modules, or unused functions) 2009-05-19 09:05:38 +00:00
Neil Brown
853a52cc00 Finished the name change from Polyplate to Alloy
Most of this was a find-and-replace, PolyplateM -> AlloyA.  But I also fixed some of the opsets and removed types that were no longer needed, and so on.
2009-05-11 15:22:58 +00:00
Neil Brown
44eabe4baa Reworked Polyplate to have a simpler way of expressing opsets, and also simplified PolyplateM and PolyplateMRoute 2009-05-06 11:32:19 +00:00
Neil Brown
fcacdd3235 Turned csCurrentFile into a monad transformer variable, and added csCompilationHash to help in uniquifying names between files 2009-04-19 19:36:38 +00:00
Neil Brown
3a5565471f Added support for extended rendezvous throughout the compiler 2009-04-19 16:26:37 +00:00
Neil Brown
57ffc7bfa4 Split out a chunk of CompState into a CompOpts type for things that can be set on the command-line 2009-04-17 21:10:14 +00:00
Neil Brown
c0e2972717 Rejigged CSM to solve some problems with monad transformers 2009-04-17 17:39:23 +00:00
Neil Brown
f2c4ada01b Removed PolyplateSpine in favour of using PolyplateM (and the State monad) everywhere 2009-04-13 20:37:14 +00:00
Neil Brown
e409b15b58 Merged latest patches from trunk into Polyplate 2009-04-13 16:58:07 +00:00
Neil Brown
8f767ff0d4 Made all the imports of Data.Generics have an import list
This makes sure that we catch all leftover instances of using SYB to do generic operations that we should be using Polyplate for instead.  Most modules should only import Data, and possibly Typeable.
2009-04-09 15:36:37 +00:00
Neil Brown
e61a23855a Fixed all the conflicts while merging into the Polyplate branch 2009-04-09 11:01:39 +00:00
Neil Brown
effa8189b1 Disabled the pass that checks for unused variables for now as it runs too slowly 2009-01-28 15:48:31 +00:00
Neil Brown
5a10e94c6a Fixed various conflicts between the Polyplate branch and the latest changes in the trunk 2009-01-28 15:48:08 +00:00
Neil Brown
4672675ba8 Removed the GenericUtils module, now that everything uses Polyplate instead 2009-01-12 18:03:41 +00:00
Neil Brown
1d73b56988 Adjusted the PassList module to work with the adjusted Pass type synonym 2008-12-14 18:29:09 +00:00
Neil Brown
954664d238 Added some more type synonyms for checks and passes 2008-12-14 18:27:51 +00:00
Neil Brown
890e7ea9a6 Fixed many of the modules to use the new Polyplate-based Traversal system 2008-12-02 18:06:10 +00:00
Neil Brown
a3bcb32937 Switched the Pass and Traversal modules over to Polyplate, breaking most of the other modules 2008-12-02 17:33:55 +00:00
Neil Brown
229f2197af Turned findMeta into a member of a FindMeta type-class 2009-04-09 11:13:37 +00:00
Neil Brown
6cb47fd1c3 Fixed one of properties that involved AFTER 2009-04-08 10:19:38 +00:00
Neil Brown
e457d82f0c Changed FUNCTIONs and PROCs to have optional bodies, and put all the externals into the AST (without bodies)
This may seem like an odd change, but it simplifies the logic a lot.  I kept having problems with passes not operating on externals (e.g. functions-to-procs, adding array sizes, constant folding in array dimensions) and adding a special case every time to also process the externals was getting silly.

Putting the externals in the AST therefore made sense, but I didn't want to just add dummy bodies as this would cause them to throw up errors (e.g. in the type-checking for functions).  So I turned the bodies into a Maybe type, and that has worked out well.

I also stopped storing the formals in csExternals (since they are now in csNames, and the tree), which streamlined that nicely, and stopped me having to keep them up to date.
2009-04-04 14:56:35 +00:00
Neil Brown
cd36f383c9 Turned off unused variable checking for now -- I think it's bugged 2009-03-25 18:33:23 +00:00
Neil Brown
20f2fb2c14 Renamed squashArrays to backendPasses, since that's what it has become 2009-03-22 18:27:10 +00:00
Neil Brown
88077ce755 Cleared up a problem where passes from the Rain list could be enabled in occam and vice versa 2009-03-20 15:16:20 +00:00
Neil Brown
b970b9df33 Added command line options for occam 2 mobility, and turned it off by default 2009-03-19 11:38:48 +00:00
Neil Brown
823592bd1d Added some passes to mobilise non-mobile arrays 2009-02-27 17:12:08 +00:00
Neil Brown
cff10e2f28 Added a pass that checks that abbreviations are used properly 2009-02-10 11:32:10 +00:00
Neil Brown
979eec927a Added a pass that removes replicators with a count of 0, and turns replicators with a count of 1 into non-replicated things (with the appropriate abbreviation) 2009-02-04 11:30:57 +00:00
Neil Brown
dbc75ef0b1 Added a pass that helps stop some GCC warnings about literals equivalent to INT_MIN and similar 2009-01-27 13:00:08 +00:00
Neil Brown
2137be190b Added a PassMaker function for use when something should only be used with occam and the CCSP backend 2009-01-20 17:24:01 +00:00
Neil Brown
e6d9a88e14 Changed the CSM constraint on the various messages to CSMR 2009-01-15 21:00:27 +00:00
Neil Brown
0a98db5295 Changed pshow on CompState (which caused errors) to plain show, by adding a Show instance to CompState 2009-01-15 20:59:37 +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
d529d78846 Added a slightly hacky fastListify function built on top of applyDepthM 2008-11-21 18:54:23 +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
Adam Sampson
7a11d0b2c3 Include TypeSet in OpsM.
This means the TypeSet is only rebuilt when the ops are extended, not
each time the operation is applied (curse the unpredictability of
Haskell CAF optimisation).
2008-06-11 12:04:06 +00:00
Adam Sampson
62a0873d3d Implement channel direction decorators.
This is mostly straightforward: modify the parser to allow direction
decorators in the right places, and extend the type checker to match.
There's some slight awkwardness in that some of the Types functions
have to perform the same checks as the type checker (e.g. directing a
non-channel), so I've tidied up their error messages a bit.

At the backend, I've just added a little pass to strip out all the
DirectedVariables, since the other backend passes don't handle them
gracefully. From the occam/C point of view this is fine, but I'm not
sure if it's going to cause problems for C++.
2008-06-09 21:35:20 +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
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
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