Commit graph

381 commits

Author SHA1 Message Date
Bill Currie
d162838299 Resurrect constant_expr(). 2011-02-15 09:28:27 +09:00
Bill Currie
6b29568fa9 Set the source file and line when copying an expression.
This fixes the crazy line numbers in the debug info.
2011-02-14 23:10:45 +09:00
Bill Currie
b545f72f93 Report errors for incomplete types and missing fields. 2011-02-13 20:23:08 +09:00
Bill Currie
976ff8a6bb Allow cast expressions to be lvalues.
These really need to be alias expressions rather than cast expressions
so the two can be separated as cast expressions should not be lvalues.
2011-02-13 17:54:15 +09:00
Bill Currie
fa742ceed6 Handle @self and @this correctly. 2011-02-13 17:52:19 +09:00
Bill Currie
0b5565396b Add a class type to symbols and rework the CLASS_NAME handling.
This fixes the problem with [Array alloc] producing a warning about Class
not repsonding to -alloc.
2011-02-13 16:05:09 +09:00
Bill Currie
d93d8d7d46 Remove the dirty hack used for accessing params and the return value.
Instead of using the equivalent of *(float*)&.return, now use the
equivalent of (float).return. No conversion is done in the "cast".

NOTE: this sort of cast should be separated from normal casts.
2011-02-11 22:29:38 +09:00
Bill Currie
f5412c2b20 Remove a fixme. 2011-02-11 22:29:38 +09:00
Bill Currie
c185fbb782 Set the type of the super structure to the correct type. 2011-02-11 22:29:38 +09:00
Bill Currie
a1d4d4bae1 Handle block expressions in is_indirect(). 2011-02-11 22:29:30 +09:00
Bill Currie
adeef4a4eb Copy named expressions.
Since expressions can be modified, making DAGs this early causes
corruption of the expression tree.
2011-02-10 14:43:49 +09:00
Bill Currie
681ded9375 Fix debug line number information. 2011-02-09 09:59:43 +09:00
Bill Currie
6643c5dd98 Fix messages to super. 2011-02-08 17:09:27 +09:00
Bill Currie
93a5808659 Support direct struct/union field access. 2011-02-08 14:48:26 +09:00
Bill Currie
92799650c0 Implement struct field access via a pointer. 2011-02-07 22:15:10 +09:00
Bill Currie
d549e5c6b5 Allow enums to be tested. 2011-02-07 11:30:56 +09:00
Bill Currie
829fb33e92 Fix converting nil to a pointer type. 2011-02-07 10:10:48 +09:00
Bill Currie
3025e04ac5 Partially resurrect field_expr()
For now, only entity.field and ivar access via a pointer have been
implemented. The rest will come later as needed.
2011-02-07 08:30:28 +09:00
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