Commit graph

390 commits

Author SHA1 Message Date
Bill Currie
c5ecc170b6 Give labels a usage count to detect unused labels. 2011-03-03 15:28:49 +09:00
Bill Currie
74e6b13aee Use alias expressions where possible when testing an expression. 2011-03-03 13:47:28 +09:00
Bill Currie
45de7327dc Implement alias expressions (finally).
Alias expressions are like cast expressions, but never do any conversions.
2011-03-03 11:06:10 +09:00
Bill Currie
c12211d8bb Support enum results for boolean expressions.
eg enum BOOL x = a && b;
2011-03-02 22:46:55 +09:00
Bill Currie
aa4ed00090 Fix the message type used to check arguments. 2011-03-02 22:13:16 +09:00
Bill Currie
4fd6bdae6f Allow nil to be assigned to field variables.
Note, this is the field variable itself, not the field in the entity.
eg:
	.integer x = nil;
2011-02-22 09:19:01 +09:00
Bill Currie
5252d72856 Correct the type for _OBJ_SELECTOR_TABLE. 2011-02-15 15:33:12 +09:00
Bill Currie
b2d4aee61e Reimplement selector expressions to work with far data.
They currently execute a lea instruction every method call, but the
optimizer should take care of that once its written.
2011-02-15 10:48:05 +09:00
Bill Currie
19f6faf0ad Fix aggregate initializers.
Initializing arrays and structs seems to be working.
2011-02-15 09:30:37 +09:00
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