Commit Graph

33 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
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
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
1d73b56988 Adjusted the PassList module to work with the adjusted Pass type synonym 2008-12-14 18:29:09 +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
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
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
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
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
8943b767eb Fixed the SimplifyTypes module
This fixes Trac ticket #46.  The pass for masking out state bodies has been moved to PassList (since it's so small and should be run first) for now, and SimplifyTypes has had its previous two passes merged into one.
2008-05-21 13:12:49 +00:00
Neil Brown
9f411bfd45 Fixed the Rain passes so that the order correctly satisfies the pre-requisites 2008-05-21 12:46:51 +00:00
Neil Brown
4537cd205c Fixed the occam pass list so that it now has the correct order in respect to all the pre-requisite properties 2008-05-21 12:30:04 +00:00
Neil Brown
15cf63980f Changed the pass mechanism to use a fixed list again rather than use the dependency graph
This fixes ticket #47 from Trac, which explains how using a dependency graph for passes was a bit too over the top, and led to unexpected results.  Under the "new" (the original!) system, the pass list is used as-is, but the dependencies are checked to make sure the pass list order isn't wrong.  In future we should also add back running the properties at the appropriate point (currently disabled).
2008-05-21 12:26:32 +00:00
Neil Brown
142926172d Fixed the error message given when there is a problem with the pass dependency graph 2008-03-21 14:51:54 +00:00
Adam Sampson
89040a97b0 Move the dummy occam pass into an OccamPasses module.
(The plan is to gradually replace it with real passes.)
2008-03-15 14:40:17 +00:00
Neil Brown
4c1f2a1930 Adjusted the C++ (a lot) and C (a little) backends to reflect array _sizes changes, and added the new array passes to the overall pass list
Now that I have begun moving all the _sizes stuff forward into proper compiler passes, much of the code for handling arrays in the backends is going to become redundant:

- The tockArrayView class should eventually disappear; now that _sizes are pulled forward, there's no advantage of having this extra class (compared to just doing C and C++ arrays in the same, C-based, style)
- The declaration and use of the _sizes array everywhere should go, now that it is inserted in an earlier pass

I haven't removed as much as I should from the C backend; I am wary to touch it when Adam is about to move it over to the new CIF anyway
2008-03-06 19:08:38 +00:00
Neil Brown
13c46d1fb2 Moved three pass-related modules out to their own directory 2008-02-24 12:32:21 +00:00