diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1997-03-15 07:57:55 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1997-03-15 07:57:55 -0500 |
commit | 12d94bff7eb3b937938bccaba739106d0892a7c1 (patch) | |
tree | cf79b35a7ff49b4af5c7653d4c50e135e6808dc4 /gcc | |
parent | d3d71914cbbbf32e38cf96ac8f6760685937956b (diff) | |
download | gcc-12d94bff7eb3b937938bccaba739106d0892a7c1.zip gcc-12d94bff7eb3b937938bccaba739106d0892a7c1.tar.gz gcc-12d94bff7eb3b937938bccaba739106d0892a7c1.tar.bz2 |
(objc_module): Eliminate statics variable.
From-SVN: r13713
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/objc/objc-api.h | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/gcc/objc/objc-api.h b/gcc/objc/objc-api.h index 5962f02..2f5e8de 100644 --- a/gcc/objc/objc-api.h +++ b/gcc/objc/objc-api.h @@ -134,6 +134,16 @@ objc_error_handler objc_set_error_handler(objc_error_handler func); extern BOOL objc_trace; +/* For every class which happens to have statically allocated instances in + this module, one OBJC_STATIC_INSTANCES is allocated by the compiler. + INSTANCES is NULL terminated and points to all statically allocated + instances of this class. */ +struct objc_static_instances +{ + char *class_name; + id instances[0]; +}; + /* ** Whereas a Module (defined further down) is the root (typically) of a file, ** a Symtab is the root of the class and category definitions within the @@ -150,23 +160,16 @@ typedef struct objc_symtab { unsigned short cat_def_cnt; /* Number of categories compiled (defined) in the module. */ + void *defs[1]; /* Variable array of pointers. cls_def_cnt of type Class followed by cat_def_cnt of - type Category_t. */ + type Category_t, followed + by a NULL terminated array + of objc_static_instances. */ } Symtab, *Symtab_t; -/* For every class which happens to have statically allocated instances in - this module, one OBJC_STATIC_INSTANCES is allocated by the compiler. - INSTANCES is NULL terminated and points to all statically allocated - instances of this class. */ -struct objc_static_instances -{ - char *class_name; - id instances[0]; -}; - /* ** The compiler generates one of these structures for each module that ** composes the executable (eg main.m). @@ -183,9 +186,6 @@ typedef struct objc_module { module was generated. The name includes the path. */ - /* Pointer to a NULL terminated array of objc_static_instances. */ - struct objc_static_instances **statics; - Symtab_t symtab; /* Pointer to the Symtab of the module. The Symtab holds an array of @@ -443,6 +443,12 @@ BOOL sel_is_mapped (SEL aSel); extern id class_create_instance(Class class); +/* You should call this function immediately after a bundle has loaded the + code. This function sends the +load message to all classes/categories + just loaded and then calls the _objc_load_callback function for each + class/category. */ +extern void objc_send_load (void); + static inline const char * class_get_class_name(Class class) { |