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
8030161a90
Changed bytesInType to use the new module for getting the size of the bool and int types
2008-03-07 21:24:20 +00:00
Neil Brown
5714b5552a
Added an automatically generated module containing the sizes of bool and int in the C and C++ implementations on the host machine
2008-03-07 21:23:24 +00:00
Neil Brown
235ce3d3e5
Added a clean target to the cgtests makefile
2008-03-07 21:22:33 +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
f0fceb5aee
Stopped array literals being pulled up out of record literals in C++, now that the array handling has been changed
2008-03-07 15:48:24 +00:00
Neil Brown
e3fed836c5
Made the cgtest compilation depend on tock, to force recompilation
2008-03-07 10:02:15 +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
edefe7be9f
Added a progress message just before the backend is entered
2008-03-06 15:23:31 +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
9ad4552232
Moved the error message for occam_stop into the StopException for C++, rather than printing it directly
2008-03-05 17:12:01 +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
256ce80ccb
Moved all the testPass* functions into the TestMonad, using unsafePerformIO for running them inside QuickCheck
2008-03-05 16:06:14 +00:00
Neil Brown
d02b771572
Tidied up the type of handleDirective to make it easier to use
2008-03-05 16:05:21 +00:00
Neil Brown
03eab6c142
Fixed some typing relating to QuickCheck and the TestMonad to avoid type ambiguities in future
2008-03-05 16:04:30 +00:00
Neil Brown
2ea7c37abe
Added the implementation of declaring _sizes arrays for record fields
2008-03-04 15:22:24 +00:00