Neil Brown
56e5b8da8e
A mega-patch that gets tocktest compiling again
...
However, around a quarter of the tests currently fail...
2009-03-31 17:56:56 +00:00
Neil Brown
2941cbd049
Fixed a problem with record abbreviations being pulled all the way up to the top (which C doesn't like)
2009-03-31 16:50:42 +00:00
Neil Brown
91ce2fe960
Fixed generation of actuals that are ActualExpression (ExprVariable {})
2009-03-31 16:08:37 +00:00
Neil Brown
3566c6206f
Fixed retyping non-packed records into arrays
2009-03-31 16:08:24 +00:00
Neil Brown
edc336de7a
Fixed a bug when generating some no-arg PROCs
2009-03-31 10:50:52 +00:00
Neil Brown
dbf886996a
Removed various bits of old code relating to the old sizes mechanism
2009-03-31 10:50:04 +00:00
Neil Brown
4d2cdc0a9d
Altered the backend passes to use all the new VariableSizes mechanisms rather than the old stuff
...
This is quite a big patch, as it reworks a large pass. The three backend passes dealing with sizes stuff have now been merged into one (because the traversal order is important).
Instead of generating sizes arrays by blindly appending "_sizes", we now create nonces and store them in the csArraySizes map in CompState, which is a bit less hacky.
Added to that, we also generate constant-size arrays (e.g. for [8]) -- which are needed in case we pass the array to a PROC that has a flexible dimension -- at the top of the whole program, and use that array for every variable with that size (so if foo and bar have the same size, we use the same sizes array from the top of the program).
2009-03-31 10:22:34 +00:00
Neil Brown
a10921d53a
Fixed the last few uses of genSizeSuffix in GenerateC to use the new system instead
2009-03-31 09:35:59 +00:00
Neil Brown
f749967af4
Added some cases inside genVariable to handle the VariableSizes item
...
For mobile arrays, this uses the ->dimensions member. For normal arrays, it uses the associated sizes array (by looking it up in CompState).
2009-03-31 09:34:36 +00:00
Neil Brown
298ba6465a
Removed genSizeSuffix and turned most uses of it into calls to genDynamicDim
2009-03-31 09:29:55 +00:00
Neil Brown
b8daebfbc3
Made genDynamicDim a top-level function, and change its implementation to use VariableSizes rather than C-specific stuff
2009-03-31 09:28:45 +00:00
Neil Brown
ecc42f704d
Fixed all the nasty hacks from earlier relating to running processes in parallel
2009-03-27 21:35:28 +00:00
Neil Brown
0ca5bb17d7
A collection of nasty hacks to get Tock's replicated PARs working, and to stop memory leaking
...
All the changes in this patch should be undone as soon as possible (building the list of workspaces, and how we sort out the enrollment counts -- that should be done by pulling up PAR replicator counts outside the whole PAR), but for now, it works.
2009-03-27 17:26:37 +00:00
Neil Brown
2237d15247
Various fixes in the C backend to get oak working
2009-03-27 16:29:06 +00:00
Neil Brown
dbf0b90601
Fixed array sizes for external procs to have one extra formal per dimension, rather than passing the whole array in a single formal (this is now how it should work!)
2009-03-27 16:28:23 +00:00
Neil Brown
574694d078
Fixed some stuff on external PROCs (the adding of sizes parameters)
2009-03-26 23:58:08 +00:00
Neil Brown
6e66cf7521
Added a command-line option to change how much stack the unknown functions are given
2009-03-26 22:49:38 +00:00
Neil Brown
eb99480484
Finished off the support for external C functions
2009-03-26 22:37:28 +00:00
Neil Brown
733293745e
Added a work-around for generating infinity and NaN in the C backend
2009-03-26 18:39:23 +00:00
Neil Brown
1c4d44b739
Fixed generation of C types for channels (somewhere, one is being abbreviated with ValAbbrev, so I'll allow it for now)
2009-03-25 18:27:13 +00:00
Neil Brown
45b22472c3
Changed the rest of tock to reflect the changes to the Is constructor
2009-03-24 23:57:24 +00:00
Neil Brown
eaa8ece954
Fixed allocation of mobile channel bundles, as apparently a clone is unnecessary
2009-03-24 23:54:13 +00:00
Neil Brown
e269efe388
Added some quick hacks to make recursive PROCs work
...
This is along the lines of the Tock ticket. cgtest90 (recursive FUNCTIONs) now passes, but cgtest91 (recursive PROCs) doesn't, because it uses barriers.
2009-03-24 00:14:14 +00:00
Neil Brown
e08197bbef
Added various bits for shared channels, which now means that cgtest86 compiles and passes
2009-03-24 00:08:02 +00:00
Neil Brown
10b4cd7cfc
Realised that allocating mobile arrays as arrays of bytes screws up the resize intrinsic, and gave it a helping hand
2009-03-23 21:28:28 +00:00
Neil Brown
d3f4ff1a9a
Corrected BYTESIN for mobile arrays
2009-03-23 21:18:52 +00:00
Neil Brown
658bfd08e4
Added some code to deal with channel bundles
2009-03-23 21:14:10 +00:00
Neil Brown
7458014c2c
Fixed the C types for records, again
2009-03-23 21:13:55 +00:00
Neil Brown
585a5ed477
Realised that mobile arrays should be allocated after all, unless they are missing a dimension
2009-03-23 21:13:13 +00:00
Neil Brown
3739ff7cbd
Added some extra paranoid bracketing
2009-03-23 21:12:46 +00:00
Neil Brown
9c433b248a
Tried using my new CCSP helper function to allocate arrays
2009-03-23 18:59:57 +00:00
Neil Brown
e8fec8585b
Stopped mobile arrays being allocated after declaration (with random size!)
2009-03-23 15:56:04 +00:00
Neil Brown
919781eabc
Fixed the generation of mobile array dereferences
2009-03-23 15:55:38 +00:00
Neil Brown
4493b3d9e4
Removed some of the mobile passes at Carl's suggestion that I didn't need them anyway
2009-03-23 15:51:11 +00:00
Neil Brown
228523e7e7
Added the generation of IsDefined checks, and stopped them being applied to derefenced arrays
2009-03-23 15:48:24 +00:00
Neil Brown
fae0d6d6a2
Made intrinsic PROCs take the workspace as a parameter, and turned . to _ in their names (and implemented the RESIZE.MOBILE.ARRAY.1D intrinsic)
2009-03-23 15:46:24 +00:00
Neil Brown
3ae4824184
Added a missing case to the C backend
2009-03-22 22:49:10 +00:00
Neil Brown
0fc7266c29
Fixed various things to do with abbreviating sizes arrays, and corrected array assignment and the mobile type for Bool
2009-03-22 22:32:56 +00:00
Neil Brown
8492dc03d4
Introduced a ShareMode in the AST, and used it in the channel attributes (rather than Bool)
2009-03-22 22:29:39 +00:00
Neil Brown
7b52565270
Fixed a few things that work around the user data types problem
2009-03-22 21:06:31 +00:00
Neil Brown
0a97946fbf
Fixed various type-checking things related to mobile types
2009-03-22 21:05:36 +00:00
Neil Brown
12b3c4cd89
Added a pass (and adjusted the backends) to deal with the move-in move-out semantics of mobiles
...
Also known as communication semantics, I think. The pass adds an extra channel parameter per mobile (perhaps in future this could be a single extra channel?) that is used to send back the mobile value, and hacked the backend so that the communications to receive these mobiles are done in the right place (after the processes have been run, but before waiting on the barrier for them to complete).
cgtest83 now compiles, runs and passes without a segfault.
2009-03-22 18:28:42 +00:00
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