Commit graph

102 commits

Author SHA1 Message Date
Bill Currie
9b52c590f8 Do not try to emit anything when there are no selector references. 2011-02-08 22:28:32 +09:00
Bill Currie
da14c95bb8 Initialize current_symtab in class_init() when necessary.
If an objective-qc symbol is the first token to be read, class_init() is
called before the parser gets a chance to perform the initialization
action. However, class_init() setting current_symtab if the first
objective-qc symbol is seen in a function body would be bad.
2011-02-08 22:26:35 +09:00
Bill Currie
c01f742b7b Fix some Class vs ClassPtr confusion. 2011-02-08 18:25:23 +09:00
Bill Currie
6643c5dd98 Fix messages to super. 2011-02-08 17:09:27 +09:00
Bill Currie
505e141633 Ensure the class symbol is in the symbol table. 2011-02-08 17:08:58 +09:00
Bill Currie
3c64ae7b66 Fix overzealous type merging.
Use the type name instead of the symbol table for comparing
struct/union/enum types.
2011-02-07 20:48:01 +09:00
Bill Currie
76034861c9 Implement direct ivar access in methods.
A warning needs to be generated for access to ivars in a class method, but
it seems to work (unable to check due to other errors).
2011-02-07 08:32:52 +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
d7cdf8077b Rename id_ivars to object_ivars. 2011-02-06 15:41:15 +09:00
Bill Currie
c3c693e9c7 Correct construction of type_id. 2011-02-06 15:36:21 +09:00
Bill Currie
2f7b892452 Fix passing messages to classes.
Rename class_pointer_def() to class_pointer_symbol() and use it when a
class name is used as the receiver of a message.
2011-02-06 14:34:40 +09:00
Bill Currie
f721144ca5 Rewrite emit_ivars to use emit_structure.
The old code was broken anyway :) (it was segfaulting).
2011-02-04 15:11:47 +09:00
Bill Currie
acb3c0da11 Fix class initialization. 2011-02-04 14:29:47 +09:00
Bill Currie
04b86fcdb7 Move the Objective-QC structs from type.c to class.c 2011-02-04 12:07:32 +09:00
Bill Currie
12d8658ece Create a typedef for obj_module_t. 2011-02-03 18:05:46 +09:00
Bill Currie
79df3d2cca Put newly created classes into the symbol table. 2011-02-03 17:28:49 +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
5deda9c9b9 Clean out ex_def as ex_symbol replaces it. 2011-01-19 22:25:04 +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
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
5627e43465 Use the method's selector rather than its def name in error messages. 2011-01-03 16:25:29 +09:00
Bill Currie
a1f36a9944 Make new_function take a def rather than a name.
Moves into new_function some code that should have been there in the first
place.
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
699799bfc8 Don't warn when adding a new method to an implementation.
Methods defined in the implementation but not declared in the interface are
just fine.
2010-12-16 20:04:08 +09:00
Bill Currie
eace5b3c81 Get message checking working properly. 2010-12-16 16:41:16 +09:00
Bill Currie
4481ba9b0d Allow explicit references to classes and categories.
Use "@reference ClassName;" or "@reference ClassName(CategoryName);" to
create a refence to the class or category, forcing the defining object file
to be linked into the program when the object file is part of a library.
2010-12-12 20:27:56 +09:00
Bill Currie
bfee029249 set current_func while building the init function to avoid issues with code expecting current_func to be set. 2008-08-01 22:55:10 +00:00
Bill Currie
0382b05780 various unsigned long -> uintptr_t conversions 2007-04-04 11:22:48 +00:00
Bill Currie
48d9d96005 don't try to create multiple objects for the same protocol 2006-12-16 08:09:10 +00:00
Bill Currie
3fb03fc2be hah, should have been using __attribute__((used)) all that time (rather
than __attribute__((unused))). fixes the missing console in -x11
2005-08-04 15:27:09 +00:00
Bill Currie
5f34f87b58 ivar access control seems to work now :)
This is an imperfect revision of history.
2004-11-13 01:37:00 +00:00
Bill Currie
64cc8c60d2 compile time protocol support seems to be complete now. fortunatly, protocols had never been written out so the corrections to the protocol related stuctures do not need a progs version bump. runtime protocol support hasn't been fully tested yet.
+load runtime support seems to be working.

This is an imperfect revision of history.
2004-11-11 00:34:00 +00:00
Bill Currie
9f52181e34 fixes for methods in categories or not in an interface
This is an imperfect revision of history.
2004-11-02 11:56:00 +00:00
Bill Currie
a3a2dd62e3 fix type of "self"
This is an imperfect revision of history.
2004-11-02 07:13:00 +00:00
Bill Currie
0360859a0f all warnings (except for @self and self) are now fully controllable 2004-02-17 00:39:21 +00:00
Bill Currie
1068032f1b make implementation methods not in the interface work properly when
-Winterface-check isn't specified and make sure classes don't clash with
defs or enums
2004-02-03 07:48:23 +00:00
Bill Currie
35d690c701 give an error message instead of segging for the following code:
@class foo;
@interface bar : foo
@end
2003-12-19 04:59:34 +00:00
Bill Currie
385a90e8fb correct pr_symtab_t to include the pointer to the array of selectors used
in the module. Unfortunatly, this requires a version bump on both qfo and
progs files due to the changes structure layout.
2003-08-23 06:15:19 +00:00
Bill Currie
7d830ffc1f make @defs work properly and don't do uninitialized checks on structs 2003-08-20 19:58:41 +00:00
Bill Currie
aa4f81b6da class.c:
whitespace
switch.c:
	set up the relocations for the switch jump table properly
2003-08-18 02:57:21 +00:00
Bill Currie
3e3b316891 blah, double ; 2003-08-01 21:26:36 +00:00
Bill Currie
8e21ecd4d9 make private methods work properly and put overided methods into the
correct class
2003-08-01 16:24:44 +00:00
Bill Currie
1b5bf9d176 make methods showing up only in the implementation work when overiding an
inherited method
2003-08-01 05:08:15 +00:00
Bill Currie
6ecb707257 revamp the struct system so "struct foo;" does the right thing (ala C) 2003-07-30 04:11:45 +00:00
Jeff Teunissen
5c1875ba28 Update the interface-check warning to be more descriptive. 2003-07-29 18:53:13 +00:00