Commit Graph

315 Commits

Author SHA1 Message Date
Neil Brown
f73171140c Fixed a subtle bug with conflicting abbreviation modes in the PROCS generated to copy records 2009-03-23 21:08:40 +00:00
Neil Brown
41805aaacf Changed the ChanEnd constructor to only keep information about its shared-ness, not about the whole channel 2009-03-23 18:40:28 +00:00
Neil Brown
228523e7e7 Added the generation of IsDefined checks, and stopped them being applied to derefenced arrays 2009-03-23 15:48:24 +00:00
Neil Brown
be36af4bf0 Added a work-around for resolving user defined types in the CompState 2009-03-22 22:31:49 +00:00
Neil Brown
81ebebe4fe Added a quick work-around in SimplifyAbbrevs for the SYB-Map issue 2009-03-22 00:32:56 +00:00
Neil Brown
f5ce1c8f89 Added the code to mobilise arrays inside protocols 2009-03-20 11:26:54 +00:00
Neil Brown
65875f523f Added mobile cloning rather than using dereferencing to copy mobiles 2009-03-19 16:47:31 +00:00
Neil Brown
2e99bcfc5e Added the mobilisation of process parameters, but I think I need to clone, not dereference 2009-03-19 15:45:49 +00:00
Neil Brown
8abd09758c Fixed the implicit mobility module to mobilise arrays inside channels 2009-03-19 15:23:56 +00:00
Neil Brown
26824883d6 Changed the implicit mobility to only look at mobile variables, and recorded what future use is causing a copy decision 2009-03-19 14:00:59 +00:00
Neil Brown
823592bd1d Added some passes to mobilise non-mobile arrays 2009-02-27 17:12:08 +00:00
Neil Brown
6d112a244e Fixed when names are exempted from abbreviation checking by the PERMITALIASES pragma 2009-02-11 13:15:25 +00:00
Neil Brown
152f5fc252 Changed the abbreviation checking so that it doesn't check nonce names
When we pull up names (which happens before abbreviation checking), we create a lot of nonces with greater scope than the original variables.  When we go to abbreviation check this, we therefore set off lots of false alarms about originally safe code.  So to fix this, the easiest method seems to be turning off checking on all the names introduced by the compiler.
2009-02-11 11:23:39 +00:00
Neil Brown
e37fa37c79 Recoded abbrevCheckPass so that it is much more efficient (now does everything in one pass of the AST) 2009-02-10 13:14:45 +00:00
Neil Brown
9d44e3475c Swapped some uses of listify to fastListify, but the abbreviation checking is still very slow 2009-02-10 12:49:54 +00:00
Neil Brown
bcd670bfd2 Fixed a couple of problems with the usage checking 2009-02-10 12:40:24 +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
14df1e09b7 Corrected some problems caused by moving the direction specifiers up to the whole array (the array wasn't then being pulled up) 2009-02-10 00:28:45 +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
359763380e Fixed the test for the transformConstr pass 2009-02-03 12:37:32 +00:00
Neil Brown
502c61b01e Fixed the expansion of array literals to be more like it used to be
All the usual cgtests now compile and run
2009-02-02 23:51:57 +00:00
Neil Brown
bf365ee41a Fixed the pass that turns array constructors into replicated loops so that it handles nested array constructors and inner-procthens properly
cgtest80 now compiles and passes
2009-02-02 18:27:38 +00:00
Neil Brown
96934c871d Changed the transformation of array constructors so that it also pulls out all the specs that were pulled up to be just inside them 2009-02-02 17:36:14 +00:00
Neil Brown
ebf8ae2d83 Added a pull up context just inside the replicators for array constructors 2009-02-02 17:35:46 +00:00
Neil Brown
51acf8abb5 Made sure to change the abbreviation for VAL array things that are now being assigned to via a loop as initialisation 2009-02-02 17:34:44 +00:00
Neil Brown
88d6136dcf Stopped the expansion of inner array literals into subscripted elements
This expansion was causing a big blow-up in the code, as things like:

VAL [2][1]INT as IS [[0,1]]

were getting transformed into:

VAL [2]INT n0 IS [0,1]:
VAL [2]INT n1 IS [0,1]:
VAL [2]INT n2 IS [n0[0], n1[1]]:
VAL [2][1]INT as IS [n2]:

Or something similar -- the inner arrays were pulled up into multiple definitions that were then subscripted, because the first pull-up did this:

VAL [2]INT n2 IS [[0,1][0], [0,1][1]]:

and then the inner arrays got pulled up again, separately.  The change hasn't immediately broken anything, but I haven't fully tested it yet
2009-02-02 17:30:39 +00:00
Neil Brown
40b9a8b76b Fixed the generated PROCs for copying records not having their definition recorded 2009-02-02 17:23:28 +00:00
Neil Brown
460ee36247 Fixed the pulling up of array constructors into initialisers
Previously, this was only pulling up constructors that contained single elements, and not constructors that contained multiple elements
2009-02-02 16:17:00 +00:00
Neil Brown
3458a9197a Adjusted the backends and transformations module to match the new array literal changes 2009-02-01 21:53:17 +00:00
Neil Brown
4f83187549 Fixed up all the tests in light of the new recursive procs 2009-01-29 00:56:32 +00:00
Neil Brown
8a28d765e7 Implemented recursive procs
This works fine in the C++ backend, not tested with the C backend yet
2009-01-29 00:43:24 +00:00
Neil Brown
10e6b4ce02 Updated all the tests to work with the new recursive functions 2009-01-29 00:34:12 +00:00
Neil Brown
7722e95dfd Added support for recursive functions (not procs, yet)
At the moment, the information is only needed in the parser, which must define recursive names before parsing the body of the function.  But in future, we should keep the information when the function becomes a proc, and then the C/C++ backends may need to use it (for example, when calculating stack space usage)
2009-01-29 00:27:11 +00:00
Neil Brown
6693a8b8b9 Changed things in the transformations directory in light of the new step count 2009-01-28 23:46:04 +00:00
Neil Brown
15a4a59bcf Stopped the pass that removes unused variables removing unused replicators 2009-01-23 14:24:44 +00:00
Neil Brown
1f4796e07f Fixed all the tests to reflect the new channel-end system, such that they all pass again
This is the last patch (for now) of the set implementing the new channel-end system
2009-01-20 17:41:44 +00:00
Neil Brown
766cb09dcf Changed pullUp to pull up channel arrays that have direction specifiers applied to the whole array
For example, a call like foo(6, cs!) will have cs! pulled up, iff cs was of type CHAN X.  If cs was of type CHAN! X, nothing is done (and the needless direction will be removed later on).
2009-01-20 17:33:24 +00:00
Neil Brown
6f22d8a573 Stopped the pulling up of fully-resolved array expressions where one of the subscripts is a slice
This was causing a problem in the C/C++ backends, where the slice function call was having _sizes appended to it.  So now we pull up anything that results in an array, or is a slice.
2009-01-15 22:44:11 +00:00
Neil Brown
9d1dfb7f5f Stopped arrays being pulled up when all the indices have been supplied 2009-01-15 21:36:05 +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
0e7a6c5b98 Added a NameSource field for NameDef that indicates where a name comes from 2008-11-25 17:36:42 +00:00
Neil Brown
2a15f4ef5f Filled in all the gaps such that the CheckTest tests now run (including some debug output, for now)
One of the tests fails at the moment because the specification node has two entries associated with it in the flowgraph.  One is the scope-in and one is the scope-out.  I think the analysis is currently picking the scope-out node and looking beyond that, where -- surprise, surprise -- the variable is not used again.  So I need some easy way of telling the flow analyses which of the two nodes I want to start from, in this case and other ones where I also add two nodes related to the same point in the AST.
2008-11-12 16:54:00 +00:00
Neil Brown
dc030acabe Changed the FlowGraph stuff to use the new Route type (that includes identifiers) rather than the bare functions as it used to 2008-11-10 14:01:30 +00:00
Neil Brown
bcad0c225f Converted the other pullRepCounts test over to the new system 2008-11-16 19:40:27 +00:00
Neil Brown
fe3dd78db3 Realised that pullRepCounts should pull the counts for PAR and ALT after all, and adjusted one test to reflect this 2008-11-16 18:43:34 +00:00
Neil Brown
bfacb526fb Converted one of the tests for pullRepCounts to use the new mechanism, which in turn exposed that the pass was not altering the definition in the state (which it may as well) 2008-11-16 18:25:53 +00:00
Neil Brown
771297632d Finished converting all the cases in testInputCase to use the new occam EDSL 2008-11-16 16:57:52 +00:00
Neil Brown
b82395dc81 Tried changing an existing test from using oZ to oA which revealed a problem with the csNames comparison (and matching the map orderings) 2008-11-16 13:05:30 +00:00
Neil Brown
278b80932e Converted one of the input case tests to use the occam EDSL, making it much clearer 2008-11-16 12:24:41 +00:00
Neil Brown
42e4ca5c92 Adjusted an existing testcase for the changes in OccamEDSL 2008-11-16 12:24:24 +00:00