|
|
1.1 root 1: /* Definitions for C++ parsing and type checking.
2: Copyright (C) 1987, 1993 Free Software Foundation, Inc.
3: Hacked by Michael Tiemann ([email protected])
4:
5: This file is part of GNU CC.
6:
7: GNU CC 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 2, or (at your option)
10: any later version.
11:
12: GNU CC 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 GNU CC; see the file COPYING. If not, write to
19: the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20:
21: /* Borrow everything that is C from c-tree.h,
22: but do so by copy, not by inclusion, since c-tree.h defines
23: lang_identifier. */
24:
25: #ifndef NEW_CLASS_SCOPING
26: #define NEW_CLASS_SCOPING 1
27: #endif
28:
29: /* Language-dependent contents of an identifier. */
30:
31: struct lang_identifier
32: {
33: struct tree_identifier ignore;
34: tree global_value, local_value;
35: tree class_value;
36: tree class_template_info;
37: struct lang_id2 *x;
38: };
39:
40: struct lang_id2
41: {
42: tree label_value, implicit_decl;
43: tree type_desc, as_list, error_locus;
44: };
45:
46: /* To identify to the debug emitters if it should pay attention to the
47: flag `-Wtemplate-debugging'. */
48: #define HAVE_TEMPLATES 1
49:
50: /* Macros for access to language-specific slots in an identifier. */
51:
52: #define IDENTIFIER_GLOBAL_VALUE(NODE) \
53: (((struct lang_identifier *)(NODE))->global_value)
54: #define IDENTIFIER_CLASS_VALUE(NODE) \
55: (((struct lang_identifier *)(NODE))->class_value)
56: #define IDENTIFIER_LOCAL_VALUE(NODE) \
57: (((struct lang_identifier *)(NODE))->local_value)
58: #define IDENTIFIER_TEMPLATE(NODE) \
59: (((struct lang_identifier *)(NODE))->class_template_info)
60:
61: #define IDENTIFIER_TYPE_VALUE(NODE) (TREE_TYPE (NODE))
62: #define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (TREE_TYPE (NODE) = TYPE)
63: #define IDENTIFIER_HAS_TYPE_VALUE(NODE) (TREE_TYPE (NODE) ? 1 : 0)
64: #define IDENTIFIER_HAS_CLASS_TYPE_VALUE(NODE) \
65: (IDENTIFIER_CLASS_VALUE (NODE) && TREE_TYPE (IDENTIFIER_CLASS_VALUE (NODE)))
66: #define IDENTIFIER_CLASS_TYPE_VALUE(NODE) \
67: TREE_TYPE (IDENTIFIER_CLASS_VALUE (NODE))
68:
69: #define LANG_ID_FIELD(NAME,NODE) \
70: (((struct lang_identifier *)(NODE))->x \
71: ? ((struct lang_identifier *)(NODE))->x->NAME : 0)
72: #define SET_LANG_ID(NODE,VALUE,NAME) \
73: (((struct lang_identifier *)(NODE))->x == 0 \
74: ? ((struct lang_identifier *)(NODE))->x \
75: = (struct lang_id2 *)perm_calloc (1, sizeof (struct lang_id2)) : 0, \
76: ((struct lang_identifier *)(NODE))->x->NAME = (VALUE))
77:
78: #define IDENTIFIER_LABEL_VALUE(NODE) LANG_ID_FIELD(label_value, NODE)
79: #define SET_IDENTIFIER_LABEL_VALUE(NODE,VALUE) \
80: SET_LANG_ID(NODE, VALUE, label_value)
81:
82: #define IDENTIFIER_IMPLICIT_DECL(NODE) LANG_ID_FIELD(implicit_decl, NODE)
83: #define SET_IDENTIFIER_IMPLICIT_DECL(NODE,VALUE) \
84: SET_LANG_ID(NODE, VALUE, implicit_decl)
85:
86: #define IDENTIFIER_AS_DESC(NODE) LANG_ID_FIELD(type_desc, NODE)
87: #define SET_IDENTIFIER_AS_DESC(NODE,DESC) \
88: SET_LANG_ID(NODE, DESC, type_desc)
89:
90: #define IDENTIFIER_AS_LIST(NODE) LANG_ID_FIELD(as_list, NODE)
91: #define SET_IDENTIFIER_AS_LIST(NODE,LIST) \
92: SET_LANG_ID(NODE, LIST, as_list)
93:
94: #define IDENTIFIER_ERROR_LOCUS(NODE) LANG_ID_FIELD(error_locus, NODE)
95: #define SET_IDENTIFIER_ERROR_LOCUS(NODE,VALUE) \
96: SET_LANG_ID(NODE, VALUE, error_locus)
97:
98:
99: #define IDENTIFIER_VIRTUAL_P(NODE) TREE_LANG_FLAG_1(NODE)
100:
101: /* Nonzero if this identifier is the prefix for a mangled C++ operator name. */
102: #define IDENTIFIER_OPNAME_P(NODE) TREE_LANG_FLAG_2(NODE)
103:
104: #define IDENTIFIER_TYPENAME_P(NODE) \
105: (! strncmp (IDENTIFIER_POINTER (NODE), \
106: IDENTIFIER_POINTER (ansi_opname[(int) TYPE_EXPR]), \
107: IDENTIFIER_LENGTH (ansi_opname[(int) TYPE_EXPR])))
108:
109: /* Nonzero means reject anything that ANSI standard C forbids. */
110: extern int pedantic;
111:
112: /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only. */
113: #define C_TYPE_FIELDS_READONLY(type) TYPE_LANG_FLAG_0 (type)
114:
115: /* If non-zero, a VAR_DECL whose cleanup will cause a throw to the
116: next exception handler. */
117: extern tree exception_throw_decl;
118:
119: extern tree double_type_node, long_double_type_node, float_type_node;
120: extern tree char_type_node, unsigned_char_type_node, signed_char_type_node;
121: extern tree ptrdiff_type_node;
122:
123: extern tree short_integer_type_node, short_unsigned_type_node;
124: extern tree long_integer_type_node, long_unsigned_type_node;
125: extern tree long_long_integer_type_node, long_long_unsigned_type_node;
126: extern tree unsigned_type_node;
127: extern tree string_type_node, char_array_type_node, int_array_type_node;
128: extern tree wchar_array_type_node;
129: extern tree wchar_type_node, signed_wchar_type_node, unsigned_wchar_type_node;
130: extern tree intQI_type_node, unsigned_intQI_type_node;
131: extern tree intHI_type_node, unsigned_intHI_type_node;
132: extern tree intSI_type_node, unsigned_intSI_type_node;
133: extern tree intDI_type_node, unsigned_intDI_type_node;
134:
135: extern int current_function_returns_value;
136: extern int current_function_returns_null;
137: extern tree current_function_return_value;
138:
139: extern tree ridpointers[];
140: extern tree ansi_opname[];
141: extern tree ansi_assopname[];
142:
143: /* Nonzero means `$' can be in an identifier. */
144:
145: extern int dollars_in_ident;
146:
147: /* Nonzero means allow type mismatches in conditional expressions;
148: just make their values `void'. */
149:
150: extern int flag_cond_mismatch;
151:
152: /* Nonzero means don't recognize the keyword `asm'. */
153:
154: extern int flag_no_asm;
155:
156: /* For cross referencing. */
157:
158: extern int flag_gnu_xref;
159:
160: /* For environments where you can use GNU binutils (as, ld in particular). */
161:
162: extern int flag_gnu_binutils;
163:
164: /* Nonzero means ignore `#ident' directives. */
165:
166: extern int flag_no_ident;
167:
168: /* Nonzero means warn about implicit declarations. */
169:
170: extern int warn_implicit;
171:
172: /* Nonzero means warn when all ctors or dtors are private, and the class
173: has no friends. */
174:
175: extern int warn_ctor_dtor_privacy;
176:
177: /* Nonzero means warn about function definitions that default the return type
178: or that use a null return and have a return-type other than void. */
179:
180: extern int warn_return_type, explicit_warn_return_type;
181:
182: /* Nonzero means give string constants the type `const char *'
183: to get extra warnings from them. These warnings will be too numerous
184: to be useful, except in thoroughly ANSIfied programs. */
185:
186: extern int warn_write_strings;
187:
188: /* Nonzero means warn about sizeof(function) or addition/subtraction
189: of function pointers. */
190:
191: extern int warn_pointer_arith;
192:
193: /* Nonzero means warn for all old-style non-prototype function decls. */
194:
195: extern int warn_strict_prototypes;
196:
197: /* Nonzero means warn about suggesting putting in ()'s. */
198:
199: extern int warn_parentheses;
200:
201: /* Nonzero means warn about multiple (redundant) decls for the same single
202: variable or function. */
203:
204: extern int warn_redundant_decls;
205:
206: /* Warn if initializer is not completely bracketed. */
207:
208: extern int warn_missing_braces;
209:
210: /* Warn about a subscript that has type char. */
211:
212: extern int warn_char_subscripts;
213:
214: /* Nonzero means warn about pointer casts that can drop a type qualifier
215: from the pointer target type. */
216:
217: extern int warn_cast_qual;
218:
219: /* Warn about traditional constructs whose meanings changed in ANSI C. */
220:
221: extern int warn_traditional;
222:
223: /* Nonzero means warn about non virtual destructors in classes that have
224: virtual functions. */
225:
226: extern int warn_nonvdtor;
227:
228: /* Nonzero means do some things the same way PCC does. */
229:
230: extern int flag_traditional;
231:
232: /* Nonzero means to treat bitfields as unsigned unless they say `signed'. */
233:
234: extern int flag_signed_bitfields;
235:
236: /* 3 means write out only virtuals function tables `defined'
237: in this implementation file.
238: 2 means write out only specific virtual function tables
239: and give them (C) public visibility.
240: 1 means write out virtual function tables and give them
241: (C) public visibility.
242: 0 means write out virtual function tables and give them
243: (C) static visibility (default).
244: -1 means declare virtual function tables extern. */
245:
246: extern int write_virtuals;
247:
248: /* INTERFACE_ONLY nonzero means that we are in an "interface"
249: section of the compiler. INTERFACE_UNKNOWN nonzero means
250: we cannot trust the value of INTERFACE_ONLY. If INTERFACE_UNKNOWN
251: is zero and INTERFACE_ONLY is zero, it means that we are responsible
252: for exporting definitions that others might need. */
253: extern int interface_only, interface_unknown;
254:
255: /* Nonzero means we should attempt to elide constructors when possible. */
256:
257: extern int flag_elide_constructors;
258:
259: /* Nonzero means recognize and handle exception handling constructs. */
260:
261: extern int flag_handle_exceptions;
262:
263: /* Nonzero means recognize and handle ansi-style exception handling constructs. */
264:
265: extern int flag_ansi_exceptions;
266:
267: /* Nonzero means do argument matching for overloading according to the
268: ANSI rules, rather than what g++ used to believe to be correct. */
269:
270: extern int flag_ansi_overloading;
271:
272: /* Nonzero means that member functions defined in class scope are
273: inline by default. */
274:
275: extern int flag_default_inline;
276:
277: /* Nonzero means emit cadillac protocol. */
278:
279: extern int flag_cadillac;
280:
281: /* C++ language-specific tree codes. */
282: #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
283: enum cplus_tree_code {
284: __DUMMY = LAST_AND_UNUSED_TREE_CODE,
285: #include "cp-tree.def"
286: LAST_CPLUS_TREE_CODE
287: };
288: #undef DEFTREECODE
289:
290: /* Override OFFSET_REFs from the back-end, as we want our very own. */
291: /* Allow complex pointer to members to work correctly. */
292: #define OFFSET_REF CP_OFFSET_REF
293:
294: #ifdef OBJCPLUS
295: enum languages { lang_c, lang_objc, lang_cplusplus };
296: #else
297: enum languages { lang_c, lang_cplusplus };
298: #endif
299:
300: /* Macros to make error reporting functions' lives easier. */
301: #define TYPE_IDENTIFIER(NODE) (DECL_NAME (TYPE_NAME (NODE)))
302: #define TYPE_NAME_STRING(NODE) (IDENTIFIER_POINTER (TYPE_IDENTIFIER (NODE)))
303: #define TYPE_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (TYPE_IDENTIFIER (NODE)))
304:
305: #define TYPE_ASSEMBLER_NAME_STRING(NODE) (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE))))
306: #define TYPE_ASSEMBLER_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE))))
307:
308: #define IS_AGGR_TYPE(t) (TYPE_LANG_FLAG_5 (t))
309: #define IS_AGGR_TYPE_CODE(t) (t == RECORD_TYPE || t == UNION_TYPE)
310: #define IS_AGGR_TYPE_2(TYPE1,TYPE2) \
311: (TREE_CODE (TYPE1) == TREE_CODE (TYPE2) \
312: && IS_AGGR_TYPE (TYPE1)&IS_AGGR_TYPE (TYPE2))
313:
314: /* In a *_TYPE, nonzero means a built-in type. */
315: #define TYPE_BUILT_IN(NODE) TYPE_LANG_FLAG_6(NODE)
316:
317: /* Macros which might want to be replaced by function calls. */
318:
319: #if 1
320: /* Virtual function addresses can be gotten from a virtual function
321: table entry using this macro. */
322: #define FNADDR_FROM_VTABLE_ENTRY(ENTRY) \
323: TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY))))
324: #define SET_FNADDR_FROM_VTABLE_ENTRY(ENTRY,VALUE) \
325: (TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY)))) = (VALUE))
326:
327: #define FUNCTION_ARG_CHAIN(NODE) (TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (NODE))))
328: #define PROMOTES_TO_AGGR_TYPE(NODE,CODE) \
329: (((CODE) == TREE_CODE (NODE) \
330: && IS_AGGR_TYPE (TREE_TYPE (NODE))) \
331: || IS_AGGR_TYPE (NODE))
332:
333: #else
334: #define FNADDR_FROM_VTABLE_ENTRY(ENTRY) (fnaddr_from_vtable_entry (ENTRY))
335: #define SET_FNADDR_FROM_VTABLE_ENTRY(ENTRY,VALUE) \
336: (set_fnaddr_from_vtable_entry (ENTRY, VALUE))
337: /* #define TYPE_NAME_STRING(NODE) (type_name_string (NODE)) */
338: #define FUNCTION_ARG_CHAIN(NODE) (function_arg_chain (NODE))
339: #define PROMOTES_TO_AGGR_TYPE(NODE,CODE) (promotes_to_aggr_type (NODE, CODE))
340: /* #define IS_AGGR_TYPE_2(TYPE1, TYPE2) (is_aggr_type_2 (TYPE1, TYPE2)) */
341: #endif
342: /* Nonzero iff TYPE is uniquely derived from PARENT. Under MI, PARENT can be an
343: ambiguous base class of TYPE, and this macro will be false. */
344: #define UNIQUELY_DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 0, (tree *)0) >= 0)
345:
346: enum conversion_type { ptr_conv, constptr_conv, int_conv,
347: real_conv, last_conversion_type };
348:
349: /* Statistics show that while the GNU C++ compiler may generate
350: thousands of different types during a compilation run, it
351: generates relatively few (tens) of classtypes. Because of this,
352: it is not costly to store a generous amount of information
353: in classtype nodes. This struct must fill out to a multiple of 4 bytes. */
354: struct lang_type
355: {
356: struct
357: {
358: unsigned has_type_conversion : 1;
359: unsigned has_int_conversion : 1;
360: unsigned has_float_conversion : 1;
361: unsigned has_init_ref : 1;
362: unsigned gets_init_ref : 1;
363: unsigned gets_init_aggr : 1;
364: unsigned has_assignment : 1;
365: unsigned gets_assignment : 1;
366:
367: unsigned needs_constructor : 1;
368: unsigned has_default_ctor : 1;
369: unsigned uses_multiple_inheritance : 1;
370: unsigned const_needs_init : 1;
371: unsigned ref_needs_init : 1;
372: unsigned gets_const_init_ref : 1;
373: unsigned has_const_assign_ref : 1;
374: unsigned gets_const_assign_ref : 1;
375:
376: unsigned vtable_needs_writing : 1;
377: unsigned has_assign_ref : 1;
378: unsigned gets_assign_ref : 1;
379: unsigned gets_new : 1;
380: unsigned gets_delete : 1;
381: unsigned has_call_overloaded : 1;
382: unsigned has_array_ref_overloaded : 1;
383: unsigned has_arrow_overloaded : 1;
384:
385: unsigned local_typedecls : 1;
386: unsigned interface_only : 1;
387: unsigned interface_unknown : 1;
388: unsigned needs_virtual_reinit : 1;
389: unsigned declared_exception : 1;
390: unsigned declared_class : 1;
391: unsigned being_defined : 1;
392: unsigned redefined : 1;
393:
394: unsigned marked : 1;
395: unsigned marked2 : 1;
396: unsigned marked3 : 1;
397: unsigned marked4 : 1;
398: unsigned marked5 : 1;
399: unsigned marked6 : 1;
400: unsigned use_template : 2;
401:
402: unsigned debug_requested : 1;
403: unsigned has_method_call_overloaded : 1;
404: unsigned private_attr : 1;
405: unsigned alters_visibilities : 1;
406: unsigned got_semicolon : 1;
407: unsigned ptrmemfunc_flag : 1;
408:
409: /* The MIPS compiler gets it wrong if this struct also
410: does not fill out to a multiple of 4 bytes. */
411: unsigned dummy : 2;
412:
413: unsigned n_vancestors : 16;
414: } type_flags;
415:
416: int cid;
417: int n_ancestors;
418: int vsize;
419: int max_depth;
420:
421: union tree_node *vbinfo[2];
422: union tree_node *baselink_vec;
423: union tree_node *vfields;
424: union tree_node *vbases;
425: union tree_node *vbase_size;
426:
427: union tree_node *tags;
428: char *memoized_table_entry;
429:
430: char *search_slot;
431:
432: #ifdef ONLY_INT_FIELDS
433: unsigned int mode : 8;
434: #else
435: enum machine_mode mode : 8;
436: #endif
437:
438: unsigned char size_unit;
439: unsigned char align;
440: unsigned char sep_unit;
441:
442: union tree_node *sep;
443: union tree_node *size;
444:
445: union tree_node *base_init_list;
446: union tree_node *abstract_virtuals;
447: union tree_node *as_list;
448: union tree_node *id_as_list;
449: union tree_node *binfo_as_list;
450: union tree_node *vtbl_ptr;
451: union tree_node *instance_variable;
452: union tree_node *friend_classes;
453:
454: char *mi_matrix;
455: union tree_node *conversions[last_conversion_type];
456:
457: union tree_node *dossier;
458: };
459:
460: /* Indicates whether a template should be (or has been) expanded for this
461: class definition. 0=do, 1=did, 2=don't, 3=didn't. */
462: #define CLASSTYPE_USE_TEMPLATE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.use_template)
463:
464: /* Fields used for storing information before the class is defined.
465: After the class is defined, these fields hold other information. */
466:
467: /* List of friends which were defined inline in this class definition. */
468: #define CLASSTYPE_INLINE_FRIENDS(NODE) (TYPE_NONCOPIED_PARTS (NODE))
469:
470: /* Nonzero for _CLASSTYPE means that the _CLASSTYPE either has
471: a special meaning for the assignment operator ("operator="),
472: or one of its fields (or base members) has a special meaning
473: defined. */
474: #define TYPE_HAS_ASSIGNMENT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_assignment)
475: #define TYPE_GETS_ASSIGNMENT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_assignment)
476:
477: /* Nonzero for _CLASSTYPE means that operator new and delete are defined,
478: respectively. */
479: #define TREE_GETS_NEW(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_new)
480: #define TREE_GETS_DELETE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_delete)
481:
482: /* Nonzero for TREE_LIST or _TYPE node means that this node is class-local. */
483: #define TREE_NONLOCAL_FLAG(NODE) (TREE_LANG_FLAG_0 (NODE))
484:
485: /* Nonzero for a _CLASSTYPE node which we know to be private. */
486: #define TYPE_PRIVATE_P(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.private_attr)
487:
488: /* Nonzero means that this _CLASSTYPE node defines ways of converting
489: itself to other types. */
490: #define TYPE_HAS_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_type_conversion)
491:
492: /* Nonzero means that this _CLASSTYPE node can convert itself to an
493: INTEGER_TYPE. */
494: #define TYPE_HAS_INT_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_int_conversion)
495:
496: /* Nonzero means that this _CLASSTYPE node can convert itself to an
497: REAL_TYPE. */
498: #define TYPE_HAS_REAL_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_float_conversion)
499:
500: /* Nonzero means that this _CLASSTYPE node overloads operator=(X&). */
501: #define TYPE_HAS_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_assign_ref)
502: #define TYPE_GETS_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_assign_ref)
503: #define TYPE_HAS_CONST_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_const_assign_ref)
504: #define TYPE_GETS_CONST_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_const_assign_ref)
505:
506: /* Nonzero means that this _CLASSTYPE node has an X(X&) constructor. */
507: #define TYPE_HAS_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_init_ref)
508: #define TYPE_GETS_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_init_ref)
509: #define TYPE_GETS_CONST_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_const_init_ref)
510:
511: /* Nonzero means that this _CLASSTYPE node has an X(X ...) constructor.
512: Note that there must be other arguments, or this constructor is flagged
513: as being erroneous. */
514: #define TYPE_GETS_INIT_AGGR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_init_aggr)
515:
516: /* Nonzero means that this type is being defined. I.e., the left brace
517: starting the definition of this type has been seen. */
518: #define TYPE_BEING_DEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.being_defined)
519: /* Nonzero means that this type has been redefined. In this case, if
520: convenient, don't reprocess any methods that appear in its redefinition. */
521: #define TYPE_REDEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.redefined)
522:
523: /* Nonzero means that this _CLASSTYPE node overloads the method call
524: operator. In this case, all method calls go through `operator->()(...). */
525: #define TYPE_OVERLOADS_METHOD_CALL_EXPR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_method_call_overloaded)
526:
527: /* The is the VAR_DECL that contains NODE's dossier. */
528: #define CLASSTYPE_DOSSIER(NODE) (TYPE_LANG_SPECIFIC(NODE)->dossier)
529:
530: /* Nonzero means that this _CLASSTYPE node overloads operator(). */
531: #define TYPE_OVERLOADS_CALL_EXPR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_call_overloaded)
532:
533: /* Nonzero means that this _CLASSTYPE node overloads operator[]. */
534: #define TYPE_OVERLOADS_ARRAY_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_array_ref_overloaded)
535:
536: /* Nonzero means that this _CLASSTYPE node overloads operator->. */
537: #define TYPE_OVERLOADS_ARROW(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_arrow_overloaded)
538:
539: /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
540: multiple inheritance. If this is 0 for the root of a type
541: hierarchy, then we can use more efficient search techniques. */
542: #define TYPE_USES_MULTIPLE_INHERITANCE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.uses_multiple_inheritance)
543:
544: /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
545: virtual base classes. If this is 0 for the root of a type
546: hierarchy, then we can use more efficient search techniques. */
547: #define TYPE_USES_VIRTUAL_BASECLASSES(NODE) (TREE_LANG_FLAG_3(NODE))
548:
549: /* List of lists of member functions defined in this class. */
550: #define CLASSTYPE_METHOD_VEC(NODE) TYPE_METHODS(NODE)
551:
552: /* Pointer from any member function to the head of the list of
553: member functions of the type that member function belongs to. */
554: #define CLASSTYPE_BASELINK_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->baselink_vec)
555:
556: /* Mark bits for depth-first and breath-first searches. */
557: #define CLASSTYPE_MARKED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked)
558: #define CLASSTYPE_MARKED2(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked2)
559: #define CLASSTYPE_MARKED3(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked3)
560: #define CLASSTYPE_MARKED4(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked4)
561: #define CLASSTYPE_MARKED5(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked5)
562: #define CLASSTYPE_MARKED6(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked6)
563: /* Macros to modify the above flags */
564: #define SET_CLASSTYPE_MARKED(NODE) (CLASSTYPE_MARKED(NODE) = 1)
565: #define CLEAR_CLASSTYPE_MARKED(NODE) (CLASSTYPE_MARKED(NODE) = 0)
566: #define SET_CLASSTYPE_MARKED2(NODE) (CLASSTYPE_MARKED2(NODE) = 1)
567: #define CLEAR_CLASSTYPE_MARKED2(NODE) (CLASSTYPE_MARKED2(NODE) = 0)
568: #define SET_CLASSTYPE_MARKED3(NODE) (CLASSTYPE_MARKED3(NODE) = 1)
569: #define CLEAR_CLASSTYPE_MARKED3(NODE) (CLASSTYPE_MARKED3(NODE) = 0)
570: #define SET_CLASSTYPE_MARKED4(NODE) (CLASSTYPE_MARKED4(NODE) = 1)
571: #define CLEAR_CLASSTYPE_MARKED4(NODE) (CLASSTYPE_MARKED4(NODE) = 0)
572: #define SET_CLASSTYPE_MARKED5(NODE) (CLASSTYPE_MARKED5(NODE) = 1)
573: #define CLEAR_CLASSTYPE_MARKED5(NODE) (CLASSTYPE_MARKED5(NODE) = 0)
574: #define SET_CLASSTYPE_MARKED6(NODE) (CLASSTYPE_MARKED6(NODE) = 1)
575: #define CLEAR_CLASSTYPE_MARKED6(NODE) (CLASSTYPE_MARKED6(NODE) = 0)
576:
577: #define CLASSTYPE_TAGS(NODE) (TYPE_LANG_SPECIFIC(NODE)->tags)
578:
579: /* Remove when done merging. */
580: #define CLASSTYPE_VFIELD(NODE) TYPE_VFIELD(NODE)
581:
582: /* The number of virtual functions defined for this
583: _CLASSTYPE node. */
584: #define CLASSTYPE_VSIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->vsize)
585: /* The virtual base classes that this type uses. */
586: #define CLASSTYPE_VBASECLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->vbases)
587: /* The virtual function pointer fields that this type contains. */
588: #define CLASSTYPE_VFIELDS(NODE) (TYPE_LANG_SPECIFIC(NODE)->vfields)
589:
590: /* Number of baseclasses defined for this type.
591: 0 means no base classes. */
592: #define CLASSTYPE_N_BASECLASSES(NODE) \
593: (TYPE_BINFO_BASETYPES (NODE) ? TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES(NODE)) : 0)
594:
595: /* Memoize the number of super classes (base classes) tha this node
596: has. That way we can know immediately (albeit conservatively how
597: large a multiple-inheritance matrix we need to build to find
598: derivation information. */
599: #define CLASSTYPE_N_SUPERCLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->n_ancestors)
600: #define CLASSTYPE_N_VBASECLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.n_vancestors)
601:
602: /* Record how deep the inheritance is for this class so `void*' conversions
603: are less favorable than a conversion to the most base type. */
604: #define CLASSTYPE_MAX_DEPTH(NODE) (TYPE_LANG_SPECIFIC(NODE)->max_depth)
605:
606: /* Used for keeping search-specific information. Any search routine
607: which uses this must define what exactly this slot is used for. */
608: #define CLASSTYPE_SEARCH_SLOT(NODE) (TYPE_LANG_SPECIFIC(NODE)->search_slot)
609:
610: /* Entry for keeping memoization tables for this type to
611: hopefully speed up search routines. Since it is a pointer,
612: it can mean almost anything. */
613: #define CLASSTYPE_MTABLE_ENTRY(NODE) (TYPE_LANG_SPECIFIC(NODE)->memoized_table_entry)
614:
615: /* This is the total size of the baseclasses defined for this type.
616: Needed because it is desirable to layout such information
617: before beginning to process the class itself, and we
618: don't want to compute it second time when actually laying
619: out the type for real. */
620: #define CLASSTYPE_SIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->size)
621: #define CLASSTYPE_SIZE_UNIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->size_unit)
622: #define CLASSTYPE_MODE(NODE) (TYPE_LANG_SPECIFIC(NODE)->mode)
623: #define CLASSTYPE_ALIGN(NODE) (TYPE_LANG_SPECIFIC(NODE)->align)
624:
625: /* This is the space needed for virtual base classes. NULL if
626: there are no virtual basetypes. */
627: #define CLASSTYPE_VBASE_SIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->vbase_size)
628:
629: /* A cons list of structure elements which either have constructors
630: to be called, or virtual function table pointers which
631: need initializing. Depending on what is being initialized,
632: the TREE_PURPOSE and TREE_VALUE fields have different meanings:
633:
634: Member initialization: <FIELD_DECL, TYPE>
635: Base class construction: <NULL_TREE, BASETYPE>
636: Base class initialization: <BASE_INITIALIZATION, THESE_INITIALIZATIONS>
637: Whole type: <MEMBER_INIT, BASE_INIT>. */
638: #define CLASSTYPE_BASE_INIT_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->base_init_list)
639:
640: /* A cons list of virtual functions which cannot be inherited by
641: derived classes. When deriving from this type, the derived
642: class must provide its own definition for each of these functions. */
643: #define CLASSTYPE_ABSTRACT_VIRTUALS(NODE) (TYPE_LANG_SPECIFIC(NODE)->abstract_virtuals)
644:
645: #define CLASSTYPE_ALTERS_VISIBILITIES_P(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.alters_visibilities)
646:
647: /* Nonzero means that this aggr type has been `closed' by a semicolon. */
648: #define CLASSTYPE_GOT_SEMICOLON(NODE) (TYPE_LANG_SPECIFIC (NODE)->type_flags.got_semicolon)
649:
650: /* Nonzero means that the main virtual function table pointer needs to be
651: set because base constructors have placed the wrong value there.
652: If this is zero, it means that they placed the right value there,
653: and there is no need to change it. */
654: #define CLASSTYPE_NEEDS_VIRTUAL_REINIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.needs_virtual_reinit)
655:
656: /* Nonzero means that if this type has virtual functions, that
657: the virtual function table will be written out. */
658: #define CLASSTYPE_VTABLE_NEEDS_WRITING(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.vtable_needs_writing)
659:
660: /* Nonzero means that this type defines its own local type declarations. */
661: #define CLASSTYPE_LOCAL_TYPEDECLS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.local_typedecls)
662:
663: /* Nonzero means that this type has an X() constructor. */
664: #define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_default_ctor)
665:
666: /* Many routines need to cons up a list of basetypes for visibility
667: checking. This field contains a TREE_LIST node whose TREE_VALUE
668: is the main variant of the type, and whose TREE_VIA_PUBLIC
669: and TREE_VIA_VIRTUAL bits are correctly set. */
670: #define CLASSTYPE_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->as_list)
671: /* Same, but cache a list whose value is the name of this type. */
672: #define CLASSTYPE_ID_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->id_as_list)
673: /* Same, but cache a list whose value is the binfo of this type. */
674: #define CLASSTYPE_BINFO_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->binfo_as_list)
675:
676: /* Slot in which to cache a copy of the local vtable pointer. */
677: #define CLASSTYPE_VTBL_PTR(NODE) (TYPE_LANG_SPECIFIC(NODE)->vtbl_ptr)
678:
679: /* Hold the instance object associated with this method. */
680: #define CLASSTYPE_INST_VAR(NODE) (TYPE_LANG_SPECIFIC(NODE)->instance_variable)
681:
682: /* A list of class types with which this type is a friend. */
683: #define CLASSTYPE_FRIEND_CLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->friend_classes)
684:
685: /* Keep an inheritance lattice around so we can quickly tell whether
686: a type is derived from another or not. */
687: #define CLASSTYPE_MI_MATRIX(NODE) (TYPE_LANG_SPECIFIC(NODE)->mi_matrix)
688:
689: /* If there is exactly one conversion to a non-void, non-const pointer type,
690: remember that here. If there are more than one, put
691: `error_mark_node' here. If there are none, this holds NULL_TREE. */
692: #define CLASSTYPE_CONVERSION(NODE,KIND) \
693: (TYPE_LANG_SPECIFIC(NODE)->conversions[(int) KIND])
694:
695: /* Say whether this node was declared as a "class" or a "struct". */
696: #define CLASSTYPE_DECLARED_CLASS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.declared_class)
697: /* Say whether this node was declared as a "class" or a "struct". */
698: #define CLASSTYPE_DECLARED_EXCEPTION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.declared_exception)
699:
700: /* Nonzero if this class has const members which have no specified initialization. */
701: #define CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.const_needs_init)
702:
703: /* Nonzero if this class has ref members which have no specified initialization. */
704: #define CLASSTYPE_REF_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.ref_needs_init)
705:
706: /* Nonzero if this class is included from a header file which employs
707: `#pragma interface', and it is not included in its implementation file. */
708: #define CLASSTYPE_INTERFACE_ONLY(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_only)
709:
710: /* Same as above, but for classes whose purpose we do not know. */
711: #define CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown)
712: #define CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown == 0)
713: #define SET_CLASSTYPE_INTERFACE_UNKNOWN_X(NODE,X) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = !!(X))
714: #define SET_CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = 1)
715: #define SET_CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = 0)
716:
717: /* Nonzero if a _DECL node requires us to output debug info for this class. */
718: #define CLASSTYPE_DEBUG_REQUESTED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.debug_requested)
719:
720: /* Additional macros for inheritance information. */
721:
722: #define CLASSTYPE_VBINFO(NODE,VIA_PUBLIC) \
723: (TYPE_LANG_SPECIFIC (NODE)->vbinfo[VIA_PUBLIC])
724:
725: /* When following an binfo-specific chain, this is the cumulative
726: via-public flag. */
727: #define BINFO_VIA_PUBLIC(NODE) TREE_LANG_FLAG_5 (NODE)
728:
729: /* When building a matrix to determine by a single lookup
730: whether one class is derived from another or not,
731: this field is the index of the class in the table. */
732: #define CLASSTYPE_CID(NODE) (TYPE_LANG_SPECIFIC(NODE)->cid)
733: #define BINFO_CID(NODE) CLASSTYPE_CID(BINFO_TYPE(NODE))
734:
735: /* Nonzero means marked by DFS or BFS search, including searches
736: by `get_binfo' and `get_base_distance'. */
737: #define BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED(BINFO_TYPE(NODE)):TREE_LANG_FLAG_0(NODE))
738: /* Macros needed because of C compilers that don't allow conditional
739: expressions to be lvalues. Grr! */
740: #define SET_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_0(NODE)=1))
741: #define CLEAR_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_0(NODE)=0))
742:
743: /* Nonzero means marked in building initialization list. */
744: #define BINFO_BASEINIT_MARKED(NODE) CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
745: /* Modifier macros */
746: #define SET_BINFO_BASEINIT_MARKED(NODE) SET_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
747: #define CLEAR_BINFO_BASEINIT_MARKED(NODE) CLEAR_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
748:
749: /* Nonzero means marked in search through virtual inheritance hierarchy. */
750: #define BINFO_VBASE_MARKED(NODE) CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
751: /* Modifier macros */
752: #define SET_BINFO_VBASE_MARKED(NODE) SET_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
753: #define CLEAR_BINFO_VBASE_MARKED(NODE) CLEAR_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
754:
755: /* Nonzero means marked in search for members or member functions. */
756: #define BINFO_FIELDS_MARKED(NODE) \
757: (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED2 (BINFO_TYPE (NODE)):TREE_LANG_FLAG_2(NODE))
758: #define SET_BINFO_FIELDS_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED2(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_2(NODE)=1))
759: #define CLEAR_BINFO_FIELDS_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED2(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_2(NODE)=0))
760:
761: /* Nonzero means that this class is on a path leading to a new vtable. */
762: #define BINFO_VTABLE_PATH_MARKED(NODE) \
763: (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):TREE_LANG_FLAG_3(NODE))
764: #define SET_BINFO_VTABLE_PATH_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_3(NODE)=1))
765: #define CLEAR_BINFO_VTABLE_PATH_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_3(NODE)=0))
766:
767: /* Nonzero means that this class has a new vtable. */
768: #define BINFO_NEW_VTABLE_MARKED(NODE) \
769: (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):TREE_LANG_FLAG_4(NODE))
770: #define SET_BINFO_NEW_VTABLE_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_4(NODE)=1))
771: #define CLEAR_BINFO_NEW_VTABLE_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_4(NODE)=0))
772:
773: /* Nonzero means this class has initialized its virtual baseclasses. */
774: #define BINFO_VBASE_INIT_MARKED(NODE) \
775: (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED5(BINFO_TYPE(NODE)):TREE_LANG_FLAG_5(NODE))
776: #define SET_BINFO_VBASE_INIT_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED5(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_5(NODE)=1))
777: #define CLEAR_BINFO_VBASE_INIT_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED5(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_5(NODE)=0))
778:
779: /* Accessor macros for the vfield slots in structures. */
780:
781: /* Get the assoc info that caused this vfield to exist. */
782: #define VF_BINFO_VALUE(NODE) TREE_PURPOSE (NODE)
783:
784: /* Get that same information as a _TYPE. */
785: #define VF_BASETYPE_VALUE(NODE) TREE_VALUE (NODE)
786:
787: /* Get the value of the top-most type dominating the non-`normal' vfields. */
788: #define VF_DERIVED_VALUE(NODE) (VF_BINFO_VALUE (NODE) ? BINFO_TYPE (VF_BINFO_VALUE (NODE)) : NULL_TREE)
789:
790: /* Get the value of the top-most type that's `normal' for the vfield. */
791: #define VF_NORMAL_VALUE(NODE) TREE_TYPE (NODE)
792:
793: /* Nonzero for TREE_LIST node means that this list of things
794: is a list of parameters, as opposed to a list of expressions. */
795: #define TREE_PARMLIST(NODE) ((NODE)->common.unsigned_flag) /* overloaded! */
796:
797: /* For FUNCTION_TYPE or METHOD_TYPE, a list of the exceptions that
798: this type can raise. */
799: #define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_NONCOPIED_PARTS (NODE)
800:
801: struct lang_decl_flags
802: {
803: #ifdef ONLY_INT_FIELDS
804: int language : 8;
805: #else
806: enum languages language : 8;
807: #endif
808:
809: unsigned operator_attr : 1;
810: unsigned constructor_attr : 1;
811: unsigned returns_first_arg : 1;
812: unsigned preserves_first_arg : 1;
813: unsigned friend_attr : 1;
814: unsigned static_function : 1;
815: unsigned const_memfunc : 1;
816: unsigned volatile_memfunc : 1;
817:
818: unsigned abstract_virtual : 1;
819: unsigned permanent_attr : 1 ;
820: unsigned constructor_for_vbase_attr : 1;
821: unsigned mutable_flag : 1;
822: unsigned dummy : 12;
823:
824: tree visibility;
825: tree context;
826: };
827:
828: struct lang_decl
829: {
830: struct lang_decl_flags decl_flags;
831:
832: struct template_info *template_info;
833: tree main_decl_variant;
834: struct pending_inline *pending_inline_info;
835: tree vbase_init_list;
836: tree chain;
837: };
838:
839: /* Non-zero if NODE is a _DECL with TREE_READONLY set. */
840: #define TREE_READONLY_DECL_P(NODE) \
841: (TREE_READONLY (NODE) && TREE_CODE_CLASS (TREE_CODE (NODE)) == 'd')
842:
843: /* For FUNCTION_DECLs: return the language in which this decl
844: was declared. */
845: #define DECL_LANGUAGE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.language)
846:
847: /* For FUNCTION_DECLs: nonzero means that this function is a constructor. */
848: #define DECL_CONSTRUCTOR_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_attr)
849: /* For FUNCTION_DECLs: nonzero means that this function is a constructor
850: for an object with virtual baseclasses. */
851: #define DECL_CONSTRUCTOR_FOR_VBASE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_for_vbase_attr)
852:
853: /* For FUNCTION_DECLs: nonzero means that the constructor
854: is known to return a non-zero `this' unchanged. */
855: #define DECL_RETURNS_FIRST_ARG(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.returns_first_arg)
856:
857: /* Nonzero for FUNCTION_DECL means that this constructor is known to
858: not make any assignment to `this', and therefore can be trusted
859: to return it unchanged. Otherwise, we must re-assign `current_class_decl'
860: after performing base initializations. */
861: #define DECL_PRESERVES_THIS(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.preserves_first_arg)
862:
863: /* Nonzero for _DECL means that this decl appears in (or will appear
864: in) as a member in a RECORD_TYPE or UNION_TYPE node. It is also for
865: detecting circularity in case members are multiply defined. In the
866: case of a VAR_DECL, it is also used to determine how program storage
867: should be allocated. */
868: #define DECL_IN_AGGR_P(NODE) (DECL_LANG_FLAG_3(NODE))
869:
870: /* Nonzero for FUNCTION_DECL means that this decl is just a
871: friend declaration, and should not be added to the list of
872: member functions for this class. */
873: #define DECL_FRIEND_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.friend_attr)
874:
875: /* Nonzero for FUNCTION_DECL means that this decl is a static
876: member function. */
877: #define DECL_STATIC_FUNCTION_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.static_function)
878:
879: /* Nonzero for FUNCTION_DECL means that this member function
880: has `this' as const X *const. */
881: #define DECL_CONST_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.const_memfunc)
882:
883: /* Nonzero for FUNCTION_DECL means that this member function
884: has `this' as volatile X *const. */
885: #define DECL_VOLATILE_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.volatile_memfunc)
886:
887: /* Nonzero for _DECL means that this member object type
888: is mutable. */
889: #define DECL_MUTABLE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag)
890:
891: /* Nonzero for FUNCTION_DECL means that this member function
892: exists as part of an abstract class's interface. */
893: #define DECL_ABSTRACT_VIRTUAL_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.abstract_virtual)
894:
895: /* Nonzero if allocated on permanent_obstack. */
896: #define LANG_DECL_PERMANENT(LANGDECL) ((LANGDECL)->decl_flags.permanent_attr)
897:
898: /* The _TYPE context in which this _DECL appears. This field is used
899: only to compute visibility information. */
900: #define DECL_CLASS_CONTEXT(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.context)
901:
902: /* For a FUNCTION_DECL: the chain through which the next method
903: in the method chain is found. We now use TREE_CHAIN to
904: link into the FIELD_DECL chain. */
905: #if 1
906: #define DECL_CHAIN(NODE) (DECL_LANG_SPECIFIC(NODE)->chain)
907: #else
908: #define DECL_CHAIN(NODE) (TREE_CHAIN (NODE))
909: #endif
910:
911: /* Points back to the decl which caused this lang_decl to be allocated. */
912: #define DECL_MAIN_VARIANT(NODE) (DECL_LANG_SPECIFIC(NODE)->main_decl_variant)
913:
914: /* For a FUNCTION_DECL: if this function was declared inline inside of
915: a class declaration, this is where the text for the function is
916: squirreled away. */
917: #define DECL_PENDING_INLINE_INFO(NODE) (DECL_LANG_SPECIFIC(NODE)->pending_inline_info)
918:
919: /* Holds information about how virtual base classes should be initialized
920: by this constructor *if* this constructor is the one to perform
921: such initialization. */
922: #define DECL_VBASE_INIT_LIST(NODE) (DECL_LANG_SPECIFIC(NODE)->vbase_init_list)
923:
924: /* For a TEMPLATE_DECL: template-specific information. */
925: #define DECL_TEMPLATE_INFO(NODE) (DECL_LANG_SPECIFIC(NODE)->template_info)
926:
927: /* Nonzero in INT_CST means that this int is negative by dint of
928: using a twos-complement negated operand. */
929: #define TREE_NEGATED_INT(NODE) (TREE_LANG_FLAG_0 (NODE))
930:
931: /* Nonzero in any kind of _EXPR or _REF node means that it is a call
932: to a storage allocation routine. If, later, alternate storage
933: is found to hold the object, this call can be ignored. */
934: #define TREE_CALLS_NEW(NODE) (TREE_LANG_FLAG_1 (NODE))
935:
936: /* Nonzero in any kind of _TYPE that uses multiple inheritance
937: or virtual baseclasses. */
938: #define TYPE_USES_COMPLEX_INHERITANCE(NODE) (TREE_LANG_FLAG_1 (NODE))
939:
940: /* Nonzero in IDENTIFIER_NODE means that this name is overloaded, and
941: should be looked up in a non-standard way. */
942: #define TREE_OVERLOADED(NODE) (TREE_LANG_FLAG_0 (NODE))
943: #define DECL_OVERLOADED(NODE) (DECL_LANG_FLAG_4 (NODE))
944:
945: /* Nonzero if this (non-TYPE)_DECL has its virtual attribute set.
946: For a FUNCTION_DECL, this is when the function is a virtual function.
947: For a VAR_DECL, this is when the variable is a virtual function table.
948: For a FIELD_DECL, when the field is the field for the virtual function table.
949: For an IDENTIFIER_NODE, nonzero if any function with this name
950: has been declared virtual.
951:
952: For a _TYPE if it uses virtual functions (or is derived from
953: one that does). */
954: #define TYPE_VIRTUAL_P(NODE) (TREE_LANG_FLAG_2 (NODE))
955:
956: /* Same, but tells if this field is private in current context. */
957: #define DECL_PRIVATE(NODE) (DECL_LANG_FLAG_5 (NODE))
958:
959: /* Same, but tells if this field is private in current context. */
960: #define DECL_PROTECTED(NODE) (DECL_LANG_FLAG_6(NODE))
961:
962: #define DECL_PUBLIC(NODE) (DECL_LANG_FLAG_7(NODE))
963:
964: /* Record whether a typedef for type `int' was actually `signed int'. */
965: #define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp))
966:
967: /* Nonzero if the type T promotes to itself.
968: ANSI C states explicitly the list of types that promote;
969: in particular, short promotes to int even if they have the same width. */
970: #define C_PROMOTING_INTEGER_TYPE_P(t) \
971: (TREE_CODE ((t)) == INTEGER_TYPE \
972: && (TYPE_MAIN_VARIANT (t) == char_type_node \
973: || TYPE_MAIN_VARIANT (t) == signed_char_type_node \
974: || TYPE_MAIN_VARIANT (t) == unsigned_char_type_node \
975: || TYPE_MAIN_VARIANT (t) == short_integer_type_node \
976: || TYPE_MAIN_VARIANT (t) == short_unsigned_type_node))
977:
978: /* Mark which labels are explicitly declared.
979: These may be shadowed, and may be referenced from nested functions. */
980: #define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label)
981:
982: /* Record whether a type or decl was written with nonconstant size.
983: Note that TYPE_SIZE may have simplified to a constant. */
984: #define C_TYPE_VARIABLE_SIZE(type) TREE_LANG_FLAG_4 (type)
985: #define C_DECL_VARIABLE_SIZE(type) DECL_LANG_FLAG_8 (type)
986:
987: /* Nonzero for _TYPE means that the _TYPE defines
988: at least one constructor. */
989: #define TYPE_HAS_CONSTRUCTOR(NODE) (TYPE_LANG_FLAG_1(NODE))
990:
991: /* When appearing in an INDIRECT_REF, it means that the tree structure
992: underneath is actually a call to a constructor. This is needed
993: when the constructor must initialize local storage (which can
994: be automatically destroyed), rather than allowing it to allocate
995: space from the heap.
996:
997: When appearing in a SAVE_EXPR, it means that underneath
998: is a call to a constructor.
999:
1000: When appearing in a CONSTRUCTOR, it means that it was
1001: a GNU C constructor expression.
1002:
1003: When appearing in a FIELD_DECL, it means that this field
1004: has been duly initialized in its constructor. */
1005: #define TREE_HAS_CONSTRUCTOR(NODE) (TREE_LANG_FLAG_4(NODE))
1006:
1007: /* Indicates that a NON_LVALUE_EXPR came from a C++ reference.
1008: Used to generate more helpful error message in case somebody
1009: tries to take its address. */
1010: #define TREE_REFERENCE_EXPR(NODE) (TREE_LANG_FLAG_3(NODE))
1011:
1012: /* Nonzero for _TYPE means that the _TYPE defines a destructor. */
1013: #define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2(NODE))
1014:
1015: /* Nonzero for _TYPE node means that creating an object of this type
1016: will involve a call to a constructor. This can apply to objects
1017: of ARRAY_TYPE if the type of the elements needs a constructor. */
1018: #define TYPE_NEEDS_CONSTRUCTING(NODE) (TYPE_LANG_FLAG_3(NODE))
1019: #define TYPE_NEEDS_CONSTRUCTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.needs_constructor)
1020:
1021: /* Nonzero for _TYPE node means that destroying an object of this type
1022: will involve a call to a destructor. This can apply to objects
1023: of ARRAY_TYPE is the type of the elements needs a destructor. */
1024: #define TYPE_NEEDS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_4(NODE))
1025:
1026: /* Nonzero for _TYPE node means that this type is a pointer to member
1027: function type. */
1028: #define TYPE_PTRMEMFUNC_P(NODE) (TREE_CODE(NODE) == RECORD_TYPE && TYPE_LANG_SPECIFIC(NODE)->type_flags.ptrmemfunc_flag)
1029: #define TYPE_PTRMEMFUNC_FLAG(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.ptrmemfunc_flag)
1030: /* Get the POINTER_TYPE to the METHOD_TYPE associated with this
1031: pointer to member function. TYPE_PTRMEMFUNC_P _must_ be true,
1032: before using this macro. */
1033: #define TYPE_PTRMEMFUNC_FN_TYPE(NODE) (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (NODE)))))))
1034: /* These are use to manipulate the the canonical RECORD_TYPE from the
1035: hashed POINTER_TYPE, and can only be used on the POINTER_TYPE. */
1036: #define TYPE_GET_PTRMEMFUNC_TYPE(NODE) ((tree)TYPE_LANG_SPECIFIC(NODE))
1037: #define TYPE_SET_PTRMEMFUNC_TYPE(NODE, VALUE) (TYPE_LANG_SPECIFIC(NODE) = ((struct lang_type *)(void*)(VALUE)))
1038: /* These are to get the delta2 and pfn fields from a TYPE_PTRMEMFUNC_P. */
1039: #define DELTA2_FROM_PTRMEMFUNC(NODE) (build_component_ref (build_component_ref ((NODE), pfn_or_delta2_identifier, 0, 0), delta2_identifier, 0, 0))
1040: #define PFN_FROM_PTRMEMFUNC(NODE) (build_component_ref (build_component_ref ((NODE), pfn_or_delta2_identifier, 0, 0), pfn_identifier, 0, 0))
1041:
1042: /* Nonzero for VAR_DECL node means that `external' was specified in
1043: its declaration. */
1044: #define DECL_THIS_EXTERN(NODE) (DECL_LANG_FLAG_2(NODE))
1045:
1046: /* Nonzero for SAVE_EXPR if used to initialize a PARM_DECL. */
1047: #define PARM_DECL_EXPR(NODE) (TREE_LANG_FLAG_2(NODE))
1048:
1049: /* Nonzero in FUNCTION_DECL means it is really an operator.
1050: Just used to communicate formatting information to dbxout.c. */
1051: #define DECL_OPERATOR(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.operator_attr)
1052:
1053: #define UNKNOWN_TYPE LANG_TYPE
1054:
1055: /* Define fields and accessors for nodes representing declared names. */
1056:
1057: #if 0
1058: /* C++: A derived class may be able to directly use the virtual
1059: function table of a base class. When it does so, it may
1060: still have a decl node used to access the virtual function
1061: table (so that variables of this type can initialize their
1062: virtual function table pointers by name). When such thievery
1063: is committed, know exactly which base class's virtual function
1064: table is the one being stolen. This effectively computes the
1065: transitive closure. */
1066: #define DECL_VPARENT(NODE) ((NODE)->decl.arguments)
1067: #endif
1068:
1069: /* Make a slot so we can implement nested types. This slot holds
1070: the IDENTIFIER_NODE that uniquely names the nested type. This
1071: is for TYPE_DECLs only. */
1072: #define DECL_NESTED_TYPENAME(NODE) ((NODE)->decl.arguments)
1073:
1074: /* C++: all of these are overloaded! These apply only to TYPE_DECLs. */
1075: #define DECL_FRIENDLIST(NODE) (DECL_INITIAL (NODE))
1076: #define DECL_UNDEFINED_FRIENDS(NODE) ((NODE)->decl.result)
1077: #define DECL_WAITING_FRIENDS(NODE) ((tree)(NODE)->decl.rtl)
1078: #define SET_DECL_WAITING_FRIENDS(NODE,VALUE) \
1079: ((NODE)->decl.rtl=(struct rtx_def*)VALUE)
1080:
1081: /* The DECL_VISIBILITY is used to record under which context
1082: special visibility rules apply. */
1083: #define DECL_VISIBILITY(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.visibility)
1084:
1085: /* C++: all of these are overloaded!
1086: These apply to PARM_DECLs and VAR_DECLs. */
1087: #define DECL_REFERENCE_SLOT(NODE) ((tree)(NODE)->decl.arguments)
1088: #define SET_DECL_REFERENCE_SLOT(NODE,VAL) ((NODE)->decl.arguments=VAL)
1089:
1090: /* For local VAR_DECLs, holds index into gc-protected obstack. */
1091: #define DECL_GC_OFFSET(NODE) ((NODE)->decl.result)
1092:
1093: /* Accessor macros for C++ template decl nodes. */
1094: #define DECL_TEMPLATE_IS_CLASS(NODE) (DECL_RESULT(NODE) == NULL_TREE)
1095: #define DECL_TEMPLATE_PARMS(NODE) DECL_ARGUMENTS(NODE)
1096: /* For class templates. */
1097: #define DECL_TEMPLATE_MEMBERS(NODE) DECL_INITIAL(NODE)
1098: /* For function, method, class-data templates. */
1099: #define DECL_TEMPLATE_RESULT(NODE) DECL_RESULT(NODE)
1100: #define DECL_TEMPLATE_INSTANTIATIONS(NODE) DECL_VINDEX(NODE)
1101:
1102: /* ...and for unexpanded-parameterized-type nodes. */
1103: #define UPT_TEMPLATE(NODE) TREE_PURPOSE(TYPE_VALUES(NODE))
1104: #define UPT_PARMS(NODE) TREE_VALUE(TYPE_VALUES(NODE))
1105:
1106: /* An enumeration of the kind of tags that C++ accepts. */
1107: enum tag_types { record_type, class_type, union_type, enum_type, exception_type };
1108:
1109: /* Zero means prototype weakly, as in ANSI C (no args means nothing).
1110: Each language context defines how this variable should be set. */
1111: extern int strict_prototype;
1112: extern int strict_prototypes_lang_c, strict_prototypes_lang_cplusplus;
1113:
1114: /* Non-zero means that if a label exists, and no other identifier
1115: applies, use the value of the label. */
1116: extern int flag_labels_ok;
1117:
1118: /* Non-zero means to collect statistics which might be expensive
1119: and to print them when we are done. */
1120: extern int flag_detailed_statistics;
1121:
1122: /* Non-zero means warn in function declared in derived class has the
1123: same name as a virtual in the base class, but fails to match the
1124: type signature of any virtual function in the base class. */
1125: extern int warn_overloaded_virtual;
1126:
1127: /* in cp-decl{2}.c */
1128: extern tree void_list_node;
1129: extern tree void_zero_node;
1130: extern tree default_function_type;
1131: extern tree vtable_entry_type;
1132: extern tree __t_desc_type_node, __i_desc_type_node, __m_desc_type_node;
1133: extern tree Type_info_type_node;
1134: extern tree class_star_type_node;
1135: extern tree this_identifier;
1136: extern tree pfn_identifier;
1137: extern tree index_identifier;
1138: extern tree delta_identifier;
1139: extern tree delta2_identifier;
1140: extern tree pfn_or_delta2_identifier;
1141:
1142: /* A node that is a list (length 1) of error_mark_nodes. */
1143: extern tree error_mark_list;
1144:
1145: extern tree ptr_type_node;
1146: extern tree class_type_node, record_type_node, union_type_node, enum_type_node;
1147: extern tree exception_type_node, unknown_type_node;
1148:
1149: /* The largest size a virtual function table can be.
1150: Must be a (power of 2). */
1151: #ifndef VINDEX_MAX
1152: #define VINDEX_MAX ((unsigned)128)
1153: /* This is the integer ~ (vindex_max - 1). */
1154: #endif
1155: extern tree vtbl_mask;
1156:
1157: /* Array type `(void *)[]' */
1158: extern tree vtbl_type_node;
1159:
1160: extern tree long_long_integer_type_node, long_long_unsigned_type_node;
1161: /* For building calls to `delete'. */
1162: extern tree integer_two_node, integer_three_node;
1163:
1164: /* in cp-except.c */
1165: extern tree current_exception_type;
1166: extern tree current_exception_decl;
1167: extern tree current_exception_object;
1168:
1169: /* in cp-pt.c */
1170: /* PARM_VEC is a vector of template parameters, either IDENTIFIER_NODEs or
1171: PARM_DECLs. BINDINGS, if non-null, is a vector of bindings for those
1172: parameters. */
1173: struct template_info {
1174: /* Vector of template parameters, either PARM_DECLs or IDENTIFIER_NODEs. */
1175: tree parm_vec;
1176: /* If non-null, a vector of bindings for the template parms. */
1177: tree bindings;
1178:
1179: /* Text of template, and length. */
1180: char *text;
1181: int length;
1182: /* Where it came from. */
1183: char *filename;
1184: int lineno;
1185:
1186: /* What kind of aggregate -- struct, class, or null. */
1187: tree aggr;
1188: };
1189: extern int processing_template_decl, processing_template_defn;
1190:
1191: /* The template currently being instantiated, and where the instantiation
1192: was triggered. */
1193: struct tinst_level
1194: {
1195: tree classname;
1196: int line;
1197: char *file;
1198: struct tinst_level *next;
1199: };
1200:
1201: extern struct tinst_level *current_tinst_level;
1202:
1203: /* in cp-class.c */
1204: extern tree current_class_name;
1205: extern tree current_class_type;
1206: extern tree previous_class_type;
1207:
1208: extern tree current_lang_name, lang_name_cplusplus, lang_name_c;
1209: #ifdef OBJCPLUS
1210: extern tree lang_name_objc;
1211: #endif
1212:
1213: /* Points to the name of that function. May not be the DECL_NAME
1214: of CURRENT_FUNCTION_DECL due to overloading */
1215: extern tree original_function_name;
1216:
1217: extern tree current_class_name, current_class_type, current_class_decl, C_C_D;
1218: extern tree current_vtable_decl;
1219:
1220: /* in cp-init.c */
1221: extern tree global_base_init_list;
1222: extern tree current_base_init_list, current_member_init_list;
1223:
1224: extern int current_function_assigns_this;
1225: extern int current_function_just_assigned_this;
1226: extern int current_function_parms_stored;
1227:
1228: /* Here's where we control how name mangling takes place. */
1229:
1230: #define OPERATOR_ASSIGN_FORMAT "__a%s"
1231: #define OPERATOR_FORMAT "__%s"
1232: #define OPERATOR_TYPENAME_FORMAT "__op"
1233: #define OPERATOR_TYPENAME_P(ID_NODE) \
1234: (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \
1235: && IDENTIFIER_POINTER (ID_NODE)[1] == '_' \
1236: && IDENTIFIER_POINTER (ID_NODE)[2] == 'o' \
1237: && IDENTIFIER_POINTER (ID_NODE)[3] == 'p')
1238:
1239:
1240: /* Cannot use '$' up front, because this confuses gdb
1241: (names beginning with '$' are gdb-local identifiers).
1242:
1243: Note that all forms in which the '$' is significant are long enough
1244: for direct indexing (meaning that if we know there is a '$'
1245: at a particular location, we can index into the string at
1246: any other location that provides distinguishing characters). */
1247:
1248: /* Define NO_DOLLAR_IN_LABEL in your favorite tm file if your assembler
1249: doesn't allow '$' in symbol names. */
1250: #ifndef NO_DOLLAR_IN_LABEL
1251:
1252: #define JOINER '$'
1253:
1254: #define VPTR_NAME "$v"
1255: #define THROW_NAME "$eh_throw"
1256: #define DESTRUCTOR_DECL_PREFIX "_$_"
1257: #define AUTO_VTABLE_NAME "__vtbl$me__"
1258: #define AUTO_TEMP_NAME "_$tmp_"
1259: #define AUTO_TEMP_FORMAT "_$tmp_%d"
1260: #define VTABLE_BASE "$vb"
1261: #define VTABLE_NAME_FORMAT "_vt$%s"
1262: #define VFIELD_BASE "$vf"
1263: #define VFIELD_NAME "_vptr$"
1264: #define VFIELD_NAME_FORMAT "_vptr$%s"
1265: #define VBASE_NAME "_vb$"
1266: #define VBASE_NAME_FORMAT "_vb$%s"
1267: #define STATIC_NAME_FORMAT "_%s$%s"
1268: #define ANON_AGGRNAME_FORMAT "$_%d"
1269:
1270: #else /* NO_DOLLAR_IN_LABEL */
1271:
1272: #ifndef NO_DOT_IN_LABEL
1273:
1274: #define JOINER '.'
1275:
1276: #define VPTR_NAME ".v"
1277: #define THROW_NAME ".eh_throw"
1278: #define DESTRUCTOR_DECL_PREFIX "_._"
1279: #define AUTO_VTABLE_NAME "__vtbl.me__"
1280: #define AUTO_TEMP_NAME "_.tmp_"
1281: #define AUTO_TEMP_FORMAT "_.tmp_%d"
1282: #define VTABLE_BASE ".vb"
1283: #define VTABLE_NAME_FORMAT "_vt.%s"
1284: #define VFIELD_BASE ".vf"
1285: #define VFIELD_NAME "_vptr."
1286: #define VFIELD_NAME_FORMAT "_vptr.%s"
1287: #define VBASE_NAME "_vb."
1288: #define VBASE_NAME_FORMAT "_vb.%s"
1289: #define STATIC_NAME_FORMAT "_%s.%s"
1290:
1291: #define ANON_AGGRNAME_FORMAT "._%d"
1292:
1293: #else /* NO_DOT_IN_LABEL */
1294:
1295: #define VPTR_NAME "__vptr"
1296: #define VPTR_NAME_P(ID_NODE) \
1297: (!strncmp (IDENTIFIER_POINTER (ID_NODE), VPTR_NAME, sizeof (VPTR_NAME) - 1))
1298: #define THROW_NAME "__eh_throw"
1299: #define DESTRUCTOR_DECL_PREFIX "__destr_"
1300: #define DESTRUCTOR_NAME_P(ID_NODE) \
1301: (!strncmp (IDENTIFIER_POINTER (ID_NODE), DESTRUCTOR_DECL_PREFIX, \
1302: sizeof (DESTRUCTOR_DECL_PREFIX) - 1))
1303: #define IN_CHARGE_NAME "__in_chrg"
1304: #define AUTO_VTABLE_NAME "__vtbl_me__"
1305: #define AUTO_TEMP_NAME "__tmp_"
1306: #define TEMP_NAME_P(ID_NODE) \
1307: (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, \
1308: sizeof (AUTO_TEMP_NAME) - 1))
1309: #define AUTO_TEMP_FORMAT "__tmp_%d"
1310: #define VTABLE_BASE "__vtb"
1311: #define VTABLE_NAME "__vt_"
1312: #define VTABLE_NAME_FORMAT "__vt_%s"
1313: #define VTABLE_NAME_P(ID_NODE) \
1314: (!strncmp (IDENTIFIER_POINTER (ID_NODE), VTABLE_NAME, \
1315: sizeof (VTABLE_NAME_FORMAT) - 1))
1316: #define VFIELD_BASE "__vfb"
1317: #define VFIELD_NAME "__vptr_"
1318: #define VFIELD_NAME_P(ID_NODE) \
1319: (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, \
1320: sizeof (VFIELD_NAME) - 1))
1321: #define VFIELD_NAME_FORMAT "_vptr_%s"
1322: #define VBASE_NAME "__vb_"
1323: #define VBASE_NAME_P(ID_NODE) \
1324: (!strncmp (IDENTIFIER_POINTER (ID_NODE), VBASE_NAME, \
1325: sizeof (VBASE_NAME) - 1))
1326: #define VBASE_NAME_FORMAT "__vb_%s"
1327: #define STATIC_NAME_FORMAT "__static_%s_%s"
1328:
1329: #define ANON_AGGRNAME_PREFIX "__anon_"
1330: #define ANON_AGGRNAME_P(ID_NODE) \
1331: (!strncmp (IDENTIFIER_POINTER (ID_NODE), ANON_AGGRNAME_PREFIX, \
1332: sizeof (ANON_AGGRNAME_PREFIX) - 1))
1333: #define ANON_AGGRNAME_FORMAT "__anon_%d"
1334: #define ANON_PARMNAME_FORMAT "__%d"
1335: #define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \
1336: && IDENTIFIER_POINTER (ID_NODE)[1] == '_' \
1337: && IDENTIFIER_POINTER (ID_NODE)[2] <= '9')
1338:
1339: #endif /* NO_DOT_IN_LABEL */
1340: #endif /* NO_DOLLAR_IN_LABEL */
1341:
1342: #define THIS_NAME "this"
1343: #define DESTRUCTOR_NAME_FORMAT "~%s"
1344: #define FILE_FUNCTION_PREFIX_LEN 9
1345:
1346: #define IN_CHARGE_NAME "__in_chrg"
1347:
1348: #define VTBL_PTR_TYPE "__vtbl_ptr_type"
1349: #define VTABLE_DELTA_NAME "__delta"
1350: #define VTABLE_INDEX_NAME "__index"
1351: #define VTABLE_PFN_NAME "__pfn"
1352: #define VTABLE_DELTA2_NAME "__delta2"
1353: #define EXCEPTION_CLEANUP_NAME "exception cleanup"
1354:
1355: #define THIS_NAME_P(ID_NODE) (strcmp(IDENTIFIER_POINTER (ID_NODE), "this") == 0)
1356:
1357: #if !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL)
1358:
1359: #define VPTR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
1360: && IDENTIFIER_POINTER (ID_NODE)[1] == 'v')
1361: #define DESTRUCTOR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == JOINER)
1362:
1363: #define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \
1364: && IDENTIFIER_POINTER (ID_NODE)[2] == 't' \
1365: && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER)
1366:
1367: #define VBASE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \
1368: && IDENTIFIER_POINTER (ID_NODE)[2] == 'b' \
1369: && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER)
1370:
1371: #define TEMP_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, sizeof (AUTO_TEMP_NAME)-1))
1372: #define VFIELD_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, sizeof(VFIELD_NAME)-1))
1373:
1374: /* For anonymous aggregate types, we need some sort of name to
1375: hold on to. In practice, this should not appear, but it should
1376: not be harmful if it does. */
1377: #define ANON_AGGRNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
1378: && IDENTIFIER_POINTER (ID_NODE)[1] == '_')
1379: #define ANON_PARMNAME_FORMAT "_%d"
1380: #define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \
1381: && IDENTIFIER_POINTER (ID_NODE)[1] <= '9')
1382: #endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */
1383:
1384: /* Define the sets of attributes that member functions and baseclasses
1385: can have. These are sensible combinations of {public,private,protected}
1386: cross {virtual,non-virtual}. */
1387:
1388: enum visibility_type {
1389: visibility_default,
1390: visibility_public,
1391: visibility_private,
1392: visibility_protected,
1393: visibility_default_virtual,
1394: visibility_public_virtual,
1395: visibility_private_virtual
1396: };
1397:
1398: /* in cp-lex.c */
1399: extern tree current_unit_name, current_unit_language;
1400:
1401: /* Things for handling inline functions. */
1402:
1403: struct pending_inline
1404: {
1405: struct pending_inline *next; /* pointer to next in chain */
1406: int lineno; /* line number we got the text from */
1407: char *filename; /* name of file we were processing */
1408: tree fndecl; /* FUNCTION_DECL that brought us here */
1409: int token; /* token we were scanning */
1410: int token_value; /* value of token we were scanning (YYSTYPE) */
1411:
1412: char *buf; /* pointer to character stream */
1413: int len; /* length of stream */
1414: tree parm_vec, bindings; /* in case this is derived from a template */
1415: unsigned int can_free : 1; /* free this after we're done with it? */
1416: unsigned int deja_vu : 1; /* set iff we don't want to see it again. */
1417: unsigned int interface : 2; /* 0=interface 1=unknown 2=implementation */
1418: };
1419:
1420: /* in cp-method.c */
1421: extern struct pending_inline *pending_inlines;
1422:
1423: /* 1 for -fall-virtual: make every member function (except
1424: constructors) lay down in the virtual function table.
1425: Calls can then either go through the virtual function table or not,
1426: depending on whether we know what function will actually be called. */
1427:
1428: extern int flag_all_virtual;
1429:
1430: /* Positive values means that we cannot make optimizing assumptions about
1431: `this'. Negative values means we know `this' to be of static type. */
1432:
1433: extern int flag_this_is_variable;
1434:
1435: /* Controls whether enums and ints freely convert.
1436: 1 means with complete freedom.
1437: 0 means enums can convert to ints, but not vice-versa. */
1438:
1439: extern int flag_int_enum_equivalence;
1440:
1441: /* Nonzero means layout structures so that we can do garbage collection. */
1442:
1443: extern int flag_gc;
1444:
1445: /* Nonzero means generate 'dossiers' that give run-time type information. */
1446:
1447: extern int flag_dossier;
1448:
1449: /* Nonzero means templates obey #pragma interface and implementation. */
1450:
1451: extern int flag_external_templates;
1452:
1453: /* Current end of entries in the gc obstack for stack pointer variables. */
1454:
1455: extern int current_function_obstack_index;
1456:
1457: /* Flag saying whether we have used the obstack in this function or not. */
1458:
1459: extern int current_function_obstack_usage;
1460:
1461: enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
1462:
1463: extern tree current_class_decl, C_C_D; /* PARM_DECL: the class instance variable */
1464:
1465: /* The following two can be derived from the previous one */
1466: extern tree current_class_name; /* IDENTIFIER_NODE: name of current class */
1467: extern tree current_class_type; /* _TYPE: the type of the current class */
1468:
1469: /* Some macros for char-based bitfields. */
1470: #define B_SET(a,x) (a[x>>3] |= (1 << (x&7)))
1471: #define B_CLR(a,x) (a[x>>3] &= ~(1 << (x&7)))
1472: #define B_TST(a,x) (a[x>>3] & (1 << (x&7)))
1473:
1474: /* These are uses as bits in flags passed to build_method_call
1475: to control its error reporting behavior.
1476:
1477: LOOKUP_PROTECT means flag visibility violations.
1478: LOOKUP_COMPLAIN mean complain if no suitable member function
1479: matching the arguments is found.
1480: LOOKUP_NORMAL is just a combination of these two.
1481: LOOKUP_AGGR requires the instance to be of aggregate type.
1482: LOOKUP_NONVIRTUAL means make a direct call to the member function found
1483: LOOKUP_GLOBAL means search through the space of overloaded functions,
1484: rather than the space of member functions.
1485: LOOKUP_HAS_IN_CHARGE means that the "in charge" variable is already
1486: in the parameter list.
1487: LOOKUP_PROTECTED_OK means that even if the constructor we find appears
1488: to be non-visible to current scope, call it anyway.
1489: LOOKUP_NO_CONVERSION means that user-defined conversions are not
1490: permitted. Built-in conversions are permitted.
1491: LOOKUP_DESTRUCTOR means explicit call to destructor. */
1492:
1493: #define LOOKUP_PROTECT (1)
1494: #define LOOKUP_COMPLAIN (2)
1495: #define LOOKUP_NORMAL (3)
1496: #define LOOKUP_AGGR (4)
1497: #define LOOKUP_NONVIRTUAL (8)
1498: #define LOOKUP_GLOBAL (16)
1499: #define LOOKUP_HAS_IN_CHARGE (32)
1500: #define LOOKUP_SPECULATIVELY (64)
1501: #define LOOKUP_PROTECTED_OK (128)
1502: /* 256 is free */
1503: #define LOOKUP_NO_CONVERSION (512)
1504: #define LOOKUP_DESTRUCTOR (512)
1505:
1506: /* Anatomy of a DECL_FRIENDLIST (which is a TREE_LIST):
1507: purpose = friend name (IDENTIFIER_NODE);
1508: value = TREE_LIST of FUNCTION_DECLS;
1509: chain, type = EMPTY; */
1510: #define FRIEND_NAME(LIST) (TREE_PURPOSE (LIST))
1511: #define FRIEND_DECLS(LIST) (TREE_VALUE (LIST))
1512:
1513: /* These macros are for accessing the fields of TEMPLATE...PARM nodes. */
1514: #define TEMPLATE_TYPE_TPARMLIST(NODE) TREE_PURPOSE (TYPE_FIELDS (NODE))
1515: #define TEMPLATE_TYPE_IDX(NODE) TREE_INT_CST_LOW (TREE_VALUE (TYPE_FIELDS (NODE)))
1516: #define TEMPLATE_TYPE_SET_INFO(NODE,P,I) \
1517: (TYPE_FIELDS (NODE) = build_tree_list (P, build_int_2 (I, 0)))
1518: #define TEMPLATE_CONST_TPARMLIST(NODE) (*(tree*)&TREE_INT_CST_LOW(NODE))
1519: #define TEMPLATE_CONST_IDX(NODE) (TREE_INT_CST_HIGH(NODE))
1520: #define TEMPLATE_CONST_SET_INFO(NODE,P,I) \
1521: (TEMPLATE_CONST_TPARMLIST (NODE) = saved_parmlist, \
1522: TEMPLATE_CONST_IDX (NODE) = I)
1523:
1524: /* in cp-lex.c */
1525: /* Indexed by TREE_CODE, these tables give C-looking names to
1526: operators represented by TREE_CODES. For example,
1527: opname_tab[(int) MINUS_EXPR] == "-". */
1528: extern char **opname_tab, **assignop_tab;
1529:
1530: /* in c-common.c */
1531: extern tree convert_and_check PROTO((tree, tree));
1532: extern void overflow_warning PROTO((tree));
1533: extern void unsigned_conversion_warning PROTO((tree, tree));
1534:
1535: /* in cp-call.c */
1536: extern struct candidate *ansi_c_bullshit;
1537:
1538: extern int rank_for_overload PROTO((struct candidate *, struct candidate *));
1539: extern void compute_conversion_costs PROTO((tree, tree, struct candidate *, int));
1540: extern int get_arglist_len_in_bytes PROTO((tree));
1541: extern tree build_vfield_ref PROTO((tree, tree));
1542: extern tree find_scoped_type PROTO((tree, tree, tree));
1543: extern tree resolve_scope_to_name PROTO((tree, tree));
1544: extern tree build_scoped_method_call PROTO((tree, tree, tree, tree));
1545: extern tree build_method_call PROTO((tree, tree, tree, tree, int));
1546: extern tree build_overload_call_real PROTO((tree, tree, int, struct candidate *, int));
1547: extern tree build_overload_call PROTO((tree, tree, int, struct candidate *));
1548: extern tree build_overload_call_maybe PROTO((tree, tree, int, struct candidate *));
1549:
1550: /* in cp-class.c */
1551: extern tree build_vbase_pointer PROTO((tree, tree));
1552: extern tree build_vbase_path PROTO((enum tree_code, tree, tree, tree, int));
1553: extern tree build_vtable_entry PROTO((tree, tree));
1554: extern tree build_vfn_ref PROTO((tree *, tree, tree));
1555: extern void add_method PROTO((tree, tree *, tree));
1556: extern void duplicate_tag_error PROTO((tree));
1557: extern tree finish_struct PROTO((tree, tree, int));
1558: extern int resolves_to_fixed_type_p PROTO((tree, int *));
1559: extern void init_class_processing PROTO((void));
1560: extern void pushclass PROTO((tree, int));
1561: extern void popclass PROTO((int));
1562: #if NEW_CLASS_SCOPING
1563: extern void push_nested_class PROTO((tree, int));
1564: extern void pop_nested_class PROTO((int));
1565: #endif
1566: extern void push_lang_context PROTO((tree));
1567: extern void pop_lang_context PROTO((void));
1568: extern int root_lang_context_p PROTO((void));
1569: extern tree instantiate_type PROTO((tree, tree, int));
1570: extern void print_class_statistics PROTO((void));
1571: extern void maybe_push_cache_obstack PROTO((void));
1572:
1573: /* in cp-cvt.c */
1574: extern tree convert_to_reference PROTO((tree, tree, tree, tree, int, char *, int, int));
1575: extern tree convert_from_reference PROTO((tree));
1576: extern tree convert_to_aggr PROTO((tree, tree, char **, int));
1577: extern tree convert_pointer_to PROTO((tree, tree));
1578: extern tree convert_pointer_to_real PROTO((tree, tree));
1579: extern tree convert_pointer_to_vbase PROTO((tree, tree));
1580: extern tree convert PROTO((tree, tree));
1581: extern tree convert_force PROTO((tree, tree));
1582: extern tree build_type_conversion PROTO((enum tree_code, tree, tree, int));
1583: extern int build_default_binary_type_conversion PROTO((enum tree_code, tree *, tree *));
1584: extern int build_default_unary_type_conversion PROTO((enum tree_code, tree *));
1585:
1586: /* cp-decl.c */
1587: extern int global_bindings_p PROTO((void));
1588: extern void keep_next_level PROTO((void));
1589: extern int kept_level_p PROTO((void));
1590: extern void declare_parm_level PROTO((void));
1591: extern void declare_implicit_exception PROTO((void));
1592: extern int have_exceptions_p PROTO((void));
1593: extern void declare_uninstantiated_type_level PROTO((void));
1594: extern int uninstantiated_type_level_p PROTO((void));
1595: extern void declare_pseudo_global_level PROTO((void));
1596: extern int pseudo_global_level_p PROTO((void));
1597: extern void pushlevel PROTO((int));
1598: extern void pushlevel_temporary PROTO((int));
1599: extern tree poplevel PROTO((int, int, int));
1600: extern void delete_block PROTO((tree));
1601: extern void insert_block PROTO((tree));
1602: extern void add_block_current_level PROTO((tree));
1603: extern void set_block PROTO((tree));
1604: extern void pushlevel_class PROTO((void));
1605: extern tree poplevel_class PROTO((void));
1606: /* skip print_other_binding_stack and print_binding_level */
1607: extern void print_binding_stack PROTO((void));
1608: extern void push_to_top_level PROTO((void));
1609: extern void pop_from_top_level PROTO((void));
1610: extern void set_identifier_type_value PROTO((tree, tree));
1611: extern void set_identifier_local_value PROTO((tree, tree));
1612: extern tree make_type_decl PROTO((tree, tree));
1613: extern void pushtag PROTO((tree, tree));
1614: extern tree make_anon_name PROTO((void));
1615: extern void clear_anon_tags PROTO((void));
1616: #if !NEW_CLASS_SCOPING
1617: extern void adjust_type_value PROTO((tree));
1618: #endif
1619: extern tree pushdecl PROTO((tree));
1620: extern tree pushdecl_top_level PROTO((tree));
1621: #if NEW_CLASS_SCOPING
1622: extern void push_class_level_binding PROTO((tree, tree));
1623: #endif
1624: extern void push_overloaded_decl_top_level PROTO((tree, int));
1625: extern tree pushdecl_class_level PROTO((tree));
1626: extern int overloaded_globals_p PROTO((tree));
1627: extern tree push_overloaded_decl PROTO((tree, int));
1628: extern tree implicitly_declare PROTO((tree));
1629: extern tree lookup_label PROTO((tree));
1630: extern tree shadow_label PROTO((tree));
1631: extern tree define_label PROTO((char *, int, tree));
1632: extern void define_case_label PROTO((tree));
1633: extern tree getdecls PROTO((void));
1634: extern tree gettags PROTO((void));
1635: extern void set_current_level_tags_transparency PROTO((int));
1636: extern tree typedecl_for_tag PROTO((tree));
1637: extern tree lookup_name PROTO((tree, int));
1638: extern tree lookup_name_current_level PROTO((tree));
1639: extern void init_decl_processing PROTO((void));
1640: /* skipped define_function */
1641: extern void shadow_tag PROTO((tree));
1642: extern void grok_ctor_properties PROTO((tree, tree));
1643: extern tree groktypename PROTO((tree));
1644: extern tree start_decl PROTO((tree, tree, int, tree));
1645: extern void finish_decl PROTO((tree, tree, tree, int));
1646: extern int complete_array_type PROTO((tree, tree, int));
1647: extern tree grokdeclarator (); /* PROTO((tree, tree, enum decl_context, int, tree)); */
1648: extern tree xref_defn_tag PROTO((tree, tree, tree));
1649: extern tree xref_tag PROTO((tree, tree, tree));
1650: extern tree start_enum PROTO((tree));
1651: extern tree finish_enum PROTO((tree, tree));
1652: extern tree build_enumerator PROTO((tree, tree));
1653: extern tree grok_enum_decls PROTO((tree, tree));
1654: extern int start_function PROTO((tree, tree, tree, int));
1655: extern void store_parm_decls PROTO((void));
1656: extern void store_return_init PROTO((tree, tree));
1657: extern void finish_function PROTO((int, int));
1658: extern tree start_method PROTO((tree, tree, tree));
1659: extern tree finish_method PROTO((tree));
1660: extern void hack_incomplete_structures PROTO((tree));
1661: extern tree maybe_build_cleanup PROTO((tree));
1662: extern void cplus_expand_expr_stmt PROTO((tree));
1663: extern void finish_stmt PROTO((void));
1664: extern tree get_unique_fn PROTO((tree));
1665: extern tree get_first_fn PROTO((tree));
1666: extern void pop_implicit_try_blocks PROTO((tree));
1667: extern void push_exception_cleanup PROTO((tree));
1668: extern void revert_static_member_fn PROTO((tree *, tree *, tree *));
1669: extern tree combine_strings PROTO((tree));
1670:
1671: /* in cp-decl2.c */
1672: extern int lang_decode_option PROTO((char *));
1673: extern tree grok_method_quals PROTO((tree, tree, tree));
1674: extern void grokclassfn PROTO((tree, tree, tree, enum overload_flags, tree));
1675: extern tree grok_alignof PROTO((tree));
1676: extern tree grok_array_decl PROTO((tree, tree));
1677: extern tree delete_sanity PROTO((tree, tree, int));
1678: extern void check_classfn PROTO((tree, tree, tree));
1679: extern tree grokfield PROTO((tree, tree, tree, tree, tree));
1680: extern tree grokbitfield PROTO((tree, tree, tree));
1681: extern tree groktypefield PROTO((tree, tree));
1682: extern tree grokoptypename PROTO((tree, int));
1683: extern tree build_push_scope PROTO((tree, tree));
1684: extern tree constructor_name_full PROTO((tree));
1685: extern tree constructor_name PROTO((tree));
1686: extern void setup_vtbl_ptr PROTO((void));
1687: extern void mark_inline_for_output PROTO((tree));
1688: extern void clear_temp_name PROTO((void));
1689: extern tree get_temp_name PROTO((tree, int));
1690: extern tree get_temp_regvar PROTO((tree, tree));
1691: extern void finish_anon_union PROTO((tree));
1692: extern tree finish_table PROTO((tree, tree, tree, int));
1693: extern void finish_builtin_type PROTO((tree, char *, tree *, int, tree));
1694: extern tree coerce_new_type PROTO((tree));
1695: extern tree coerce_delete_type PROTO((tree));
1696: extern void walk_vtables PROTO((void (*)(), void (*)()));
1697: extern void finish_file PROTO((void));
1698: extern void warn_if_unknown_interface PROTO((void));
1699: extern tree grok_x_components PROTO((tree, tree));
1700:
1701: /* in cp-edsel.c */
1702:
1703: /* in cp-except.c */
1704: extern tree lookup_exception_cname PROTO((tree, tree, tree));
1705: extern tree lookup_exception_tname PROTO((tree));
1706: extern tree lookup_exception_object PROTO((tree, tree, int));
1707: extern tree lookup_exception_type PROTO((tree, tree, tree));
1708: extern tree finish_exception PROTO((tree, tree));
1709: extern void finish_exception_decl PROTO((tree, tree));
1710: extern void end_exception_decls PROTO((void));
1711: extern void cplus_expand_start_try PROTO((int));
1712: extern tree cplus_expand_end_try PROTO((int));
1713: extern void cplus_expand_start_except PROTO((tree, tree));
1714: extern void cplus_expand_end_except PROTO((tree));
1715: extern void cplus_expand_raise PROTO((tree, tree, tree, int));
1716: extern tree ansi_exception_object_lookup PROTO((tree));
1717: extern void cplus_expand_throw PROTO((tree));
1718: extern tree cplus_expand_start_catch PROTO((tree));
1719: extern tree ansi_expand_start_catch PROTO((tree));
1720: extern void cplus_expand_end_catch PROTO((int));
1721: extern void cplus_expand_reraise PROTO((tree));
1722: extern void setup_exception_throw_decl PROTO((void));
1723: extern void init_exception_processing PROTO((void));
1724: extern void init_exception_processing_1 PROTO((void));
1725:
1726: /* in cp-expr.c */
1727: /* skip cplus_expand_expr */
1728: extern void init_cplus_expand PROTO((void));
1729: extern void fixup_result_decl PROTO((tree, struct rtx_def *));
1730: extern int decl_in_memory_p PROTO((tree));
1731:
1732: /* in cp-gc.c */
1733: extern int type_needs_gc_entry PROTO((tree));
1734: extern int value_safe_from_gc PROTO((tree, tree));
1735: extern void build_static_gc_entry PROTO((tree, tree));
1736: extern tree protect_value_from_gc PROTO((tree, tree));
1737: extern tree build_headof PROTO((tree));
1738: extern tree build_classof PROTO((tree));
1739: extern tree build_t_desc PROTO((tree, int));
1740: extern tree build_i_desc PROTO((tree));
1741: extern tree build_m_desc PROTO((tree));
1742: extern void expand_gc_prologue_and_epilogue PROTO((void));
1743: extern void lang_expand_end_bindings PROTO((struct rtx_def *, struct rtx_def *));
1744: extern void init_gc_processing PROTO((void));
1745: extern tree build_typeid PROTO((tree));
1746: extern tree get_typeid PROTO((tree));
1747: extern tree build_dynamic_cast PROTO((tree, tree));
1748:
1749: /* in cp-init.c */
1750: extern void emit_base_init PROTO((tree, int));
1751: extern void check_base_init PROTO((tree));
1752: extern tree build_virtual_init PROTO((tree, tree, tree));
1753: extern void do_member_init PROTO((tree, tree, tree));
1754: extern void expand_member_init PROTO((tree, tree, tree));
1755: extern void expand_aggr_init PROTO((tree, tree, int));
1756: extern int is_aggr_typedef PROTO((tree, int));
1757: extern tree build_member_call PROTO((tree, tree, tree));
1758: extern tree build_offset_ref PROTO((tree, tree));
1759: extern tree get_member_function PROTO((tree *, tree, tree));
1760: extern tree get_member_function_from_ptrfunc PROTO((tree *, tree, tree));
1761: extern tree resolve_offset_ref PROTO((tree));
1762: extern tree decl_constant_value PROTO((tree));
1763: extern int is_friend_type PROTO((tree, tree));
1764: extern int is_friend PROTO((tree, tree));
1765: extern void make_friend_class PROTO((tree, tree));
1766: extern tree do_friend PROTO((tree, tree, tree, tree, enum overload_flags, tree));
1767: extern void embrace_waiting_friends PROTO((tree));
1768: extern tree build_builtin_call PROTO((tree, tree, tree));
1769: extern tree build_new PROTO((tree, tree, tree, int));
1770: extern tree expand_vec_init PROTO((tree, tree, tree, tree, int));
1771: extern tree build_x_delete PROTO((tree, tree, int, tree));
1772: extern tree build_delete PROTO((tree, tree, tree, int, int));
1773: extern tree build_vbase_delete PROTO((tree, tree));
1774: extern tree build_vec_delete PROTO((tree, tree, tree, tree, tree, tree));
1775:
1776: /* in cp-input.c */
1777:
1778: /* in cp-lex.c */
1779: extern tree make_pointer_declarator PROTO((tree, tree));
1780: extern tree make_reference_declarator PROTO((tree, tree));
1781: extern char *operator_name_string PROTO((tree));
1782: extern void lang_init PROTO((void));
1783: extern void lang_finish PROTO((void));
1784: extern void init_filename_times PROTO((void));
1785: extern void reinit_lang_specific PROTO((void));
1786: extern void init_lex PROTO((void));
1787: extern void reinit_parse_for_function PROTO((void));
1788: extern int *init_parse PROTO((void));
1789: extern void print_parse_statistics PROTO((void));
1790: extern void extract_interface_info PROTO((void));
1791: extern void set_vardecl_interface_info PROTO((tree, tree));
1792: extern void do_pending_inlines PROTO((void));
1793: extern void process_next_inline PROTO((tree));
1794: /* skip restore_pending_input */
1795: extern void yyungetc PROTO((int, int));
1796: extern void reinit_parse_for_method PROTO((int, tree));
1797: #if 0
1798: extern void reinit_parse_for_block PROTO((int, struct obstack *, int));
1799: #endif
1800: extern tree cons_up_default_function PROTO((tree, tree, tree, int));
1801: extern void check_for_missing_semicolon PROTO((tree));
1802: extern void note_got_semicolon PROTO((tree));
1803: extern void note_list_got_semicolon PROTO((tree));
1804: extern int check_newline PROTO((void));
1805: extern void dont_see_typename PROTO((void));
1806: extern int identifier_type PROTO((tree));
1807: extern void see_typename PROTO((void));
1808: extern tree do_identifier PROTO((tree));
1809: extern tree identifier_typedecl_value PROTO((tree));
1810: extern int real_yylex PROTO((void));
1811: extern tree build_lang_decl PROTO((enum tree_code, tree, tree));
1812: extern tree build_lang_field_decl PROTO((enum tree_code, tree, tree));
1813: extern void copy_lang_decl PROTO((tree));
1814: extern tree make_lang_type PROTO((enum tree_code));
1815: extern void copy_decl_lang_specific PROTO((tree));
1816: extern void dump_time_statistics PROTO((void));
1817: /* extern void compiler_error PROTO((char *, HOST_WIDE_INT, HOST_WIDE_INT)); */
1818: extern void compiler_error_with_decl PROTO((tree, char *));
1819: extern void yyerror PROTO((char *));
1820:
1821: /* in cp-error.c */
1822: extern void init_error PROTO((void));
1823: extern char *fndecl_as_string PROTO((tree, tree, int));
1824: extern char *type_as_string PROTO((tree, int));
1825: extern char *decl_as_string PROTO((tree, int));
1826: extern char *expr_as_string PROTO((tree, int));
1827: extern char *code_as_string PROTO((enum tree_code, int));
1828: extern char *language_as_string PROTO((enum languages, int));
1829:
1830: /* in cp-method.c */
1831: extern void init_method PROTO((void));
1832: extern tree make_anon_parm_name PROTO((void));
1833: extern void clear_anon_parm_name PROTO((void));
1834: extern void do_inline_function_hair PROTO((tree, tree));
1835: /* skip report_type_mismatch */
1836: extern char *build_overload_name PROTO((tree, int, int));
1837: extern tree cplus_exception_name PROTO((tree));
1838: extern tree build_decl_overload PROTO((tree, tree, int));
1839: extern tree build_typename_overload PROTO((tree));
1840: extern tree build_t_desc_overload PROTO((tree));
1841: extern void declare_overloaded PROTO((tree));
1842: extern tree build_opfncall PROTO((enum tree_code, int, tree, tree, tree));
1843: extern tree hack_identifier PROTO((tree, tree, int));
1844: extern tree build_component_type_expr PROTO((tree, tree, tree, int));
1845:
1846: /* in cp-pt.c */
1847: extern void begin_template_parm_list PROTO((void));
1848: extern tree process_template_parm PROTO((tree, tree));
1849: extern tree end_template_parm_list PROTO((tree));
1850: extern void end_template_decl PROTO((tree, tree, tree));
1851: extern tree lookup_template_class PROTO((tree, tree, tree));
1852: extern void push_template_decls PROTO((tree, tree, int));
1853: extern void pop_template_decls PROTO((tree, tree, int));
1854: extern int uses_template_parms PROTO((tree));
1855: extern void instantiate_member_templates PROTO((tree));
1856: extern tree instantiate_class_template PROTO((tree, int));
1857: extern tree instantiate_template PROTO((tree, tree *));
1858: extern void undo_template_name_overload PROTO((tree, int));
1859: extern void overload_template_name PROTO((tree, int));
1860: extern void end_template_instantiation PROTO((tree, tree));
1861: extern void reinit_parse_for_template PROTO((int, tree, tree));
1862: extern int type_unification PROTO((tree, tree *, tree, tree, int *));
1863: extern int do_pending_expansions PROTO((void));
1864: extern void do_pending_templates PROTO((void));
1865: struct tinst_level *tinst_for_decl PROTO((void));
1866:
1867: /* in cp-search.c */
1868: extern tree make_memoized_table_entry PROTO((tree, tree, int));
1869: extern void push_memoized_context PROTO((tree, int));
1870: extern void pop_memoized_context PROTO((int));
1871: extern tree get_binfo PROTO((tree, tree, int));
1872: extern int get_base_distance PROTO((tree, tree, int, tree *));
1873: extern enum visibility_type check_visibility PROTO((tree, tree));
1874: extern tree lookup_field PROTO((tree, tree, int, int));
1875: extern tree lookup_nested_field PROTO((tree, int));
1876: extern tree lookup_fnfields PROTO((tree, tree, int));
1877: extern HOST_WIDE_INT breadth_first_search PROTO((tree, int (*)(), int (*)()));
1878: extern int tree_needs_constructor_p PROTO((tree, int));
1879: extern int tree_has_any_destructor_p PROTO((tree, int));
1880: extern tree get_first_matching_virtual PROTO((tree, tree, int));
1881: extern tree get_abstract_virtuals PROTO((tree));
1882: extern tree get_baselinks PROTO((tree, tree, tree));
1883: extern tree next_baselink PROTO((tree));
1884: extern tree init_vbase_pointers PROTO((tree, tree));
1885: extern tree build_vbase_vtables_init PROTO((tree, tree, tree, tree, int));
1886: extern void clear_search_slots PROTO((tree));
1887: extern tree get_vbase_types PROTO((tree));
1888: extern void build_mi_matrix PROTO((tree));
1889: extern void free_mi_matrix PROTO((void));
1890: extern void build_mi_virtuals PROTO((int, int));
1891: extern void add_mi_virtuals PROTO((int, tree));
1892: extern void report_ambiguous_mi_virtuals PROTO((int, tree));
1893: extern void note_debug_info_needed PROTO((tree));
1894: extern void push_class_decls PROTO((tree));
1895: extern void pop_class_decls PROTO((tree));
1896: extern void unmark_finished_struct PROTO((tree));
1897: extern void print_search_statistics PROTO((void));
1898: extern void init_search_processing PROTO((void));
1899: extern void reinit_search_statistics PROTO((void));
1900:
1901: /* in cp-spew.c */
1902: extern void init_spew PROTO((void));
1903: extern int yylex PROTO((void));
1904: extern tree arbitrate_lookup PROTO((tree, tree, tree));
1905:
1906: /* in cp-tree.c */
1907: extern int lvalue_p PROTO((tree));
1908: extern int lvalue_or_else PROTO((tree, char *));
1909: extern tree build_cplus_new PROTO((tree, tree, int));
1910: extern tree break_out_cleanups PROTO((tree));
1911: extern tree break_out_calls PROTO((tree));
1912: extern tree build_cplus_method_type PROTO((tree, tree, tree));
1913: extern tree build_cplus_staticfn_type PROTO((tree, tree, tree));
1914: extern tree build_cplus_array_type PROTO((tree, tree));
1915: extern void propagate_binfo_offsets PROTO((tree, tree));
1916: extern int layout_vbasetypes PROTO((tree, int));
1917: extern tree layout_basetypes PROTO((tree, tree));
1918: extern int list_hash PROTO((tree));
1919: extern tree list_hash_lookup PROTO((int, tree));
1920: extern void list_hash_add PROTO((int, tree));
1921: extern tree list_hash_canon PROTO((int, tree));
1922: extern tree hash_tree_cons PROTO((int, int, int, tree, tree, tree));
1923: extern tree hash_tree_chain PROTO((tree, tree));
1924: extern tree hash_chainon PROTO((tree, tree));
1925: extern tree get_decl_list PROTO((tree));
1926: extern tree list_hash_lookup_or_cons PROTO((tree));
1927: extern tree make_binfo PROTO((tree, tree, tree, tree, tree));
1928: extern tree copy_binfo PROTO((tree));
1929: extern tree binfo_value PROTO((tree, tree));
1930: extern tree reverse_path PROTO((tree));
1931: extern tree virtual_member PROTO((tree, tree));
1932: extern tree virtual_offset PROTO((tree, tree, tree));
1933: extern void debug_binfo PROTO((tree));
1934: extern int decl_list_length PROTO((tree));
1935: extern tree fnaddr_from_vtable_entry PROTO((tree));
1936: extern void set_fnaddr_from_vtable_entry PROTO((tree, tree));
1937: extern tree function_arg_chain PROTO((tree));
1938: extern int promotes_to_aggr_type PROTO((tree, enum tree_code));
1939: extern int is_aggr_type_2 PROTO((tree, tree));
1940: extern void message_2_types PROTO((void (*)(), char *, tree, tree));
1941: extern char *lang_printable_name PROTO((tree));
1942: extern tree build_exception_variant PROTO((tree, tree, tree));
1943: extern tree copy_to_permanent PROTO((tree));
1944: extern void print_lang_statistics PROTO((void));
1945: /* skip __eprintf */
1946: extern tree array_type_nelts_total PROTO((tree));
1947: extern tree array_type_nelts_top PROTO((tree));
1948:
1949: /* in cp-typeck.c */
1950: extern tree target_type PROTO((tree));
1951: extern tree require_complete_type PROTO((tree));
1952: extern int type_unknown_p PROTO((tree));
1953: extern int fntype_p PROTO((tree));
1954: extern tree require_instantiated_type PROTO((tree, tree, tree));
1955: extern tree commonparms PROTO((tree, tree));
1956: extern tree common_type PROTO((tree, tree));
1957: extern int compexcepttypes PROTO((tree, tree, int));
1958: extern int comptypes PROTO((tree, tree, int));
1959: extern int comp_target_types PROTO((tree, tree, int));
1960: extern tree common_base_types PROTO((tree, tree));
1961: extern int compparms PROTO((tree, tree, int));
1962: extern int comp_target_types PROTO((tree, tree, int));
1963: extern tree unsigned_type PROTO((tree));
1964: extern tree signed_type PROTO((tree));
1965: extern tree signed_or_unsigned_type PROTO((int, tree));
1966: extern tree c_sizeof PROTO((tree));
1967: extern tree c_sizeof_nowarn PROTO((tree));
1968: extern tree c_alignof PROTO((tree));
1969: extern tree default_conversion PROTO((tree));
1970: extern tree build_object_ref PROTO((tree, tree, tree));
1971: extern tree build_component_ref_1 PROTO((tree, tree, int));
1972: extern tree build_component_ref PROTO((tree, tree, tree, int));
1973: extern tree build_x_indirect_ref PROTO((tree, char *));
1974: extern tree build_indirect_ref PROTO((tree, char *));
1975: extern tree build_x_array_ref PROTO((tree, tree));
1976: extern tree build_array_ref PROTO((tree, tree));
1977: extern tree build_x_function_call PROTO((tree, tree, tree));
1978: extern tree build_function_call_real PROTO((tree, tree, int));
1979: extern tree build_function_call PROTO((tree, tree));
1980: extern tree build_function_call_maybe PROTO((tree, tree));
1981: extern tree convert_arguments PROTO((tree, tree, tree, tree, int));
1982: extern tree build_x_binary_op PROTO((enum tree_code, tree, tree));
1983: extern tree build_binary_op PROTO((enum tree_code, tree, tree, int));
1984: extern tree build_binary_op_nodefault PROTO((enum tree_code, tree, tree, enum tree_code));
1985: extern tree build_component_addr PROTO((tree, tree, char *));
1986: extern tree build_x_unary_op PROTO((enum tree_code, tree));
1987: extern tree build_unary_op PROTO((enum tree_code, tree, int));
1988: extern tree unary_complex_lvalue PROTO((enum tree_code, tree));
1989: extern int mark_addressable PROTO((tree));
1990: extern tree build_x_conditional_expr PROTO((tree, tree, tree));
1991: extern tree build_conditional_expr PROTO((tree, tree, tree));
1992: extern tree build_x_compound_expr PROTO((tree));
1993: extern tree build_compound_expr PROTO((tree));
1994: extern tree build_c_cast PROTO((tree, tree));
1995: extern tree build_modify_expr PROTO((tree, enum tree_code, tree));
1996: extern int language_lvalue_valid PROTO((tree));
1997: extern void warn_for_assignment PROTO((char *, char *, char *, tree, int, int));
1998: extern tree convert_for_initialization PROTO((tree, tree, tree, int, char *, tree, int));
1999: extern void c_expand_asm_operands PROTO((tree, tree, tree, tree, int, char *, int));
2000: extern void c_expand_return PROTO((tree));
2001: extern tree c_expand_start_case PROTO((tree));
2002: extern void record_format_info PROTO((tree, int, int, int));
2003: extern tree build_component_ref PROTO((tree, tree, tree, int));
2004: extern tree build_ptrmemfunc PROTO((tree, tree));
2005:
2006: /* in cp-type2.c */
2007: extern tree error_not_base_type PROTO((tree, tree));
2008: extern tree binfo_or_else PROTO((tree, tree));
2009: extern void error_with_aggr_type (); /* PROTO((tree, char *, HOST_WIDE_INT)); */
2010: extern void readonly_error PROTO((tree, char *, int));
2011: extern void abstract_virtuals_error PROTO((tree, tree));
2012: extern void incomplete_type_error PROTO((tree, tree));
2013: extern void my_friendly_abort PROTO((int));
2014: extern void my_friendly_assert PROTO((int, int));
2015: extern tree store_init_value PROTO((tree, tree));
2016: extern tree digest_init PROTO((tree, tree, tree *));
2017: extern tree build_scoped_ref PROTO((tree, tree));
2018: extern tree build_x_arrow PROTO((tree));
2019: extern tree build_m_component_ref PROTO((tree, tree));
2020: extern tree build_functional_cast PROTO((tree, tree));
2021: extern char *enum_name_string PROTO((tree, tree));
2022: extern void report_case_error PROTO((int, tree, tree, tree));
2023:
2024: /* in cp-xref.c */
2025: extern void GNU_xref_begin PROTO((char *));
2026: extern void GNU_xref_end PROTO((int));
2027: extern void GNU_xref_file PROTO((char *));
2028: extern void GNU_xref_start_scope PROTO((HOST_WIDE_INT));
2029: extern void GNU_xref_end_scope PROTO((HOST_WIDE_INT, HOST_WIDE_INT, int, int, int));
2030: extern void GNU_xref_def PROTO((tree, char *));
2031: extern void GNU_xref_decl PROTO((tree, tree));
2032: extern void GNU_xref_call PROTO((tree, char *));
2033: extern void GNU_xref_function PROTO((tree, tree));
2034: extern void GNU_xref_assign PROTO((tree));
2035: extern void GNU_xref_hier PROTO((char *, char *, int, int, int));
2036: extern void GNU_xref_member PROTO((tree, tree));
2037:
2038: /* -- end of C++ */
2039:
2040: /* Objective-C++ (objc-act.c) */
2041: #ifdef OBJCPLUS
2042: extern int doing_objc_thang;
2043: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.