diff options
author | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-11 02:36:32 +0000 |
---|---|---|
committer | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-11 02:36:32 +0000 |
commit | 631bc351153ee1d0b70c15ee976b90c57957c851 (patch) | |
tree | f2b370a071fcf2d2a1803013ffb11cafc329f866 /libobjc/objc-private | |
parent | 3334ecf96eb93c0b3244d778c08036741fa552cf (diff) | |
download | gcc-631bc351153ee1d0b70c15ee976b90c57957c851.tar.gz |
In libobjc/:
2010-10-11 Nicola Pero <nicola.pero@meta-innovation.com>
* Makefile.in (C_SOURCE_FILES): Added ivars.c.
* ivars.c: New.
* objc/objc.h: Updated comments.
* objc/runtime.h (object_getClass): New.
(object_getClassName): New.
(object_setClass): New.
(class_getInstanceVariable): New.
(object_getIndexedIvars): New.
(object_getInstanceVariable): New.
(object_setInstanceVariable): New.
(object_getIvar): New.
(object_setIvar): New.
(ivar_getName): New.
(ivar_getOffset): New.
(ivar_getTypeEncoding): New.
* objc-private/module-abi-8.h (struct objc_class): Added.
* objects.c (object_getClassName): New.
(object_setClass): New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165269 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libobjc/objc-private')
-rw-r--r-- | libobjc/objc-private/module-abi-8.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/libobjc/objc-private/module-abi-8.h b/libobjc/objc-private/module-abi-8.h index 7296273711c..a20e3a3ae6e 100644 --- a/libobjc/objc-private/module-abi-8.h +++ b/libobjc/objc-private/module-abi-8.h @@ -145,6 +145,59 @@ struct objc_protocol_list Protocol *list[1]; }; +/* + The compiler generates one of these structures for each class. + + This structure is the definition for classes. + + This structure is generated by the compiler in the executable and + used by the run-time during normal messaging operations. Therefore + some members change type. The compiler generates "char* const" and + places a string in the following member variables: super_class. +*/ +struct objc_class { + struct objc_class* class_pointer; /* Pointer to the class's meta + class. */ + struct objc_class* super_class; /* Pointer to the super + class. NULL for class + Object. */ + const char* name; /* Name of the class. */ + long version; /* Unknown. */ + unsigned long info; /* Bit mask. See class masks + defined above. */ + long instance_size; /* Size in bytes of the class. + The sum of the class + definition and all super + class definitions. */ +#ifdef _WIN64 + /* We pad the structure manually to prevent warning when -Wpadded is + used. The compiler automatically pads the structures that it + generates, so this manually padded structure still matches the + one generated by the compiler, but if we don't pad manually, + -Wpadded detects that padding is being added and generates + annoying warnings. This hack is necessary as on LLP64 targets + sizeof (long) isn't equal to sizeof (void *). */ + long pad; +#endif + struct objc_ivar_list* ivars; /* Pointer to a structure that + describes the instance + variables in the class + definition. NULL indicates + no instance variables. + Does not include super + class variables. */ + struct objc_method_list* methods; /* Linked list of instance + methods defined for the + class. */ + struct sarray * dtable; /* Pointer to instance method + dispatch table. */ + struct objc_class* subclass_list; /* Subclasses */ + struct objc_class* sibling_class; + + struct objc_protocol_list *protocols; /* Protocols conformed to */ + void* gc_object_type; +}; + /* The compiler generates one of these structures for each category. A class may have many categories and contain both instance and factory methods. */ |