Mirror of http://offog.org/git/tock.git . Tock (translator from occam to C from Kent) is a Haskell-based compiler for occam and related languages.
Go to file
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
backends Reworked how stack sizes are calculated, and changed how we use them in the build process 2009-04-03 12:24:53 +00:00
checks A mega-patch that gets tocktest compiling again 2009-03-31 17:56:56 +00:00
common Fixed the generation of formals that are arrays of channel-ends 2009-04-02 15:58:35 +00:00
config Added code for full compilation mode to include the relevant C files from occam #USE directives, and link to the relevant object files 2009-04-01 18:32:39 +00:00
data Made the name of record-copying PROCs different for each file that generates them, to avoid clashes at link time 2009-04-03 10:25:55 +00:00
docextra Add the Tock hacker's guide to the repository. 2008-11-20 13:41:06 +00:00
flow A mega-patch that gets tocktest compiling again 2009-03-31 17:56:56 +00:00
frontends 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
pass Turned off unused variable checking for now -- I think it's bugged 2009-03-25 18:33:23 +00:00
pregen Make GenNavAST generate instances of a "Polyplate" class. 2008-05-10 16:27:46 +00:00
support Added some missing static specifiers to some occam support functions 2009-04-01 18:59:10 +00:00
testcases Fixed some of the tests, and added another testcase for array passing, based on one of Carl's examples 2009-03-20 12:59:16 +00:00
transformations Made the name of record-copying PROCs different for each file that generates them, to avoid clashes at link time 2009-04-03 10:25:55 +00:00
AUTHORS Changed tock to use autoconf/automake for its build process 2007-10-08 17:02:03 +00:00
cgtests.mk Changed the names of generated tock files to have ".tock" before the extension 2009-04-02 15:40:39 +00:00
ChangeLog Changed tock to use autoconf/automake for its build process 2007-10-08 17:02:03 +00:00
compile-cgtests Added rules for getting and making the cgtests to the new Automake make system 2007-10-09 00:44:41 +00:00
configure.ac Took out my warning option since it causes problems 2009-03-22 14:50:25 +00:00
COPYING Add licensing information. 2007-08-18 20:42:11 +00:00
COPYING.LIB Add licensing information. 2007-08-18 20:42:11 +00:00
LANGUAGE Implement channel direction decorators. 2008-06-09 21:35:20 +00:00
Main.hs Reworked how stack sizes are calculated, and changed how we use them in the build process 2009-04-03 12:24:53 +00:00
Makefile.am Fixed some things to do with the build system (extra headers, include paths) 2009-03-27 19:54:05 +00:00
NEWS Changed tock to use autoconf/automake for its build process 2007-10-08 17:02:03 +00:00
ProcessTags.hs Finally got round to adding a little program to qualify the AST tags in the TAGS file 2009-03-22 15:51:43 +00:00
rangetest.c Fixed rangetest to work with the new support headers (it doesn't need the CIF header, only the plain header) 2009-04-02 13:20:35 +00:00
README Changed tock to use autoconf/automake for its build process 2007-10-08 17:02:03 +00:00
SYNTAX Give tock its own repo -- i.e. remove everything else and move tock up 2007-07-16 21:48:55 +00:00
TestMain.hs Added some testcases related to checking the use of abbreviations 2009-02-08 23:25:30 +00:00
TODO Give tock its own repo -- i.e. remove everything else and move tock up 2007-07-16 21:48:55 +00:00