Commit Graph

352 Commits

Author SHA1 Message Date
Neil Brown
d12d630de1 Added some code to allocate a mobile before a dereferenced input 2009-03-22 18:28:19 +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
4f6050069c Moved isMobileType into the Types module where it belongs 2009-03-22 18:26:14 +00:00
Neil Brown
854a1fca50 Fixed various things in the C backend and made genVariable more flexible, for functions that want to specify the C type desired 2009-03-22 14:49:35 +00:00
Neil Brown
3801857817 Fixed a bug in the C backend (using the wrong type in a call) 2009-03-22 14:27:46 +00:00
Neil Brown
2fc327287a Fixed various conflicts in the backends directory while merging one of my branches 2009-03-21 23:43:04 +00:00
Neil Brown
90634ff1d6 Improved the error message for getting the C type to leave the mobile wrapper on 2009-03-21 23:41:54 +00:00
Neil Brown
f5fa5e5caf Fiddled with the code supplying the mobile types to MTAlloc 2009-03-20 21:20:43 +00:00
Neil Brown
1d43b9d7bd Poked the mobile and record stuff until cgtest83 compiles (it blows up on running, but it compiles) 2009-03-20 19:24:54 +00:00
Neil Brown
bbabef868c Moved the comma-related helper functions to the GenerateCBased module 2009-03-20 19:24:20 +00:00
Neil Brown
1044a94730 Changed most of the rest of Tock (except some tests) to understand the new record attributes 2009-03-20 15:18:29 +00:00
Neil Brown
e79fa43fa2 Fixed the last few of the channel uses to request abbreviations of channels when using them 2009-03-21 23:24:21 +00:00
Neil Brown
e0bec17672 Fixed the tests enough to get them to compile, but a lot fail 2009-03-21 23:05:11 +00:00
Neil Brown
e4bed22b7e Various fixes to the C++ backend to at least get it compiling (not tested it much yet) 2009-03-21 23:04:25 +00:00
Neil Brown
bf2f50ba2c Removed a lot of commented out old code in the C backend 2009-03-21 23:03:46 +00:00
Neil Brown
defca6e34d Started simplifying some of the C backend in light of the new changes, and made a few fixes
The first few cgtests (at least) now pass with the new system in the C backend.
2009-03-21 22:59:25 +00:00
Neil Brown
b6b0577ecd Fixed directed variables (for the C++ backend) 2009-03-21 21:01:25 +00:00
Neil Brown
8e768e2b25 Started fixing up the new variable stuff to work with mobiles 2009-03-21 20:50:06 +00:00
Neil Brown
87fefcb66d Fiddled with the new variable stuff in the C backend, and now variable subscripts seem to work 2009-03-21 19:30:29 +00:00
Neil Brown
ca207f7291 Quickly implemented the first version of a revamp of the genVariable code in the C backend
Surprisingly, the generated code seems to be compiled by GCC without warnings.  Array subscripts are currently unimplemented (a star, i.e. equivalent of subscript 0) is used wherever there should be a subscript.

The new mechanism is based on working out the C type of the original variable/abbrev-mode, the C type of the desired variable/abbrev-mode, and works out how many *s or &s to insert to coerce it to the right type.
2009-03-21 18:43:32 +00:00
Neil Brown
936dc29fde Fixed some of the tests, and added another testcase for array passing, based on one of Carl's examples 2009-03-20 12:59:16 +00:00
Neil Brown
56cd7d73c4 Changed the channel-output code generation so that it knows the desired type being sent 2009-03-20 11:37:52 +00:00
Neil Brown
65550b705e Added an AllSizesVariable item to the AST so that the backend inserts the right code for mobiles and non-mobiles 2009-03-20 11:31:14 +00:00
Neil Brown
3c4f76ed46 Fixed the memory leaks arising from not clearing mobiles before an input 2009-03-19 18:18:17 +00:00
Neil Brown
7d3e9e8648 Stopped MTRelease being called with a NULL pointer 2009-03-19 16:59:19 +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
8e5e73e3a2 Fixed the support in the backends for mobile channel stuff 2009-03-19 15:23:35 +00:00
Neil Brown
a995d29c32 Moved the mobile stuff across to use the CCSP API 2009-03-19 11:33:09 +00:00
Neil Brown
4bc15aae48 Bashed the backend until it works with the new mobility passes (standard occam may be broken though) 2009-02-27 17:12:17 +00:00
Neil Brown
2dd8867c91 Removed C++CSP's mobile stuff so that I only have one unified system to deal with for now 2009-02-27 17:04:11 +00:00
Neil Brown
9614d5f7f9 Fixed the intrinsic PROCs to be generated correctly 2009-02-27 17:13:18 +00:00
Neil Brown
4041284feb Renamed a slightly confusing backend pass 2009-02-27 17:04:41 +00:00
Neil Brown
cd1b409f96 Removed cppremoveSpec, since it was doing the same as cremoveSpec 2009-02-27 10:49:45 +00:00
Adam Sampson
deedad4268 Add kyb as another possible name for the keyboard channel. 2009-03-21 15:22:58 +00:00
Neil Brown
d0d5cf6779 Fixed the C++ backend where I was trying to be too clever with the sizes 2009-02-11 14:19:34 +00:00
Neil Brown
18f23bf767 Fixed a small problem with the types of arrays of channel-ends in the C++ generation 2009-02-10 22:21:13 +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
6afbb80e9f Fixed some of the test modules to work with the new array literals and constructors 2009-02-03 11:19:21 +00:00
Neil Brown
1cde2bd959 Added a few useful error messages in the C backend 2009-02-02 18:26:12 +00:00
Neil Brown
cbeeef486e Fixed the C backend putting too many braces in array literals, and removed some old comments 2009-02-01 22:27:43 +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
3e8273f4f6 Adjusted the C backend to work with the new step count 2009-01-28 23:51:19 +00:00
Neil Brown
a4f0e85c72 Fixed a bug involving abbreviation of arrays of channels into arrays of channel-ends in the C++ backend
The array for the channel-ends was not being allocated storage, so the array (a pointer to some random location) was being written to and causing a seg-fault
2009-01-28 23:16:31 +00:00
Neil Brown
9b1368ffe7 Implemented all but one (RAN) of the intrinsic functions in appendix N by mapping them directly to the C versions 2009-01-27 13:38:00 +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
0b2708b2ed Fixed a few small things related to generating intrinsic calls in the C and C++ backends 2009-01-25 20:43:39 +00:00
Neil Brown
0189ba3793 Began implementing the occam intrinsics (some of them, at least) in the C support header 2009-01-23 19:20:26 +00:00
Neil Brown
1410e80fb1 Added support for intrinsic functions with multiple return values
Previously, such a function was an IntrinsicFunctionCall inside one expression of an ExpressionList, which the type-checker rejected.  I've had to add a new constructor to ExpressionList, and I've quickly hacked together the line in the C backend to make it work -- but it does seem to work.
2009-01-23 18:58:52 +00:00