aboutsummaryrefslogtreecommitdiff
path: root/libobjc/objc-private
diff options
context:
space:
mode:
authorNicola Pero <nicola.pero@meta-innovation.com>2010-10-16 21:26:59 +0000
committerNicola Pero <nicola@gcc.gnu.org>2010-10-16 21:26:59 +0000
commit6c5c7efd6bbca80cb28fffd24600cbb58436f808 (patch)
tree3920a8a13cd2db3193c61dca0c4a3e93ab0c05f5 /libobjc/objc-private
parentd4d9b0a64193609249caa5db60afc6cb0bf50e2a (diff)
downloadgcc-6c5c7efd6bbca80cb28fffd24600cbb58436f808.zip
gcc-6c5c7efd6bbca80cb28fffd24600cbb58436f808.tar.gz
gcc-6c5c7efd6bbca80cb28fffd24600cbb58436f808.tar.bz2
In libobjc/: 2010-10-16 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/: 2010-10-16 Nicola Pero <nicola.pero@meta-innovation.com> * objc/runtime.h: Updated comments. (class_addMethod): New. (class_addIvar): New. (class_replaceMethod): New. (objc_allocateClassPair): New. (objc_registerClassPair): New. (objc_disposeClassPair): New. * class.c (objc_allocateClassPair): New. (objc_registerClassPair): New. (objc_disposeClassPair): New. (class_getSuperclass): Return Nil if a class is in construction. * init.c (__objc_exec_class): Call __objc_init_class. (__objc_init_class): New. * ivars.c (class_copyIvarList): Return NULL if class is in construction. Do not lock the runtime mutex. (class_getInstanceVariable): Return NULL if class is in construction. Do not lock the runtime mutex. (class_addIvar): New. * sendmsg.c (class_addMethod): New. (class_replaceMethod): New. * objc-private/module-abi-8.h (__CLS_SETNOTINFO): New. (_CLS_IN_CONSTRUCTION): New. (CLS_IS_IN_CONSTRUCTION): New. (CLS_SET_IN_CONSTRUCTION): New. (CLS_SET_NOT_IN_CONSTRUCTION): New. * objc-private/runtime.h (__objc_init_class): New. From-SVN: r165563
Diffstat (limited to 'libobjc/objc-private')
-rw-r--r--libobjc/objc-private/module-abi-8.h13
-rw-r--r--libobjc/objc-private/runtime.h2
2 files changed, 13 insertions, 2 deletions
diff --git a/libobjc/objc-private/module-abi-8.h b/libobjc/objc-private/module-abi-8.h
index 7505a6b..bad5478 100644
--- a/libobjc/objc-private/module-abi-8.h
+++ b/libobjc/objc-private/module-abi-8.h
@@ -181,7 +181,7 @@ struct objc_protocol_list
places a string in the following member variables: super_class.
*/
#ifndef __objc_STRUCT_OBJC_CLASS_defined
-struct objc_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
@@ -234,6 +234,7 @@ struct objc_class {
#define __CLS_INFO(cls) ((cls)->info)
#define __CLS_ISINFO(cls, mask) ((__CLS_INFO(cls)&mask)==mask)
#define __CLS_SETINFO(cls, mask) (__CLS_INFO(cls) |= mask)
+#define __CLS_SETNOTINFO(cls, mask) (__CLS_INFO(cls) &= ~mask)
/* The structure is of type MetaClass */
#define _CLS_META 0x2L
@@ -255,6 +256,16 @@ struct objc_class {
#define CLS_ISINITIALIZED(cls) __CLS_ISINFO(cls, _CLS_INITIALIZED)
#define CLS_SETINITIALIZED(cls) __CLS_SETINFO(cls, _CLS_INITIALIZED)
+/* The class is being constructed; it has been allocated using
+ objc_allocateClassPair(), but has not been registered yet by using
+ objc_registerClassPair(). This means it is possible to freely add
+ instance variables to the class, but it can't be used for anything
+ yet. */
+#define _CLS_IN_CONSTRUCTION 0x10L
+#define CLS_IS_IN_CONSTRUCTION(cls) __CLS_ISINFO(cls, _CLS_IN_CONSTRUCTION)
+#define CLS_SET_IN_CONSTRUCTION(cls) __CLS_SETINFO(cls, _CLS_IN_CONSTRUCTION)
+#define CLS_SET_NOT_IN_CONSTRUCTION(cls) __CLS_SETNOTINFO(cls, _CLS_IN_CONSTRUCTION)
+
/* The class number of this class. This must be the same for both the
class and its meta class object. */
#define CLS_GETNUMBER(cls) (__CLS_INFO(cls) >> (HOST_BITS_PER_LONG/2))
diff --git a/libobjc/objc-private/runtime.h b/libobjc/objc-private/runtime.h
index ff924be..4769d0f 100644
--- a/libobjc/objc-private/runtime.h
+++ b/libobjc/objc-private/runtime.h
@@ -67,7 +67,7 @@ extern void __objc_update_dispatch_table_for_class (Class);/* (objc-msg.c) */
extern int __objc_init_thread_system(void); /* thread.c */
extern int __objc_fini_thread_system(void); /* thread.c */
extern void __objc_print_dtable_stats(void); /* sendmsg.c */
-
+extern void __objc_init_class (Class class); /* init.c */
extern void class_add_method_list(Class, struct objc_method_list *);
/* Registering instance methods as class methods for root classes */