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
79530aaf8b
Removed an unused function from tockArrayView in the C++ header file
2007-10-04 00:16:14 +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
f32471709d
Fixed a few small unescaped slashes that were confusing haddock
2007-10-02 14:55:19 +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
c59c2ed5f6
Removed an unused function (simplifyType) from the Types module
2007-10-02 14:48:09 +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
47052d5f39
Fixed a bug where the default cases were left out for the recent "genericised" functions in the Types module
2007-09-27 10:59:35 +00:00
Neil Brown
4a0732629d
Added support for the new AlternativeWait guard to the C++ backend
2007-09-27 10:05:31 +00:00
Neil Brown
028c27eb73
Rain: implemented type-checking for wait guards
2007-09-26 23:42:40 +00:00
Neil Brown
c38978c123
Rain: added tests for checking types in wait guards
2007-09-26 23:42:16 +00:00
Neil Brown
d79de5a936
Rain: implemented parsing of wait guards
2007-09-26 23:34:55 +00:00
Neil Brown
cbd2d04371
Rain: added tests for parsing wait guards
2007-09-26 23:34:42 +00:00
Neil Brown
be676060b9
Added a new wait guard (that matches the Rain wait guards exactly) to the AST
2007-09-26 23:18:57 +00:00
Neil Brown
41d4923e9c
Added support for the new Wait process to the C and C++ backends
2007-09-26 23:18:21 +00:00
Neil Brown
a65953ad89
Rain: added type-checking for wait statements
2007-09-26 23:08:55 +00:00
Neil Brown
41ac788601
Rain: added tests for checking the types in wait statements
2007-09-26 23:08:37 +00:00
Neil Brown
5af96110c7
Rain: implemented the parsing of wait statements
2007-09-26 23:00:58 +00:00
Neil Brown
13584ed2cb
Added a wait statement to the AST, and added Rain tests for parsing wait statements
2007-09-26 23:00:09 +00:00
Neil Brown
a12d46401a
Rain: implementing type checking for inputs inside alts
2007-09-26 22:37:32 +00:00
Neil Brown
5c827fdacb
Rain: added testing for correct types in input statements in alts
2007-09-26 22:37:03 +00:00
Neil Brown
4cc0628757
Corrected the name of one of the RainTypesTest tests
2007-09-26 22:24:01 +00:00
Neil Brown
db4f05932b
Fixed a conflict between the old time-related patches and the new alt patches
2007-09-26 21:39:16 +00:00
Neil Brown
769dc3c79a
Rain: changed the if, while and each loops to require a block as their body, rather than just a statement.
2007-09-26 18:03:42 +00:00
Neil Brown
68c468fbea
Rain: added the parsing of else (skip) guards in alts
2007-09-26 19:56:22 +00:00
Neil Brown
420839ef1e
Rain: added tests for parsing else guards in alts
2007-09-26 19:56:11 +00:00
Neil Brown
9c87478110
Corrected a test number in ParseRainTest
2007-09-26 19:44:33 +00:00
Neil Brown
205b090cef
Rain: implemented the parsing of alt statements
2007-09-26 19:40:04 +00:00
Neil Brown
9cfbed3c6e
Rain: added tests for parsing alt statements
2007-09-26 19:39:37 +00:00