OSDN Git Service

In gcc/c-family/:
[pf3gnuchains/gcc-fork.git] / gcc / objc / objc-act.h
1 /* Declarations for objc-act.c.
2    Copyright (C) 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
3    Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
11
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3.  If not see
19 <http://www.gnu.org/licenses/>.  */
20
21
22 #ifndef GCC_OBJC_ACT_H
23 #define GCC_OBJC_ACT_H
24
25 /*** Language hooks ***/
26
27 bool objc_init (void);
28 const char *objc_printable_name (tree, int);
29 tree objc_fold_obj_type_ref (tree, tree);
30 int objc_gimplify_expr (tree *, gimple_seq *, gimple_seq *);
31 tree objc_eh_runtime_type (tree);
32 tree objc_eh_personality (void);
33
34 /* NB: The remaining public functions are prototyped in c-common.h, for the
35    benefit of stub-objc.c and objc-act.c.  */
36
37 /* Objective-C structures */
38
39 #define CLASS_LANG_SLOT_ELTS            7
40 #define PROTOCOL_LANG_SLOT_ELTS         7
41 #define OBJC_INFO_SLOT_ELTS             2
42
43 /* KEYWORD_DECL */
44 #define KEYWORD_KEY_NAME(DECL) ((DECL)->decl_minimal.name)
45 #define KEYWORD_ARG_NAME(DECL) ((DECL)->decl_non_common.arguments)
46
47 /* INSTANCE_METHOD_DECL, CLASS_METHOD_DECL */
48 #define METHOD_SEL_NAME(DECL) ((DECL)->decl_minimal.name)
49 #define METHOD_SEL_ARGS(DECL) ((DECL)->decl_non_common.arguments)
50 #define METHOD_ADD_ARGS(DECL) ((DECL)->decl_non_common.result)
51 #define METHOD_ADD_ARGS_ELLIPSIS_P(DECL) ((DECL)->decl_common.lang_flag_0)
52 #define METHOD_DEFINITION(DECL) ((DECL)->decl_common.initial)
53 #define METHOD_ENCODING(DECL) ((DECL)->decl_minimal.context)
54 #define METHOD_TYPE_ATTRIBUTES(DECL) ((DECL)->decl_common.abstract_origin)
55 #define METHOD_PROPERTY_CONTEXT(DECL) ((DECL)->decl_common.size_unit)
56
57
58 /* PROPERTY_DECL.  A PROPERTY_DECL repesents a @property declaration
59    (when attached to the list of properties of an interface) or a
60    @synthesize or @dynamic declaration (when attached to the list of
61    properties of an implementation).  */
62
63 /* TREE_TYPE is the type (int, float, etc) of the property.  */
64
65 /* DECL_ARTIFICIAL is set to 1 if the PROPERTY_DECL is an artificial
66    property declaration created when the dot-syntax object.component
67    is used with no actual @property matching the component, but a
68    valid getter/setter.  */
69
70 /* PROPERTY_NAME is the name of the property.  */
71 #define PROPERTY_NAME(DECL) DECL_NAME(DECL)
72
73 /* PROPERTY_GETTER_NAME is the identifier of the getter method.  */
74 #define PROPERTY_GETTER_NAME(DECL) ((DECL)->decl_non_common.arguments)
75
76 /* PROPERTY_SETTER_NAME is the identifier of the setter method.  */
77 #define PROPERTY_SETTER_NAME(DECL) ((DECL)->decl_non_common.result)
78
79 /* PROPERTY_READONLY can be 0 or 1.  */
80 #define PROPERTY_READONLY(DECL) DECL_LANG_FLAG_0 (DECL)
81
82 /* PROPERTY_NONATOMIC can be 0 or 1.  */
83 #define PROPERTY_NONATOMIC(DECL) DECL_LANG_FLAG_1 (DECL)
84
85 typedef enum objc_property_assign_semantics {
86   OBJC_PROPERTY_ASSIGN = 1,
87   OBJC_PROPERTY_RETAIN = 2,
88   OBJC_PROPERTY_COPY = 3
89 } objc_property_assign_semantics;
90
91 /* PROPERTY_ASSIGN_SEMANTICS can be OBJC_PROPERTY_ASSIGN,
92    OBJC_PROPERTY_RETAIN or OBJC_PROPERTY_COPY.  We need an integer to
93    store it, so we hijack the alignment, that properties don't
94    have.  */
95 #define PROPERTY_ASSIGN_SEMANTICS(DECL) ((DECL)->decl_common.align)
96
97 /* PROPERTY_IVAR_NAME is the identifier of the instance variable.
98    This is set only if the PROPERTY_DECL represents a @synthesize;
99    otherwise, it is set to TREE_NULL.  */
100 #define PROPERTY_IVAR_NAME(DECL) ((DECL)->decl_common.initial)
101
102 /* PROPERTY_DYNAMIC can be 0 or 1.  This is 1 if the PROPERTY_DECL
103    represents a @dynamic; otherwise, it is set to 0.  */
104 #define PROPERTY_DYNAMIC(DECL) DECL_LANG_FLAG_2 (DECL)
105
106 /* PROPERTY_HAS_NO_GETTER can be 0 or 1.  Normally it is 0, but if
107    this is an artificial PROPERTY_DECL that we generate even without a
108    getter, it is set to 1.  */
109 #define PROPERTY_HAS_NO_GETTER(DECL) DECL_LANG_FLAG_3 (DECL)
110
111 /* PROPERTY_HAS_NO_SETTER can be 0 or 1.  Normally it is 0, but if
112    this is an artificial PROPERTY_DECL that we generate even without a
113    setter, it is set to 1.  */
114 #define PROPERTY_HAS_NO_SETTER(DECL) DECL_LANG_FLAG_4 (DECL)
115
116 /* PROPERTY_OPTIONAL can be 0 or 1.  Normally it is 0, but if this is
117    a property declared as @optional in a @protocol, then it is set to
118    1.  */
119 #define PROPERTY_OPTIONAL(DECL) DECL_LANG_FLAG_5 (DECL)
120
121 /* PROPERTY_REF.  A PROPERTY_REF represents an 'object.property'
122    expression.  It is normally used for property access, but when
123    the Objective-C 2.0 "dot-syntax" (object.component) is used
124    with no matching property, a PROPERTY_REF is still created to
125    represent it, with an artificial PROPERTY_DECL.  */
126
127 /* PROPERTY_REF_OBJECT is the object whose property we are
128    accessing.  */
129 #define PROPERTY_REF_OBJECT(NODE) TREE_OPERAND (PROPERTY_REF_CHECK (NODE), 0)
130
131 /* PROPERTY_REF_PROPERTY_DECL is the PROPERTY_DECL for the property
132    used in the expression.  From it, you can get the property type,
133    and the getter/setter names.  This PROPERTY_DECL could be artificial
134    if we are processing an 'object.component' syntax with no matching 
135    declared property.  */
136 #define PROPERTY_REF_PROPERTY_DECL(NODE) TREE_OPERAND (PROPERTY_REF_CHECK (NODE), 1)
137
138 /* PROPERTY_REF_GETTER_CALL is the getter call expression, ready to
139    use at gimplify time if needed.  Generating the getter call
140    requires modifying the selector table, and, in the case of
141    self/super, requires the context to be generated correctly.  The
142    gimplify stage is too late to do these things, so we generate the
143    getter call earlier instead, and keep it here in case we need to
144    use it.  */
145 #define PROPERTY_REF_GETTER_CALL(NODE) TREE_OPERAND (PROPERTY_REF_CHECK (NODE), 2)
146
147
148 /* CLASS_INTERFACE_TYPE, CLASS_IMPLEMENTATION_TYPE,
149    CATEGORY_INTERFACE_TYPE, CATEGORY_IMPLEMENTATION_TYPE,
150    PROTOCOL_INTERFACE_TYPE */
151 /* CLASS_NAME is the name of the class.  */
152 #define CLASS_NAME(CLASS) ((CLASS)->type.name)
153 /* CLASS_SUPER_NAME is the name of the superclass, or, in the case of
154    categories, it is the name of the category itself.  */
155 #define CLASS_SUPER_NAME(CLASS) (TYPE_CHECK (CLASS)->type.context)
156 #define CLASS_IVARS(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 0)
157 #define CLASS_RAW_IVARS(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 1)
158 #define CLASS_NST_METHODS(CLASS) ((CLASS)->type.minval)
159 #define CLASS_CLS_METHODS(CLASS) ((CLASS)->type.maxval)
160 #define CLASS_STATIC_TEMPLATE(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 2)
161 #define CLASS_CATEGORY_LIST(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 3)
162 #define CLASS_PROTOCOL_LIST(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 4)
163 #define TOTAL_CLASS_RAW_IVARS(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 5)
164
165 #define PROTOCOL_NAME(CLASS) ((CLASS)->type.name)
166 #define PROTOCOL_LIST(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 0)
167 #define PROTOCOL_NST_METHODS(CLASS) ((CLASS)->type.minval)
168 #define PROTOCOL_CLS_METHODS(CLASS) ((CLASS)->type.maxval)
169 #define PROTOCOL_FORWARD_DECL(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 1)
170 #define PROTOCOL_DEFINED(CLASS) TREE_USED (CLASS)
171 #define PROTOCOL_OPTIONAL_CLS_METHODS(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 2)
172 #define PROTOCOL_OPTIONAL_NST_METHODS(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 3)
173
174
175 /* For CATEGORY_INTERFACE_TYPE, CLASS_INTERFACE_TYPE or PROTOCOL_INTERFACE_TYPE */
176 #define CLASS_PROPERTY_DECL(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 6)
177 /* For CLASS_IMPLEMENTATION_TYPE or CATEGORY_IMPLEMENTATION_TYPE. */
178 #define IMPL_PROPERTY_DECL(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 6)
179
180 /* TREE_DEPRECATED is used for a CLASS_INTERFACE_TYPE or PROTOCOL_INTERFACE_TYPE.  */
181
182 /* TYPE_ATTRIBUTES is used for a CLASS_INTERFACE_TYPE or PROTOCOL_INTERFACE_TYPE.  */
183
184 /* ObjC-specific information pertaining to RECORD_TYPEs are stored in
185    the LANG_SPECIFIC structures, which may itself need allocating first.  */
186
187 /* The following three macros must be overridden (in objcp/objcp-decl.h)
188    for Objective-C++.  */
189 #define TYPE_OBJC_INFO(TYPE) TYPE_LANG_SPECIFIC (TYPE)->objc_info
190 #define SIZEOF_OBJC_TYPE_LANG_SPECIFIC sizeof (struct lang_type)
191 #define ALLOC_OBJC_TYPE_LANG_SPECIFIC(NODE)                             \
192   do {                                                                  \
193     TYPE_LANG_SPECIFIC (NODE)                                           \
194       = ggc_alloc_cleared_lang_type (sizeof (struct lang_type));        \
195   } while (0)
196
197 #define TYPE_HAS_OBJC_INFO(TYPE)                                \
198         (TYPE_LANG_SPECIFIC (TYPE) && TYPE_OBJC_INFO (TYPE))
199 #define TYPE_OBJC_INTERFACE(TYPE) TREE_VEC_ELT (TYPE_OBJC_INFO (TYPE), 0)
200 #define TYPE_OBJC_PROTOCOL_LIST(TYPE) TREE_VEC_ELT (TYPE_OBJC_INFO (TYPE), 1)
201
202
203 #define INIT_TYPE_OBJC_INFO(TYPE)                               \
204         do                                                      \
205           {                                                     \
206             if (!TYPE_LANG_SPECIFIC (TYPE))                     \
207               ALLOC_OBJC_TYPE_LANG_SPECIFIC(TYPE);              \
208             if (!TYPE_OBJC_INFO (TYPE))                         \
209               TYPE_OBJC_INFO (TYPE)                             \
210                 = make_tree_vec (OBJC_INFO_SLOT_ELTS);          \
211           }                                                     \
212         while (0)
213 #define DUP_TYPE_OBJC_INFO(DST, SRC)                            \
214         do                                                      \
215           {                                                     \
216             ALLOC_OBJC_TYPE_LANG_SPECIFIC(DST);                 \
217             if (TYPE_LANG_SPECIFIC (SRC))                       \
218               memcpy (TYPE_LANG_SPECIFIC (DST),                 \
219                       TYPE_LANG_SPECIFIC (SRC),                 \
220                       SIZEOF_OBJC_TYPE_LANG_SPECIFIC);          \
221             TYPE_OBJC_INFO (DST)                                \
222               = make_tree_vec (OBJC_INFO_SLOT_ELTS);            \
223           }                                                     \
224         while (0)
225
226 #define TYPED_OBJECT(TYPE)                                      \
227         (TREE_CODE (TYPE) == RECORD_TYPE                        \
228          && TYPE_HAS_OBJC_INFO (TYPE)                           \
229          && TYPE_OBJC_INTERFACE (TYPE))
230 #define OBJC_TYPE_NAME(TYPE) TYPE_NAME(TYPE)
231 #define OBJC_SET_TYPE_NAME(TYPE, NAME) (TYPE_NAME (TYPE) = NAME)
232
233 /* Hash tables to manage the global pool of method prototypes.  */
234
235 typedef struct hashed_entry     *hash;
236 typedef struct hashed_attribute *attr;
237
238 struct GTY(()) hashed_attribute {
239   attr next;
240   tree value;
241 };
242 struct GTY(()) hashed_entry {
243   attr list;
244   hash next;
245   tree key;
246 };
247
248 extern GTY ((length ("SIZEHASHTABLE"))) hash *nst_method_hash_list;
249 extern GTY ((length ("SIZEHASHTABLE"))) hash *cls_method_hash_list;
250
251 extern GTY ((length ("SIZEHASHTABLE"))) hash *cls_name_hash_list;
252 extern GTY ((length ("SIZEHASHTABLE"))) hash *als_name_hash_list;
253
254 #define SIZEHASHTABLE           257
255
256 /* An array of all the local variables in the current function that
257    need to be marked as volatile.  */
258 extern GTY(()) VEC(tree,gc) *local_variables_to_volatilize;
259
260 /* Objective-C/Objective-C++ @implementation list.  */
261
262 struct GTY(()) imp_entry {
263   struct imp_entry *next;
264   tree imp_context;
265   tree imp_template;
266   tree class_decl;              /* _OBJC_CLASS_<my_name>; */
267   tree meta_decl;               /* _OBJC_METACLASS_<my_name>; */
268   BOOL_BITFIELD has_cxx_cdtors : 1;
269 };
270
271 extern GTY(()) struct imp_entry *imp_list;
272 extern GTY(()) int imp_count;   /* `@implementation' */
273 extern GTY(()) int cat_count;   /* `@category' */
274
275 extern GTY(()) objc_ivar_visibility_kind objc_ivar_visibility;
276
277 /* Objective-C/Objective-C++ global tree enumeration.  */
278
279 enum objc_tree_index
280 {
281     OCTI_STATIC_NST,
282     OCTI_STATIC_NST_DECL,
283     OCTI_SELF_ID,
284     OCTI_UCMD_ID,
285
286     OCTI_SELF_DECL,
287     OCTI_UMSG_DECL,
288     OCTI_UMSG_FAST_DECL,
289     OCTI_UMSG_SUPER_DECL,
290     OCTI_UMSG_STRET_DECL,
291     OCTI_UMSG_SUPER_STRET_DECL,
292     OCTI_GET_CLASS_DECL,
293     OCTI_GET_MCLASS_DECL,
294     OCTI_SUPER_TYPE,
295     OCTI_SEL_TYPE,
296     OCTI_ID_TYPE,
297     OCTI_CLS_TYPE,
298     OCTI_NST_TYPE,
299     OCTI_PROTO_TYPE,
300
301     OCTI_INTF_CHAIN,
302     OCTI_PROTO_CHAIN,
303     OCTI_IMPL_CHAIN,
304     OCTI_CLS_REF_CHAIN,
305     OCTI_SEL_REF_CHAIN,
306     OCTI_IVAR_CHAIN,
307     OCTI_CLS_NAMES_CHAIN,
308     OCTI_METH_VAR_NAMES_CHAIN,
309     OCTI_METH_VAR_TYPES_CHAIN,
310
311     OCTI_SYMBOLS_DECL,
312     OCTI_NST_VAR_DECL,
313     OCTI_CLS_VAR_DECL,
314     OCTI_NST_METH_DECL,
315     OCTI_CLS_METH_DECL,
316     OCTI_CLS_DECL,
317     OCTI_MCLS_DECL,
318     OCTI_SEL_TABLE_DECL,
319     OCTI_MODULES_DECL,
320     OCTI_GNU_INIT_DECL,
321
322     OCTI_INTF_CTX,
323     OCTI_IMPL_CTX,
324     OCTI_METH_CTX,
325     OCTI_IVAR_CTX,
326
327     OCTI_IMPL_TEMPL,
328     OCTI_CLS_TEMPL,
329     OCTI_CAT_TEMPL,
330     OCTI_UPRIV_REC,
331     OCTI_PROTO_TEMPL,
332     OCTI_SEL_TEMPL,
333     OCTI_UCLS_SUPER_REF,
334     OCTI_UUCLS_SUPER_REF,
335     OCTI_METH_TEMPL,
336     OCTI_IVAR_TEMPL,
337     OCTI_METH_LIST_TEMPL,
338     OCTI_METH_PROTO_LIST_TEMPL,
339     OCTI_IVAR_LIST_TEMPL,
340     OCTI_SYMTAB_TEMPL,
341     OCTI_MODULE_TEMPL,
342     OCTI_SUPER_TEMPL,
343     OCTI_OBJ_REF,
344     OCTI_CLS_REF,
345     OCTI_METH_PROTO_TEMPL,
346     OCTI_FUNCTION1_TEMPL,
347     OCTI_FUNCTION2_TEMPL,
348
349     OCTI_OBJ_ID,
350     OCTI_CLS_ID,
351     OCTI_ID_NAME,
352     OCTI_CLASS_NAME,
353     OCTI_CNST_STR_ID,
354     OCTI_CNST_STR_TYPE,
355     OCTI_CNST_STR_GLOB_ID,
356     OCTI_STRING_CLASS_DECL,
357     OCTI_INTERNAL_CNST_STR_TYPE,
358     OCTI_SUPER_DECL,
359     OCTI_UMSG_NONNIL_DECL,
360     OCTI_UMSG_NONNIL_STRET_DECL,
361     OCTI_STORAGE_CLS,
362     OCTI_EXCEPTION_EXTRACT_DECL,
363     OCTI_EXCEPTION_TRY_ENTER_DECL,
364     OCTI_EXCEPTION_TRY_EXIT_DECL,
365     OCTI_EXCEPTION_MATCH_DECL,
366     OCTI_EXCEPTION_THROW_DECL,
367     OCTI_SYNC_ENTER_DECL,
368     OCTI_SYNC_EXIT_DECL,
369     OCTI_SETJMP_DECL,
370     OCTI_EXCDATA_TEMPL,
371     OCTI_STACK_EXCEPTION_DATA_DECL,
372     OCTI_LOCAL_EXCEPTION_DECL,
373     OCTI_RETHROW_EXCEPTION_DECL,
374     OCTI_EVAL_ONCE_DECL,
375     OCTI_CATCH_TYPE,
376     OCTI_EXECCLASS_DECL,
377
378     OCTI_ASSIGN_IVAR_DECL,
379     OCTI_ASSIGN_IVAR_FAST_DECL,
380     OCTI_ASSIGN_GLOBAL_DECL,
381     OCTI_ASSIGN_STRONGCAST_DECL,
382
383     OCTI_FAST_ENUM_STATE_TEMP,
384     OCTI_ENUM_MUTATION_DECL,
385
386     OCTI_GET_PROPERTY_DECL,
387     OCTI_SET_PROPERTY_DECL,
388     OCTI_COPY_STRUCT_DECL,
389     OCTI_GET_PROPERTY_STRUCT_DECL,
390     OCTI_SET_PROPERTY_STRUCT_DECL,
391
392     OCTI_MAX
393 };
394
395 extern GTY(()) tree objc_global_trees[OCTI_MAX];
396
397 /* List of classes with list of their static instances.  */
398 #define objc_static_instances   objc_global_trees[OCTI_STATIC_NST]
399
400 /* The declaration of the array administrating the static instances.  */
401 #define static_instances_decl   objc_global_trees[OCTI_STATIC_NST_DECL]
402
403 /* Some commonly used instances of "identifier_node".  */
404
405 #define self_id                 objc_global_trees[OCTI_SELF_ID]
406 #define ucmd_id                 objc_global_trees[OCTI_UCMD_ID]
407
408 #define self_decl               objc_global_trees[OCTI_SELF_DECL]
409 #define umsg_decl               objc_global_trees[OCTI_UMSG_DECL]
410 #define umsg_fast_decl          objc_global_trees[OCTI_UMSG_FAST_DECL]
411 #define umsg_super_decl         objc_global_trees[OCTI_UMSG_SUPER_DECL]
412 #define umsg_stret_decl         objc_global_trees[OCTI_UMSG_STRET_DECL]
413 #define umsg_super_stret_decl   objc_global_trees[OCTI_UMSG_SUPER_STRET_DECL]
414 #define objc_get_class_decl     objc_global_trees[OCTI_GET_CLASS_DECL]
415 #define objc_get_meta_class_decl                        \
416                                 objc_global_trees[OCTI_GET_MCLASS_DECL]
417
418 #define objc_super_type         objc_global_trees[OCTI_SUPER_TYPE]
419 #define objc_selector_type              objc_global_trees[OCTI_SEL_TYPE]
420 #define objc_object_type        objc_global_trees[OCTI_ID_TYPE]
421 #define objc_class_type         objc_global_trees[OCTI_CLS_TYPE]
422 #define objc_instance_type      objc_global_trees[OCTI_NST_TYPE]
423 #define objc_protocol_type      objc_global_trees[OCTI_PROTO_TYPE]
424
425 /* Type checking macros.  */
426
427 #define IS_ID(TYPE)                                                     \
428         (TREE_CODE (TYPE) == POINTER_TYPE                               \
429          && (TYPE_MAIN_VARIANT (TREE_TYPE (TYPE))                       \
430              == TREE_TYPE (objc_object_type)))
431 #define IS_CLASS(TYPE)                                                  \
432         (TREE_CODE (TYPE) == POINTER_TYPE                               \
433          && (TYPE_MAIN_VARIANT (TREE_TYPE (TYPE))                       \
434              == TREE_TYPE (objc_class_type)))
435 #define IS_PROTOCOL_QUALIFIED_UNTYPED(TYPE)                             \
436         ((IS_ID (TYPE) || IS_CLASS (TYPE))                              \
437          && TYPE_HAS_OBJC_INFO (TREE_TYPE (TYPE))                       \
438          && TYPE_OBJC_PROTOCOL_LIST (TREE_TYPE (TYPE)))
439 #define IS_SUPER(TYPE)                                                  \
440         (TREE_CODE (TYPE) == POINTER_TYPE                               \
441          && TREE_TYPE (TYPE) == objc_super_template)
442
443 #define interface_chain         objc_global_trees[OCTI_INTF_CHAIN]
444 #define protocol_chain          objc_global_trees[OCTI_PROTO_CHAIN]
445 #define implemented_classes     objc_global_trees[OCTI_IMPL_CHAIN]
446
447 /* Chains to manage selectors that are referenced and defined in the
448    module.  */
449
450 #define cls_ref_chain           objc_global_trees[OCTI_CLS_REF_CHAIN]   /* Classes referenced.  */
451 #define sel_ref_chain           objc_global_trees[OCTI_SEL_REF_CHAIN]   /* Selectors referenced.  */
452 #define objc_ivar_chain         objc_global_trees[OCTI_IVAR_CHAIN]
453
454 /* Chains to manage uniquing of strings.  */
455
456 #define class_names_chain       objc_global_trees[OCTI_CLS_NAMES_CHAIN]
457 #define meth_var_names_chain    objc_global_trees[OCTI_METH_VAR_NAMES_CHAIN]
458 #define meth_var_types_chain    objc_global_trees[OCTI_METH_VAR_TYPES_CHAIN]
459
460
461 /* Backend data declarations.  */
462
463 #define UOBJC_SYMBOLS_decl              objc_global_trees[OCTI_SYMBOLS_DECL]
464 #define UOBJC_INSTANCE_VARIABLES_decl   objc_global_trees[OCTI_NST_VAR_DECL]
465 #define UOBJC_CLASS_VARIABLES_decl      objc_global_trees[OCTI_CLS_VAR_DECL]
466 #define UOBJC_INSTANCE_METHODS_decl     objc_global_trees[OCTI_NST_METH_DECL]
467 #define UOBJC_CLASS_METHODS_decl        objc_global_trees[OCTI_CLS_METH_DECL]
468 #define UOBJC_CLASS_decl                objc_global_trees[OCTI_CLS_DECL]
469 #define UOBJC_METACLASS_decl            objc_global_trees[OCTI_MCLS_DECL]
470 #define UOBJC_SELECTOR_TABLE_decl       objc_global_trees[OCTI_SEL_TABLE_DECL]
471 #define UOBJC_MODULES_decl              objc_global_trees[OCTI_MODULES_DECL]
472 #define GNU_INIT_decl                   objc_global_trees[OCTI_GNU_INIT_DECL]
473
474 /* The following are used when compiling a class implementation.
475    implementation_template will normally be an interface, however if
476    none exists this will be equal to objc_implementation_context...it is
477    set in start_class.  */
478
479 #define objc_interface_context          objc_global_trees[OCTI_INTF_CTX]
480 #define objc_implementation_context     objc_global_trees[OCTI_IMPL_CTX]
481 #define objc_method_context             objc_global_trees[OCTI_METH_CTX]
482 #define objc_ivar_context               objc_global_trees[OCTI_IVAR_CTX]
483
484 #define implementation_template objc_global_trees[OCTI_IMPL_TEMPL]
485 #define objc_class_template     objc_global_trees[OCTI_CLS_TEMPL]
486 #define objc_category_template  objc_global_trees[OCTI_CAT_TEMPL]
487 #define uprivate_record         objc_global_trees[OCTI_UPRIV_REC]
488 #define objc_protocol_template  objc_global_trees[OCTI_PROTO_TEMPL]
489 #define objc_selector_template  objc_global_trees[OCTI_SEL_TEMPL]
490 #define ucls_super_ref          objc_global_trees[OCTI_UCLS_SUPER_REF]
491 #define uucls_super_ref         objc_global_trees[OCTI_UUCLS_SUPER_REF]
492
493 #define umsg_nonnil_decl        objc_global_trees[OCTI_UMSG_NONNIL_DECL]
494 #define umsg_nonnil_stret_decl  objc_global_trees[OCTI_UMSG_NONNIL_STRET_DECL]
495 #define objc_storage_class      objc_global_trees[OCTI_STORAGE_CLS]
496 #define objc_exception_extract_decl             \
497                                 objc_global_trees[OCTI_EXCEPTION_EXTRACT_DECL]
498 #define objc_exception_try_enter_decl           \
499                                 objc_global_trees[OCTI_EXCEPTION_TRY_ENTER_DECL]
500 #define objc_exception_try_exit_decl            \
501                                 objc_global_trees[OCTI_EXCEPTION_TRY_EXIT_DECL]
502 #define objc_exception_match_decl               \
503                                 objc_global_trees[OCTI_EXCEPTION_MATCH_DECL]
504 #define objc_exception_throw_decl               \
505                                 objc_global_trees[OCTI_EXCEPTION_THROW_DECL]
506 #define objc_sync_enter_decl    objc_global_trees[OCTI_SYNC_ENTER_DECL]
507 #define objc_sync_exit_decl     objc_global_trees[OCTI_SYNC_EXIT_DECL]
508 #define objc_exception_data_template            \
509                                 objc_global_trees[OCTI_EXCDATA_TEMPL]
510 #define objc_setjmp_decl        objc_global_trees[OCTI_SETJMP_DECL]
511 #define objc_stack_exception_data               \
512                                 objc_global_trees[OCTI_STACK_EXCEPTION_DATA_DECL]
513 #define objc_caught_exception   objc_global_trees[OCTI_LOCAL_EXCEPTION_DECL]    
514 #define objc_rethrow_exception  objc_global_trees[OCTI_RETHROW_EXCEPTION_DECL]  
515 #define objc_eval_once          objc_global_trees[OCTI_EVAL_ONCE_DECL]  
516 #define objc_catch_type         objc_global_trees[OCTI_CATCH_TYPE]
517
518 #define execclass_decl          objc_global_trees[OCTI_EXECCLASS_DECL]
519
520 #define objc_assign_ivar_decl   objc_global_trees[OCTI_ASSIGN_IVAR_DECL]
521 #define objc_assign_ivar_fast_decl              \
522                                 objc_global_trees[OCTI_ASSIGN_IVAR_FAST_DECL]
523 #define objc_assign_global_decl objc_global_trees[OCTI_ASSIGN_GLOBAL_DECL]
524 #define objc_assign_strong_cast_decl            \
525                                 objc_global_trees[OCTI_ASSIGN_STRONGCAST_DECL]
526
527 #define objc_method_template    objc_global_trees[OCTI_METH_TEMPL]
528 #define objc_ivar_template      objc_global_trees[OCTI_IVAR_TEMPL]
529 #define objc_method_list_ptr    objc_global_trees[OCTI_METH_LIST_TEMPL]
530 #define objc_method_proto_list_ptr              \
531                                 objc_global_trees[OCTI_METH_PROTO_LIST_TEMPL]
532 #define objc_ivar_list_ptr      objc_global_trees[OCTI_IVAR_LIST_TEMPL]
533 #define objc_symtab_template    objc_global_trees[OCTI_SYMTAB_TEMPL]
534 #define objc_module_template    objc_global_trees[OCTI_MODULE_TEMPL]
535 #define objc_super_template     objc_global_trees[OCTI_SUPER_TEMPL]
536 #define objc_object_reference   objc_global_trees[OCTI_OBJ_REF]
537 #define objc_class_reference    objc_global_trees[OCTI_CLS_REF]
538 #define objc_method_prototype_template          \
539                                 objc_global_trees[OCTI_METH_PROTO_TEMPL]
540 #define function1_template      objc_global_trees[OCTI_FUNCTION1_TEMPL]
541 #define function2_template      objc_global_trees[OCTI_FUNCTION2_TEMPL]
542
543 #define objc_object_id          objc_global_trees[OCTI_OBJ_ID]
544 #define objc_class_id           objc_global_trees[OCTI_CLS_ID]
545 #define objc_object_name                objc_global_trees[OCTI_ID_NAME]
546 #define objc_class_name         objc_global_trees[OCTI_CLASS_NAME]
547 #define constant_string_id      objc_global_trees[OCTI_CNST_STR_ID]
548 #define constant_string_type    objc_global_trees[OCTI_CNST_STR_TYPE]
549 #define constant_string_global_id               \
550                                 objc_global_trees[OCTI_CNST_STR_GLOB_ID]
551 #define string_class_decl       objc_global_trees[OCTI_STRING_CLASS_DECL]
552 #define internal_const_str_type objc_global_trees[OCTI_INTERNAL_CNST_STR_TYPE]
553 #define UOBJC_SUPER_decl        objc_global_trees[OCTI_SUPER_DECL]
554 #define objc_fast_enumeration_state_template    \
555                                 objc_global_trees[OCTI_FAST_ENUM_STATE_TEMP]
556 #define objc_enumeration_mutation_decl          \
557                                 objc_global_trees[OCTI_ENUM_MUTATION_DECL]
558
559 /* Declarations of functions used when synthesizing property
560    accessors.  */
561 #define objc_getProperty_decl       objc_global_trees[OCTI_GET_PROPERTY_DECL]
562 #define objc_setProperty_decl       objc_global_trees[OCTI_SET_PROPERTY_DECL]
563 #define objc_copyStruct_decl        objc_global_trees[OCTI_COPY_STRUCT_DECL]
564 #define objc_getPropertyStruct_decl objc_global_trees[OCTI_GET_PROPERTY_STRUCT_DECL]
565 #define objc_setPropertyStruct_decl objc_global_trees[OCTI_SET_PROPERTY_STRUCT_DECL]
566
567
568 #endif /* GCC_OBJC_ACT_H */