Commit Graph

363 Commits

Author SHA1 Message Date
Bill Currie e4ac92b5f2 Auto-cast between enums and the default type. 2011-02-06 20:08:16 +09:00
Bill Currie f2c272f0b8 Make adding a symbol to multiple tables an internal error. 2011-02-06 20:00:14 +09:00
Bill Currie 67957a14df Bring back convert_name(), but siimplified.
It is now mainly for converting __FILE__ etc, handling expression symbols,
and checking for undefined identifiers.
2011-02-06 14:29:14 +09:00
Bill Currie 1f6abb2cce Minor cleanups to message_expr().
Fix for class names no longer being pointers to the class.
2011-02-04 23:22:51 +09:00
Bill Currie eff3957487 Resurrect the address expression code for arrays etc.
This fixes selector finding.
2011-02-04 23:20:37 +09:00
Bill Currie d7853682af Fix conversion of nil to a real type. 2011-02-03 21:37:15 +09:00
Bill Currie c158b14286 Remove the labels list from the pr struct.
I'm not sure they were ever needed.
2011-01-28 11:40:25 +09:00
Bill Currie a6e65488ec Remove the "test" parameter from test_expr.
The parameter became redundant at some stage.
2011-01-27 08:31:51 +09:00
Bill Currie 5231e8e9f8 Handle .zero, .return and .param* properly. 2011-01-26 08:01:24 +09:00
Bill Currie 0624408317 Move the diagnostic functions into their own file. 2011-01-24 21:54:57 +09:00
Bill Currie 483cbeba03 Fix a few FIXMEs. 2011-01-24 21:13:37 +09:00
Bill Currie afc5b2827d Simplify def handling, use far data.
Since there is now a proper symbol table, defs are now just references to
memory locations and the symbol table takes care of duplicates.

Also, start using far data for ObjQC structures.

The qfo functions have been stubbed out until I figure out what to do with
object files in the new scheme.
2011-01-24 15:41:43 +09:00
Bill Currie bf626c9e00 Fix some simple fixmes 2011-01-23 11:13:56 +09:00
Bill Currie 20b14af024 Add "is_math" type check and use for unary +/-. 2011-01-23 11:12:58 +09:00
Bill Currie 341f370662 Rename is_math() to is_math_op(). 2011-01-23 11:12:05 +09:00
Bill Currie dea6771d92 Create type_nil for passing nil into ... 2011-01-22 16:41:31 +09:00
Bill Currie d5f669af7a Nuke temp reference counting.
The whole reason for this crazy developement branch :)
2011-01-22 11:40:53 +09:00
Bill Currie 2f09efe547 Break out print_expr into its own file. 2011-01-21 20:31:40 +09:00
Bill Currie 52b561f7cb Nuke bind expressions.
Since I'm planning on implementing CSE and other optimizations, they're
rather redundant (and I'm having trouble getting them to work).
2011-01-21 19:07:58 +09:00
Bill Currie 0d01930056 Link a bool to its block rather than the block's head.
This makes the flow make a little more sense.
2011-01-21 18:50:17 +09:00
Bill Currie 5c5fa67e43 Minor tweaks of the expression tree output. 2011-01-21 15:34:42 +09:00
Bill Currie 35b7278967 Re-disable the next-edge constraints.
This gives a flatter layout.
2011-01-20 15:36:10 +09:00
Bill Currie 08e387ebac Slight improvement to branch instruction nodes/labels. 2011-01-20 15:33:13 +09:00
Bill Currie f8cc347dce Print expressions as dot files.
While the resulting images can be a little confusing, they're much easier
to read than my cryptic postfix notation.
2011-01-20 15:23:19 +09:00
Bill Currie 5deda9c9b9 Clean out ex_def as ex_symbol replaces it. 2011-01-19 22:25:04 +09:00
Bill Currie b5424bca7d Start work on getting expressions converted to internal statements. 2011-01-19 15:47:45 +09:00
Bill Currie f2ef24d0cc Make symbols use the new value struct for constants. 2011-01-19 11:09:54 +09:00
Bill Currie e08efe036b Move the constant expression values into their own struct. 2011-01-19 08:43:24 +09:00
Bill Currie 87ce9f5333 Get basic function creation working.
Even more FIXMEs, but the pascal parser can now create functions. The
function records even get emitted.
2011-01-18 12:47:13 +09:00
Bill Currie ea3895805b Rewrite much to use symbols and symtabs. Gut emit.c. Massive breakage.
That which isn't rewritten is horribly broken. However, this does include a
nice mechanism for building QC structs for emitting data.

emit.c has been gutted in the spirit of "throw one away".

There is much work to be done to get even variables emitted, let alone
code. Things should be a little more fun from here on.
2011-01-17 22:34:41 +09:00
Bill Currie d3a98af783 Make internal_error globally available. 2011-01-17 22:34:41 +09:00
Bill Currie 8f71986306 Add symbol expressions (like def expressions).
They will eventually replace def expressions. Currently quite broken.
2011-01-13 14:54:24 +09:00
Bill Currie 258c896e4d Create a function to build if/else blocks. 2011-01-13 14:33:16 +09:00
Bill Currie c787923c99 Forgot to remove that print_expr. 2011-01-11 12:11:54 +09:00
Bill Currie 08bf7e24de Produce nicer code for post-op.
The temp notice is still there for arrays (that's caused by issues in
constfold.c, not easily fixilbe), but it's harmless and correct (and nice)
code is much more important.
2011-01-11 12:07:48 +09:00
Bill Currie ad787ae98a Set the expression type to the correct value for addresses. 2011-01-11 12:06:40 +09:00
Bill Currie 21d7c78eb7 Allow deep copying of expression trees.
Certain expression types (eg labels) are created fresh.
2011-01-11 12:05:29 +09:00
Bill Currie abe471110c Make inc/dec_users return the the expression.
Just for convenience.
2011-01-11 08:44:43 +09:00
Bill Currie 18ae178eaf Make new_vector_expr and new_quaternion_expr const-correct. 2011-01-11 08:43:34 +09:00
Bill Currie cd38bd71fa Swap the order of scale and base for calculating the array index.
fold_constants doesn't like dags very much, but it can do the right thing
if the expressions are in the right order. This is merely a workaround
until I get to work on the code generator itself.
2011-01-10 12:26:11 +09:00
Bill Currie d327c860cb Get messages working again. 2011-01-10 12:26:11 +09:00
Bill Currie 75ec6bf244 Clean out some unnecessary types from the progs engine and clean up the mess.
This is a nasty commit, sorry, but 99% of the commit is interdependent.
2011-01-10 12:25:31 +09:00
Bill Currie 02f78e46f8 More expression docs. 2011-01-03 16:25:59 +09:00
Bill Currie 5627e43465 Use the method's selector rather than its def name in error messages. 2011-01-03 16:25:29 +09:00
Bill Currie a4635d79e8 Slightly more informative error locations.
Inside a class or protocol definition is not "at top level" ;)
2011-01-03 16:25:29 +09:00
Bill Currie 530e8fae34 Rework class_type_t to be more useful.
This allows current_class to refer to procols as well (for error
reporting).
2011-01-03 16:25:29 +09:00
Bill Currie 52e844ee48 Produce slightly better v6 modulo code for complex inputs.
I'm having problems with temp defs, but I imagine this code is rarely used
so I won't worry about it for now. It will, however, make a good test case
for when I rework emit.c after I do some reading.
2010-12-19 11:23:33 +09:00
Bill Currie d981968208 v6 modulo implementation now produces good code.
At least for simple inputs, anyway. That needs to be tested next.
2010-12-18 22:21:55 +09:00
Bill Currie 00e50c0ad3 Rewrite the v6 modulo implementation.
While trying to understand bind expressions, I discovered that the v6
modulo code was incorrect. This version is correct but uses one too many
temps. That's next.
2010-12-18 22:21:55 +09:00
Bill Currie eace5b3c81 Get message checking working properly. 2010-12-16 16:41:16 +09:00