For example, this now works:
#define A (1 + 2)
Note that we still don't support defines with argument lists, so this is
still illegal:
#define A(X) (X + 2)
Also in this change: The compiler test script allows command-line
arguments to disable testing on ARM and to disable testing the output
of the old OTCC compiler.
Disabling testing on ARM is handy for developing front-end code when no
device or emulator is available.
Disabling testing OTCC output is handy for some 64-bit Linux environments,
because the original OTCC needs some tweaking to be fully compatible, and
I don't have time to investigate this problem right now.
This is another step towards being able to handle lval / rvals.
Improved storeR0ToTOS to convert R0 to the proper type to store into
*TOS. (This is something that storeR0 was already doing.)
Removed storeR0 as it is no longer being used.
This makes it easier to generate frame-pointer-relative addresses for ARM.
Prior to this we had stored char sized local variables in the highest
address of the 4-byte stack allocation. Now we store "char"s in the
lowest address of the 4-byte stack allocation, just like chars are
passed as arguments.
We now store global chars on byte boundaries.
This means we don't have to pass it around as an argument.
This change was made because I'm about to start creating pointer types
during expression evaluation, and I didn't want to add an arena
argument to all the expression functions.
Factor ARM integer binary operation setup code into a function.
Don't pass redundant pType information into loadR0FromR0, storeR0ToTOS,
gcmp, gUnaryCmp, li
Separate inc/dec from variable loading. Generates worse code, but now
we handle pointer inc/dec and char inc/dec.
Don't segfault if the right-hand operand of a binary operator is missing.
Don't segfault if a semicolon is missing at the end of a forward
declaration.
Support floating-point if/while statements: if(1.0) { ... }
Support reading values from float and double pointers.
And some additional error checking.
Detect malformed "return" statements
Detect passing the results of "void" functions as arguments.