Commit Graph

102 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
ed63476ad7 Fixed strings passed on the command-line for defines 2009-05-19 13:28:39 +00:00
Neil Brown
2c7fc86533 Fixed the processing of -D arguments on the command-line 2009-05-19 09:53:54 +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
b70811926a Fixed some imports that were secretly causing a haskell98 package dependency 2009-05-18 19:55:59 +00:00
Neil Brown
fcacdd3235 Turned csCurrentFile into a monad transformer variable, and added csCompilationHash to help in uniquifying names between files 2009-04-19 19:36:38 +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
378ef07893 Adjusted all the other modules to reflect the new change to CSM 2009-04-17 17:40:00 +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
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
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
50662fa6f0 Added support for passing preprocessor defines from the command-line 2009-04-14 10:48:26 +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
e3c426e870 Added full-compile support for the CHP backend 2008-11-26 12:48:48 +00:00
Neil Brown
78716a2727 Added a CHP backend option to Tock 2008-11-26 12:24:21 +00:00
Neil Brown
e462da4a76 Added a system for specifying implicitly-used modules on the command-line
An implicitly used module is equivalent to a #USE directive before the first line of the main file.  This, combined with changes in occbuild, are my current way of implementing the automatic use of the forall module in occam.
2009-04-10 19:26:22 +00:00
Neil Brown
ae61b22355 Corrected the C++ compilation commands, and gave the header a different extension 2009-04-08 16:45:08 +00:00
Neil Brown
49d6e2aaaf Reworked how the stack sizes are recorded and merged together
The previous method, using the C preprocessor was both nasty, and crazily resource-intensive.  The new method stores stack size information in files that are read in and processed by the compiler when it comes time to link.
2009-04-07 16:03:52 +00:00
Neil Brown
f8103c1d2d Added a library path to the set of Tock directories 2009-04-04 15:57:50 +00:00
Neil Brown
df21bf23ae Added a command-line option to print the include path
I'm not totally clear yet if the include path is or should be different to the module path, but I think it will become clear as I get KRoC compiling.
2009-04-04 13:45:22 +00:00
Neil Brown
d595b73f28 Added a command-line option to print out the module directory 2009-04-04 12:30:09 +00:00
Neil Brown
18f37a0d96 Made it easier to print out a plain String after processing the command-line options 2009-04-04 12:27:56 +00:00
Neil Brown
38ffed2bda Stopped the .o file being removed after compilation when the -c flag was given 2009-04-03 16:52:16 +00:00
Neil Brown
427938039c Implemented a search path for Tock (for #INCLUDE and #USE directives) 2009-04-03 16:51:00 +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
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
Neil Brown
098c4e5ef4 Added -c as an alternative for --no-main 2009-04-02 18:15:02 +00:00
Neil Brown
0e31e98bb2 Made Tock draw in the post-analysis object files when linking 2009-04-02 18:14:40 +00:00
Neil Brown
f69030df34 Changed the names of generated tock files to have ".tock" before the extension
This helps avoid collisions with pre-existing files, especially .inc files (but also .c and .h)
2009-04-02 15:40:39 +00:00
Neil Brown
8153cfc659 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
Neil Brown
db9b8e9d91 Changed where we generate the .inc file from being in the backend, to being a pass just after type-checking
We need to generate the externals after we've inferred channel directions, but before we do further work (like adding _sizes parameters and so on).
2009-04-01 16:54:07 +00:00
Neil Brown
abce001bab Added a command line option to indicate that there is no main PROC 2009-04-01 15:29:22 +00:00
Neil Brown
219bfd9ce1 Modified the C backend so that it will put the forward declarations into a header file and include that 2009-04-01 14:35:47 +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
95d7144c7b Added the ability to specify linker flags separately from C compilation flags 2009-03-26 22:36:13 +00:00
Neil Brown
09093cff12 Added the ability to print out HTML-highlighted lexed occam
This falls a bit outside the compiler's remit, but it will be the same code to print out the lexed occam without highlighting, which I plan to use for doing libraries with Tock in a bit.
2009-03-26 22:34:34 +00:00
Neil Brown
633a3dbbc5 Quickly added a command line option to allow you to specify flags to pass to the C/C++ compiler 2009-03-25 22:35:49 +00:00
Neil Brown
5ffea3f78e Added a lex mode to Tock that shows how a program was lexed 2009-03-24 18:18:55 +00:00
Neil Brown
1343954c2f Added an option to automatically run indent on C/C++ source before running GCC
This option is very handy when debugging the C/C++ output of Tock when GCC gives a compiler error.
2009-03-21 18:25:09 +00:00
Neil Brown
b970b9df33 Added command line options for occam 2 mobility, and turned it off by default 2009-03-19 11:38:48 +00:00
Neil Brown
6cbdc0e13b Finally merged the list of warnings into CompState rather than having its own StateT monad 2008-11-20 13:35:44 +00:00
Neil Brown
a455676fa9 Added all the necessary command-line options for enabling and disabling warnings in the Main module 2008-11-20 13:26:45 +00:00
Neil Brown
0746219984 Added support for recording terminator nodes (as well as root nodes) while building the flow graph 2008-05-30 17:15:52 +00:00
Neil Brown
90986ea97b Added a backend that prints out the AST as source (rather than dumping the raw AST) 2008-05-17 22:20:38 +00:00
Neil Brown
7d65db43c0 Changed TestHarness to support Rain test files as well as occam 2008-05-17 13:13:52 +00:00
Neil Brown
4ef1ff7196 Changed to a state monad for warnings, and added a runPassM function to remove duplicate code for running passes 2008-04-03 12:21:59 +00:00
Neil Brown
463ddc636b Changed the running of the PassM monad to use the new mechanism 2008-03-10 15:19:50 +00:00
Neil Brown
d66fb79796 Fixed some unused module import warnings, now that PassM is not build of monad transformers 2008-03-10 17:19:45 +00:00