Commit Graph

257 Commits

Author SHA1 Message Date
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
Neil Brown
9c4f977416 Added tests for channels carrying counted arrays of arrays for the C and C++ backends 2007-10-06 23:50:20 +00:00
Neil Brown
5e1e51ac15 Refactored the C++ genOutputItem to merge some duplicate code 2007-10-06 23:08:05 +00:00
Neil Brown
9af1ec78bb Fixed all the tests for sending items in C++, and made the tests pass 2007-10-06 23:05:03 +00:00
Neil Brown
6d29bbd260 Added some tests for outputs in the C and C++ backends, but the C++ backend needs fixing 2007-10-06 18:20:55 +00:00
Neil Brown
3b20d18937 Added tests for the genOutput and genOutputCase functions, corrected the C++ code, and added some helper functions to the C++ support header 2007-10-06 17:05:49 +00:00
Neil Brown
97ee0c4a4e Added tests for ProtocolCase in introduceSpec, and made the C++ version behave the same as the C version 2007-10-06 16:35:02 +00:00
Neil Brown
03a4b8e41b Removed the generate of tuples for sequential protocols in C++, since we're now using a byte-array approach 2007-10-06 16:22:51 +00:00
Neil Brown
062851dabf Added tests for introduceSpec and Is, for all types except arrays 2007-10-06 15:55:18 +00:00
Neil Brown
0cf27ce4b6 Simplified the tests for IsChannelArray a little by overriding genVariable in the test 2007-10-06 13:32:12 +00:00
Neil Brown
0517465eff Removed the function genArraySizesSize from GenOps, since it was only called in one place 2007-10-06 12:52:59 +00:00
Neil Brown
c3fad80f06 Changed the behaviour of the C++ version of declareArraySizes, moving towards potentially merging more of the C++ array handling with the C array handling 2007-10-06 12:49:30 +00:00
Neil Brown
e7cdaf2e90 Changed the type of genArraySizesLiteral, added tests for the C++ version and implemented the C++ version 2007-10-06 12:31:14 +00:00
Neil Brown
8ea4ad79e8 Changed the type of declareArraySizes, and added a C++ implementation of it 2007-10-06 12:22:40 +00:00
Neil Brown
071172954d Removed redundant/common code in the C++ backend relating to arrays 2007-10-06 11:59:29 +00:00
Neil Brown
9a6f9186a9 Changed the behaviour of genArraySizesLiteral to include the curly brackets 2007-10-06 11:55:50 +00:00
Neil Brown
a583403372 Removed the C++ code for IsChannelArray, so that the C version is used instead 2007-10-06 11:40:10 +00:00
Neil Brown
4c0c27f350 Added a test for handling IsChannelArray in introduceSpec, for both C and C++ backends 2007-10-06 11:38:16 +00:00
Neil Brown
c521187cd2 Added a genArrayStoreName function to GenOps and implemented it for both C and C++ 2007-10-06 11:30:03 +00:00
Neil Brown
24b3975cf8 Fixed channel arrays that are abbreviations to have the proper indirection, because they can be constructed in a special way (using IsChannelArray) 2007-10-06 00:57:03 +00:00
Neil Brown
9d5164d9c1 Changed the generation of the record structs to use the altered genDeclaration (that can now generate declarations for inside records) 2007-10-05 20:06:11 +00:00
Neil Brown
904d1e8f5f Changed the genDeclaration function so that it can either generate stand-alone declarations (as it did before), or declarations inside records 2007-10-05 19:01:42 +00:00
Neil Brown
34609f1fee Corrected the C++ tests and implementation of arrays inside records -- the dimensions of the tockArrayView were not being set, but they should be. 2007-10-05 17:52:37 +00:00
Neil Brown
8cd20b9906 Changed the C++ implementation of introduceSpec to fall through to the C implementation for all unhandled cases (which will remove duplicate code) 2007-10-05 17:51:00 +00:00
Neil Brown
9effe37977 Removed the declareType function from GenOps (it has been merged with genType) and changed the C++ channel types to pass the new genType tests 2007-10-05 17:01:17 +00:00
Neil Brown
e68e80ddda Added a new type to the C++ header, tockSendableArrayOfBytes, ready for dealing with protocols and counted arrays properly. Also removed the tockAny type.
The tests for genType on channels of ANY, protocols, and counted arrays have also been changed accordingly.
2007-10-05 16:59:14 +00:00
Neil Brown
2b8010138b Added the first part of a test for introduceSpec/removeSpec in the C and C++ backends 2007-10-05 11:44:23 +00:00
Neil Brown
4d2833affb Added a test for genWhile to the C and C++ backends 2007-10-04 14:58:28 +00:00
Neil Brown
986b6d956a Added a test for genWait in the C and C++ backends 2007-10-04 14:55:03 +00:00
Neil Brown
1f8a5555ac Added a test for genIf in the C and C++ backends 2007-10-04 14:36:56 +00:00
Neil Brown
af74ac1039 Added a test of genGetTime for the C and C++ backends 2007-10-04 14:06:15 +00:00
Neil Brown
bc7e1b1433 Added a test for genCase on the C and C++ backends 2007-10-04 13:57:19 +00:00
Neil Brown
38fb0baa4e Added a test for genAssign in the C and C++ backends, and tweaked its implementation to pass the tests 2007-10-04 12:40:13 +00:00
Neil Brown
d3fa9fb8c8 Added some documentation about the testing strategy in GenerateC 2007-10-04 12:12:12 +00:00
Neil Brown
ae73eef435 Fixed a bug in genVariable in GenerateC where recursive calls with checkValid being False would still generate checks 2007-10-04 12:06:20 +00:00
Neil Brown
a4638a252d Changed an instance of _sizes in GenerateC to use the genSizeSuffix function 2007-10-04 12:03:55 +00:00
Neil Brown
b46dabe555 Added tests of the C and C++ backend pertaining to records 2007-10-04 12:02:08 +00:00
Neil Brown
46d2ff32f3 Added tests for genVariable in the C and C++ backends 2007-10-04 12:01:29 +00:00
Neil Brown
b4ac249367 Changed the C and C++ channel arrays to be actual arrays of channels, not arrays of channel pointers as they were before.
The effects of this change will not be fully tested until further tests have been written (especially for genVariable).
2007-10-04 00:53:25 +00:00
Neil Brown
7ef16c3b6c Added a test for declareInit and declareFree, to test the C and C++ backends 2007-10-04 00:24:32 +00:00
Neil Brown
93610a5837 Changed the C++ arrays to use standard C-like arrays rather than std::vector as they used to 2007-10-04 00:19:38 +00:00
Neil Brown
b8556bfe6d Refactored some of the tested functions in the C and C++ backends to use genSizeSuffix rather than using _sizes/.extent directly 2007-10-04 00:07:15 +00:00
Neil Brown
366504c301 Corrected a couple of Haddock syntax problems in GenerateC 2007-10-03 23:57:05 +00:00
Neil Brown
8b95ae00f0 Added a test for genReplicator 2007-10-03 23:48:57 +00:00
Neil Brown
25e7e0ef2b Removed an unused function (genReplicatorSize) from GenOps 2007-10-03 23:26:24 +00:00
Neil Brown
f3e15b6f78 Changed the C genOverArray function to pass the test, and removed the now-redundant C++ version 2007-10-03 23:18:53 +00:00
Neil Brown
2b1603629f Added a test for the genOverArray function in the C/C++ backends 2007-10-03 23:14:55 +00:00
Neil Brown
65fb758dbd Added tests for genDeclaration, and tweaked the backends to make the tests pass 2007-10-03 17:58:59 +00:00
Neil Brown
f6af19c67e Removed an unnecessary line from the GenerateC backend, and added a comment to a tested function 2007-10-03 17:17:28 +00:00
Neil Brown
1f8bb0e44a Removed the genVariable' function from GenOps
Now that the C++ generator no longer overrides genVariable', it seems wise to remove it from the GenOps function dictionary.

You can call it via either genVariable or genVariableUnchecked anyway, so genVariable' is just used by the two former functions as implementation.  It can easily be put back into the dictionary later on, if that turns out to be necessary.
2007-10-03 16:57:03 +00:00
Neil Brown
9b96ea9899 Removed the C++CSP implementation of genVariable' by adding a new function (genDirectedVariable) that represents the only change from the C version (and added C and C++ version of genDirectedVariable accordingly) 2007-10-03 16:55:48 +00:00
Neil Brown
4111dd3cb7 Added a test for genArraySubscript, and made the C and C++ backends pass it 2007-10-03 16:43:07 +00:00
Neil Brown
91d9dcf3bc Changed the functions in GenerateCTest to have separate tests (rather than separate assertions) for C and C++
This makes it easier to see straight away if both the C and C++ tests are failing (previously only the C test would have shown up if it failed, masking the C++ failure temporarily, until the C test passed).
2007-10-03 16:21:05 +00:00
Neil Brown
80836c0074 Added more tests for the C backend (genArrayLiteralElems, genActual, genActuals) 2007-10-03 15:57:45 +00:00
Neil Brown
9260bb9177 Added an export list to the GenerateC module 2007-10-03 15:31:03 +00:00
Neil Brown
e17367edfa Simplified the GenOps by removing a function (genArrayAbbrev) that did not need to be in there 2007-10-03 15:23:32 +00:00
Neil Brown
8a2894893c Changed the GenerateC[PPCSP] modules to pass the current tests (just a matter of changing the spacing in the output) 2007-10-03 14:08:34 +00:00
Neil Brown
d985043d62 Added more tests to the GenerateCTest module (stop, and array-related tests) 2007-10-03 14:08:09 +00:00
Neil Brown
96ee8ae9bd Simplified the GenerateCTest module by changing the helper functions 2007-10-03 13:32:28 +00:00
Neil Brown
639b662a98 Starting making the spacing in the generated C and C++ code consistent, so that it passes the tests 2007-10-02 14:50:04 +00:00
Neil Brown
9fc166d819 Added the first group of tests for the C and C++ code generation backends 2007-10-02 14:49:31 +00:00
Neil Brown
15ecb2b178 Added the -fwarn-type-defaults compiler option (for when integer literals are given a default type) and fixed the few warnings that arose from doing so 2007-09-27 13:29:16 +00:00
Neil Brown
38c409d378 Added the -fwarn-unused-imports compiler option to warn about unused imports, and then set about pruning and ordering (mostly in my code) the import lists for all the modules 2007-09-27 13:13:46 +00:00
Neil Brown
e2ab43af3f Tidied up the new BackendPassesTest module, removing some old code that was not intended to be in there, and tidying up the imports list 2007-09-27 13:13:07 +00:00
Neil Brown
8d95b65f00 Added support for the new AlternativeWait guards to the C backend
This was not as straightforward as the C++ backend.  CIF has no capability for supporting waiting *for* a specified time as an ALT guard; only waiting until (AFTER, in occam) a specified time.  This is further complicated by the fact that when you disable an ALT timer guard in CIF, you have to be able to supply the timeout value that you waited on in the enable sequence.

Therefore, I added a pass that transforms all WaitFor guards into WaitUntil guards, by declaring nonce time variables, getting the time, and adding on the delay that we want to wait for; these actions occur just before the ALT.

This new pass is in the new BackendPasses module, into which I also moved the identifyParProcs pass.  I also wrote tests for my new pass that live in the new BackendPassesTest module.
2007-09-27 11:48:04 +00:00
Neil Brown
4a0732629d Added support for the new AlternativeWait guard to the C++ backend 2007-09-27 10:05:31 +00:00