Commit Graph

303 Commits

Author SHA1 Message Date
Adam Sampson
2c4ccfbf39 Update all the copyright notices.
I've checked these all against the Darcs history using a script
(check-copyright, in my misccode collection). Anything Neil or I did as
part of our PhDs is copyright University of Kent; more recent work
belongs to us, as appropriate.
2011-07-21 11:38:13 +00:00
Neil Brown
728fa5f328 Fixed up the implicit mobility to work with oak (but needs some more work to make sure normal mobility still functions) 2009-05-27 18:01:03 +00:00
Neil Brown
734685d715 Fixed genOverArray to be okay with mobile arrays 2009-05-22 21:57:00 +00:00
Neil Brown
703bfe1afe Added better error messages for problems with C types in the backend 2009-05-19 12:58:22 +00:00
Neil Brown
af1e4b6b7f Added an EXIT intrinsic that's useful for profiling 2009-05-25 17:08:11 +00:00
Neil Brown
d98c5079ca Cleaned up all the warnings in Tock's code (most unused modules, or unused functions) 2009-05-19 09:05:38 +00:00
Neil Brown
f4eea82bb7 Fixed a bug where C. externals were turned into blocking calls, and B. externals were turned into normal external calls
This turned out to be the reason for the slowness in parrot_attack.
2009-04-19 23:09:18 +00:00
Neil Brown
cb4250b1b2 Implemented the SETAFF intrinsic 2009-04-19 17:29:20 +00:00
Neil Brown
b0ea943c72 Fixed the creation of the header define when there are characters such as dashes in the file name 2009-04-19 17:01:35 +00:00
Neil Brown
838de8a366 Corrected various test failures in the C backend 2009-04-19 15:01:00 +00:00
Neil Brown
3a5565471f Added support for extended rendezvous throughout the compiler 2009-04-19 16:26:37 +00:00
Neil Brown
41cf599ebe Fixed non-top-level records in the C backend 2009-04-19 13:22:24 +00:00
Neil Brown
40e0399e4c A whole lot of changes, described in #101 that help with records and separate compilation
The scheme may be strange, but a lot of KRoC compiles with it (and I think the cgtests will compile again now too)
2009-04-18 21:35:26 +00:00
Neil Brown
57ffc7bfa4 Split out a chunk of CompState into a CompOpts type for things that can be set on the command-line 2009-04-17 21:10:14 +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
5a5b91e387 Fixed the passing of mobile arrays to old-style external calls 2009-04-16 14:19:25 +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
535054eed0 Added a missing sanity check when allocating mobile arrays 2009-04-15 19:36:14 +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
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
ca3fc18748 Fixed the backend to work out the header extension better 2009-04-14 17:03:55 +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
f257100ba8 Added support for the SETPRI intrinsic 2009-04-14 11:05:27 +00:00
Neil Brown
c2b31d3c78 Fixed the listify function, especially for the C backend, so that the ordering is what we want, regardless of whether it makes sense 2009-04-13 22:40:25 +00:00
Neil Brown
d36503e15d Fixed a couple of problems in the backend with channel bundles 2009-04-13 20:37:21 +00:00
Neil Brown
f2c4ada01b Removed PolyplateSpine in favour of using PolyplateM (and the State monad) everywhere 2009-04-13 20:37:14 +00:00
Neil Brown
9069282ca2 Added support to the backend for FORK and FORKING 2009-04-13 14:58:07 +00:00
Neil Brown
8f767ff0d4 Made all the imports of Data.Generics have an import list
This makes sure that we catch all leftover instances of using SYB to do generic operations that we should be using Polyplate for instead.  Most modules should only import Data, and possibly Typeable.
2009-04-09 15:36:37 +00:00
Neil Brown
e61a23855a Fixed all the conflicts while merging into the Polyplate branch 2009-04-09 11:01:39 +00:00
Neil Brown
d49c7fad4a Fixed all the modules in the backends directory to work with the new Pass system 2008-12-14 18:32:34 +00:00
Neil Brown
47d565a3b9 Changed records to always use their original name in the C code
This fixes the problem with PROCs complaining that one munged version of the record name was not the same as another.

This will cause problems if two different record definitions for the same name are visible in the same file.
2009-04-12 13:06:49 +00:00
Neil Brown
7a7eefa33e Changed inline items to always be static
I'm not sure if this is a valid thing to do, but it solved a problem with the occam libraries where multiple occam files were including an inline FUNCTION from an include file, and this was causing problems at link time.
2009-04-12 13:02:58 +00:00
Neil Brown
2308c6571c Fixed assignment of arrays to work when dimensions are missing (helps with the initialisers for mobile allocations) 2009-04-09 17:09:50 +00:00
Neil Brown
98ffb74505 Corrected cgenVariableWithAM to work properly (and be a little cleaner) for generating VariableSizes 2009-04-09 17:09:23 +00:00
Neil Brown
229f2197af Turned findMeta into a member of a FindMeta type-class 2009-04-09 11:13:37 +00:00
Neil Brown
debdef4f4f Fixed the generation of directed channels for the C++ backend 2009-04-08 19:14:29 +00:00
Neil Brown
5a7f68a44f Removed some of the old C generation functions, and added a new one (genFunctionCall) to get the C++ backend compiling again 2009-04-08 16:07:01 +00:00
Neil Brown
7bd4e3d309 Added functions to the list of things that need stack sizes, even if they are external
I think this is not quite right, but for now it fixes stack sizes not being generated for any non-inlined standard operators.
2009-04-07 15:42:37 +00:00
Neil Brown
c4f625b1ba Overhauled the support headers to add most of the missing occam operators as inline functions 2009-04-06 00:56:06 +00:00
Neil Brown
6d6d26d5d6 Fixed the backends to work with the new system (mainly removing unnecessary code) 2009-04-05 23:06:47 +00:00
Neil Brown
e457d82f0c Changed FUNCTIONs and PROCs to have optional bodies, and put all the externals into the AST (without bodies)
This may seem like an odd change, but it simplifies the logic a lot.  I kept having problems with passes not operating on externals (e.g. functions-to-procs, adding array sizes, constant folding in array dimensions) and adding a special case every time to also process the externals was getting silly.

Putting the externals in the AST therefore made sense, but I didn't want to just add dummy bodies as this would cause them to throw up errors (e.g. in the type-checking for functions).  So I turned the bodies into a Maybe type, and that has worked out well.

I also stopped storing the formals in csExternals (since they are now in csNames, and the tree), which streamlined that nicely, and stopped me having to keep them up to date.
2009-04-04 14:56:35 +00:00
Neil Brown
b9cbcf0902 Added the intrinsic CAUSEERROR 2009-04-03 15:14:24 +00:00
Neil Brown
b803b1ec91 Reworked how stack sizes are calculated, and changed how we use them in the build process
Now that we support separate compilation, some of the stack sizes for PROCs depend on the stack sizes of other PROCs that were compiled in different files.  We can't just assume the default 512 bytes for these "foreign" PROCs, because that often won't be enough.  So instead, we must make the stack sizes for the current PROCs depend on (i.e. use in the calculation) the stack sizes of the foreign PROCs.

This dependence adds some issues though.  We cannot declare in one C file a const int that depends on the value of an extern const int from another C file (not valid C, it seems).  So instead, we move all the stack size declarations to header files, and use #includes and the preprocessor to make sure that the stack sizes are statically determined.

This in turn simplifies the build process in some ways.  These headers only need to be compiled by the .occ file that has the main process, by including them all into a C file and compiling that as before.  It means that each .occ file only has one .o file resulting (plus two C headers*, and a .inc file) so linking is a bit less confusing.

* I am keeping the two C headers for now, rather than appending the sizes one to the normal header, because I'm not entirely sure whether having one header that the C file depends on may trigger a recompilation that we don't want in some build systems.  I can always merge them later if that's not a valid worry.
2009-04-03 12:24:53 +00:00
Neil Brown
9bf32e339d Made sure that the names printed in TOCKEXTERNAL pragmas are fully munged (and thus equivalent to the exact C function name) 2009-04-03 12:22:19 +00:00
Neil Brown
ca332a0925 Changed the asm-analysis to only generate stack-sizes for PROCs, and not non-PROCs or external PROCs
This just about works, but it allocates the usual 512 bytes for all external PROCs being called, rather than using the actual stack_size for those external PROCs (this causes popcorn to overflow the stack if left with the default 512 bytes)
2009-04-02 20:04:21 +00:00