Commit Graph

1719 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
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
Neil Brown
05c16b77d3 Added comments to the flowAlgorithm function and tweaked the names to make it clear it can do forward or backward analysis 2008-05-23 15:38:03 +00:00
Neil Brown
60eb320ee0 Separated FlowGraph into two modules (the new one being FlowUtils) 2008-05-23 14:52:25 +00:00
Adam Sampson
397ba6a3f5 Add some missing type constraints.
These were tripping GHC 6.8's monomorphism restriction warning.
2008-05-26 17:41:38 +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
d8d6ab12cc Generate size arrays using IsExpr rather than Is.
This wasn't actually wrong, but everywhere else uses IsExpr for Val
abbreviations.
2008-05-26 17:19:25 +00:00
Adam Sampson
d9e00294f9 Format a NameDef constant more nicely. 2008-05-26 17:17:59 +00:00
Adam Sampson
a7877ecd68 Make applyToOnly more general, and use it in more places.
This simplifies several bits of code that are doing things with Structureds.
2008-05-25 22:36:54 +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
Adam Sampson
b413cf3dc2 Fix some broken Haddock. 2008-05-25 18:49:15 +00:00
Adam Sampson
5d8d96fb7a GenerateC doesn't need Text.Regex any more. 2008-05-25 18:42:18 +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
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
0627ff2b4f Changed the Rain TLP interface to use lists for output streams as I'd originally intended 2008-05-21 00:20:29 +00:00
Neil Brown
0b1708c241 Added the equality operator for tockList in the C++ support code 2008-05-21 00:20:11 +00:00
Neil Brown
11588b34a3 Fixed a bug where transformConstr would skip over the second of two nested definitions of array constructors 2008-05-20 23:44:32 +00:00
Neil Brown
48fbf5f3e1 Added pulling up of list literals and list-constructed expressions 2008-05-20 23:44:07 +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
e5d8b51827 Added a missing line to substitute back inferred types for anonymous non-numeric types 2008-05-20 22:08:15 +00:00
Neil Brown
8c78d056b6 Improved display of unknown types (for debugging, really) 2008-05-20 22:07:35 +00:00
Neil Brown
926659cf70 Fixed the Rain lists testcase to adhere to the new type unification scheme 2008-05-20 21:56:25 +00:00