Adam Sampson
a2a15cab64
Split include file expansion out into a separate pass.
...
The order of initial passes is now:
lex -> preprocess -> structure -> expand-include -> parse
which means that #IFing out structurally-invalid code (like inline VALOF) now
works. This also cleans up the preprocessor code a bit.
2008-02-29 15:01:19 +00:00
Adam Sampson
d7fbd93816
Add some tests for structureOccam.
2008-02-29 14:08:57 +00:00
Adam Sampson
2f407fc2cd
Pass CFLAGS/CXXFLAGS/CPPFLAGS/LDFLAGS through into Tock's built-in options.
2008-02-29 11:16:35 +00:00
Adam Sampson
cbcccae96c
Don't clobber CFLAGS/CPPFLAGS while configuring.
2008-02-29 11:09:18 +00:00
Adam Sampson
c8b6be34e1
Implement comparisons in preprocessor expressions.
...
This brings Tock's conditional compilation facilities up to par with occ21.
2008-02-29 00:23:49 +00:00
Adam Sampson
a5fd73130a
Use Parsec to parse #DEFINE directives.
...
This is much neater, and I'll need most of the code to implement comparisons anyway.
2008-02-28 23:47:06 +00:00
Neil Brown
6d4f1dd702
Added labels to all the top-level tests that didn't have one
2008-02-28 16:11:01 +00:00
Neil Brown
cb8327451d
Added the ability to apply a filter to which HUnit tests you run
2008-02-28 16:08:36 +00:00
Neil Brown
b3458ec541
Corrected the pointer indirection for records inside records
2008-02-28 16:08:06 +00:00
Neil Brown
62e45a8909
Added a missed new C/C++ test to the list of tests to run
2008-02-28 15:33:08 +00:00
Neil Brown
d73f2f509c
Added some template types to one of the uses of tockArrayView to please the C++ compiler, and adjusted the tests accordingly
2008-02-28 15:32:26 +00:00
Adam Sampson
8f2575819b
Initial implementation of the occam-pi preprocessor.
...
This implements #DEFINE, #UNDEF, #IF, #ELSE and #ENDIF, macro expansion with
##, and TRUE, FALSE, AND, OR, NOT and DEFINED within #IF expressions, with the
same semantics as occ21.
The macro COMPILER.TOCK is always defined by default, so you can now say things
like "#IF NOT DEFINED (COMPILER.TOCK) ... #ENDIF".
2008-02-28 20:27:30 +00:00
Adam Sampson
62b9c9b105
Prefix pass test output with the pass name ++ ": " consistently.
2008-02-28 16:51:53 +00:00
Adam Sampson
06ad1e5e06
Clean up the documentation hack a bit.
...
We now postprocess all the generated HTML using M4, so we can hide the SVG
images behind macros (and we can now use images inside the main documentation
too).
2008-02-28 14:43:53 +00:00
Adam Sampson
8d06c3d180
Various tweaks to the Haddock comments to get it building with 0.8 again.
2008-02-28 14:20:34 +00:00
Neil Brown
0ecb7146e4
Fixed the implementation of REM for floating point types
2008-02-27 20:56:13 +00:00
Neil Brown
8da136a3b6
Added the -v flag when compiling the cgtests, so that I have something to look at
2008-02-27 20:35:26 +00:00
Neil Brown
a4424ee82d
Fixed a few dependencies in the pass lists relating to functions
2008-02-27 20:05:47 +00:00
Neil Brown
4a0d199406
Fixed the keep temporaries thing so that it still keeps them when the compilation succeeds, not just when it dies
2008-02-27 19:58:32 +00:00
Neil Brown
46de1956b3
Corrected the pulling up of SEQ replicator counts to descend properly into nested functions
2008-02-27 19:58:09 +00:00
Neil Brown
86c17fed99
Added a pass for pulling up the replicator counts in SEQs so that the count is constant for the whole loop
2008-02-27 19:33:44 +00:00
Neil Brown
7206d45af3
Toned down the amount of suffixes generated for C/C++ integer literals
2008-02-27 18:56:36 +00:00
Neil Brown
63730b5aff
Adjusted the tests for record definitions in the C/C++ backends to use the new function in the dictionary for them
2008-02-27 18:56:09 +00:00
Neil Brown
9ab4563a2c
Moved the definition of record types into the forward declarations
2008-02-27 18:25:14 +00:00
Neil Brown
cfc3577c21
Fixed the pre-condition of flattenAssign to include the types being resolved
2008-02-27 18:24:33 +00:00
Neil Brown
1afea6c62c
Fixed underlyingType not recursing properly into the inner types in arrays
2008-02-27 18:23:53 +00:00
Neil Brown
eef0ac53e0
Added a flag to the compiler to tell let it to not delete the temporary files it used
2008-02-27 18:23:22 +00:00
Neil Brown
b0fac1f82a
Made sure that definitions are only pulled up after protocol inputs have been flattened
2008-02-27 17:20:52 +00:00
Neil Brown
af7a15b4df
Changed testTransformProtocolInput so that it does transform protocol inputs in ALT guards
2008-02-27 17:20:19 +00:00
Neil Brown
9b521c9b07
Added tests for testing that testTransformProtocolInput transformed protocol inputs in ALTs
2008-02-27 17:19:47 +00:00
Neil Brown
5c7bb1296b
Altered transformProtocolInput to only bother flattening inputs with more than one item
2008-02-27 17:01:19 +00:00
Neil Brown
9b570996ca
Added a pass to flatten protocol inputs down into multiple sequential input statements
2008-02-27 16:45:27 +00:00
Neil Brown
018951ef40
Fixed the shift behaviour by moving it out into functions like the add and subtract operations already were
2008-02-27 15:13:11 +00:00
Neil Brown
40bb883497
Fixed the printf specifiers on float and double items for printing errors
2008-02-27 15:09:27 +00:00
Neil Brown
9712df4458
Added a type annotation (esp. for signed types) for hex literals in the C/C++ backends
2008-02-27 14:00:54 +00:00
Neil Brown
245e4536bc
Fixed signed hexed values in the constant folder
2008-02-27 14:00:28 +00:00
Neil Brown
93a3c81255
Fixed the right-shift in the constant folding to be an unsigned (logical, non sign-extending) shift
2008-02-27 12:45:29 +00:00
Neil Brown
9d1c170b34
Added a size suffix to the code generated for C/C++ integer and real literals (where needed)
2008-02-26 18:09:21 +00:00
Neil Brown
4595a2ddd5
Added -fno-strict-aliasing to the C and C++ compiler options, since we break strict aliasing when retyping
2008-02-26 18:06:50 +00:00
Neil Brown
0f437dcf0e
Fixed the behaviour of the right-shift operator to match how it should work in occam
2008-02-26 17:20:29 +00:00
Neil Brown
5807c59edf
Moved the three Flow modules out to a new flow directory
2008-02-26 15:07:07 +00:00
Neil Brown
decf249c51
Moved AST, CompState and Metadata out to a new data directory (along with the generated OrdAST and TagAST)
2008-02-26 15:02:13 +00:00
Neil Brown
bca3f89872
Adjusted the QuickCheck tests, now that Alt is handled properly
2008-02-26 14:34:46 +00:00
Neil Brown
b4ee07a3a7
Fixed a few comments in FlowAlgorithms
2008-02-26 14:24:33 +00:00
Neil Brown
9ba8d30aa0
Added the handling of ALTs to the control-flow graph
2008-02-26 14:20:45 +00:00
Neil Brown
4dbeabb5dc
Added the first group of tests for handling ALTs in the control-flow graph building
2008-02-26 14:19:57 +00:00
Neil Brown
5dbf7fea7a
Changed functionsToProcs to work on the new style of function, and made sure parallel assignment isn't removed first
2008-02-25 22:05:53 +00:00
Neil Brown
f9625ce495
Adjusted the tests for functionsToProcs to include the new style of functions
2008-02-25 22:02:21 +00:00
Neil Brown
7af49a2d10
Fixed the checkFunction pass
2008-02-25 21:27:37 +00:00
Neil Brown
dcf419744a
Renamed the transformFunction pass into checkFunction, and adjusted the tests for it accordingly
2008-02-25 21:17:37 +00:00