Commit Graph

2564 Commits

Author SHA1 Message Date
Neil Brown
3b1519e4d3 Fixed problems with passing MOBILE items to operators 2009-04-17 18:40:50 +00:00
Neil Brown
40fc118c31 Fixed an inappropriate use of type equality that was causing problems with operators that return arrays 2009-04-17 18:31:11 +00:00
Neil Brown
0f277365b5 Removed a big piece of commented out old code that was recorded by accident 2009-04-17 18:28:04 +00:00
Neil Brown
57657aa6cf Added a missing operator (unary MINUS on BYTE) to the support headers 2009-04-17 18:24:03 +00:00
Neil Brown
032e40f562 Corrected a bug where user-defined types involved with operators were not being resolved properly 2009-04-17 18:19:09 +00:00
Neil Brown
87f69d816f Fixed the checkConstants pass to not complain about variably-sized dimensions in RESHAPES abbreviations 2009-04-17 18:05:03 +00:00
Neil Brown
759bc06a53 Fixed the type inference for operators
The previous system followed Jim Moores' description, which turns out to not be how KRoC does it, and different enough that lots of existing occam code was failing.

The new system makes two changes.  First, if there is only one suitable operator, given the types (taking Infer to be a wild-card) then it uses that operator, and can usually settle any remaining Infers.  Second, it uses the type context to narrow down the operators to only those that have a matching return type.  These changes seem enough to compile a lot of the trickier types.
2009-04-17 18:01:17 +00:00
Neil Brown
4add133d5b Made the size of INT in occam be based on the size of void* in C
I also stopped there being separate sizes for C and C++ since that wasn't supported properly in the compiler anyway.

Fixes #37
2009-04-17 14:22:53 +00:00
Neil Brown
9aa698aac3 Refactored the code that parses pragmas to be nicer
Fixes #94
2009-04-17 14:10:14 +00:00
Neil Brown
aaf951fe67 Split up the OccamTypes module into OccamCheckTypes and OccamInferTypes 2009-04-17 14:11:44 +00:00
Neil Brown
f36543d067 Fixed the dereference-inference for mobiles
The new system works by inserting code in the processing of all AST elements that directly contain a variable.  If the variable needs to be dereferenced, it is.  This only happens outside variables, and when a variable is subscripted.  I did try putting this processing in doVariable, but then odd double-dereferences began to crop up, so I realised the processing has to happen outside the variable.  It seems to pass cgtest85 fine, which it was having lots of trouble with before.
2009-04-17 11:46:00 +00:00
Neil Brown
b0faa0e387 Fixed the sizes for mobile arrays of mobile arrays
The pass was folding the two arrays together, then digging too far into the dimensions of the outer array, rather than looking at the dimensions of the inner array.
2009-04-16 18:42:27 +00:00
Neil Brown
f909c6fd03 Fixed external calls so that passing mobile arrays to and from external calls now works 2009-04-16 18:29:14 +00:00
Neil Brown
437c6bd3ef Fixed genBytesIn for mobile arrays 2009-04-16 17:39:24 +00:00
Neil Brown
cdab6af65a Fixed the allocation of mobile arrays of mobile things so that the pointers in the new array are set to 0 2009-04-16 17:19:40 +00:00
Neil Brown
19cd8085d2 Fixed the abbreviation modes of claimed channels a bit
This doesn't solve the problem (see #95), but it at least properly confines the problem to shared channel bundles, rather than affecting shared normal channels too.
2009-04-16 17:18:39 +00:00
Neil Brown
ea2d00355c Changed findAllProcess to be much more efficient
Previously, it was finding the processes in the flow-graph, then using the routes to find the process in question, then calling the examination function on that process.  For large flow trees, the cost of traversing all the routes (to all A.Process!) was too high.

Now it find the processes in the AST (so that it only traverses the AST once) then zips any found processes with the flow-graph (using the route IDs) with Map.intersectionWith, which is much faster.

Fixes #90
2009-04-16 17:03:27 +00:00
Neil Brown
e5001b1c6c Added progress messages with a little detail about the usage checking, which helps to see which part is going slow 2009-04-16 17:02:23 +00:00
Neil Brown
3041cda59c Added a new listifyDepthRoute function that's like listifyDepth, but stores the route too 2009-04-16 17:01:43 +00:00
Neil Brown
5a5b91e387 Fixed the passing of mobile arrays to old-style external calls 2009-04-16 14:19:25 +00:00
Neil Brown
decd2d16df Fixed type inference for multidimensional array literals
Fixes #93
2009-04-16 12:27:37 +00:00
Neil Brown
a8b1697df6 Fixed the types for MOBILE array allocations that are inferred from something with unknown dimensions 2009-04-16 10:45:02 +00:00
Neil Brown
720388c764 Added a pass for MOBILE params to FORKed processes 2009-04-16 10:44:46 +00:00
Neil Brown
ee787b911c Rejigged the calculation of stack sizes to do partial subsitution for sizes files when they are generated 2009-04-16 10:25:43 +00:00
Neil Brown
c8136b7ef4 Fixed some problems with mobile stuff in the C backend 2009-04-16 10:25:16 +00:00
Neil Brown
ff9cabd80b Changed csParProcs to be a map that indicates whether the process is a wrapper for FORK or PAR 2009-04-16 10:25:02 +00:00
Neil Brown
2af2563773 Changed CLAIMs to be ValAbbrev (this eases dealing with it in the C backend later) 2009-04-16 10:22:49 +00:00
Neil Brown
a12c4cc814 Got most of the C++ backend working again, at least on the early cgtests 2009-04-14 15:33:34 +00:00
Neil Brown
d419c89843 Fixed the type-checking for the allocation of mobile arrays 2009-04-15 19:37:19 +00:00
Neil Brown
535054eed0 Added a missing sanity check when allocating mobile arrays 2009-04-15 19:36:14 +00:00
Neil Brown
d07a4cb496 Fixed a function in AnalyseAsm to not read in the same sizes file twice, and made sure that sizes files are not emitted with their path 2009-04-15 17:17:22 +00:00
Neil Brown
f11db734a8 Added in kroc_argc and kroc_argv that is expected by one of the occam modules 2009-04-15 17:11:03 +00:00
Neil Brown
5f87855cc7 Fixed the backend so that it does not think stack sizes are needed for external functions 2009-04-15 17:10:29 +00:00
Neil Brown
681b1aa878 Added a couple of new pragmas (TOCKINCLUDE and TOCKNATIVELINK) to help with modules 2009-04-15 17:09:22 +00:00
Neil Brown
2d7728a4b7 Fixed the bitwise functions for BYTE in the support headers 2009-04-15 17:06:36 +00:00
Neil Brown
5dc19cc614 Fixed part of the full-compile stuff that was using stale CompState 2009-04-15 17:05:36 +00:00
Neil Brown
1572752534 Renamed the --external-link flag to --linker-flags (which is more like the corresponding --compiler-flags option) 2009-04-15 17:05:12 +00:00
Neil Brown
5fe8d4ba6a Fixed a couple of small things in the C backend that were causing GCC to spew out lots of warnings 2009-04-15 12:06:29 +00:00
Neil Brown
587554a5a0 Stopped INLINE PROCs and INLINE FUNCTIONs being written out to the .tock.inc files 2009-04-15 12:05:34 +00:00
Neil Brown
d03a0d4cb1 Added support for a new TOCKSIZES pragma that will be used in .module files to indicate that some .sizes should be loaded 2009-04-14 17:05:37 +00:00
Neil Brown
058ed31cad Changed the implicit modules to be INCLUDEd rather than USEd (duh!) 2009-04-14 17:04:46 +00:00
Neil Brown
ce15465849 Made the preprocessor be a little clearer with regards to its suffix workings 2009-04-14 17:04:13 +00:00
Neil Brown
ca3fc18748 Fixed the backend to work out the header extension better 2009-04-14 17:03:55 +00:00
Neil Brown
54175f1a08 Added a new csExtraSizes item to CompState and adjusted Main to work with that and the new AnalyseAsm 2009-04-14 17:03:21 +00:00
Neil Brown
5f5dac41d1 Fixed the backend to work with channels that shared at one end only 2009-04-14 17:01:09 +00:00
Neil Brown
46f9e1f7e4 Changed AnalyseAsm to give more helpful error messages when there is a problem 2009-04-14 16:59:53 +00:00
Neil Brown
3a2182326c Added a new function in Utils for splitting a file into its extension, and the rest of it 2009-04-14 16:58:38 +00:00
Neil Brown
5abf19a2a3 Added a dummy sizes file for the dummy occamutl module 2009-04-14 16:58:26 +00:00
Neil Brown
bda3a0ad96 Stopped the usage checker checking shared channels for CREW violations 2009-04-14 12:11:32 +00:00
Neil Brown
433be2105b Corrected the parser to accept normal channels with only one end shared 2009-04-14 12:07:41 +00:00