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
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
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
20a142839f
Added the beginnings of list support for CCSP (using glib)
2008-03-25 18:44:49 +00:00
Neil Brown
89c25e3f6c
Added a type-class for retrieving the (AST) type of things
...
This patch hides all the old typeOfExpression, typeOfName, typeOfVariable, etc, and unifies them into a single type-class with an "astTypeOf" function. The type-class is currently named Typed, but that can easily be changed (it's only explicitly referred to in the Types module). The patch is essentially the type-class with a giant find-and-replace on the other modules.
2008-05-17 11:41:52 +00:00
Neil Brown
3daf82d318
Merged Alternative and AlternativeCond into a single Alternative item that always has a pre-condition
2008-04-03 14:52:37 +00:00
Adam Sampson
9e9459cb4a
Clean up EvalLiterals.
...
In particular, evalSimpleLiteral is now much nicer, and the error
messages should be a bit more comprehensible.
The signed types previously used a different version of fromRead that
passed an extra argument that it then didn't use; I've switched back to
the old version now, since it appears not to need it any more.
2008-04-08 00:29:23 +00:00
Adam Sampson
6fb8780cae
Make a pattern match more explicit.
...
This is looking at array dimensions in literals. By this point unknown
dimensions should have been inferred; if they haven't, I'd rather it blew up
here than caused bizarre behaviour later on.
(This is a good candidate for a property check.)
2008-04-06 15:38:59 +00:00
Adam Sampson
28f329dd07
Don't assume an empty array literal can be a string literal.
2008-04-06 15:33:18 +00:00
Adam Sampson
3fcf363a31
In AnalyseAsm, ignore labels that contain "." anywhere.
...
GCC appears to generate labels that look like "constantname.1234" for some
array constants.
2008-04-06 15:31:28 +00:00
Adam Sampson
17702401fa
Rewrite AnalyseAsm's parser.
...
It now just uses "words" and regular pattern matches rather than regular
expressions. The resulting code is quite a bit simpler, and goes much faster.
I've added some unit tests for it too.
2008-04-05 22:05:17 +00:00
Neil Brown
4ef1ff7196
Changed to a state monad for warnings, and added a runPassM function to remove duplicate code for running passes
2008-04-03 12:21:59 +00:00
Neil Brown
cba72045d7
Added a missing base case for transformActualVariable, when a subscripted variable is passed to a procedure
2008-04-03 11:24:47 +00:00
Neil Brown
20843f70a4
Corrected all the tests to use the new PassM monad
2008-03-10 17:07:48 +00:00
Neil Brown
d66fb79796
Fixed some unused module import warnings, now that PassM is not build of monad transformers
2008-03-10 17:19:45 +00:00
Adam Sampson
17da4db956
Make genActual(s) use the correct abbreviation mode.
2008-04-01 13:16:23 +00:00
Adam Sampson
40bf42e5ea
Remove obsolete CGenCall instance.
2008-03-29 23:24:50 +00:00
Adam Sampson
3283b7db41
Remove the Type/AbbrevMode information from Actual*.
...
It's redundant, since you can always compute them from the variable, and it
makes the code that deals with actuals rather cleaner.
On the other hand, it slightly complicates some of the tests, because any names
you use in an Actual need to be defined...
2008-03-26 18:16:09 +00:00
Neil Brown
986a4acb2b
Added support for a StreamReader (to support the input channel from stdin) to the C++CSP backend
2008-03-24 23:46:05 +00:00
Neil Brown
bbdb429498
Changed transformWaitFor (and its tests) to transform the new InputTimerFor into InputTimerAfter
2008-03-24 15:09:05 +00:00
Neil Brown
2d0d6463d5
Removed the handling of the old Rain Wait/GetTime items from the backends
2008-03-24 15:08:05 +00:00
Neil Brown
cbbafffbd2
Changed Rain to use the new timer type rather than things like the GetTime statement
2008-03-24 13:50:14 +00:00
Neil Brown
c68aa42277
Added a sub-type to Timers, to support multiple types
2008-03-23 22:20:16 +00:00
Neil Brown
fc4cac736b
Added the helper functions for adding and subtracting Times in C++CSP
2008-03-23 13:29:22 +00:00
Neil Brown
cc6dce5ead
Tidied up the export/import lists for GenerateC and GenerateCPPCSP
2008-03-23 12:40:06 +00:00
Neil Brown
bc7e682119
Added a Concat operator for lists, and added support for it (and list assignment) to the backends
2008-03-21 19:20:15 +00:00
Neil Brown
80ffc87f94
Added a newline at the end of the generated C++ files
2008-03-21 18:47:09 +00:00
Neil Brown
ebef4aaedf
Fixed array constructors by adding an occam pass to figure out their type early on, and also corrected the ordering of the later passes
2008-03-21 18:23:42 +00:00
Neil Brown
b496912c51
Fixed conflicts with Adam's dimension changes
2008-03-19 17:49:32 +00:00
Neil Brown
839d92546b
Altered the backends to support lists and foreach loops over lists (at least in the C++ part)
2008-03-19 17:20:52 +00:00
Adam Sampson
b1416bb0cf
Change A.Dimension to take an Expression, not an Int.
...
This touches an awful lot of code, but cgtest07/17 (arrays and retyping) pass.
This is useful because there are going to be places in the future where we'll
want to represent dimensions that are known at runtime but not at compile time
-- for example, mobile allocations, or dynamically-sized arrays. It simplifies
the code in a number of places.
However, we do now need to be careful that expressions containing variables do
not leak into the State, since they won't be affected by later passes.
Two caveats (marked as FIXMEs in the source):
- Retypes checking in the occam parser is disabled, since the plan is to move
it out to a pass anyway.
- There's some (now very obvious) duplication, particularly in the backend, of
bits of code that construct expressions for the total size of an array
(either in bytes or elements); this should be moved to a couple of helper
functions that everything can use.
2008-03-18 16:45:38 +00:00
Adam Sampson
1124bb5a44
Use either Alt or TimerAlt as appropriate.
2008-03-15 15:15:21 +00:00
Adam Sampson
54668d3ba2
Implement the RESCHEDULE intrinsic.
2008-03-15 11:00:11 +00:00
Adam Sampson
4a68dda2b5
Clean up the generation of wrapper Procs for Pars.
...
Procs that are in csParProcs are now generated with the correct calling
convention directly, rather than having a second wrapper function generated
around them.
2008-03-14 22:01:59 +00:00
Adam Sampson
9c2a6b6656
Handle both addl and subl for stack increases.
...
GCC seems to very occasionally generate addl -N rather than subl N.
Also don't allow subl -N any more -- if it's adjusting the stack pointer back
up, that doesn't mean it's going to use any less of the stack...
2008-03-14 22:00:36 +00:00
Adam Sampson
5156626ab0
Remove the identifyParProcs pass.
...
All it did was to make a list of the Procs generated by parsToProcs, so
parsToProcs may as well just do the same job itself.
The reason I'd made it a separate pass originally was that I wanted to
optimise out the wrapper when the child of a Par was already a ProcCall.
That optimisation isn't going to be possible any more with the new CCSP,
since wrappers have to fetch their arguments in a different way from
ordinary Procs.
2008-03-14 14:53:05 +00:00
Adam Sampson
3996a1379b
Update BackendPassesTest to match my last _sizes change.
2008-03-13 10:52:23 +00:00
Adam Sampson
006559271d
Declare size arrays before the corresponding real arrays.
...
This is because we sometimes need the size array while initialising the real
array -- for example, if we're initialising a 2D array of channels.
2008-03-12 15:14:00 +00:00
Adam Sampson
88af6a29d2
Abstract CCSP setup into a function, and set up terminal properly.
...
If stdin is in use, it'll now be put into non-canonical mode. This is almost
the same as libkrocif's behaviour, except I've set VTIME to 0, since I don't
think there's a good reason to have a terminal read complete if no characters
are available.
This also sets CCSP's branding to "Tock", so error messages now start "Tock: ".
2008-03-12 14:38:58 +00:00
Adam Sampson
f2d3280cee
Abstract killing TLP channel handlers out into a function.
2008-03-12 10:47:19 +00:00
Adam Sampson
8880413128
Use TimerAlt rather than Alt.
...
It really ought to pick the right one depending on whether there are any timer
guards.
2008-03-11 18:52:35 +00:00
Adam Sampson
7eaab68f04
Implement TLP output channels using a CIF helper process.
...
Input channels will be similar, but are stubbed out for now.
2008-03-11 18:47:48 +00:00
Adam Sampson
882d0c002a
Remove debugging code.
2008-03-11 17:43:54 +00:00
Neil Brown
c778ff0031
Fixed some unused module import warnings, now that PassM is not build of monad transformers
2008-03-10 17:19:45 +00:00
Neil Brown
9f18b348e8
Corrected all the tests to use the new PassM monad
2008-03-10 17:07:48 +00:00
Neil Brown
6abda39ee2
Fixed a couple of uses of the PassM monad that depended on the old mechanism
2008-03-10 15:19:28 +00:00
Adam Sampson
8aae275895
Fix ALT enabling in the C backend.
2008-03-10 11:38:25 +00:00
Neil Brown
0b93e67ca3
Fixed the last load of backend tests, for specs and actuals
2008-03-09 19:32:09 +00:00
Neil Brown
9b2f6b9e2b
Updated a couple of the retypes-sizes tests for the backend
2008-03-09 19:23:46 +00:00
Neil Brown
9533fa9926
Reversed the effect of an earlier patch (to put timers back in the C++ backend) now that I've seen Adam's patch that fixes it anyway
2008-03-09 19:04:34 +00:00
Neil Brown
76aeabe747
Fixed genRetypesSizes to work properly again with arrays with a non-fixed dimension (oops)
2008-03-09 18:54:37 +00:00
Neil Brown
f8cd341cd8
Fixed the tests for array slicing
2008-03-09 18:21:16 +00:00
Neil Brown
e90ea48baa
Fixed the test for genOverArray, to test arrays with fixed and unknown dimensions
2008-03-09 17:26:37 +00:00
Neil Brown
7dc379cb86
Fixed a test relating to initialising channel arrays
2008-03-09 17:25:50 +00:00
Neil Brown
3189c066b5
Fixed genRetypeSizes and its associated tests in light of the new array sizes passes
2008-03-09 16:58:05 +00:00
Neil Brown
dd14f6b62a
Fixed one of the tests for declareSizesArray that had not been updated
2008-03-09 16:57:38 +00:00
Neil Brown
668983f1e5
Adjusted the tests for the new type of genArraySubscript
2008-03-09 16:20:06 +00:00
Neil Brown
0265063250
Re-added the index checking for array slices in the backend
2008-03-09 16:19:01 +00:00
Neil Brown
3d1945b517
Changed the code handling SizeVariable to output the size as an integer if it is known
2008-03-09 16:18:13 +00:00
Neil Brown
35b1ffdc51
Added a new pass to turn all array slices into the full FromFor form
2008-03-09 16:15:24 +00:00
Neil Brown
5c43172e46
Added an annotation to array subscripts to indicate whether they should have a run-time check added or not
2008-03-09 14:30:19 +00:00
Neil Brown
c733ac2cff
Fixed the C++ backends so that it continues to declare timer variables, even though the C backend doesn't any more
2008-03-09 12:48:26 +00:00
Neil Brown
ba75f5b06c
Removed the initialiser expression on the Declaration item in the AST
2008-03-09 00:23:13 +00:00
Adam Sampson
f8d4efa0e9
Go back to generating Time variables for timers.
...
This is for two reasons: first, the C++CSP backend still needs them, and
second, the way I'd done the removal wasn't correct; since you can have arrays
of them, abbreviate them, etc., they need to be stripped out by an earlier
pass so that other passes don't try to operate upon them.
2008-03-09 11:57:43 +00:00
Adam Sampson
35538cda36
Resolve conflicts.
...
This simplifies the formals/actuals stuff enough that most of it can probably
go away (once it's made to work again).
2008-03-08 17:18:22 +00:00
Neil Brown
ba9ac70d7c
Changed the C and C++ backends to write directly to the output file, to save building up the strings in memory
2008-03-08 14:10:05 +00:00
Neil Brown
c87581e490
Tidied up the export list for the GenerateC module
2008-03-08 14:03:10 +00:00
Neil Brown
5197435b2c
Removed a lot of old comments and support code relating to the way arrays used to be handled in the C++ backend
2008-03-08 13:52:50 +00:00
Neil Brown
e1fd001322
Fixed a bug relating to not initialising C channel arrays properly (an over-enthusiastic trimming earlier)
2008-03-08 13:42:36 +00:00
Neil Brown
10effbf8f5
Corrected most of the tests for the C/C++ backends to reflect the recent changes to array handling
2008-03-08 13:19:06 +00:00
Neil Brown
126dcdb4bb
Removed all the unnecessary stuff from the C backend that used to be there for array sizes
2008-03-08 12:36:38 +00:00
Neil Brown
66a7ae9b58
Refactored the C backend, removed the abbrevVariable and genSlice functions
2008-03-08 11:55:56 +00:00
Neil Brown
3c070f035c
Removed the code for initialising members - it is unneeded, and will no longer work until the ensuing _sizes declaration
2008-03-08 00:09:28 +00:00
Neil Brown
a4646f88fa
Removed the C++ version of genDeclaration, deferring instead to the C version
2008-03-08 00:08:19 +00:00
Neil Brown
3f02caba7c
Changed the handling of retypes with arrays to handle source items with unknown size
2008-03-08 00:06:35 +00:00
Neil Brown
24ddcf6f0d
Changed chansToAny to use the makeGeneric pass structure
2008-03-07 23:32:00 +00:00
Neil Brown
5ae8aca68e
Fixed the sizes of retyping a multi-dimensional array
2008-03-07 22:46:39 +00:00
Neil Brown
8d44077891
Refactored and enhanced the declareSizesArray pass
2008-03-07 15:54:10 +00:00
Neil Brown
5a42b7eb0c
Corrected a test for abbreviating array variables
2008-03-07 15:52:05 +00:00
Neil Brown
fdef3b1924
Corrected genVariable to obey checkValid when working out the types for array slices
2008-03-07 15:51:27 +00:00
Neil Brown
ffc4594604
Removed some more unneeded code from GenerateCPPCSP, deferring to the C implementation
2008-03-07 15:49:09 +00:00
Neil Brown
8d411184c1
Corrected the size of array slices
2008-03-07 10:00:02 +00:00
Neil Brown
6106fc13a1
Removed a leftover suffix involved in declaring channel arrays
2008-03-06 21:04:11 +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
a751531b4e
Added some comments in declareSizesArray and renamed a variable to be clearer
2008-03-06 19:08:09 +00:00
Neil Brown
588381ee06
Fixed declareArraySizes to also use the size of an array element in its calculations for resizing
2008-03-06 18:40:20 +00:00
Neil Brown
0d638c690a
Added some support for declaring sizes for retypes abbreviations (so far, only where the sizes are known at compile-time)
2008-03-06 18:30:29 +00:00
Neil Brown
41eda81ee7
Added some comments to declareSizesArray
2008-03-06 18:23:02 +00:00
Neil Brown
c3e1a32909
Rearranged declareSizesArray to easily support IsExpr
2008-03-06 18:03:49 +00:00
Neil Brown
a9692f884a
Added a constructor to record types to help build record literals (especially those that contain array literals)
2008-02-29 16:44:00 +00:00
Neil Brown
8518860cd3
Fixed the handling of Is abbreviations (declaring array sizes)
2008-03-06 17:52:26 +00:00
Neil Brown
bf17347ba2
Added some tests for IsExpr with a statically sized array
2008-03-06 17:51:28 +00:00
Neil Brown
c21fee44d4
Added test for adding sizes to an Is array abbreviation
2008-03-06 17:50:19 +00:00
Neil Brown
3d823fb1b5
Fixed the handling of actual array parameters to include array variables inside ActualExpression
2008-03-06 17:34:54 +00:00
Neil Brown
807b219a39
Implemented adding array sizes for Is abbreviations
2008-03-06 15:25:05 +00:00
Neil Brown
a9c2643ad4
Fixed some horribly exponential speculative recursion in one of the passes
2008-03-06 14:20:21 +00:00
Neil Brown
60c7a2dde3
Added a preliminary pass-list for the work on flattening arrays
2008-03-06 09:59:18 +00:00
Neil Brown
a2106a98e7
Fixed some incorrect recursion in the pass for declaring array _sizes
2008-03-06 01:50:01 +00:00
Neil Brown
264149ef3f
Added some more tests for dynamically sized arrays
2008-03-06 01:49:33 +00:00
Neil Brown
70a207fe6c
Implemented the addSizesActualParameters pass
2008-03-05 23:40:17 +00:00
Neil Brown
8b3edc90ce
Added some limited tests for the addSizesActualParameters pass
2008-03-05 23:39:54 +00:00
Neil Brown
6a5d84ffcd
Implemented the addSizesFormalParameters pass
2008-03-05 22:10:21 +00:00
Neil Brown
3481a3f51d
Finished the tests for the addSizesFormalParameters pass
2008-03-05 22:09:51 +00:00
Neil Brown
6c629b33f7
Added a few types in BackendPassesTest to remove a monomorphism restriction warning
2008-03-05 21:04:42 +00:00
Neil Brown
1fef1e64ed
Added the beginnings of testing for adding _sizes parameters to PROC definitions (formals)
2008-03-05 17:31:14 +00:00
Neil Brown
6a784bffd9
Switch the tests for declareSizesArray to be QuickCheck tests rather than HUnit tests
2008-03-05 16:35:37 +00:00
Neil Brown
2ea7c37abe
Added the implementation of declaring _sizes arrays for record fields
2008-03-04 15:22:24 +00:00
Neil Brown
30f1b6ecab
Added tests for the declaring of _sizes arrays for record fields
2008-03-04 15:22:03 +00:00
Neil Brown
41303eb993
Altered the code and the tests for declareSizesArray to approach what it should be doing
2008-03-03 17:50:57 +00:00
Neil Brown
81ea069707
Added a dummy implementation of a new pass, declareSizesArray, and the tests for it
2008-03-03 15:02:07 +00:00
Adam Sampson
2f7539bcdb
Convert the C backend to the new CIF API (mostly).
...
Most of this is mechanical: changing function names, and carrying the "wptr"
argument around. I've made the code for computing Expressions from Structureds
a bit more generic too.
The only complex bit is the handling of PAR processes, which I'm not very happy
with at the moment; they used to use the normal C calling convention, but now
you need to pack the arguments into the workspace. I'm handling this at the
moment by generating wrapper functions that do the unpacking, but it would be
better in the future to make the wrapper PROCs that we already generate have
the right interface.
This won't work for programs that use any of the top-level channels yet, since
there are no handlers for them.
2008-03-07 17:50:10 +00:00
Adam Sampson
87a1c39411
Fix recursion in identifyParProcs that broke testcases/par.occ.
...
It wasn't looking for PROC definitions inside Specs. This is a good example of
a pass that really wants a trimmed "everywhere"/"contexts" rather than explicit
recursion.
2008-03-07 17:28:30 +00:00
Adam Sampson
8aabb0c98e
Add a missing fold marker.
2008-03-07 17:02:03 +00:00
Neil Brown
20f7666044
Refactored cgenArraySubscript ready to add support for static dimensions
2008-03-01 20:39:45 +00:00
Neil Brown
60daa07b93
Renamed one of the array functions in the function table to be clearer
2008-03-01 20:22:34 +00:00
Neil Brown
01ac2ef21d
Fixed an odd monomorphism restriction warning
2008-03-01 20:13:11 +00:00
Adam Sampson
50967cba95
Split the common C99/C++ support code out into a separate header.
...
Or, rather, add a new CIF-specific header, so tock_support.h is now the common
code and each of the backends has its own. This means some of the conditional
stuff can go away.
2008-03-05 16:54:29 +00:00
Adam Sampson
aff90d8d45
Some initial shuffling to get Tock working with the new CIF.
...
This changes the TLP code to use CCSP's stand-alone mode, and gets rid of the
old KRoC wrapper stuff. It also changes occam_stop everywhere in order to pass
the number of arguments (since ExternalCallN needs that now), and cleans up the
interaction with the C++ backend a bit.
2008-03-05 16:21:20 +00:00
Neil Brown
49585a1922
Added a constructor to record types to help build record literals (especially those that contain array literals)
2008-02-29 16:44:00 +00:00
Neil Brown
24dc839cfb
Added helper functions for PLUS, MINUS and TIMES to help constrain the result types and prevent surprising integer promotions
2008-02-29 00:20:52 +00:00
Neil Brown
6d4f1dd702
Added labels to all the top-level tests that didn't have one
2008-02-28 16:11:01 +00:00
Neil Brown
b3458ec541
Corrected the pointer indirection for records inside records
2008-02-28 16:08:06 +00:00
Neil Brown
62e45a8909
Added a missed new C/C++ test to the list of tests to run
2008-02-28 15:33:08 +00:00
Neil Brown
d73f2f509c
Added some template types to one of the uses of tockArrayView to please the C++ compiler, and adjusted the tests accordingly
2008-02-28 15:32:26 +00:00
Adam Sampson
8d06c3d180
Various tweaks to the Haddock comments to get it building with 0.8 again.
2008-02-28 14:20:34 +00:00
Neil Brown
7206d45af3
Toned down the amount of suffixes generated for C/C++ integer literals
2008-02-27 18:56:36 +00:00
Neil Brown
63730b5aff
Adjusted the tests for record definitions in the C/C++ backends to use the new function in the dictionary for them
2008-02-27 18:56:09 +00:00
Neil Brown
9ab4563a2c
Moved the definition of record types into the forward declarations
2008-02-27 18:25:14 +00:00
Neil Brown
018951ef40
Fixed the shift behaviour by moving it out into functions like the add and subtract operations already were
2008-02-27 15:13:11 +00:00
Neil Brown
9712df4458
Added a type annotation (esp. for signed types) for hex literals in the C/C++ backends
2008-02-27 14:00:54 +00:00
Neil Brown
9d1c170b34
Added a size suffix to the code generated for C/C++ integer and real literals (where needed)
2008-02-26 18:09:21 +00:00
Neil Brown
0f437dcf0e
Fixed the behaviour of the right-shift operator to match how it should work in occam
2008-02-26 17:20:29 +00:00
Neil Brown
74f3cb7fc2
Removed the export of "m" in TestUtils, instead moving the definition to each module that uses it (less confusing that way)
2008-02-24 18:55:44 +00:00
Neil Brown
feabd450f0
Fixed a conflict between the prolifing-related changes and the dependence graph
2008-02-24 11:23:29 +00:00
Neil Brown
635f7bf1b0
Changed the backend passes in BackendPasses to not use the everywhere(M) function
2008-02-23 18:33:16 +00:00
Neil Brown
2e6718ac50
Changed all the lists of passes to add pre- and post- properties
2008-02-19 09:43:40 +00:00
Neil Brown
360abc195e
Moved the enabling/disabling of passes based on CompState from PassList to the point of the declaration of the passes
2008-02-16 11:09:25 +00:00
Neil Brown
3ce0eaf452
Made the first adjustment to the Pass system, ready to introduce properties and a dependency graph. For now passes are still executed in list order
2008-02-16 10:19:14 +00:00
Neil Brown
cc29010103
Fixed some more monomorphism restriction warnings in GenerateCTest
2008-02-08 13:35:04 +00:00
Neil Brown
b037b6a8ca
Tidied up the new code relating to warnings, and moved it all into the Errors module (out of CompState and Pass)
2008-02-08 13:31:37 +00:00
Neil Brown
f17ff5071c
Added a Warn monad for warnings, and incorporated a WriterT monad into the PassM stack to support the Warn monad, then changed all the rest of the code accordingly, including adding a Warn instance for the GenParser parser that hides it in the state
2008-02-08 13:22:23 +00:00
Neil Brown
035c526bef
Changed the TLP and PrettyShow modules to use CSMR instead of CSM
2008-02-08 11:29:09 +00:00
Neil Brown
e3e9e912f2
Added a read-only version of CSM, named CSMR
2008-02-08 11:17:50 +00:00
Neil Brown
e0d6c5eb08
Fixed the monomorphism restriction warnings in GenerateCTest
2008-02-08 01:11:20 +00:00
Neil Brown
7e7625385d
Pulled out various types and definitions from GenerateC into a common module, GenerateCBased
2008-02-08 01:08:42 +00:00
Neil Brown
a143fb75ef
Changed all the C/C++ backend functions to stop passing round GenOps everywhere; they now all properly pull it from the monad
2008-02-08 01:01:44 +00:00
Neil Brown
df832b450d
Changed the C/C++ backends to read GenOps from a reader-monad rather than passing the ops around (rough draft)
2008-02-08 00:33:44 +00:00
Neil Brown
acd57d74de
Changed the A.Structured type to be parameterised
...
This patch is actually an amalgam of multiple (already large) patches. Those patches conflicted (parameterised Structured vs. changes to usage checking and FlowGraph) and encountered a nasty bug in darcs 1 involving exponential time (see http://wiki.darcs.net/DarcsWiki/ConflictsFAQ for more details). Reasoning that half an hour (of 100% CPU use) was too long to apply patches, I opted to re-record the parameterised Structured changes as this new large patch. Here are the commit messages originally used for the patches (which, as mentioned, were already large patches):
A gigantic patch switching all the non-test modules over to using parameterised A.Structured
Changed the FlowGraph module again to handle any sort of Structured you want to pass to it (mainly for testing)
A further gigantic patch changing all the tests to work with the new parameterised Structured
Fixed a nasty bug involving functions being named incorrectly inside transformInputCase
Added a hand-written instance of Data for Structured that allows us to use ext1M properly
Fixed a few warnings in the code
2008-02-05 19:40:27 +00:00
Neil Brown
edc3a7e910
Removed the die function (that has no source position) and as far as possible replaced all its uses with dieP and a valid position
2008-01-28 17:21:13 +00:00
Neil Brown
bdda623d7e
Added types to all the cases where the monomorhpism restriction applied
2008-01-26 20:51:11 +00:00
Neil Brown
26dd2fa5c4
Renamed the TestUtil and TreeUtil modules to TestUtils and TreeUtils, to be consistent with the Utils module
2007-12-13 19:05:29 +00:00
Neil Brown
7d175b1d0d
Added more documentation to the testing frameworks in the backends directory.
2007-11-12 17:51:54 +00:00
Neil Brown
7433e49d49
Added support for List types to the C and C++ backend, in genType at least
2007-10-27 11:24:24 +00:00
Neil Brown
7f59eec189
Changed the C and C++ backends (and tests) to handle declarations with initialisers properly
2007-10-25 00:27:12 +00:00
Neil Brown
6b95827cab
Added an optional initialiser-expression to Declaration in the AST, and changed the rest of the code accordingly
2007-10-24 23:50:00 +00:00
Neil Brown
83f654a273
Implemented the code for ClearMobile in the C and C++ backends
2007-10-24 20:54:37 +00:00
Neil Brown
dfee567ffc
Added tests for ClearMobile in the C and C++ backends
2007-10-24 20:52:39 +00:00
Neil Brown
48c1bea724
Added tests for the AllocMobile item in the C and C++ backends
2007-10-24 19:44:50 +00:00
Neil Brown
dd86b240b5
Implemented (most of the needed) support for AllocMobile in the C and C++ backends
2007-10-24 19:32:58 +00:00
Neil Brown
08c8d47e2f
Overhauled cgenVariable' in GenerateC so that it passes the new tests involving DerefVariable (while still passing all the previous tests)
2007-10-24 15:58:20 +00:00
Neil Brown
0eea361f95
Added tests for DerefVariable during the genVariable function for the C and C++ backends
2007-10-24 15:57:40 +00:00
Neil Brown
9f78582391
Added support for mobile types to the genType functions in the C and C++ backends
2007-10-21 14:37:05 +00:00
Neil Brown
441b700d8d
Added tests for the new mobile types in the C and C++ backends
2007-10-21 14:16:24 +00:00
Neil Brown
acca3d03fd
Removed the A.Main item from the AST entirely
2007-10-17 13:43:40 +00:00
Neil Brown
12191cb36a
Changed the C and C++ backends to take in a Structured rather than a Process as the top-level item
2007-10-17 13:25:21 +00:00
Neil Brown
30b7cc686b
Doubled the stack size for C++CSP processes, in order to get cg test 08 passing
2007-10-14 13:25:31 +00:00
Neil Brown
0fc7ceaf68
Fixed an issue where the size in counted array inputs in C++ was not being correctly calculated
2007-10-14 11:09:35 +00:00
Neil Brown
fed32e1531
Adjusted the tests for inputs to catch an error where the size in counted array inputs in C++ was not being correctly calculated
2007-10-14 11:09:08 +00:00
Neil Brown
c19ae03116
Added a pass that changes all C++CSP channels to be of type tockSendableArrayOfBytes, so that the channels can be retyped into each other
2007-10-14 10:28:43 +00:00
Neil Brown
3c101bae19
Removed my old cgmap function, in favour of the identical library function mapM_
2007-10-14 00:14:19 +00:00
Neil Brown
d4dabfd3bb
Removed unused code from the GenerateCTest module
2007-10-14 00:09:28 +00:00
Neil Brown
fd74473b9b
Removed a big load of unused code from the C++ code generation, that was related to the old way of handling protocols
2007-10-14 00:08:13 +00:00
Neil Brown
e9dbfbab3c
Added the input-case to case pass to the pass-list, and therefore removed all code dealing with input-case statements in the C and C++ backends (and corresponding tests)
2007-10-14 00:01:44 +00:00
Neil Brown
ffe8477237
Added a fix to prevent running a zero-length list of processes in CIF
2007-10-13 20:02:07 +00:00
Neil Brown
9e21e4fc0d
Added a C++ implementation of the genRetypeSizes function
2007-10-13 17:57:23 +00:00
Neil Brown
1885518b8d
Changed the C genRetypeSizes function to pass the tests
2007-10-13 17:54:46 +00:00
Neil Brown
acd09137f6
Added tests for genRetypeSizes in the C and C++ backends
2007-10-13 17:49:09 +00:00
Neil Brown
c74ae12810
Changed the type of genBytesIn again, to remove redundancy in its parameters
2007-10-13 16:16:52 +00:00
Neil Brown
a98ff8cad0
Removed the horrible tockBool type, now that we are no longer using vectors to store C++ arrays
2007-10-13 15:40:39 +00:00
Neil Brown
ed38f80db0
Changed the type of genRetypeSizes to removed the unused AbbrevMode parameter
2007-10-13 15:38:04 +00:00
Neil Brown
9a48683033
Refactored the C implementation of genBytesIn to better integrate the old genBytesIn' with genBytesIn
2007-10-13 15:01:51 +00:00
Neil Brown
ffd09847fe
Removed genBytesIn' from the GenOps, in favour of adding a parameter to genBytesIn, and changed the tests and code accordingly
2007-10-13 14:51:29 +00:00
Neil Brown
d5d4580aa3
Changed the type of genSlice, and put the C++ version into the GenOps dictionary, as well as adding tests for the function
2007-10-13 13:20:40 +00:00
Neil Brown
886659fd09
Changed the C++ backend to pass the RETYPES tests (primarily white-space changes, and also reordering the parameters for tockArrayView)
2007-10-13 12:58:20 +00:00
Neil Brown
324257198a
Changed the C backend to pass the RETYPES tests (mainly white-space changes)
2007-10-13 12:51:13 +00:00
Neil Brown
a1f0faac8f
Added tests for RETYPES specifications in the C and C++ backends
2007-10-13 12:50:39 +00:00
Neil Brown
ec43e592f0
Fixed the initialisation of C++ channel arrays to initialise the correct array
2007-10-11 01:32:36 +00:00
Neil Brown
8d0b5fbe1a
Added a helper function for receiving an array of bytes, and changed the C++CSP backend and tests to use the function
2007-10-11 00:51:07 +00:00
Neil Brown
4935a04aa4
Added the simplifyComms pass to the shared pass list for the compiler, and removed the corresponding code in the C backend that the pass replaces
2007-10-11 00:14:27 +00:00
Neil Brown
cc2040679b
Changed the C and C++ backends to pass the input tests
2007-10-10 20:46:23 +00:00
Neil Brown
3f6fe50438
Added tests for (non-case-protocol) inputs in the C and C++ backends
2007-10-10 20:45:05 +00:00
Neil Brown
32fa80be0f
Removed the kroc C wrapper file (kroc-wrapper-c.c) in favour of tacking it onto the end of each C file we create (to better facilitate all-in-one compilation)
2007-10-08 22:04:11 +00:00
Neil Brown
5b10466e68
Fixed the channel arrays (and abbreviations thereof) to have the correct types (correcting an earlier mistake), and added helper functions to the support headers for easy initialisation of the arrays
2007-10-07 23:03:15 +00:00
Neil Brown
4e6938e0ae
Fixed AnalyseAsm so that it can parse negative literals in the assembly code
2007-10-07 15:09:36 +00:00
Neil Brown
5450f77963
Added a test for genBytesIn in the C and C++ backends
2007-10-07 11:47:39 +00:00