]> gcc.gnu.org Git - gcc.git/blob - gcc/cp/cp-tree.h
3cde1028f53603bcc418aaae52ef036503430865
[gcc.git] / gcc / cp / cp-tree.h
1 /* Definitions for C++ parsing and type checking.
2 Copyright (C) 1987, 93, 94, 95, 1996 Free Software Foundation, Inc.
3 Hacked by Michael Tiemann (tiemann@cygnus.com)
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, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
21
22 #ifndef _CP_TREE_H
23 #define _CP_TREE_H
24
25 #include "gansidecl.h"
26
27 /* Usage of TREE_LANG_FLAG_?:
28 0: TREE_NONLOCAL_FLAG (in TREE_LIST or _TYPE).
29 BINFO_MARKED (BINFO nodes).
30 TI_USES_TEMPLATE_PARMS.
31 COMPOUND_STMT_NO_SCOPE (in COMPOUND_STMT).
32 NEW_EXPR_USE_GLOBAL (in NEW_EXPR).
33 DELETE_EXPR_USE_GLOBAL (in DELETE_EXPR).
34 LOOKUP_EXPR_GLOBAL (in LOOKUP_EXPR).
35 TREE_NEGATED_INT (in INTEGER_CST).
36 (TREE_MANGLED) (in IDENTIFIER_NODE) (commented-out).
37 1: IDENTIFIER_VIRTUAL_P.
38 TI_PENDING_TEMPLATE_FLAG.
39 TI_PENDING_SPECIALIZATION_FLAG.
40 TEMPLATE_PARMS_FOR_INLINE.
41 DELETE_EXPR_USE_VEC (in DELETE_EXPR).
42 (TREE_CALLS_NEW) (in _EXPR or _REF) (commented-out).
43 TYPE_USES_COMPLEX_INHERITANCE (in _TYPE).
44 C_DECLARED_LABEL_FLAG.
45 2: IDENTIFIER_OPNAME_P.
46 BINFO_FIELDS_MARKED.
47 TYPE_VIRTUAL_P.
48 PARM_DECL_EXPR (in SAVE_EXPR).
49 3: TYPE_USES_VIRTUAL_BASECLASSES (in a class TYPE).
50 BINFO_VTABLE_PATH_MARKED.
51 (TREE_REFERENCE_EXPR) (in NON_LVALUE_EXPR) (commented-out).
52 4: BINFO_NEW_VTABLE_MARKED.
53 TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR,
54 or FIELD_DECL).
55 5: BINFO_VIA_PUBLIC.
56 BINFO_VBASE_INIT_MARKED.
57 6: Not used.
58
59 Usage of TYPE_LANG_FLAG_?:
60 0: C_TYPE_FIELDS_READONLY (in RECORD_TYPE or UNION_TYPE).
61 1: TYPE_HAS_CONSTRUCTOR.
62 2: TYPE_HAS_DESTRUCTOR.
63 3: Not used.
64 4: TYPE_NEEDS_DESTRUCTOR.
65 5: IS_AGGR_TYPE.
66 6: TYPE_BUILT_IN
67
68 Usage of DECL_LANG_FLAG_?:
69 0: DECL_ERROR_REPORTED (in VAR_DECL).
70 1: C_TYPEDEF_EXPLICITLY_SIGNED (in TYPE_DECL).
71 2: DECL_THIS_EXTERN (in VAR_DECL or FUNCTION_DECL).
72 3: DECL_IN_AGGR_P.
73 4: DECL_MAYBE_TEMPLATE.
74 5: DECL_INTERFACE_KNOWN.
75 6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL).
76 7: DECL_DEAD_FOR_LOCAL (in VAR_DECL).
77 */
78
79 /* Language-dependent contents of an identifier. */
80
81 struct lang_identifier
82 {
83 struct tree_identifier ignore;
84 tree namespace_bindings, local_value;
85 tree class_value;
86 tree class_template_info;
87 struct lang_id2 *x;
88 };
89
90 struct lang_id2
91 {
92 tree label_value, implicit_decl;
93 tree type_desc, as_list, error_locus;
94 };
95
96 typedef struct
97 {
98 tree t;
99 int new_type_flag;
100 } flagged_type_tree;
101
102 typedef struct
103 {
104 char common[sizeof (struct tree_common)];
105 struct rtx_def *rtl; /* Unused, but required to match up with what
106 the middle-end expects. */
107 HOST_WIDE_INT index;
108 HOST_WIDE_INT level;
109 HOST_WIDE_INT orig_level;
110 tree decl;
111 } template_parm_index;
112
113 /* For a binding between a name and an entity, defines the scope
114 where the binding is declared. Currently always points to a
115 namespace declaration. */
116 #define BINDING_SCOPE(NODE) (((struct tree_binding*)NODE)->scope)
117 /* This is the declaration bound to the name. Possible values:
118 variable, overloaded function, namespace, template, enumerator. */
119 #define BINDING_VALUE(NODE) (((struct tree_binding*)NODE)->value)
120 /* If name is bound to a type, this is the type (struct, union, enum). */
121 #define BINDING_TYPE(NODE) TREE_TYPE(NODE)
122 #define IDENTIFIER_GLOBAL_VALUE(NODE) \
123 namespace_binding (NODE, global_namespace)
124 #define SET_IDENTIFIER_GLOBAL_VALUE(NODE, VAL) \
125 set_namespace_binding (NODE, global_namespace, VAL)
126 #define IDENTIFIER_NAMESPACE_VALUE(NODE) \
127 namespace_binding (NODE, current_namespace)
128 #define SET_IDENTIFIER_NAMESPACE_VALUE(NODE, VAL) \
129 set_namespace_binding (NODE, current_namespace, VAL)
130
131 struct tree_binding
132 {
133 char common[sizeof (struct tree_common)];
134 tree scope;
135 tree value;
136 };
137
138 /* The overloaded FUNCTION_DECL. */
139 #define OVL_FUNCTION(NODE) (((struct tree_overload*)NODE)->function)
140 #define OVL_CHAIN(NODE) TREE_CHAIN(NODE)
141 /* Polymorphic access to FUNCTION and CHAIN. */
142 #define OVL_CURRENT(NODE) \
143 ((TREE_CODE(NODE)==OVERLOAD) ? OVL_FUNCTION(NODE) : NODE)
144 #define OVL_NEXT(NODE) \
145 ((TREE_CODE(NODE)==OVERLOAD) ? TREE_CHAIN(NODE) : NULL_TREE)
146 /* If set, this was imported in a using declaration.
147 This is not to confuse with being used somewhere, which
148 is not important for this node. */
149 #define OVL_USED(NODE) TREE_USED(NODE)
150
151 struct tree_overload
152 {
153 char common[sizeof (struct tree_common)];
154 tree function;
155 };
156
157 #define WRAPPER_PTR(NODE) (((struct tree_wrapper*)NODE)->u.ptr)
158 #define WRAPPER_INT(NODE) (((struct tree_wrapper*)NODE)->u.i)
159
160 struct tree_wrapper
161 {
162 char common[sizeof (struct tree_common)];
163 union {
164 void *ptr;
165 int i;
166 } u;
167 };
168
169 /* To identify to the debug emitters if it should pay attention to the
170 flag `-Wtemplate-debugging'. */
171 #define HAVE_TEMPLATES 1
172
173 /* Macros for access to language-specific slots in an identifier. */
174
175 #define IDENTIFIER_NAMESPACE_BINDINGS(NODE) \
176 (((struct lang_identifier *)(NODE))->namespace_bindings)
177 #define IDENTIFIER_CLASS_VALUE(NODE) \
178 (((struct lang_identifier *)(NODE))->class_value)
179 #define IDENTIFIER_LOCAL_VALUE(NODE) \
180 (((struct lang_identifier *)(NODE))->local_value)
181 #define IDENTIFIER_TEMPLATE(NODE) \
182 (((struct lang_identifier *)(NODE))->class_template_info)
183
184 /* TREE_TYPE only indicates on local and class scope the current
185 type. For namespace scope, the presence of a type in any namespace
186 is indicated with global_type_node, and the real type behind must
187 be found through lookup. */
188 #define IDENTIFIER_TYPE_VALUE(NODE) (identifier_type_value(NODE))
189 #define REAL_IDENTIFIER_TYPE_VALUE(NODE) (TREE_TYPE (NODE))
190 #define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (TREE_TYPE (NODE) = TYPE)
191 #define IDENTIFIER_HAS_TYPE_VALUE(NODE) (IDENTIFIER_TYPE_VALUE (NODE) ? 1 : 0)
192
193 #define LANG_ID_FIELD(NAME,NODE) \
194 (((struct lang_identifier *)(NODE))->x \
195 ? ((struct lang_identifier *)(NODE))->x->NAME : 0)
196 #define SET_LANG_ID(NODE,VALUE,NAME) \
197 (((struct lang_identifier *)(NODE))->x == 0 \
198 ? ((struct lang_identifier *)(NODE))->x \
199 = (struct lang_id2 *)perm_calloc (1, sizeof (struct lang_id2)) : 0, \
200 ((struct lang_identifier *)(NODE))->x->NAME = (VALUE))
201
202 #define IDENTIFIER_LABEL_VALUE(NODE) LANG_ID_FIELD(label_value, NODE)
203 #define SET_IDENTIFIER_LABEL_VALUE(NODE,VALUE) \
204 SET_LANG_ID(NODE, VALUE, label_value)
205
206 #define IDENTIFIER_IMPLICIT_DECL(NODE) LANG_ID_FIELD(implicit_decl, NODE)
207 #define SET_IDENTIFIER_IMPLICIT_DECL(NODE,VALUE) \
208 SET_LANG_ID(NODE, VALUE, implicit_decl)
209
210 #define IDENTIFIER_AS_DESC(NODE) LANG_ID_FIELD(type_desc, NODE)
211 #define SET_IDENTIFIER_AS_DESC(NODE,DESC) \
212 SET_LANG_ID(NODE, DESC, type_desc)
213
214 #define IDENTIFIER_AS_LIST(NODE) LANG_ID_FIELD(as_list, NODE)
215 #define SET_IDENTIFIER_AS_LIST(NODE,LIST) \
216 SET_LANG_ID(NODE, LIST, as_list)
217
218 #define IDENTIFIER_ERROR_LOCUS(NODE) LANG_ID_FIELD(error_locus, NODE)
219 #define SET_IDENTIFIER_ERROR_LOCUS(NODE,VALUE) \
220 SET_LANG_ID(NODE, VALUE, error_locus)
221
222
223 #define IDENTIFIER_VIRTUAL_P(NODE) TREE_LANG_FLAG_1(NODE)
224
225 /* Nonzero if this identifier is the prefix for a mangled C++ operator name. */
226 #define IDENTIFIER_OPNAME_P(NODE) TREE_LANG_FLAG_2(NODE)
227
228 #define IDENTIFIER_TYPENAME_P(NODE) \
229 (! strncmp (IDENTIFIER_POINTER (NODE), \
230 IDENTIFIER_POINTER (ansi_opname[(int) TYPE_EXPR]), \
231 IDENTIFIER_LENGTH (ansi_opname[(int) TYPE_EXPR])))
232
233 /* Nonzero means reject anything that ANSI standard C forbids. */
234 extern int pedantic;
235
236 /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only. */
237 #define C_TYPE_FIELDS_READONLY(type) TYPE_LANG_FLAG_0 (type)
238
239 /* Record in each node resulting from a binary operator
240 what operator was specified for it. */
241 #define C_EXP_ORIGINAL_CODE(exp) ((enum tree_code) TREE_COMPLEXITY (exp))
242
243 /* Store a value in that field. */
244 #define C_SET_EXP_ORIGINAL_CODE(exp, code) \
245 (TREE_COMPLEXITY (exp) = (int)(code))
246 \f
247 /* If non-zero, a VAR_DECL whose cleanup will cause a throw to the
248 next exception handler. */
249 extern tree exception_throw_decl;
250
251 extern tree double_type_node, long_double_type_node, float_type_node;
252 extern tree char_type_node, unsigned_char_type_node, signed_char_type_node;
253 extern tree ptrdiff_type_node;
254
255 extern tree short_integer_type_node, short_unsigned_type_node;
256 extern tree long_integer_type_node, long_unsigned_type_node;
257 extern tree long_long_integer_type_node, long_long_unsigned_type_node;
258 extern tree unsigned_type_node;
259 extern tree string_type_node, char_array_type_node, int_array_type_node;
260 extern tree wchar_array_type_node;
261 extern tree wchar_type_node, signed_wchar_type_node, unsigned_wchar_type_node;
262
263 extern tree complex_integer_type_node;
264 extern tree complex_float_type_node;
265 extern tree complex_double_type_node;
266 extern tree complex_long_double_type_node;
267
268 extern tree intQI_type_node, unsigned_intQI_type_node;
269 extern tree intHI_type_node, unsigned_intHI_type_node;
270 extern tree intSI_type_node, unsigned_intSI_type_node;
271 extern tree intDI_type_node, unsigned_intDI_type_node;
272 extern tree intTI_type_node, unsigned_intTI_type_node;
273
274 extern int current_function_returns_value;
275 extern int current_function_returns_null;
276 extern tree current_function_return_value;
277
278 extern tree current_namespace;
279 extern tree global_namespace;
280
281 extern tree ridpointers[];
282 extern tree ansi_opname[];
283 extern tree ansi_assopname[];
284
285 /* Nonzero means `$' can be in an identifier. */
286
287 extern int dollars_in_ident;
288
289 /* Nonzero means allow type mismatches in conditional expressions;
290 just make their values `void'. */
291
292 extern int flag_cond_mismatch;
293
294 /* Nonzero means don't recognize the keyword `asm'. */
295
296 extern int flag_no_asm;
297
298 /* For cross referencing. */
299
300 extern int flag_gnu_xref;
301
302 /* For environments where you can use GNU binutils (as, ld in particular). */
303
304 extern int flag_gnu_binutils;
305
306 /* Nonzero means ignore `#ident' directives. */
307
308 extern int flag_no_ident;
309
310 /* Nonzero means warn about implicit declarations. */
311
312 extern int warn_implicit;
313
314 /* Nonzero means warn when all ctors or dtors are private, and the class
315 has no friends. */
316
317 extern int warn_ctor_dtor_privacy;
318
319 /* Nonzero means warn about function definitions that default the return type
320 or that use a null return and have a return-type other than void. */
321
322 extern int warn_return_type;
323
324 /* Nonzero means give string constants the type `const char *'
325 to get extra warnings from them. These warnings will be too numerous
326 to be useful, except in thoroughly ANSIfied programs. */
327
328 extern int warn_write_strings;
329
330 /* Nonzero means warn about sizeof(function) or addition/subtraction
331 of function pointers. */
332
333 extern int warn_pointer_arith;
334
335 /* Nonzero means warn about suggesting putting in ()'s. */
336
337 extern int warn_parentheses;
338
339 /* Nonzero means warn about multiple (redundant) decls for the same single
340 variable or function. */
341
342 extern int warn_redundant_decls;
343
344 /* Warn if initializer is not completely bracketed. */
345
346 extern int warn_missing_braces;
347
348 /* Warn about comparison of signed and unsigned values. */
349
350 extern int warn_sign_compare;
351
352 /* Warn about a subscript that has type char. */
353
354 extern int warn_char_subscripts;
355
356 /* Nonzero means warn about pointer casts that can drop a type qualifier
357 from the pointer target type. */
358
359 extern int warn_cast_qual;
360
361 /* Warn about *printf or *scanf format/argument anomalies. */
362
363 extern int warn_format;
364
365 /* Nonzero means warn about non virtual destructors in classes that have
366 virtual functions. */
367
368 extern int warn_nonvdtor;
369
370 /* Non-zero means warn when we convert a pointer to member function
371 into a pointer to (void or function). */
372
373 extern int warn_pmf2ptr;
374
375 /* Nonzero means warn about violation of some Effective C++ style rules. */
376
377 extern int warn_ecpp;
378
379 /* Nonzero means warn where overload resolution chooses a promotion from
380 unsigned to signed over a conversion to an unsigned of the same size. */
381
382 extern int warn_sign_promo;
383
384 /* Non-zero means warn when a function is declared extern and later inline. */
385
386 extern int warn_extern_inline;
387
388 /* Non-zero means warn when an old-style cast is used. */
389
390 extern int warn_old_style_cast;
391
392 /* Nonzero means to treat bitfields as unsigned unless they say `signed'. */
393
394 extern int flag_signed_bitfields;
395
396 /* 3 means write out only virtuals function tables `defined'
397 in this implementation file.
398 2 means write out only specific virtual function tables
399 and give them (C) public access.
400 1 means write out virtual function tables and give them
401 (C) public access.
402 0 means write out virtual function tables and give them
403 (C) static access (default).
404 -1 means declare virtual function tables extern. */
405
406 extern int write_virtuals;
407
408 /* True for more efficient but incompatible (not fully tested)
409 vtable implementation (using thunks).
410 0 is old behavior; 1 is new behavior. */
411 extern int flag_vtable_thunks;
412
413 /* INTERFACE_ONLY nonzero means that we are in an "interface"
414 section of the compiler. INTERFACE_UNKNOWN nonzero means
415 we cannot trust the value of INTERFACE_ONLY. If INTERFACE_UNKNOWN
416 is zero and INTERFACE_ONLY is zero, it means that we are responsible
417 for exporting definitions that others might need. */
418 extern int interface_only, interface_unknown;
419
420 /* Nonzero means we should attempt to elide constructors when possible. */
421
422 extern int flag_elide_constructors;
423
424 /* Nonzero means enable obscure ANSI features and disable GNU extensions
425 that might cause ANSI-compliant code to be miscompiled. */
426
427 extern int flag_ansi;
428
429 /* Nonzero means recognize and handle signature language constructs. */
430
431 extern int flag_handle_signatures;
432
433 /* Nonzero means that member functions defined in class scope are
434 inline by default. */
435
436 extern int flag_default_inline;
437
438 /* The name-mangling scheme to use. Versions of gcc before 2.8 use
439 version 0. */
440 extern int name_mangling_version;
441
442 /* Nonzero means that guiding declarations are allowed. */
443 extern int flag_guiding_decls;
444
445 /* Nonzero if squashed mangling is to be performed.
446 This uses the B and K codes to reference previously seen class types
447 and class qualifiers. */
448 extern int flag_do_squangling;
449
450 \f
451 /* C++ language-specific tree codes. */
452 #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
453 enum cplus_tree_code {
454 __DUMMY = LAST_AND_UNUSED_TREE_CODE,
455 #include "cp-tree.def"
456 LAST_CPLUS_TREE_CODE
457 };
458 #undef DEFTREECODE
459
460 enum languages { lang_c, lang_cplusplus, lang_java };
461
462 /* Macros to make error reporting functions' lives easier. */
463 #define TYPE_IDENTIFIER(NODE) (DECL_NAME (TYPE_NAME (NODE)))
464 #define TYPE_NAME_STRING(NODE) (IDENTIFIER_POINTER (TYPE_IDENTIFIER (NODE)))
465 #define TYPE_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (TYPE_IDENTIFIER (NODE)))
466
467 #define TYPE_ASSEMBLER_NAME_STRING(NODE) (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE))))
468 #define TYPE_ASSEMBLER_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE))))
469
470 /* The _DECL for this _TYPE. */
471 #define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE)))
472
473 #define IS_AGGR_TYPE(t) (TYPE_LANG_FLAG_5 (t))
474 #define IS_AGGR_TYPE_CODE(t) (t == RECORD_TYPE || t == UNION_TYPE)
475 #define IS_AGGR_TYPE_2(TYPE1,TYPE2) \
476 (TREE_CODE (TYPE1) == TREE_CODE (TYPE2) \
477 && IS_AGGR_TYPE (TYPE1)&IS_AGGR_TYPE (TYPE2))
478 #define IS_OVERLOAD_TYPE(t) \
479 (IS_AGGR_TYPE (t) || TREE_CODE (t) == ENUMERAL_TYPE)
480
481 /* In a *_TYPE, nonzero means a built-in type. */
482 #define TYPE_BUILT_IN(NODE) TYPE_LANG_FLAG_6(NODE)
483
484 #define DELTA_FROM_VTABLE_ENTRY(ENTRY) \
485 (!flag_vtable_thunks ? \
486 TREE_VALUE (CONSTRUCTOR_ELTS (ENTRY)) \
487 : TREE_CODE (TREE_OPERAND ((ENTRY), 0)) != THUNK_DECL ? integer_zero_node \
488 : build_int_2 (THUNK_DELTA (TREE_OPERAND ((ENTRY), 0)), 0))
489
490 /* Virtual function addresses can be gotten from a virtual function
491 table entry using this macro. */
492 #define FNADDR_FROM_VTABLE_ENTRY(ENTRY) \
493 (!flag_vtable_thunks ? \
494 TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY)))) \
495 : TREE_CODE (TREE_OPERAND ((ENTRY), 0)) != THUNK_DECL ? (ENTRY) \
496 : DECL_INITIAL (TREE_OPERAND ((ENTRY), 0)))
497 #define SET_FNADDR_FROM_VTABLE_ENTRY(ENTRY,VALUE) \
498 (TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY)))) = (VALUE))
499 #define FUNCTION_ARG_CHAIN(NODE) (TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (NODE))))
500 #define PROMOTES_TO_AGGR_TYPE(NODE,CODE) \
501 (((CODE) == TREE_CODE (NODE) \
502 && IS_AGGR_TYPE (TREE_TYPE (NODE))) \
503 || IS_AGGR_TYPE (NODE))
504
505 /* Nonzero iff TYPE is uniquely derived from PARENT. Under MI, PARENT can
506 be an ambiguous base class of TYPE, and this macro will be false. */
507 #define UNIQUELY_DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 0, (tree *)0) >= 0)
508 #define ACCESSIBLY_DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, -1, (tree *)0) >= 0)
509 #define ACCESSIBLY_UNIQUELY_DERIVED_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 1, (tree *)0) >= 0)
510 #define DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 0, (tree *)0) != -1)
511 \f
512 /* Statistics show that while the GNU C++ compiler may generate
513 thousands of different types during a compilation run, it
514 generates relatively few (tens) of classtypes. Because of this,
515 it is not costly to store a generous amount of information
516 in classtype nodes. This struct must fill out to a multiple of 4 bytes. */
517 struct lang_type
518 {
519 struct
520 {
521 unsigned has_type_conversion : 1;
522 unsigned has_init_ref : 1;
523 unsigned has_assignment : 1;
524 unsigned has_default_ctor : 1;
525 unsigned uses_multiple_inheritance : 1;
526 unsigned const_needs_init : 1;
527 unsigned ref_needs_init : 1;
528 unsigned has_const_assign_ref : 1;
529
530 unsigned has_nonpublic_ctor : 2;
531 unsigned has_nonpublic_assign_ref : 2;
532 unsigned vtable_needs_writing : 1;
533 unsigned has_assign_ref : 1;
534 unsigned gets_new : 2;
535
536 unsigned gets_delete : 2;
537 unsigned has_call_overloaded : 1;
538 unsigned has_array_ref_overloaded : 1;
539 unsigned has_arrow_overloaded : 1;
540 unsigned local_typedecls : 1;
541 unsigned interface_only : 1;
542 unsigned interface_unknown : 1;
543
544 unsigned needs_virtual_reinit : 1;
545 unsigned vec_delete_takes_size : 1;
546 unsigned declared_class : 1;
547 unsigned being_defined : 1;
548 unsigned redefined : 1;
549 unsigned marked : 1;
550 unsigned marked2 : 1;
551 unsigned marked3 : 1;
552
553 unsigned marked4 : 1;
554 unsigned marked5 : 1;
555 unsigned marked6 : 1;
556 unsigned debug_requested : 1;
557 unsigned use_template : 2;
558 unsigned got_semicolon : 1;
559 unsigned ptrmemfunc_flag : 1;
560
561 unsigned is_signature : 1;
562 unsigned is_signature_pointer : 1;
563 unsigned is_signature_reference : 1;
564 unsigned has_opaque_typedecls : 1;
565 unsigned sigtable_has_been_generated : 1;
566 unsigned was_anonymous : 1;
567 unsigned has_real_assignment : 1;
568 unsigned has_real_assign_ref : 1;
569
570 unsigned has_const_init_ref : 1;
571 unsigned has_complex_init_ref : 1;
572 unsigned has_complex_assign_ref : 1;
573 unsigned has_abstract_assign_ref : 1;
574 unsigned non_aggregate : 1;
575
576 /* The MIPS compiler gets it wrong if this struct also
577 does not fill out to a multiple of 4 bytes. Add a
578 member `dummy' with new bits if you go over the edge. */
579 unsigned dummy : 11;
580 } type_flags;
581
582 #ifdef MI_MATRIX
583 int cid;
584 #endif
585 int n_ancestors;
586 int n_vancestors;
587 int vsize;
588 int max_depth;
589 int vfield_parent;
590
591 union tree_node *baselink_vec;
592 union tree_node *vfields;
593 union tree_node *vbases;
594
595 union tree_node *tags;
596 char *memoized_table_entry;
597
598 union tree_node *search_slot;
599
600 unsigned char align;
601 /* Room for another three unsigned chars. */
602
603 union tree_node *size;
604
605 union tree_node *base_init_list;
606 union tree_node *abstract_virtuals;
607 union tree_node *as_list;
608 union tree_node *id_as_list;
609 union tree_node *binfo_as_list;
610 union tree_node *friend_classes;
611
612 #ifdef MI_MATRIX
613 char *mi_matrix;
614 #endif
615
616 union tree_node *rtti;
617
618 union tree_node *methods;
619
620 union tree_node *signature;
621 union tree_node *signature_pointer_to;
622 union tree_node *signature_reference_to;
623
624 union tree_node *template_info;
625
626 int linenum;
627 };
628
629 #define CLASSTYPE_SOURCE_LINE(NODE) (TYPE_LANG_SPECIFIC(NODE)->linenum)
630
631 /* Indicates whether or not (and how) a template was expanded for this class.
632 0=no information yet/non-template class
633 1=implicit template instantiation
634 2=explicit template specialization
635 3=explicit template instantiation */
636 #define CLASSTYPE_USE_TEMPLATE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.use_template)
637
638 /* Fields used for storing information before the class is defined.
639 After the class is defined, these fields hold other information. */
640
641 /* List of friends which were defined inline in this class definition. */
642 #define CLASSTYPE_INLINE_FRIENDS(NODE) (TYPE_NONCOPIED_PARTS (NODE))
643
644 /* Nonzero for _CLASSTYPE means that the _CLASSTYPE either has
645 a special meaning for the assignment operator ("operator="),
646 or one of its fields (or base members) has a special meaning
647 defined. */
648 #define TYPE_HAS_ASSIGNMENT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_assignment)
649 #define TYPE_HAS_REAL_ASSIGNMENT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_real_assignment)
650
651 /* Returns the canonical version of TYPE. In other words, if TYPE is
652 a typedef, returns the underlying type. The cv-qualification of
653 the type returned matches the type input; they will always be
654 compatible types. */
655 #define CANONICAL_TYPE_VARIANT(NODE) \
656 (cp_build_type_variant (TYPE_MAIN_VARIANT (NODE), \
657 TYPE_READONLY (NODE), TYPE_VOLATILE (NODE)))
658
659 /* Nonzero for _CLASSTYPE means that operator new and delete are defined,
660 respectively. */
661 #define TYPE_GETS_NEW(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_new)
662 #define TYPE_GETS_DELETE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_delete)
663 #define TYPE_GETS_REG_DELETE(NODE) (TYPE_GETS_DELETE (NODE) & 1)
664
665 /* Nonzero for _CLASSTYPE means that operator vec delete is defined and
666 takes the optional size_t argument. */
667 #define TYPE_VEC_DELETE_TAKES_SIZE(NODE) \
668 (TYPE_LANG_SPECIFIC(NODE)->type_flags.vec_delete_takes_size)
669 #define TYPE_VEC_NEW_USES_COOKIE(NODE) \
670 (TYPE_NEEDS_DESTRUCTOR (NODE) \
671 || (TYPE_LANG_SPECIFIC (NODE) && TYPE_VEC_DELETE_TAKES_SIZE (NODE)))
672
673 /* Nonzero for TREE_LIST or _TYPE node means that this node is class-local. */
674 #define TREE_NONLOCAL_FLAG(NODE) (TREE_LANG_FLAG_0 (NODE))
675
676 /* Nonzero means that this _CLASSTYPE node defines ways of converting
677 itself to other types. */
678 #define TYPE_HAS_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_type_conversion)
679
680 /* Nonzero means that this _CLASSTYPE node overloads operator=(X&). */
681 #define TYPE_HAS_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_assign_ref)
682 #define TYPE_HAS_CONST_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_const_assign_ref)
683
684 /* Nonzero means that this _CLASSTYPE node has an X(X&) constructor. */
685 #define TYPE_HAS_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_init_ref)
686 #define TYPE_HAS_CONST_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_const_init_ref)
687
688 /* Nonzero means that this type is being defined. I.e., the left brace
689 starting the definition of this type has been seen. */
690 #define TYPE_BEING_DEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.being_defined)
691 /* Nonzero means that this type has been redefined. In this case, if
692 convenient, don't reprocess any methods that appear in its redefinition. */
693 #define TYPE_REDEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.redefined)
694
695 /* Nonzero means that this type is a signature. */
696 # define IS_SIGNATURE(NODE) (TYPE_LANG_SPECIFIC(NODE)?TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature:0)
697 # define SET_SIGNATURE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature=1)
698 # define CLEAR_SIGNATURE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature=0)
699
700 /* Nonzero means that this type is a signature pointer type. */
701 # define IS_SIGNATURE_POINTER(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature_pointer)
702
703 /* Nonzero means that this type is a signature reference type. */
704 # define IS_SIGNATURE_REFERENCE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature_reference)
705
706 /* Nonzero means that this signature contains opaque type declarations. */
707 #define SIGNATURE_HAS_OPAQUE_TYPEDECLS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_opaque_typedecls)
708
709 /* Nonzero means that a signature table has been generated
710 for this signature. */
711 #define SIGTABLE_HAS_BEEN_GENERATED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.sigtable_has_been_generated)
712
713 /* If NODE is a class, this is the signature type that contains NODE's
714 signature after it has been computed using sigof(). */
715 #define CLASSTYPE_SIGNATURE(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature)
716
717 /* If NODE is a signature pointer or signature reference, this is the
718 signature type the pointer/reference points to. */
719 #define SIGNATURE_TYPE(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature)
720
721 /* If NODE is a signature, this is a vector of all methods defined
722 in the signature or in its base types together with their default
723 implementations. */
724 #define SIGNATURE_METHOD_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature)
725
726 /* If NODE is a signature, this is the _TYPE node that contains NODE's
727 signature pointer type. */
728 #define SIGNATURE_POINTER_TO(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature_pointer_to)
729
730 /* If NODE is a signature, this is the _TYPE node that contains NODE's
731 signature reference type. */
732 #define SIGNATURE_REFERENCE_TO(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature_reference_to)
733
734 /* The is the VAR_DECL that contains NODE's rtti. */
735 #define CLASSTYPE_RTTI(NODE) (TYPE_LANG_SPECIFIC(NODE)->rtti)
736
737 /* Nonzero means that this _CLASSTYPE node overloads operator(). */
738 #define TYPE_OVERLOADS_CALL_EXPR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_call_overloaded)
739
740 /* Nonzero means that this _CLASSTYPE node overloads operator[]. */
741 #define TYPE_OVERLOADS_ARRAY_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_array_ref_overloaded)
742
743 /* Nonzero means that this _CLASSTYPE node overloads operator->. */
744 #define TYPE_OVERLOADS_ARROW(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_arrow_overloaded)
745
746 /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
747 multiple inheritance. If this is 0 for the root of a type
748 hierarchy, then we can use more efficient search techniques. */
749 #define TYPE_USES_MULTIPLE_INHERITANCE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.uses_multiple_inheritance)
750
751 /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
752 virtual base classes. If this is 0 for the root of a type
753 hierarchy, then we can use more efficient search techniques. */
754 #define TYPE_USES_VIRTUAL_BASECLASSES(NODE) (TREE_LANG_FLAG_3(NODE))
755
756 /* List of lists of member functions defined in this class. */
757 #define CLASSTYPE_METHOD_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->methods)
758
759 /* The first type conversion operator in the class (the others can be
760 searched with TREE_CHAIN), or the first non-constructor function if
761 there are no type conversion operators. */
762 #define CLASSTYPE_FIRST_CONVERSION(NODE) \
763 TREE_VEC_LENGTH (CLASSTYPE_METHOD_VEC (NODE)) > 2 \
764 ? TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), 2) \
765 : NULL_TREE;
766
767 /* Pointer from any member function to the head of the list of
768 member functions of the type that member function belongs to. */
769 #define CLASSTYPE_BASELINK_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->baselink_vec)
770
771 /* Mark bits for depth-first and breath-first searches. */
772 #define CLASSTYPE_MARKED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked)
773 #define CLASSTYPE_MARKED2(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked2)
774 #define CLASSTYPE_MARKED3(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked3)
775 #define CLASSTYPE_MARKED4(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked4)
776 #define CLASSTYPE_MARKED5(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked5)
777 #define CLASSTYPE_MARKED6(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked6)
778 /* Macros to modify the above flags */
779 #define SET_CLASSTYPE_MARKED(NODE) (CLASSTYPE_MARKED(NODE) = 1)
780 #define CLEAR_CLASSTYPE_MARKED(NODE) (CLASSTYPE_MARKED(NODE) = 0)
781 #define SET_CLASSTYPE_MARKED2(NODE) (CLASSTYPE_MARKED2(NODE) = 1)
782 #define CLEAR_CLASSTYPE_MARKED2(NODE) (CLASSTYPE_MARKED2(NODE) = 0)
783 #define SET_CLASSTYPE_MARKED3(NODE) (CLASSTYPE_MARKED3(NODE) = 1)
784 #define CLEAR_CLASSTYPE_MARKED3(NODE) (CLASSTYPE_MARKED3(NODE) = 0)
785 #define SET_CLASSTYPE_MARKED4(NODE) (CLASSTYPE_MARKED4(NODE) = 1)
786 #define CLEAR_CLASSTYPE_MARKED4(NODE) (CLASSTYPE_MARKED4(NODE) = 0)
787 #define SET_CLASSTYPE_MARKED5(NODE) (CLASSTYPE_MARKED5(NODE) = 1)
788 #define CLEAR_CLASSTYPE_MARKED5(NODE) (CLASSTYPE_MARKED5(NODE) = 0)
789 #define SET_CLASSTYPE_MARKED6(NODE) (CLASSTYPE_MARKED6(NODE) = 1)
790 #define CLEAR_CLASSTYPE_MARKED6(NODE) (CLASSTYPE_MARKED6(NODE) = 0)
791
792 /* A list of the nested tag-types (class, struct, union, or enum)
793 found within this class. The TREE_PURPOSE of each node is the name
794 of the type; the TREE_VALUE is the type itself. This list includes
795 nested member class templates. */
796 #define CLASSTYPE_TAGS(NODE) (TYPE_LANG_SPECIFIC(NODE)->tags)
797
798 /* If this class has any bases, this is the number of the base class from
799 which our VFIELD is based, -1 otherwise. If this class has no base
800 classes, this is not used.
801 In D : B1, B2, PARENT would be 0, if D's vtable came from B1,
802 1, if D's vtable came from B2. */
803 #define CLASSTYPE_VFIELD_PARENT(NODE) (TYPE_LANG_SPECIFIC(NODE)->vfield_parent)
804
805 /* Remove when done merging. */
806 #define CLASSTYPE_VFIELD(NODE) TYPE_VFIELD(NODE)
807
808 /* The number of virtual functions defined for this
809 _CLASSTYPE node. */
810 #define CLASSTYPE_VSIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->vsize)
811 /* The virtual base classes that this type uses. */
812 #define CLASSTYPE_VBASECLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->vbases)
813 /* The virtual function pointer fields that this type contains. */
814 #define CLASSTYPE_VFIELDS(NODE) (TYPE_LANG_SPECIFIC(NODE)->vfields)
815
816 /* Number of baseclasses defined for this type.
817 0 means no base classes. */
818 #define CLASSTYPE_N_BASECLASSES(NODE) \
819 (TYPE_BINFO_BASETYPES (NODE) ? TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES(NODE)) : 0)
820
821 /* Memoize the number of super classes (base classes) tha this node
822 has. That way we can know immediately (albeit conservatively how
823 large a multiple-inheritance matrix we need to build to find
824 derivation information. */
825 #define CLASSTYPE_N_SUPERCLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->n_ancestors)
826 #define CLASSTYPE_N_VBASECLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->n_vancestors)
827
828 /* Record how deep the inheritance is for this class so `void*' conversions
829 are less favorable than a conversion to the most base type. */
830 #define CLASSTYPE_MAX_DEPTH(NODE) (TYPE_LANG_SPECIFIC(NODE)->max_depth)
831
832 /* Used for keeping search-specific information. Any search routine
833 which uses this must define what exactly this slot is used for. */
834 #define CLASSTYPE_SEARCH_SLOT(NODE) (TYPE_LANG_SPECIFIC(NODE)->search_slot)
835
836 /* Entry for keeping memoization tables for this type to
837 hopefully speed up search routines. Since it is a pointer,
838 it can mean almost anything. */
839 #define CLASSTYPE_MTABLE_ENTRY(NODE) (TYPE_LANG_SPECIFIC(NODE)->memoized_table_entry)
840
841 /* These are the size, mode and alignment of the type without its
842 virtual base classes, for when we use this type as a base itself. */
843 #define CLASSTYPE_SIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->size)
844 #define CLASSTYPE_ALIGN(NODE) (TYPE_LANG_SPECIFIC(NODE)->align)
845
846 /* A cons list of structure elements which either have constructors
847 to be called, or virtual function table pointers which
848 need initializing. Depending on what is being initialized,
849 the TREE_PURPOSE and TREE_VALUE fields have different meanings:
850
851 Member initialization: <FIELD_DECL, TYPE>
852 Base class construction: <NULL_TREE, BASETYPE>
853 Base class initialization: <BASE_INITIALIZATION, THESE_INITIALIZATIONS>
854 Whole type: <MEMBER_INIT, BASE_INIT>. */
855 #define CLASSTYPE_BASE_INIT_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->base_init_list)
856
857 /* A cons list of virtual functions which cannot be inherited by
858 derived classes. When deriving from this type, the derived
859 class must provide its own definition for each of these functions. */
860 #define CLASSTYPE_ABSTRACT_VIRTUALS(NODE) (TYPE_LANG_SPECIFIC(NODE)->abstract_virtuals)
861
862 /* Nonzero means that this aggr type has been `closed' by a semicolon. */
863 #define CLASSTYPE_GOT_SEMICOLON(NODE) (TYPE_LANG_SPECIFIC (NODE)->type_flags.got_semicolon)
864
865 /* Nonzero means that the main virtual function table pointer needs to be
866 set because base constructors have placed the wrong value there.
867 If this is zero, it means that they placed the right value there,
868 and there is no need to change it. */
869 #define CLASSTYPE_NEEDS_VIRTUAL_REINIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.needs_virtual_reinit)
870
871 /* Nonzero means that if this type has virtual functions, that
872 the virtual function table will be written out. */
873 #define CLASSTYPE_VTABLE_NEEDS_WRITING(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.vtable_needs_writing)
874
875 /* Nonzero means that this type defines its own local type declarations. */
876 #define CLASSTYPE_LOCAL_TYPEDECLS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.local_typedecls)
877
878 /* Nonzero means that this type has an X() constructor. */
879 #define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_default_ctor)
880
881 /* Nonzero means the type declared a ctor as private or protected. We
882 use this to make sure we don't try to generate a copy ctor for a
883 class that has a member of type NODE. */
884 #define TYPE_HAS_NONPUBLIC_CTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_nonpublic_ctor)
885
886 /* Ditto, for operator=. */
887 #define TYPE_HAS_NONPUBLIC_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_nonpublic_assign_ref)
888
889 /* Many routines need to cons up a list of basetypes for access
890 checking. This field contains a TREE_LIST node whose TREE_VALUE
891 is the main variant of the type, and whose TREE_VIA_PUBLIC
892 and TREE_VIA_VIRTUAL bits are correctly set. */
893 #define CLASSTYPE_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->as_list)
894 /* Same, but cache a list whose value is the name of this type. */
895 #define CLASSTYPE_ID_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->id_as_list)
896 /* Same, but cache a list whose value is the binfo of this type. */
897 #define CLASSTYPE_BINFO_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->binfo_as_list)
898
899 /* A list of class types with which this type is a friend. */
900 #define CLASSTYPE_FRIEND_CLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->friend_classes)
901
902 #ifdef MI_MATRIX
903 /* Keep an inheritance lattice around so we can quickly tell whether
904 a type is derived from another or not. */
905 #define CLASSTYPE_MI_MATRIX(NODE) (TYPE_LANG_SPECIFIC(NODE)->mi_matrix)
906 #endif
907
908 /* Say whether this node was declared as a "class" or a "struct". */
909 #define CLASSTYPE_DECLARED_CLASS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.declared_class)
910
911 /* Nonzero if this class has const members which have no specified initialization. */
912 #define CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.const_needs_init)
913
914 /* Nonzero if this class has ref members which have no specified initialization. */
915 #define CLASSTYPE_REF_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.ref_needs_init)
916
917 /* Nonzero if this class is included from a header file which employs
918 `#pragma interface', and it is not included in its implementation file. */
919 #define CLASSTYPE_INTERFACE_ONLY(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_only)
920
921 /* Same as above, but for classes whose purpose we do not know. */
922 #define CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown)
923 #define CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown == 0)
924 #define SET_CLASSTYPE_INTERFACE_UNKNOWN_X(NODE,X) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = !!(X))
925 #define SET_CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = 1)
926 #define SET_CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = 0)
927
928 /* Nonzero if a _DECL node requires us to output debug info for this class. */
929 #define CLASSTYPE_DEBUG_REQUESTED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.debug_requested)
930 \f
931 /* Additional macros for inheritance information. */
932
933 /* When following an binfo-specific chain, this is the cumulative
934 via-public flag. */
935 #define BINFO_VIA_PUBLIC(NODE) TREE_LANG_FLAG_5 (NODE)
936
937 #ifdef MI_MATRIX
938 /* When building a matrix to determine by a single lookup
939 whether one class is derived from another or not,
940 this field is the index of the class in the table. */
941 #define CLASSTYPE_CID(NODE) (TYPE_LANG_SPECIFIC(NODE)->cid)
942 #define BINFO_CID(NODE) CLASSTYPE_CID(BINFO_TYPE(NODE))
943 #endif
944
945 /* Nonzero means marked by DFS or BFS search, including searches
946 by `get_binfo' and `get_base_distance'. */
947 #define BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED(BINFO_TYPE(NODE)):TREE_LANG_FLAG_0(NODE))
948 /* Macros needed because of C compilers that don't allow conditional
949 expressions to be lvalues. Grr! */
950 #define SET_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_0(NODE)=1))
951 #define CLEAR_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_0(NODE)=0))
952
953 /* Nonzero means marked in building initialization list. */
954 #define BINFO_BASEINIT_MARKED(NODE) CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
955 /* Modifier macros */
956 #define SET_BINFO_BASEINIT_MARKED(NODE) SET_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
957 #define CLEAR_BINFO_BASEINIT_MARKED(NODE) CLEAR_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
958
959 /* Nonzero means marked in search through virtual inheritance hierarchy. */
960 #define BINFO_VBASE_MARKED(NODE) CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
961 /* Modifier macros */
962 #define SET_BINFO_VBASE_MARKED(NODE) SET_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
963 #define CLEAR_BINFO_VBASE_MARKED(NODE) CLEAR_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
964
965 /* Nonzero means marked in search for members or member functions. */
966 #define BINFO_FIELDS_MARKED(NODE) \
967 (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED2 (BINFO_TYPE (NODE)):TREE_LANG_FLAG_2(NODE))
968 #define SET_BINFO_FIELDS_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED2(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_2(NODE)=1))
969 #define CLEAR_BINFO_FIELDS_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED2(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_2(NODE)=0))
970
971 /* Nonzero means that this class is on a path leading to a new vtable. */
972 #define BINFO_VTABLE_PATH_MARKED(NODE) \
973 (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):TREE_LANG_FLAG_3(NODE))
974 #define SET_BINFO_VTABLE_PATH_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_3(NODE)=1))
975 #define CLEAR_BINFO_VTABLE_PATH_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_3(NODE)=0))
976
977 /* Nonzero means that this class has a new vtable. */
978 #define BINFO_NEW_VTABLE_MARKED(NODE) \
979 (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):TREE_LANG_FLAG_4(NODE))
980 #define SET_BINFO_NEW_VTABLE_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_4(NODE)=1))
981 #define CLEAR_BINFO_NEW_VTABLE_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_4(NODE)=0))
982
983 /* Nonzero means this class has initialized its virtual baseclasses. */
984 #define BINFO_VBASE_INIT_MARKED(NODE) \
985 (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED5(BINFO_TYPE(NODE)):TREE_LANG_FLAG_5(NODE))
986 #define SET_BINFO_VBASE_INIT_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED5(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_5(NODE)=1))
987 #define CLEAR_BINFO_VBASE_INIT_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED5(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_5(NODE)=0))
988 \f
989 /* Accessor macros for the vfield slots in structures. */
990
991 /* Get the assoc info that caused this vfield to exist. */
992 #define VF_BINFO_VALUE(NODE) TREE_PURPOSE (NODE)
993
994 /* Get that same information as a _TYPE. */
995 #define VF_BASETYPE_VALUE(NODE) TREE_VALUE (NODE)
996
997 /* Get the value of the top-most type dominating the non-`normal' vfields. */
998 #define VF_DERIVED_VALUE(NODE) (VF_BINFO_VALUE (NODE) ? BINFO_TYPE (VF_BINFO_VALUE (NODE)) : NULL_TREE)
999
1000 /* Get the value of the top-most type that's `normal' for the vfield. */
1001 #define VF_NORMAL_VALUE(NODE) TREE_TYPE (NODE)
1002 \f
1003 /* Nonzero for TREE_LIST node means that this list of things
1004 is a list of parameters, as opposed to a list of expressions. */
1005 #define TREE_PARMLIST(NODE) ((NODE)->common.unsigned_flag) /* overloaded! */
1006
1007 /* For FUNCTION_TYPE or METHOD_TYPE, a list of the exceptions that
1008 this type can raise. */
1009 #define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_NONCOPIED_PARTS (NODE)
1010
1011 /* The binding level associated with the namespace. */
1012 #define NAMESPACE_LEVEL(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.level)
1013 \f
1014 struct lang_decl_flags
1015 {
1016 #ifdef ONLY_INT_FIELDS
1017 int language : 8;
1018 #else
1019 enum languages language : 8;
1020 #endif
1021
1022 unsigned operator_attr : 1;
1023 unsigned constructor_attr : 1;
1024 unsigned returns_first_arg : 1;
1025 unsigned preserves_first_arg : 1;
1026 unsigned friend_attr : 1;
1027 unsigned static_function : 1;
1028 unsigned const_memfunc : 1;
1029 unsigned volatile_memfunc : 1;
1030
1031 unsigned abstract_virtual : 1;
1032 unsigned permanent_attr : 1 ;
1033 unsigned constructor_for_vbase_attr : 1;
1034 unsigned mutable_flag : 1;
1035 unsigned is_default_implementation : 1;
1036 unsigned saved_inline : 1;
1037 unsigned use_template : 2;
1038
1039 unsigned nonconverting : 1;
1040 unsigned declared_inline : 1;
1041 unsigned not_really_extern : 1;
1042 unsigned comdat : 1;
1043 unsigned needs_final_overrider : 1;
1044 unsigned dummy : 3;
1045
1046 tree access;
1047 tree context;
1048 tree memfunc_pointer_to;
1049 tree template_info;
1050 struct binding_level *level;
1051 };
1052
1053 struct lang_decl
1054 {
1055 struct lang_decl_flags decl_flags;
1056
1057 tree main_decl_variant;
1058 struct pending_inline *pending_inline_info;
1059 };
1060
1061 /* Non-zero if NODE is a _DECL with TREE_READONLY set. */
1062 #define TREE_READONLY_DECL_P(NODE) \
1063 (TREE_READONLY (NODE) && TREE_CODE_CLASS (TREE_CODE (NODE)) == 'd')
1064
1065 /* Non-zero iff DECL is memory-based. The DECL_RTL of
1066 certain const variables might be a CONST_INT, or a REG
1067 in some cases. We cannot use `memory_operand' as a test
1068 here because on most RISC machines, a variable's address
1069 is not, by itself, a legitimate address. */
1070 #define DECL_IN_MEMORY_P(NODE) \
1071 (DECL_RTL (NODE) != NULL_RTX && GET_CODE (DECL_RTL (NODE)) == MEM)
1072
1073 /* For FUNCTION_DECLs: return the language in which this decl
1074 was declared. */
1075 #define DECL_LANGUAGE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.language)
1076
1077 /* For FUNCTION_DECLs: nonzero means that this function is a constructor. */
1078 #define DECL_CONSTRUCTOR_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_attr)
1079 /* For FUNCTION_DECLs: nonzero means that this function is a constructor
1080 for an object with virtual baseclasses. */
1081 #define DECL_CONSTRUCTOR_FOR_VBASE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_for_vbase_attr)
1082
1083 /* For FUNCTION_DECLs: nonzero means that this function is a default
1084 implementation of a signature method. */
1085 #define IS_DEFAULT_IMPLEMENTATION(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.is_default_implementation)
1086
1087 /* For FUNCTION_DECLs: nonzero means that the constructor
1088 is known to return a non-zero `this' unchanged. */
1089 #define DECL_RETURNS_FIRST_ARG(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.returns_first_arg)
1090
1091 /* Nonzero for FUNCTION_DECL means that this constructor is known to
1092 not make any assignment to `this', and therefore can be trusted
1093 to return it unchanged. Otherwise, we must re-assign `current_class_ptr'
1094 after performing base initializations. */
1095 #define DECL_PRESERVES_THIS(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.preserves_first_arg)
1096
1097 /* Nonzero for _DECL means that this decl appears in (or will appear
1098 in) as a member in a RECORD_TYPE or UNION_TYPE node. It is also for
1099 detecting circularity in case members are multiply defined. In the
1100 case of a VAR_DECL, it is also used to determine how program storage
1101 should be allocated. */
1102 #define DECL_IN_AGGR_P(NODE) (DECL_LANG_FLAG_3(NODE))
1103
1104 /* Nonzero for FUNCTION_DECL means that this decl is just a
1105 friend declaration, and should not be added to the list of
1106 member functions for this class. */
1107 #define DECL_FRIEND_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.friend_attr)
1108
1109 /* Nonzero for FUNCTION_DECL means that this decl is a static
1110 member function. */
1111 #define DECL_STATIC_FUNCTION_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.static_function)
1112
1113 /* Nonzero for a class member means that it is shared between all objects
1114 of that class. */
1115 #define SHARED_MEMBER_P(NODE) \
1116 (TREE_CODE (NODE) == VAR_DECL || TREE_CODE (NODE) == TYPE_DECL \
1117 || TREE_CODE (NODE) == CONST_DECL)
1118
1119 /* Nonzero for FUNCTION_DECL means that this decl is a non-static
1120 member function. */
1121 #define DECL_NONSTATIC_MEMBER_FUNCTION_P(NODE) \
1122 (TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE)
1123
1124 /* Nonzero for FUNCTION_DECL means that this decl is a member function
1125 (static or non-static). */
1126 #define DECL_FUNCTION_MEMBER_P(NODE) \
1127 (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE) || DECL_STATIC_FUNCTION_P (NODE))
1128
1129 /* Nonzero for FUNCTION_DECL means that this member function
1130 has `this' as const X *const. */
1131 #define DECL_CONST_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.const_memfunc)
1132
1133 /* Nonzero for FUNCTION_DECL means that this member function
1134 has `this' as volatile X *const. */
1135 #define DECL_VOLATILE_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.volatile_memfunc)
1136
1137 /* Nonzero for _DECL means that this member object type
1138 is mutable. */
1139 #define DECL_MUTABLE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag)
1140
1141 /* Nonzero for _DECL means that this constructor is a non-converting
1142 constructor. */
1143 #define DECL_NONCONVERTING_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.nonconverting)
1144
1145 /* Nonzero for FUNCTION_DECL means that this member function
1146 exists as part of an abstract class's interface. */
1147 #define DECL_ABSTRACT_VIRTUAL_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.abstract_virtual)
1148
1149 /* Nonzero for FUNCTION_DECL means that this member function
1150 must be overridden by derived classes. */
1151 #define DECL_NEEDS_FINAL_OVERRIDER_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.needs_final_overrider)
1152
1153 /* Nonzero if allocated on permanent_obstack. */
1154 #define LANG_DECL_PERMANENT(LANGDECL) ((LANGDECL)->decl_flags.permanent_attr)
1155
1156 /* The _TYPE context in which this _DECL appears. This field holds the
1157 class where a virtual function instance is actually defined, and the
1158 lexical scope of a friend function defined in a class body. */
1159 #define DECL_CLASS_CONTEXT(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.context)
1160 #define DECL_REAL_CONTEXT(NODE) \
1161 ((TREE_CODE (NODE) == FUNCTION_DECL && DECL_FUNCTION_MEMBER_P (NODE)) \
1162 ? DECL_CLASS_CONTEXT (NODE) : DECL_CONTEXT (NODE))
1163
1164 /* 1 iff NODE has namespace scope, including the global namespace. */
1165 #define DECL_NAMESPACE_SCOPE_P(NODE) \
1166 (DECL_CONTEXT (NODE) == NULL_TREE \
1167 || TREE_CODE (DECL_CONTEXT (NODE)) == NAMESPACE_DECL)
1168
1169 /* 1 iff NODE is a class member. */
1170 #define DECL_CLASS_SCOPE_P(NODE) \
1171 (DECL_CONTEXT (NODE) \
1172 && TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (NODE))) == 't')
1173
1174 /* For a NAMESPACE_DECL: the list of using namespace directives
1175 The PURPOSE is the used namespace, the value is the namespace
1176 that is the common ancestor. */
1177 #define DECL_NAMESPACE_USING(NODE) DECL_VINDEX(NODE)
1178
1179 /* In a NAMESPACE_DECL, the DECL_INITIAL is used to record all users
1180 of a namespace, to record the transitive closure of using namespace. */
1181 #define DECL_NAMESPACE_USERS(NODE) DECL_INITIAL (NODE)
1182
1183 /* In a TREE_LIST concatenating using directives, indicate indirekt
1184 directives */
1185 #define TREE_INDIRECT_USING(NODE) ((NODE)->common.lang_flag_0)
1186
1187 /* In a VAR_DECL for a variable declared in a for statement,
1188 this is the shadowed (local) variable. */
1189 #define DECL_SHADOWED_FOR_VAR(NODE) DECL_RESULT(NODE)
1190
1191 /* Points back to the decl which caused this lang_decl to be allocated. */
1192 #define DECL_MAIN_VARIANT(NODE) (DECL_LANG_SPECIFIC(NODE)->main_decl_variant)
1193
1194 /* For a FUNCTION_DECL: if this function was declared inline inside of
1195 a class declaration, this is where the text for the function is
1196 squirreled away. */
1197 #define DECL_PENDING_INLINE_INFO(NODE) (DECL_LANG_SPECIFIC(NODE)->pending_inline_info)
1198
1199 /* True if on the saved_inlines (see decl2.c) list. */
1200 #define DECL_SAVED_INLINE(DECL) \
1201 (DECL_LANG_SPECIFIC(DECL)->decl_flags.saved_inline)
1202
1203 /* For a FUNCTION_DECL: if this function was declared inside a signature
1204 declaration, this is the corresponding member function pointer that was
1205 created for it. */
1206 #define DECL_MEMFUNC_POINTER_TO(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.memfunc_pointer_to)
1207
1208 /* For a FIELD_DECL: this points to the signature member function from
1209 which this signature member function pointer was created. */
1210 #define DECL_MEMFUNC_POINTING_TO(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.memfunc_pointer_to)
1211
1212 /* For a VAR_DECL or FUNCTION_DECL: template-specific information. */
1213 #define DECL_TEMPLATE_INFO(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.template_info)
1214 #define CLASSTYPE_TEMPLATE_INFO(NODE) (TYPE_LANG_SPECIFIC(NODE)->template_info)
1215 #define TI_TEMPLATE(NODE) (TREE_PURPOSE (NODE))
1216 #define TI_ARGS(NODE) (TREE_VALUE (NODE))
1217 #define TI_SPEC_INFO(NODE) (TREE_CHAIN (NODE))
1218 #define TI_USES_TEMPLATE_PARMS(NODE) TREE_LANG_FLAG_0 (NODE)
1219 #define TI_PENDING_TEMPLATE_FLAG(NODE) TREE_LANG_FLAG_1 (NODE)
1220 /* TI_PENDING_SPECIALIZATION_FLAG on a template-info node indicates
1221 that the template is a specialization of a member template, but
1222 that we don't yet know which one. */
1223 #define TI_PENDING_SPECIALIZATION_FLAG(NODE) TREE_LANG_FLAG_1 (NODE)
1224 #define DECL_TI_TEMPLATE(NODE) TI_TEMPLATE (DECL_TEMPLATE_INFO (NODE))
1225 #define DECL_TI_ARGS(NODE) TI_ARGS (DECL_TEMPLATE_INFO (NODE))
1226 #define CLASSTYPE_TI_TEMPLATE(NODE) TI_TEMPLATE (CLASSTYPE_TEMPLATE_INFO (NODE))
1227 #define CLASSTYPE_TI_ARGS(NODE) TI_ARGS (CLASSTYPE_TEMPLATE_INFO (NODE))
1228 #define CLASSTYPE_TI_SPEC_INFO(NODE) TI_SPEC_INFO (CLASSTYPE_TEMPLATE_INFO (NODE))
1229 #define INNERMOST_TEMPLATE_PARMS(NODE) TREE_VALUE(NODE)
1230
1231 #define TEMPLATE_PARMS_FOR_INLINE(NODE) TREE_LANG_FLAG_1 (NODE)
1232
1233 #define DECL_SAVED_TREE(NODE) DECL_MEMFUNC_POINTER_TO (NODE)
1234 #define COMPOUND_STMT_NO_SCOPE(NODE) TREE_LANG_FLAG_0 (NODE)
1235 #define NEW_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
1236 #define DELETE_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
1237 #define DELETE_EXPR_USE_VEC(NODE) TREE_LANG_FLAG_1 (NODE)
1238 #define LOOKUP_EXPR_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
1239
1240 /* The TYPE_MAIN_DECL for a class template type is a TYPE_DECL, not a
1241 TEMPLATE_DECL. This macro determines whether or not a given class
1242 type is really a template type, as opposed to an instantiation or
1243 specialization of one. */
1244 #define CLASSTYPE_IS_TEMPLATE(NODE) \
1245 (CLASSTYPE_TEMPLATE_INFO (NODE) \
1246 && !CLASSTYPE_USE_TEMPLATE (NODE) \
1247 && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (NODE)))
1248
1249 #define TYPENAME_TYPE_FULLNAME(NODE) CLASSTYPE_SIZE (NODE)
1250
1251 /* Nonzero in INTEGER_CST means that this int is negative by dint of
1252 using a twos-complement negated operand. */
1253 #define TREE_NEGATED_INT(NODE) (TREE_LANG_FLAG_0 (NODE))
1254
1255 #if 0 /* UNUSED */
1256 /* Nonzero in any kind of _EXPR or _REF node means that it is a call
1257 to a storage allocation routine. If, later, alternate storage
1258 is found to hold the object, this call can be ignored. */
1259 #define TREE_CALLS_NEW(NODE) (TREE_LANG_FLAG_1 (NODE))
1260 #endif
1261
1262 /* Nonzero in any kind of _TYPE that uses multiple inheritance
1263 or virtual baseclasses. */
1264 #define TYPE_USES_COMPLEX_INHERITANCE(NODE) (TREE_LANG_FLAG_1 (NODE))
1265
1266 #if 0 /* UNUSED */
1267 /* Nonzero in IDENTIFIER_NODE means that this name is not the name the user
1268 gave; it's a DECL_NESTED_TYPENAME. Someone may want to set this on
1269 mangled function names, too, but it isn't currently. */
1270 #define TREE_MANGLED(NODE) (TREE_LANG_FLAG_0 (NODE))
1271 #endif
1272
1273 #if 0 /* UNUSED */
1274 /* Nonzero in IDENTIFIER_NODE means that this name is overloaded, and
1275 should be looked up in a non-standard way. */
1276 #define DECL_OVERLOADED(NODE) (FOO)
1277 #endif
1278
1279 /* Nonzero if this (non-TYPE)_DECL has its virtual attribute set.
1280 For a FUNCTION_DECL, this is when the function is a virtual function.
1281 For a VAR_DECL, this is when the variable is a virtual function table.
1282 For a FIELD_DECL, when the field is the field for the virtual function table.
1283 For an IDENTIFIER_NODE, nonzero if any function with this name
1284 has been declared virtual.
1285
1286 For a _TYPE if it uses virtual functions (or is derived from
1287 one that does). */
1288 #define TYPE_VIRTUAL_P(NODE) (TREE_LANG_FLAG_2 (NODE))
1289
1290 extern int flag_new_for_scope;
1291
1292 /* This flag is true of a local VAR_DECL if it was declared in a for
1293 statement, but we are no longer in the scope of the for. */
1294 #define DECL_DEAD_FOR_LOCAL(NODE) DECL_LANG_FLAG_7 (NODE)
1295
1296 /* This flag is set on a VAR_DECL that is a DECL_DEAD_FOR_LOCAL
1297 if we already emitted a warning about using it. */
1298 #define DECL_ERROR_REPORTED(NODE) DECL_LANG_FLAG_0 (NODE)
1299
1300 /* This _DECL represents a compiler-generated entity. */
1301 #define SET_DECL_ARTIFICIAL(NODE) (DECL_ARTIFICIAL (NODE) = 1)
1302
1303 /* Record whether a typedef for type `int' was actually `signed int'. */
1304 #define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp))
1305
1306 /* Nonzero if the type T promotes to itself.
1307 ANSI C states explicitly the list of types that promote;
1308 in particular, short promotes to int even if they have the same width. */
1309 #define C_PROMOTING_INTEGER_TYPE_P(t) \
1310 (TREE_CODE ((t)) == INTEGER_TYPE \
1311 && (TYPE_MAIN_VARIANT (t) == char_type_node \
1312 || TYPE_MAIN_VARIANT (t) == signed_char_type_node \
1313 || TYPE_MAIN_VARIANT (t) == unsigned_char_type_node \
1314 || TYPE_MAIN_VARIANT (t) == short_integer_type_node \
1315 || TYPE_MAIN_VARIANT (t) == short_unsigned_type_node))
1316
1317 #define INTEGRAL_CODE_P(CODE) \
1318 (CODE == INTEGER_TYPE || CODE == ENUMERAL_TYPE || CODE == BOOLEAN_TYPE)
1319 #define ARITHMETIC_TYPE_P(TYPE) (INTEGRAL_TYPE_P (TYPE) || FLOAT_TYPE_P (TYPE))
1320
1321 /* Mark which labels are explicitly declared.
1322 These may be shadowed, and may be referenced from nested functions. */
1323 #define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label)
1324
1325 /* Nonzero for _TYPE means that the _TYPE defines
1326 at least one constructor. */
1327 #define TYPE_HAS_CONSTRUCTOR(NODE) (TYPE_LANG_FLAG_1(NODE))
1328
1329 /* When appearing in an INDIRECT_REF, it means that the tree structure
1330 underneath is actually a call to a constructor. This is needed
1331 when the constructor must initialize local storage (which can
1332 be automatically destroyed), rather than allowing it to allocate
1333 space from the heap.
1334
1335 When appearing in a SAVE_EXPR, it means that underneath
1336 is a call to a constructor.
1337
1338 When appearing in a CONSTRUCTOR, it means that it was
1339 a GNU C constructor expression.
1340
1341 When appearing in a FIELD_DECL, it means that this field
1342 has been duly initialized in its constructor. */
1343 #define TREE_HAS_CONSTRUCTOR(NODE) (TREE_LANG_FLAG_4(NODE))
1344
1345 #define EMPTY_CONSTRUCTOR_P(NODE) (TREE_CODE (NODE) == CONSTRUCTOR \
1346 && CONSTRUCTOR_ELTS (NODE) == NULL_TREE)
1347
1348 #if 0
1349 /* Indicates that a NON_LVALUE_EXPR came from a C++ reference.
1350 Used to generate more helpful error message in case somebody
1351 tries to take its address. */
1352 #define TREE_REFERENCE_EXPR(NODE) (TREE_LANG_FLAG_3(NODE))
1353 #endif
1354
1355 /* Nonzero for _TYPE means that the _TYPE defines a destructor. */
1356 #define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2(NODE))
1357
1358 #if 0
1359 /* Nonzero for _TYPE node means that creating an object of this type
1360 will involve a call to a constructor. This can apply to objects
1361 of ARRAY_TYPE if the type of the elements needs a constructor. */
1362 #define TYPE_NEEDS_CONSTRUCTING(NODE) ... defined in ../tree.h ...
1363 #endif
1364
1365 /* Nonzero means that an object of this type can not be initialized using
1366 an initializer list. */
1367 #define CLASSTYPE_NON_AGGREGATE(NODE) \
1368 (TYPE_LANG_SPECIFIC (NODE)->type_flags.non_aggregate)
1369 #define TYPE_NON_AGGREGATE_CLASS(NODE) \
1370 (IS_AGGR_TYPE (NODE) && CLASSTYPE_NON_AGGREGATE (NODE))
1371
1372 /* Nonzero if there is a user-defined X::op=(x&) for this class. */
1373 #define TYPE_HAS_REAL_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_real_assign_ref)
1374 #define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_complex_assign_ref)
1375 #define TYPE_HAS_ABSTRACT_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_abstract_assign_ref)
1376 #define TYPE_HAS_COMPLEX_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_complex_init_ref)
1377
1378 /* Nonzero for _TYPE node means that destroying an object of this type
1379 will involve a call to a destructor. This can apply to objects
1380 of ARRAY_TYPE is the type of the elements needs a destructor. */
1381 #define TYPE_NEEDS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_4(NODE))
1382
1383 /* Nonzero for class type means that initialization of this type can use
1384 a bitwise copy. */
1385 #define TYPE_HAS_TRIVIAL_INIT_REF(NODE) \
1386 (TYPE_HAS_INIT_REF (NODE) && ! TYPE_HAS_COMPLEX_INIT_REF (NODE))
1387
1388 /* Nonzero for class type means that assignment of this type can use
1389 a bitwise copy. */
1390 #define TYPE_HAS_TRIVIAL_ASSIGN_REF(NODE) \
1391 (TYPE_HAS_ASSIGN_REF (NODE) && ! TYPE_HAS_COMPLEX_ASSIGN_REF (NODE))
1392
1393 #define TYPE_PTRMEM_P(NODE) \
1394 (TREE_CODE (NODE) == POINTER_TYPE \
1395 && TREE_CODE (TREE_TYPE (NODE)) == OFFSET_TYPE)
1396 #define TYPE_PTR_P(NODE) \
1397 (TREE_CODE (NODE) == POINTER_TYPE \
1398 && TREE_CODE (TREE_TYPE (NODE)) != OFFSET_TYPE)
1399 #define TYPE_PTROB_P(NODE) \
1400 (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE \
1401 && TREE_CODE (TREE_TYPE (NODE)) != VOID_TYPE)
1402 #define TYPE_PTROBV_P(NODE) \
1403 (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE)
1404 #define TYPE_PTRFN_P(NODE) \
1405 (TREE_CODE (NODE) == POINTER_TYPE \
1406 && TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE)
1407
1408 /* Nonzero for _TYPE node means that this type is a pointer to member
1409 function type. */
1410 #define TYPE_PTRMEMFUNC_P(NODE) (TREE_CODE(NODE) == RECORD_TYPE && TYPE_LANG_SPECIFIC(NODE)->type_flags.ptrmemfunc_flag)
1411 #define TYPE_PTRMEMFUNC_FLAG(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.ptrmemfunc_flag)
1412 /* Get the POINTER_TYPE to the METHOD_TYPE associated with this
1413 pointer to member function. TYPE_PTRMEMFUNC_P _must_ be true,
1414 before using this macro. */
1415 #define TYPE_PTRMEMFUNC_FN_TYPE(NODE) (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (NODE)))))))
1416
1417 /* Returns `A' for a type like `int (A::*)(double)' */
1418 #define TYPE_PTRMEMFUNC_OBJECT_TYPE(NODE) \
1419 TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (NODE)))
1420
1421 /* These are use to manipulate the canonical RECORD_TYPE from the
1422 hashed POINTER_TYPE, and can only be used on the POINTER_TYPE. */
1423 #define TYPE_GET_PTRMEMFUNC_TYPE(NODE) ((tree)TYPE_LANG_SPECIFIC(NODE))
1424 #define TYPE_SET_PTRMEMFUNC_TYPE(NODE, VALUE) (TYPE_LANG_SPECIFIC(NODE) = ((struct lang_type *)(void*)(VALUE)))
1425 /* These are to get the delta2 and pfn fields from a TYPE_PTRMEMFUNC_P. */
1426 #define DELTA2_FROM_PTRMEMFUNC(NODE) (build_component_ref (build_component_ref ((NODE), pfn_or_delta2_identifier, NULL_TREE, 0), delta2_identifier, NULL_TREE, 0))
1427 #define PFN_FROM_PTRMEMFUNC(NODE) (build_component_ref (build_component_ref ((NODE), pfn_or_delta2_identifier, NULL_TREE, 0), pfn_identifier, NULL_TREE, 0))
1428
1429 /* Nonzero for VAR_DECL and FUNCTION_DECL node means that `extern' was
1430 specified in its declaration. */
1431 #define DECL_THIS_EXTERN(NODE) (DECL_LANG_FLAG_2(NODE))
1432
1433 /* Nonzero for VAR_DECL and FUNCTION_DECL node means that `static' was
1434 specified in its declaration. */
1435 #define DECL_THIS_STATIC(NODE) (DECL_LANG_FLAG_6(NODE))
1436
1437 /* Nonzero for SAVE_EXPR if used to initialize a PARM_DECL. */
1438 #define PARM_DECL_EXPR(NODE) (TREE_LANG_FLAG_2(NODE))
1439
1440 /* Nonzero in FUNCTION_DECL means it is really an operator.
1441 Just used to communicate formatting information to dbxout.c. */
1442 #define DECL_OPERATOR(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.operator_attr)
1443
1444 #define ANON_UNION_P(NODE) (DECL_NAME (NODE) == 0)
1445
1446 #define UNKNOWN_TYPE LANG_TYPE
1447
1448 /* Define fields and accessors for nodes representing declared names. */
1449
1450 #if 0
1451 /* C++: A derived class may be able to directly use the virtual
1452 function table of a base class. When it does so, it may
1453 still have a decl node used to access the virtual function
1454 table (so that variables of this type can initialize their
1455 virtual function table pointers by name). When such thievery
1456 is committed, know exactly which base class's virtual function
1457 table is the one being stolen. This effectively computes the
1458 transitive closure. */
1459 #define DECL_VPARENT(NODE) ((NODE)->decl.arguments)
1460 #endif
1461
1462 #define TYPE_WAS_ANONYMOUS(NODE) (TYPE_LANG_SPECIFIC (NODE)->type_flags.was_anonymous)
1463
1464 /* C++: all of these are overloaded! These apply only to TYPE_DECLs. */
1465
1466 /* The format of each node in the DECL_FRIENDLIST is as follows:
1467
1468 The TREE_PURPOSE will be the name of a function, i.e., an
1469 IDENTIFIER_NODE. The TREE_VALUE will be itself a TREE_LIST, the
1470 list of functions with that name which are friends. The
1471 TREE_PURPOSE of each node in this sublist will be error_mark_node,
1472 if the function was declared a friend individually, in which case
1473 the TREE_VALUE will be the function_decl. If, however, all
1474 functions with a given name in a class were declared to be friends,
1475 the TREE_PUROSE will be the class type, and the TREE_VALUE will be
1476 NULL_TREE. */
1477 #define DECL_FRIENDLIST(NODE) (DECL_INITIAL (NODE))
1478
1479 /* The DECL_ACCESS is used to record under which context
1480 special access rules apply. */
1481 #define DECL_ACCESS(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.access)
1482
1483 /* C++: all of these are overloaded!
1484 These apply to PARM_DECLs and VAR_DECLs. */
1485 #define DECL_REFERENCE_SLOT(NODE) ((tree)(NODE)->decl.arguments)
1486 #define SET_DECL_REFERENCE_SLOT(NODE,VAL) ((NODE)->decl.arguments=VAL)
1487
1488 /* Accessor macros for C++ template decl nodes. */
1489
1490 /* The DECL_TEMPLATE_PARMS are a list. The TREE_PURPOSE of each node
1491 indicates the level of the template parameters, with 1 being the
1492 outermost set of template parameters. The TREE_VALUE is a vector,
1493 whose elements are the template parameters at each level. Each
1494 element in the vector is a TREE_LIST, whose TREE_VALUE is a
1495 PARM_DECL (if the parameter is a non-type parameter), or a
1496 TYPE_DECL (if the parameter is a type parameter). The TREE_PURPOSE
1497 is the default value, if any. The TEMPLATE_PARM_INDEX for the
1498 parameter is avilable as the DECL_INITIAL (for a PARM_DECL) or as
1499 the TREE_TYPE (for a TYPE_DECL). */
1500 #define DECL_TEMPLATE_PARMS(NODE) DECL_ARGUMENTS(NODE)
1501 #define DECL_INNERMOST_TEMPLATE_PARMS(NODE) \
1502 INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (NODE))
1503 #define DECL_NTPARMS(NODE) \
1504 TREE_VEC_LENGTH (DECL_INNERMOST_TEMPLATE_PARMS (NODE))
1505 /* For class templates. */
1506 #define DECL_TEMPLATE_SPECIALIZATIONS(NODE) DECL_SIZE(NODE)
1507 /* For function, method, class-data templates. */
1508 #define DECL_TEMPLATE_RESULT(NODE) DECL_RESULT(NODE)
1509 #define DECL_TEMPLATE_INSTANTIATIONS(NODE) DECL_VINDEX(NODE)
1510 #define DECL_TEMPLATE_INJECT(NODE) DECL_INITIAL(NODE)
1511
1512 /* Nonzero for TEMPLATE_DECL nodes that represents template template
1513 parameters */
1514 #define DECL_TEMPLATE_TEMPLATE_PARM_P(NODE) \
1515 (TREE_CODE (NODE) == TEMPLATE_DECL && TREE_TYPE (NODE) \
1516 && TREE_CODE (TREE_TYPE (NODE)) == TEMPLATE_TEMPLATE_PARM)
1517
1518 #define DECL_FUNCTION_TEMPLATE_P(NODE) \
1519 (TREE_CODE (NODE) == TEMPLATE_DECL \
1520 && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == FUNCTION_DECL)
1521
1522 /* Nonzero for a DECL that represents a template class. */
1523 #define DECL_CLASS_TEMPLATE_P(NODE) \
1524 (TREE_CODE (NODE) == TEMPLATE_DECL \
1525 && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == TYPE_DECL \
1526 && !DECL_TEMPLATE_TEMPLATE_PARM_P (NODE))
1527
1528 /* Nonzero if NODE which declares a type. */
1529 #define DECL_DECLARES_TYPE_P(NODE) \
1530 (TREE_CODE (NODE) == TYPE_DECL || DECL_CLASS_TEMPLATE_P (NODE))
1531
1532 /* A `primary' template is one that has its own template header. A
1533 member function of a class template is a template, but not primary.
1534 A member template is primary. Friend templates are primary, too. */
1535
1536 /* Returns the primary template corresponding to these parameters. */
1537 #define DECL_PRIMARY_TEMPLATE(NODE) \
1538 (TREE_TYPE (DECL_INNERMOST_TEMPLATE_PARMS (NODE)))
1539
1540 /* Returns non-zero if NODE is a primary template. */
1541 #define PRIMARY_TEMPLATE_P(NODE) (DECL_PRIMARY_TEMPLATE (NODE) == NODE)
1542
1543 #define CLASSTYPE_TEMPLATE_LEVEL(NODE) \
1544 (TREE_INT_CST_HIGH (TREE_PURPOSE (CLASSTYPE_TI_TEMPLATE (NODE))))
1545
1546 /* Indicates whether or not (and how) a template was expanded for this
1547 FUNCTION_DECL or VAR_DECL.
1548 0=normal declaration, e.g. int min (int, int);
1549 1=implicit template instantiation
1550 2=explicit template specialization, e.g. int min<int> (int, int);
1551 3=explicit template instantiation, e.g. template int min<int> (int, int); */
1552 #define DECL_USE_TEMPLATE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.use_template)
1553
1554 #define DECL_TEMPLATE_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) & 1)
1555 #define CLASSTYPE_TEMPLATE_INSTANTIATION(NODE) \
1556 (CLASSTYPE_USE_TEMPLATE (NODE) & 1)
1557
1558 #define DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) == 2)
1559 #define SET_DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) = 2)
1560 #define CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \
1561 (CLASSTYPE_USE_TEMPLATE (NODE) == 2)
1562 #define SET_CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \
1563 (CLASSTYPE_USE_TEMPLATE (NODE) = 2)
1564
1565 #define DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 1)
1566 #define SET_DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) = 1)
1567 #define CLASSTYPE_IMPLICIT_INSTANTIATION(NODE) \
1568 (CLASSTYPE_USE_TEMPLATE(NODE) == 1)
1569 #define SET_CLASSTYPE_IMPLICIT_INSTANTIATION(NODE) \
1570 (CLASSTYPE_USE_TEMPLATE(NODE) = 1)
1571
1572 #define DECL_EXPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 3)
1573 #define SET_DECL_EXPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) = 3)
1574 #define CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \
1575 (CLASSTYPE_USE_TEMPLATE(NODE) == 3)
1576 #define SET_CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \
1577 (CLASSTYPE_USE_TEMPLATE(NODE) = 3)
1578
1579 /* This function may be a guiding decl for a template. */
1580 #define DECL_MAYBE_TEMPLATE(NODE) DECL_LANG_FLAG_4 (NODE)
1581 /* We know what we're doing with this decl now. */
1582 #define DECL_INTERFACE_KNOWN(NODE) DECL_LANG_FLAG_5 (NODE)
1583
1584 /* This function was declared inline. This flag controls the linkage
1585 semantics of 'inline'; whether or not the function is inlined is
1586 controlled by DECL_INLINE. */
1587 #define DECL_THIS_INLINE(NODE) \
1588 (DECL_LANG_SPECIFIC (NODE)->decl_flags.declared_inline)
1589
1590 /* DECL_EXTERNAL must be set on a decl until the decl is actually emitted,
1591 so that assemble_external will work properly. So we have this flag to
1592 tell us whether the decl is really not external. */
1593 #define DECL_NOT_REALLY_EXTERN(NODE) \
1594 (DECL_LANG_SPECIFIC (NODE)->decl_flags.not_really_extern)
1595
1596 #define DECL_REALLY_EXTERN(NODE) \
1597 (DECL_EXTERNAL (NODE) && ! DECL_NOT_REALLY_EXTERN (NODE))
1598
1599 /* Used to tell cp_finish_decl that it should approximate comdat linkage
1600 as best it can for this decl. */
1601 #define DECL_COMDAT(NODE) (DECL_LANG_SPECIFIC (NODE)->decl_flags.comdat)
1602
1603 #define THUNK_DELTA(DECL) ((DECL)->decl.frame_size.i)
1604
1605 /* ...and for unexpanded-parameterized-type nodes. */
1606 #define UPT_TEMPLATE(NODE) TREE_PURPOSE(TYPE_VALUES(NODE))
1607 #define UPT_PARMS(NODE) TREE_VALUE(TYPE_VALUES(NODE))
1608
1609 /* An un-parsed default argument looks like an identifier. */
1610 #define DEFARG_LENGTH(NODE) IDENTIFIER_LENGTH(NODE)
1611 #define DEFARG_POINTER(NODE) IDENTIFIER_POINTER(NODE)
1612
1613 #define builtin_function(NAME, TYPE, CODE, LIBNAME) \
1614 define_function (NAME, TYPE, CODE, (void (*) PROTO((tree)))pushdecl, LIBNAME)
1615
1616 /* These macros provide convenient access to the various _STMT nodes
1617 created when parsing template declarations. */
1618 #define IF_COND(NODE) TREE_OPERAND (NODE, 0)
1619 #define THEN_CLAUSE(NODE) TREE_OPERAND (NODE, 1)
1620 #define ELSE_CLAUSE(NODE) TREE_OPERAND (NODE, 2)
1621 #define WHILE_COND(NODE) TREE_OPERAND (NODE, 0)
1622 #define WHILE_BODY(NODE) TREE_OPERAND (NODE, 1)
1623 #define DO_COND(NODE) TREE_OPERAND (NODE, 0)
1624 #define DO_BODY(NODE) TREE_OPERAND (NODE, 1)
1625 #define RETURN_EXPR(NODE) TREE_OPERAND (NODE, 0)
1626 #define EXPR_STMT_EXPR(NODE) TREE_OPERAND (NODE, 0)
1627 #define FOR_INIT_STMT(NODE) TREE_OPERAND (NODE, 0)
1628 #define FOR_COND(NODE) TREE_OPERAND (NODE, 1)
1629 #define FOR_EXPR(NODE) TREE_OPERAND (NODE, 2)
1630 #define FOR_BODY(NODE) TREE_OPERAND (NODE, 3)
1631 #define SWITCH_COND(NODE) TREE_OPERAND (NODE, 0)
1632 #define SWITCH_BODY(NODE) TREE_OPERAND (NODE, 1)
1633 #define CASE_LOW(NODE) TREE_OPERAND (NODE, 0)
1634 #define CASE_HIGH(NODE) TREE_OPERAND (NODE, 1)
1635 #define GOTO_DESTINATION(NODE) TREE_OPERAND (NODE, 0)
1636 #define TRY_STMTS(NODE) TREE_OPERAND (NODE, 0)
1637 #define TRY_HANDLERS(NODE) TREE_OPERAND (NODE, 1)
1638 #define HANDLER_PARMS(NODE) TREE_OPERAND (NODE, 0)
1639 #define HANDLER_BODY(NODE) TREE_OPERAND (NODE, 1)
1640 #define COMPOUND_BODY(NODE) TREE_OPERAND (NODE, 0)
1641 #define ASM_CV_QUAL(NODE) TREE_OPERAND (NODE, 0)
1642 #define ASM_STRING(NODE) TREE_OPERAND (NODE, 1)
1643 #define ASM_OUTPUTS(NODE) TREE_OPERAND (NODE, 2)
1644 #define ASM_INPUTS(NODE) TREE_OPERAND (NODE, 3)
1645 #define ASM_CLOBBERS(NODE) TREE_OPERAND (NODE, 4)
1646
1647 /* An enumeration of the kind of tags that C++ accepts. */
1648 enum tag_types { record_type, class_type, union_type, enum_type,
1649 signature_type };
1650
1651 /* Zero means prototype weakly, as in ANSI C (no args means nothing).
1652 Each language context defines how this variable should be set. */
1653 extern int strict_prototype;
1654 extern int strict_prototypes_lang_c, strict_prototypes_lang_cplusplus;
1655
1656 /* Non-zero means that if a label exists, and no other identifier
1657 applies, use the value of the label. */
1658 extern int flag_labels_ok;
1659
1660 /* Non-zero means to collect statistics which might be expensive
1661 and to print them when we are done. */
1662 extern int flag_detailed_statistics;
1663
1664 /* Non-zero means warn in function declared in derived class has the
1665 same name as a virtual in the base class, but fails to match the
1666 type signature of any virtual function in the base class. */
1667 extern int warn_overloaded_virtual;
1668
1669 /* in c-common.c */
1670 extern void declare_function_name PROTO((void));
1671 extern void decl_attributes PROTO((tree, tree, tree));
1672 extern void init_function_format_info PROTO((void));
1673 extern void record_function_format PROTO((tree, tree, int, int, int));
1674 extern void check_function_format PROTO((tree, tree, tree));
1675 /* Print an error message for invalid operands to arith operation CODE.
1676 NOP_EXPR is used as a special case (see truthvalue_conversion). */
1677 extern void binary_op_error PROTO((enum tree_code));
1678 extern tree cp_build_type_variant PROTO((tree, int, int));
1679 extern void c_expand_expr_stmt PROTO((tree));
1680 /* Validate the expression after `case' and apply default promotions. */
1681 extern tree check_case_value PROTO((tree));
1682 /* Concatenate a list of STRING_CST nodes into one STRING_CST. */
1683 extern tree combine_strings PROTO((tree));
1684 extern void constant_expression_warning PROTO((tree));
1685 extern tree convert_and_check PROTO((tree, tree));
1686 extern void overflow_warning PROTO((tree));
1687 extern void unsigned_conversion_warning PROTO((tree, tree));
1688 /* Read the rest of the current #-directive line. */
1689 #if USE_CPPLIB
1690 extern char *get_directive_line PROTO((void));
1691 #define GET_DIRECTIVE_LINE() get_directive_line ()
1692 #else
1693 extern char *get_directive_line PROTO((FILE *));
1694 #define GET_DIRECTIVE_LINE() get_directive_line (finput)
1695 #endif
1696 /* Subroutine of build_binary_op, used for comparison operations.
1697 See if the operands have both been converted from subword integer types
1698 and, if so, perhaps change them both back to their original type. */
1699 extern tree shorten_compare PROTO((tree *, tree *, tree *, enum tree_code *));
1700 /* Prepare expr to be an argument of a TRUTH_NOT_EXPR,
1701 or validate its data type for an `if' or `while' statement or ?..: exp. */
1702 extern tree truthvalue_conversion PROTO((tree));
1703 extern tree type_for_mode PROTO((enum machine_mode, int));
1704 extern tree type_for_size PROTO((unsigned, int));
1705
1706 /* in decl{2}.c */
1707 extern tree void_list_node;
1708 extern tree void_zero_node;
1709 extern tree default_function_type;
1710 extern tree vtable_entry_type;
1711 extern tree sigtable_entry_type;
1712 extern tree __t_desc_type_node;
1713 #if 0
1714 extern tree __tp_desc_type_node;
1715 #endif
1716 extern tree __access_mode_type_node;
1717 extern tree __bltn_desc_type_node, __user_desc_type_node;
1718 extern tree __class_desc_type_node, __attr_desc_type_node;
1719 extern tree __ptr_desc_type_node, __func_desc_type_node;
1720 extern tree __ptmf_desc_type_node, __ptmd_desc_type_node;
1721 extern tree type_info_type_node;
1722 extern tree class_star_type_node;
1723 extern tree this_identifier;
1724 extern tree ctor_identifier, dtor_identifier;
1725 extern tree pfn_identifier;
1726 extern tree index_identifier;
1727 extern tree delta_identifier;
1728 extern tree delta2_identifier;
1729 extern tree pfn_or_delta2_identifier;
1730 extern tree tag_identifier;
1731 extern tree vt_off_identifier;
1732
1733 /* A node that is a list (length 1) of error_mark_nodes. */
1734 extern tree error_mark_list;
1735
1736 extern tree ptr_type_node;
1737 extern tree class_type_node, record_type_node, union_type_node, enum_type_node;
1738 extern tree unknown_type_node;
1739 extern tree opaque_type_node, signature_type_node;
1740
1741 /* Node for "pointer to (virtual) function".
1742 This may be distinct from ptr_type_node so gdb can distinguish them. */
1743 #define vfunc_ptr_type_node \
1744 (flag_vtable_thunks ? vtable_entry_type : ptr_type_node)
1745
1746 /* Array type `(void *)[]' */
1747 extern tree vtbl_type_node;
1748 extern tree delta_type_node;
1749 extern tree std_node;
1750
1751 extern tree long_long_integer_type_node, long_long_unsigned_type_node;
1752 /* For building calls to `delete'. */
1753 extern tree integer_two_node, integer_three_node;
1754 extern tree boolean_type_node, boolean_true_node, boolean_false_node;
1755
1756 extern tree null_node;
1757
1758 /* in pt.c */
1759
1760 /* These values are used for the `STRICT' parameter to type_unfication and
1761 fn_type_unification. Their meanings are described with the
1762 documentation for fn_type_unification. */
1763
1764 typedef enum unification_kind_t {
1765 DEDUCE_CALL,
1766 DEDUCE_CONV,
1767 DEDUCE_EXACT
1768 } unification_kind_t;
1769
1770 extern tree current_template_parms;
1771 extern HOST_WIDE_INT processing_template_decl;
1772 extern tree last_tree;
1773
1774 /* The template currently being instantiated, and where the instantiation
1775 was triggered. */
1776 struct tinst_level
1777 {
1778 tree decl;
1779 int line;
1780 char *file;
1781 struct tinst_level *next;
1782 };
1783
1784 extern int minimal_parse_mode;
1785
1786 /* in class.c */
1787 extern tree current_class_name;
1788 extern tree current_class_type;
1789 extern tree current_class_ptr;
1790 extern tree previous_class_type;
1791 extern tree current_class_ref;
1792 extern int current_class_depth;
1793
1794 extern tree current_lang_name;
1795 extern tree lang_name_cplusplus, lang_name_c, lang_name_java;
1796
1797 /* Points to the name of that function. May not be the DECL_NAME
1798 of CURRENT_FUNCTION_DECL due to overloading */
1799 extern tree original_function_name;
1800
1801 /* in init.c */
1802 extern tree global_base_init_list;
1803 extern tree current_base_init_list, current_member_init_list;
1804
1805 extern int current_function_just_assigned_this;
1806 extern int current_function_parms_stored;
1807 \f
1808 /* Here's where we control how name mangling takes place. */
1809
1810 #define OPERATOR_ASSIGN_FORMAT "__a%s"
1811 #define OPERATOR_FORMAT "__%s"
1812 #define OPERATOR_TYPENAME_FORMAT "__op"
1813 #define OPERATOR_TYPENAME_P(ID_NODE) \
1814 (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \
1815 && IDENTIFIER_POINTER (ID_NODE)[1] == '_' \
1816 && IDENTIFIER_POINTER (ID_NODE)[2] == 'o' \
1817 && IDENTIFIER_POINTER (ID_NODE)[3] == 'p')
1818
1819
1820 /* Cannot use '$' up front, because this confuses gdb
1821 (names beginning with '$' are gdb-local identifiers).
1822
1823 Note that all forms in which the '$' is significant are long enough
1824 for direct indexing (meaning that if we know there is a '$'
1825 at a particular location, we can index into the string at
1826 any other location that provides distinguishing characters). */
1827
1828 /* Define NO_DOLLAR_IN_LABEL in your favorite tm file if your assembler
1829 doesn't allow '$' in symbol names. */
1830 #ifndef NO_DOLLAR_IN_LABEL
1831
1832 #define JOINER '$'
1833
1834 #define VPTR_NAME "$v"
1835 #define THROW_NAME "$eh_throw"
1836 #define DESTRUCTOR_DECL_PREFIX "_$_"
1837 #define AUTO_VTABLE_NAME "__vtbl$me__"
1838 #define AUTO_TEMP_NAME "_$tmp_"
1839 #define AUTO_TEMP_FORMAT "_$tmp_%d"
1840 #define VTABLE_BASE "$vb"
1841 #define VTABLE_NAME_FORMAT (flag_vtable_thunks ? "__vt_%s" : "_vt$%s")
1842 #define VFIELD_BASE "$vf"
1843 #define VFIELD_NAME "_vptr$"
1844 #define VFIELD_NAME_FORMAT "_vptr$%s"
1845 #define VBASE_NAME "_vb$"
1846 #define VBASE_NAME_FORMAT "_vb$%s"
1847 #define STATIC_NAME_FORMAT "_%s$%s"
1848 #define ANON_AGGRNAME_FORMAT "$_%d"
1849
1850 #else /* NO_DOLLAR_IN_LABEL */
1851
1852 #ifndef NO_DOT_IN_LABEL
1853
1854 #define JOINER '.'
1855
1856 #define VPTR_NAME ".v"
1857 #define THROW_NAME ".eh_throw"
1858 #define DESTRUCTOR_DECL_PREFIX "_._"
1859 #define AUTO_VTABLE_NAME "__vtbl.me__"
1860 #define AUTO_TEMP_NAME "_.tmp_"
1861 #define AUTO_TEMP_FORMAT "_.tmp_%d"
1862 #define VTABLE_BASE ".vb"
1863 #define VTABLE_NAME_FORMAT (flag_vtable_thunks ? "__vt_%s" : "_vt.%s")
1864 #define VFIELD_BASE ".vf"
1865 #define VFIELD_NAME "_vptr."
1866 #define VFIELD_NAME_FORMAT "_vptr.%s"
1867 #define VBASE_NAME "_vb."
1868 #define VBASE_NAME_FORMAT "_vb.%s"
1869 #define STATIC_NAME_FORMAT "_%s.%s"
1870
1871 #define ANON_AGGRNAME_FORMAT "._%d"
1872
1873 #else /* NO_DOT_IN_LABEL */
1874
1875 #define VPTR_NAME "__vptr"
1876 #define VPTR_NAME_P(ID_NODE) \
1877 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VPTR_NAME, sizeof (VPTR_NAME) - 1))
1878 #define THROW_NAME "__eh_throw"
1879 #define DESTRUCTOR_DECL_PREFIX "__destr_"
1880 #define DESTRUCTOR_NAME_P(ID_NODE) \
1881 (!strncmp (IDENTIFIER_POINTER (ID_NODE), DESTRUCTOR_DECL_PREFIX, \
1882 sizeof (DESTRUCTOR_DECL_PREFIX) - 1))
1883 #define IN_CHARGE_NAME "__in_chrg"
1884 #define AUTO_VTABLE_NAME "__vtbl_me__"
1885 #define AUTO_TEMP_NAME "__tmp_"
1886 #define TEMP_NAME_P(ID_NODE) \
1887 (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, \
1888 sizeof (AUTO_TEMP_NAME) - 1))
1889 #define AUTO_TEMP_FORMAT "__tmp_%d"
1890 #define VTABLE_BASE "__vtb"
1891 #define VTABLE_NAME "__vt_"
1892 #define VTABLE_NAME_FORMAT (flag_vtable_thunks ? "__vt_%s" : "_vt_%s")
1893 #define VTABLE_NAME_P(ID_NODE) \
1894 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VTABLE_NAME, \
1895 sizeof (VTABLE_NAME) - 1))
1896 #define VFIELD_BASE "__vfb"
1897 #define VFIELD_NAME "__vptr_"
1898 #define VFIELD_NAME_P(ID_NODE) \
1899 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, \
1900 sizeof (VFIELD_NAME) - 1))
1901 #define VFIELD_NAME_FORMAT "_vptr_%s"
1902 #define VBASE_NAME "__vb_"
1903 #define VBASE_NAME_P(ID_NODE) \
1904 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VBASE_NAME, \
1905 sizeof (VBASE_NAME) - 1))
1906 #define VBASE_NAME_FORMAT "__vb_%s"
1907 #define STATIC_NAME_FORMAT "__static_%s_%s"
1908
1909 #define ANON_AGGRNAME_PREFIX "__anon_"
1910 #define ANON_AGGRNAME_P(ID_NODE) \
1911 (!strncmp (IDENTIFIER_POINTER (ID_NODE), ANON_AGGRNAME_PREFIX, \
1912 sizeof (ANON_AGGRNAME_PREFIX) - 1))
1913 #define ANON_AGGRNAME_FORMAT "__anon_%d"
1914 #define ANON_PARMNAME_FORMAT "__%d"
1915 #define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \
1916 && IDENTIFIER_POINTER (ID_NODE)[1] == '_' \
1917 && IDENTIFIER_POINTER (ID_NODE)[2] <= '9')
1918
1919 #endif /* NO_DOT_IN_LABEL */
1920 #endif /* NO_DOLLAR_IN_LABEL */
1921
1922 #define THIS_NAME "this"
1923 #define DESTRUCTOR_NAME_FORMAT "~%s"
1924 #define FILE_FUNCTION_PREFIX_LEN 9
1925 #define CTOR_NAME "__ct"
1926 #define DTOR_NAME "__dt"
1927
1928 #define IN_CHARGE_NAME "__in_chrg"
1929
1930 #define VTBL_PTR_TYPE "__vtbl_ptr_type"
1931 #define VTABLE_DELTA_NAME "__delta"
1932 #define VTABLE_INDEX_NAME "__index"
1933 #define VTABLE_PFN_NAME "__pfn"
1934 #define VTABLE_DELTA2_NAME "__delta2"
1935
1936 #define SIGNATURE_FIELD_NAME "__s_"
1937 #define SIGNATURE_FIELD_NAME_FORMAT "__s_%s"
1938 #define SIGNATURE_OPTR_NAME "__optr"
1939 #define SIGNATURE_SPTR_NAME "__sptr"
1940 #define SIGNATURE_POINTER_NAME "__sp_"
1941 #define SIGNATURE_POINTER_NAME_FORMAT "__%s%ssp_%s"
1942 #define SIGNATURE_REFERENCE_NAME "__sr_"
1943 #define SIGNATURE_REFERENCE_NAME_FORMAT "__%s%ssr_%s"
1944
1945 #define SIGTABLE_PTR_TYPE "__sigtbl_ptr_type"
1946 #define SIGTABLE_NAME_FORMAT "__st_%s_%s"
1947 #define SIGTABLE_NAME_FORMAT_LONG "__st_%s_%s_%d"
1948 #define SIGTABLE_TAG_NAME "__tag"
1949 #define SIGTABLE_VB_OFF_NAME "__vb_off"
1950 #define SIGTABLE_VT_OFF_NAME "__vt_off"
1951 #define EXCEPTION_CLEANUP_NAME "exception cleanup"
1952
1953 #define THIS_NAME_P(ID_NODE) (strcmp(IDENTIFIER_POINTER (ID_NODE), "this") == 0)
1954
1955 #if !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL)
1956
1957 #define VPTR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
1958 && IDENTIFIER_POINTER (ID_NODE)[1] == 'v')
1959 #define DESTRUCTOR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == JOINER \
1960 && IDENTIFIER_POINTER (ID_NODE)[2] == '_')
1961
1962 #define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \
1963 && IDENTIFIER_POINTER (ID_NODE)[2] == 't' \
1964 && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER)
1965
1966 #define VBASE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \
1967 && IDENTIFIER_POINTER (ID_NODE)[2] == 'b' \
1968 && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER)
1969
1970 #define TEMP_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, sizeof (AUTO_TEMP_NAME)-1))
1971 #define VFIELD_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, sizeof(VFIELD_NAME)-1))
1972
1973 /* For anonymous aggregate types, we need some sort of name to
1974 hold on to. In practice, this should not appear, but it should
1975 not be harmful if it does. */
1976 #define ANON_AGGRNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
1977 && IDENTIFIER_POINTER (ID_NODE)[1] == '_')
1978 #define ANON_PARMNAME_FORMAT "_%d"
1979 #define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \
1980 && IDENTIFIER_POINTER (ID_NODE)[1] <= '9')
1981 #endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */
1982
1983 /* Returns non-zero iff ID_NODE is an IDENTIFIER_NODE whose name is
1984 `main'. */
1985 #define MAIN_NAME_P(ID_NODE) \
1986 (strcmp (IDENTIFIER_POINTER (ID_NODE), "main") == 0)
1987
1988 /* Returns non-zero iff NODE is a declaration for the global function
1989 `main'. */
1990 #define DECL_MAIN_P(NODE) \
1991 (TREE_CODE (NODE) == FUNCTION_DECL \
1992 && (DECL_CONTEXT (NODE) == global_namespace \
1993 || DECL_CONTEXT (NODE) == NULL_TREE) \
1994 && DECL_NAME (NODE) != NULL_TREE \
1995 && MAIN_NAME_P (DECL_NAME (NODE)))
1996
1997 \f
1998 /* Define the sets of attributes that member functions and baseclasses
1999 can have. These are sensible combinations of {public,private,protected}
2000 cross {virtual,non-virtual}. */
2001
2002 /* in class.c. */
2003 extern tree access_default_node; /* 0 */
2004 extern tree access_public_node; /* 1 */
2005 extern tree access_protected_node; /* 2 */
2006 extern tree access_private_node; /* 3 */
2007 extern tree access_default_virtual_node; /* 4 */
2008 extern tree access_public_virtual_node; /* 5 */
2009 extern tree access_protected_virtual_node; /* 6 */
2010 extern tree access_private_virtual_node; /* 7 */
2011
2012 /* Things for handling inline functions. */
2013
2014 struct pending_inline
2015 {
2016 struct pending_inline *next; /* pointer to next in chain */
2017 int lineno; /* line number we got the text from */
2018 char *filename; /* name of file we were processing */
2019 tree fndecl; /* FUNCTION_DECL that brought us here */
2020 int token; /* token we were scanning */
2021 int token_value; /* value of token we were scanning (YYSTYPE) */
2022
2023 char *buf; /* pointer to character stream */
2024 int len; /* length of stream */
2025 unsigned int can_free : 1; /* free this after we're done with it? */
2026 unsigned int deja_vu : 1; /* set iff we don't want to see it again. */
2027 unsigned int interface : 2; /* 0=interface 1=unknown 2=implementation */
2028 };
2029
2030 /* in method.c */
2031 extern struct pending_inline *pending_inlines;
2032
2033 /* 1 for -fall-virtual: make every member function (except
2034 constructors) lay down in the virtual function table.
2035 Calls can then either go through the virtual function table or not,
2036 depending on whether we know what function will actually be called. */
2037
2038 extern int flag_all_virtual;
2039
2040 /* Positive values means that we cannot make optimizing assumptions about
2041 `this'. Negative values means we know `this' to be of static type. */
2042
2043 extern int flag_this_is_variable;
2044
2045 /* Controls whether enums and ints freely convert.
2046 1 means with complete freedom.
2047 0 means enums can convert to ints, but not vice-versa. */
2048
2049 extern int flag_int_enum_equivalence;
2050
2051 /* Nonzero means generate 'rtti' that give run-time type information. */
2052
2053 extern int flag_rtti;
2054
2055 /* Nonzero means do emit exported implementations of functions even if
2056 they can be inlined. */
2057
2058 extern int flag_implement_inlines;
2059
2060 /* Nonzero means templates obey #pragma interface and implementation. */
2061
2062 extern int flag_external_templates;
2063
2064 /* Nonzero means templates are emitted where they are instantiated. */
2065
2066 extern int flag_alt_external_templates;
2067
2068 /* Nonzero means implicit template instantiations are emitted. */
2069
2070 extern int flag_implicit_templates;
2071
2072 /* Nonzero if we want to emit defined symbols with common-like linkage as
2073 weak symbols where possible, in order to conform to C++ semantics.
2074 Otherwise, emit them as local symbols. */
2075
2076 extern int flag_weak;
2077
2078 /* Nonzero to enable experimental ABI changes. */
2079
2080 extern int flag_new_abi;
2081
2082 /* Nonzero to not ignore namespace std. */
2083
2084 extern int flag_honor_std;
2085
2086 /* Nonzero if we're done parsing and into end-of-file activities. */
2087
2088 extern int at_eof;
2089
2090 enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
2091
2092 /* The following two can be derived from the previous one */
2093 extern tree current_class_name; /* IDENTIFIER_NODE: name of current class */
2094 extern tree current_class_type; /* _TYPE: the type of the current class */
2095
2096 /* Some macros for char-based bitfields. */
2097 #define B_SET(a,x) (a[x>>3] |= (1 << (x&7)))
2098 #define B_CLR(a,x) (a[x>>3] &= ~(1 << (x&7)))
2099 #define B_TST(a,x) (a[x>>3] & (1 << (x&7)))
2100
2101 /* These are uses as bits in flags passed to build_method_call
2102 to control its error reporting behavior.
2103
2104 LOOKUP_PROTECT means flag access violations.
2105 LOOKUP_COMPLAIN mean complain if no suitable member function
2106 matching the arguments is found.
2107 LOOKUP_NORMAL is just a combination of these two.
2108 LOOKUP_NONVIRTUAL means make a direct call to the member function found
2109 LOOKUP_GLOBAL means search through the space of overloaded functions,
2110 as well as the space of member functions.
2111 LOOKUP_HAS_IN_CHARGE means that the "in charge" variable is already
2112 in the parameter list.
2113 LOOKUP_ONLYCONVERTING means that non-conversion constructors are not tried.
2114 DIRECT_BIND means that if a temporary is created, it should be created so
2115 that it lives as long as the current variable bindings; otherwise it
2116 only lives until the end of the complete-expression.
2117 LOOKUP_SPECULATIVELY means return NULL_TREE if we cannot find what we are
2118 after. Note, LOOKUP_COMPLAIN is checked and error messages printed
2119 before LOOKUP_SPECULATIVELY is checked.
2120 LOOKUP_NO_CONVERSION means that user-defined conversions are not
2121 permitted. Built-in conversions are permitted.
2122 LOOKUP_DESTRUCTOR means explicit call to destructor.
2123 LOOKUP_NO_TEMP_BIND means temporaries will not be bound to references. */
2124
2125 #define LOOKUP_PROTECT (1)
2126 #define LOOKUP_COMPLAIN (2)
2127 #define LOOKUP_NORMAL (3)
2128 /* #define LOOKUP_UNUSED (4) */
2129 #define LOOKUP_NONVIRTUAL (8)
2130 #define LOOKUP_GLOBAL (16)
2131 #define LOOKUP_HAS_IN_CHARGE (32)
2132 #define LOOKUP_SPECULATIVELY (64)
2133 #define LOOKUP_ONLYCONVERTING (128)
2134 #define DIRECT_BIND (256)
2135 #define LOOKUP_NO_CONVERSION (512)
2136 #define LOOKUP_DESTRUCTOR (512)
2137 #define LOOKUP_NO_TEMP_BIND (1024)
2138
2139 /* These flags are used by the conversion code.
2140 CONV_IMPLICIT : Perform implicit conversions (standard and user-defined).
2141 CONV_STATIC : Perform the explicit conversions for static_cast.
2142 CONV_CONST : Perform the explicit conversions for const_cast.
2143 CONV_REINTERPRET: Perform the explicit conversions for reinterpret_cast.
2144 CONV_PRIVATE : Perform upcasts to private bases.
2145 CONV_FORCE_TEMP : Require a new temporary when converting to the same
2146 aggregate type. */
2147
2148 #define CONV_IMPLICIT 1
2149 #define CONV_STATIC 2
2150 #define CONV_CONST 4
2151 #define CONV_REINTERPRET 8
2152 #define CONV_PRIVATE 16
2153 /* #define CONV_NONCONVERTING 32 */
2154 #define CONV_FORCE_TEMP 64
2155 #define CONV_STATIC_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_FORCE_TEMP)
2156 #define CONV_OLD_CONVERT (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \
2157 | CONV_REINTERPRET)
2158 #define CONV_C_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \
2159 | CONV_REINTERPRET | CONV_PRIVATE | CONV_FORCE_TEMP)
2160
2161 /* Used by build_expr_type_conversion to indicate which types are
2162 acceptable as arguments to the expression under consideration. */
2163
2164 #define WANT_INT 1 /* integer types, including bool */
2165 #define WANT_FLOAT 2 /* floating point types */
2166 #define WANT_ENUM 4 /* enumerated types */
2167 #define WANT_POINTER 8 /* pointer types */
2168 #define WANT_NULL 16 /* null pointer constant */
2169
2170 #define WANT_ARITH (WANT_INT | WANT_FLOAT)
2171
2172 #define FRIEND_NAME(LIST) (TREE_PURPOSE (LIST))
2173 #define FRIEND_DECLS(LIST) (TREE_VALUE (LIST))
2174
2175 /* These macros are used to access a TEMPLATE_PARM_INDEX. */
2176 #define TEMPLATE_PARM_IDX(NODE) (((template_parm_index*) NODE)->index)
2177 #define TEMPLATE_PARM_LEVEL(NODE) (((template_parm_index*) NODE)->level)
2178 #define TEMPLATE_PARM_DESCENDANTS(NODE) (TREE_CHAIN (NODE))
2179 #define TEMPLATE_PARM_ORIG_LEVEL(NODE) (((template_parm_index*) NODE)->orig_level)
2180 #define TEMPLATE_PARM_DECL(NODE) (((template_parm_index*) NODE)->decl)
2181
2182 /* These macros are for accessing the fields of TEMPLATE_TYPE_PARM
2183 and TEMPLATE_TEMPLATE_PARM nodes. */
2184 #define TEMPLATE_TYPE_PARM_INDEX(NODE) (TYPE_FIELDS (NODE))
2185 #define TEMPLATE_TYPE_IDX(NODE) \
2186 (TEMPLATE_PARM_IDX (TEMPLATE_TYPE_PARM_INDEX (NODE)))
2187 #define TEMPLATE_TYPE_LEVEL(NODE) \
2188 (TEMPLATE_PARM_LEVEL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
2189 #define TEMPLATE_TYPE_ORIG_LEVEL(NODE) \
2190 (TEMPLATE_PARM_ORIG_LEVEL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
2191 #define TEMPLATE_TYPE_DECL(NODE) \
2192 (TEMPLATE_PARM_DECL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
2193
2194 /* in lex.c */
2195 /* Indexed by TREE_CODE, these tables give C-looking names to
2196 operators represented by TREE_CODES. For example,
2197 opname_tab[(int) MINUS_EXPR] == "-". */
2198 extern char **opname_tab, **assignop_tab;
2199 \f
2200 /* in call.c */
2201 extern int get_arglist_len_in_bytes PROTO((tree));
2202
2203 extern tree build_vfield_ref PROTO((tree, tree));
2204 extern tree resolve_scope_to_name PROTO((tree, tree));
2205 extern tree build_scoped_method_call PROTO((tree, tree, tree, tree));
2206 extern tree build_addr_func PROTO((tree));
2207 extern tree build_call PROTO((tree, tree, tree));
2208 extern tree build_method_call PROTO((tree, tree, tree, tree, int));
2209 extern int null_ptr_cst_p PROTO((tree));
2210 extern tree type_decays_to PROTO((tree));
2211 extern tree build_user_type_conversion PROTO((tree, tree, int));
2212 extern tree build_new_function_call PROTO((tree, tree));
2213 extern tree build_new_op PROTO((enum tree_code, int, tree, tree, tree));
2214 extern tree build_op_new_call PROTO((enum tree_code, tree, tree, int));
2215 extern tree build_op_delete_call PROTO((enum tree_code, tree, tree, int));
2216 extern int can_convert PROTO((tree, tree));
2217 extern int can_convert_arg PROTO((tree, tree, tree));
2218 extern void enforce_access PROTO((tree, tree));
2219
2220 /* in class.c */
2221 extern tree build_vbase_path PROTO((enum tree_code, tree, tree, tree, int));
2222 extern tree build_vtbl_ref PROTO((tree, tree));
2223 extern tree build_vfn_ref PROTO((tree *, tree, tree));
2224 extern void add_method PROTO((tree, tree *, tree));
2225 extern int currently_open_class PROTO((tree));
2226 extern tree get_vfield_offset PROTO((tree));
2227 extern void duplicate_tag_error PROTO((tree));
2228 extern tree finish_struct PROTO((tree, tree, tree, int));
2229 extern tree finish_struct_1 PROTO((tree, int));
2230 extern tree finish_struct_methods PROTO((tree, tree, int));
2231 extern int resolves_to_fixed_type_p PROTO((tree, int *));
2232 extern void init_class_processing PROTO((void));
2233 extern int is_empty_class PROTO((tree));
2234 extern void pushclass PROTO((tree, int));
2235 extern void popclass PROTO((int));
2236 extern void push_nested_class PROTO((tree, int));
2237 extern void pop_nested_class PROTO((int));
2238 extern void push_lang_context PROTO((tree));
2239 extern void pop_lang_context PROTO((void));
2240 extern tree instantiate_type PROTO((tree, tree, int));
2241 extern void print_class_statistics PROTO((void));
2242 extern void maybe_push_cache_obstack PROTO((void));
2243 extern unsigned HOST_WIDE_INT skip_rtti_stuff PROTO((tree *));
2244 extern tree build_self_reference PROTO((void));
2245 extern void warn_hidden PROTO((tree));
2246
2247 /* in cvt.c */
2248 extern tree convert_to_reference PROTO((tree, tree, int, int, tree));
2249 extern tree convert_from_reference PROTO((tree));
2250 extern tree convert_pointer_to_real PROTO((tree, tree));
2251 extern tree convert_pointer_to PROTO((tree, tree));
2252 extern tree ocp_convert PROTO((tree, tree, int, int));
2253 extern tree cp_convert PROTO((tree, tree));
2254 extern tree convert PROTO((tree, tree));
2255 extern tree convert_force PROTO((tree, tree, int));
2256 extern tree build_type_conversion PROTO((enum tree_code, tree, tree, int));
2257 extern tree build_expr_type_conversion PROTO((int, tree, int));
2258 extern tree type_promotes_to PROTO((tree));
2259 extern tree perform_qualification_conversions PROTO((tree, tree));
2260
2261 /* decl.c */
2262 /* resume_binding_level */
2263 extern int global_bindings_p PROTO((void));
2264 extern int toplevel_bindings_p PROTO((void));
2265 extern void keep_next_level PROTO((void));
2266 extern int kept_level_p PROTO((void));
2267 extern void declare_parm_level PROTO((void));
2268 extern void declare_pseudo_global_level PROTO((void));
2269 extern int pseudo_global_level_p PROTO((void));
2270 extern void set_class_shadows PROTO((tree));
2271 extern void pushlevel PROTO((int));
2272 extern void note_level_for_for PROTO((void));
2273 extern void pushlevel_temporary PROTO((int));
2274 extern tree poplevel PROTO((int, int, int));
2275 extern void resume_level PROTO((struct binding_level *));
2276 extern void delete_block PROTO((tree));
2277 extern void insert_block PROTO((tree));
2278 extern void add_block_current_level PROTO((tree));
2279 extern void set_block PROTO((tree));
2280 extern void pushlevel_class PROTO((void));
2281 extern tree poplevel_class PROTO((int));
2282 extern void print_binding_stack PROTO((void));
2283 extern void print_binding_level PROTO((struct binding_level *));
2284 extern void push_namespace PROTO((tree));
2285 extern void pop_namespace PROTO((void));
2286 extern void maybe_push_to_top_level PROTO((int));
2287 extern void push_to_top_level PROTO((void));
2288 extern void pop_from_top_level PROTO((void));
2289 extern tree identifier_type_value PROTO((tree));
2290 extern void set_identifier_type_value PROTO((tree, tree));
2291 extern void pop_everything PROTO((void));
2292 extern void pushtag PROTO((tree, tree, int));
2293 extern tree make_anon_name PROTO((void));
2294 extern void clear_anon_tags PROTO((void));
2295 extern int decls_match PROTO((tree, tree));
2296 extern int duplicate_decls PROTO((tree, tree));
2297 extern tree pushdecl PROTO((tree));
2298 extern tree pushdecl_top_level PROTO((tree));
2299 extern tree pushdecl_class_level PROTO((tree));
2300 #if 0
2301 extern void pushdecl_nonclass_level PROTO((tree));
2302 #endif
2303 extern tree pushdecl_namespace_level PROTO((tree));
2304 extern tree push_using_decl PROTO((tree, tree));
2305 extern void push_class_level_binding PROTO((tree, tree));
2306 extern tree implicitly_declare PROTO((tree));
2307 extern tree lookup_label PROTO((tree));
2308 extern tree shadow_label PROTO((tree));
2309 extern tree define_label PROTO((char *, int, tree));
2310 extern void push_switch PROTO((void));
2311 extern void pop_switch PROTO((void));
2312 extern void define_case_label PROTO((tree));
2313 extern tree getdecls PROTO((void));
2314 extern tree gettags PROTO((void));
2315 #if 0
2316 extern void set_current_level_tags_transparency PROTO((int));
2317 #endif
2318 extern tree binding_for_name PROTO((tree, tree));
2319 extern tree namespace_binding PROTO((tree, tree));
2320 extern void set_namespace_binding PROTO((tree, tree, tree));
2321 extern tree lookup_namespace_name PROTO((tree, tree));
2322 extern tree make_typename_type PROTO((tree, tree));
2323 extern tree lookup_name_nonclass PROTO((tree));
2324 extern tree lookup_function_nonclass PROTO((tree, tree));
2325 extern tree lookup_name PROTO((tree, int));
2326 extern tree lookup_name_current_level PROTO((tree));
2327 extern int lookup_using_namespace PROTO((tree,tree,tree,tree));
2328 extern int qualified_lookup_using_namespace PROTO((tree,tree,tree));
2329 extern tree auto_function PROTO((tree, tree, enum built_in_function));
2330 extern void init_decl_processing PROTO((void));
2331 extern int init_type_desc PROTO((void));
2332 extern tree define_function
2333 PROTO((char *, tree, enum built_in_function,
2334 void (*) (tree), char *));
2335 extern void shadow_tag PROTO((tree));
2336 extern tree groktypename PROTO((tree));
2337 extern tree start_decl PROTO((tree, tree, int, tree, tree));
2338 extern void start_decl_1 PROTO((tree));
2339 extern void cp_finish_decl PROTO((tree, tree, tree, int, int));
2340 extern void finish_decl PROTO((tree, tree, tree));
2341 extern void expand_static_init PROTO((tree, tree));
2342 extern int complete_array_type PROTO((tree, tree, int));
2343 extern tree build_ptrmemfunc_type PROTO((tree));
2344 /* the grokdeclarator prototype is in decl.h */
2345 extern int parmlist_is_exprlist PROTO((tree));
2346 extern int copy_args_p PROTO((tree));
2347 extern int grok_ctor_properties PROTO((tree, tree));
2348 extern void grok_op_properties PROTO((tree, int, int));
2349 extern tree xref_tag PROTO((tree, tree, tree, int));
2350 extern tree xref_tag_from_type PROTO((tree, tree, int));
2351 extern void xref_basetypes PROTO((tree, tree, tree, tree));
2352 extern tree start_enum PROTO((tree));
2353 extern tree finish_enum PROTO((tree, tree));
2354 extern tree build_enumerator PROTO((tree, tree));
2355 extern tree grok_enum_decls PROTO((tree));
2356 extern int start_function PROTO((tree, tree, tree, int));
2357 extern void expand_start_early_try_stmts PROTO((void));
2358 extern void store_parm_decls PROTO((void));
2359 extern void store_return_init PROTO((tree, tree));
2360 extern void finish_function PROTO((int, int, int));
2361 extern tree start_method PROTO((tree, tree));
2362 extern tree finish_method PROTO((tree));
2363 extern void hack_incomplete_structures PROTO((tree));
2364 extern tree maybe_build_cleanup_and_delete PROTO((tree));
2365 extern tree maybe_build_cleanup PROTO((tree));
2366 extern void cplus_expand_expr_stmt PROTO((tree));
2367 extern void finish_stmt PROTO((void));
2368 extern int id_in_current_class PROTO((tree));
2369 extern void push_cp_function_context PROTO((tree));
2370 extern void pop_cp_function_context PROTO((tree));
2371 extern int in_function_p PROTO((void));
2372 extern void replace_defarg PROTO((tree, tree));
2373 extern void print_other_binding_stack PROTO((struct binding_level *));
2374 extern void revert_static_member_fn PROTO((tree*, tree*, tree*));
2375 extern void cat_namespace_levels PROTO((void));
2376
2377 /* in decl2.c */
2378 extern int flag_assume_nonnull_objects;
2379 extern int lang_decode_option PROTO((char *));
2380 extern tree grok_method_quals PROTO((tree, tree, tree));
2381 extern void warn_if_unknown_interface PROTO((tree));
2382 extern tree grok_x_components PROTO((tree, tree));
2383 extern void grokclassfn PROTO((tree, tree, tree, enum overload_flags, tree));
2384 extern tree grok_alignof PROTO((tree));
2385 extern tree grok_array_decl PROTO((tree, tree));
2386 extern tree delete_sanity PROTO((tree, tree, int, int));
2387 extern tree check_classfn PROTO((tree, tree));
2388 extern void check_member_template PROTO((tree));
2389 extern tree grokfield PROTO((tree, tree, tree, tree, tree));
2390 extern tree grokbitfield PROTO((tree, tree, tree));
2391 extern tree groktypefield PROTO((tree, tree));
2392 extern tree grokoptypename PROTO((tree, tree));
2393 extern int copy_assignment_arg_p PROTO((tree, int));
2394 extern void cplus_decl_attributes PROTO((tree, tree, tree));
2395 extern tree constructor_name_full PROTO((tree));
2396 extern tree constructor_name PROTO((tree));
2397 extern void setup_vtbl_ptr PROTO((void));
2398 extern void mark_inline_for_output PROTO((tree));
2399 extern void clear_temp_name PROTO((void));
2400 extern tree get_temp_name PROTO((tree, int));
2401 extern tree get_temp_regvar PROTO((tree, tree));
2402 extern void finish_anon_union PROTO((tree));
2403 extern tree finish_table PROTO((tree, tree, tree, int));
2404 extern void finish_builtin_type PROTO((tree, char *, tree *, int, tree));
2405 extern tree coerce_new_type PROTO((tree));
2406 extern tree coerce_delete_type PROTO((tree));
2407 extern void comdat_linkage PROTO((tree));
2408 extern void import_export_vtable PROTO((tree, tree, int));
2409 extern int finish_prevtable_vardecl PROTO((tree, tree));
2410 extern int walk_vtables PROTO((void (*)(tree, tree),
2411 int (*)(tree, tree)));
2412 extern void walk_sigtables PROTO((void (*)(tree, tree),
2413 void (*)(tree, tree)));
2414 extern void import_export_decl PROTO((tree));
2415 extern tree build_cleanup PROTO((tree));
2416 extern void finish_file PROTO((void));
2417 extern tree reparse_absdcl_as_expr PROTO((tree, tree));
2418 extern tree reparse_absdcl_as_casts PROTO((tree, tree));
2419 extern tree build_expr_from_tree PROTO((tree));
2420 extern tree reparse_decl_as_expr PROTO((tree, tree));
2421 extern tree finish_decl_parsing PROTO((tree));
2422 extern tree check_cp_case_value PROTO((tree));
2423 extern void set_decl_namespace PROTO((tree, tree));
2424 extern tree current_decl_namespace PROTO((void));
2425 extern void push_decl_namespace PROTO((tree));
2426 extern void pop_decl_namespace PROTO((void));
2427 extern void do_namespace_alias PROTO((tree, tree));
2428 extern void do_toplevel_using_decl PROTO((tree));
2429 extern tree do_class_using_decl PROTO((tree));
2430 extern void do_using_directive PROTO((tree));
2431 extern void check_default_args PROTO((tree));
2432 extern void mark_used PROTO((tree));
2433 extern tree handle_class_head PROTO((tree, tree, tree));
2434 extern tree lookup_arg_dependent PROTO((tree, tree, tree));
2435
2436 /* in errfn.c */
2437 extern void cp_error ();
2438 extern void cp_error_at ();
2439 extern void cp_warning ();
2440 extern void cp_warning_at ();
2441 extern void cp_pedwarn ();
2442 extern void cp_pedwarn_at ();
2443 extern void cp_compiler_error ();
2444 extern void cp_sprintf ();
2445
2446 /* in error.c */
2447 extern void init_error PROTO((void));
2448 extern char *fndecl_as_string PROTO((tree, int));
2449 extern char *type_as_string PROTO((tree, int));
2450 extern char *type_as_string_real PROTO((tree, int, int));
2451 extern char *args_as_string PROTO((tree, int));
2452 extern char *decl_as_string PROTO((tree, int));
2453 extern char *expr_as_string PROTO((tree, int));
2454 extern char *code_as_string PROTO((enum tree_code, int));
2455 extern char *language_as_string PROTO((enum languages, int));
2456 extern char *parm_as_string PROTO((int, int));
2457 extern char *op_as_string PROTO((enum tree_code, int));
2458 extern char *assop_as_string PROTO((enum tree_code, int));
2459 extern char *cv_as_string PROTO((tree, int));
2460 extern char *lang_decl_name PROTO((tree, int));
2461 extern char *cp_file_of PROTO((tree));
2462 extern int cp_line_of PROTO((tree));
2463
2464 /* in except.c */
2465 extern void init_exception_processing PROTO((void));
2466 extern void expand_start_catch_block PROTO((tree, tree));
2467 extern void expand_end_catch_block PROTO((void));
2468 extern void expand_builtin_throw PROTO((void));
2469 extern void expand_start_eh_spec PROTO((void));
2470 extern void expand_exception_blocks PROTO((void));
2471 extern tree start_anon_func PROTO((void));
2472 extern void end_anon_func PROTO((void));
2473 extern void expand_throw PROTO((tree));
2474 extern tree build_throw PROTO((tree));
2475
2476 /* in expr.c */
2477 extern void init_cplus_expand PROTO((void));
2478 extern void fixup_result_decl PROTO((tree, struct rtx_def *));
2479 extern int extract_init PROTO((tree, tree));
2480 extern void do_case PROTO((tree, tree));
2481
2482 /* friend.c */
2483 extern int is_friend PROTO((tree, tree));
2484 extern void make_friend_class PROTO((tree, tree));
2485 extern tree do_friend PROTO((tree, tree, tree, tree, enum overload_flags, tree, int));
2486
2487 /* in init.c */
2488 extern void init_init_processing PROTO((void));
2489 extern void expand_direct_vtbls_init PROTO((tree, tree, int, int, tree));
2490 extern void emit_base_init PROTO((tree, int));
2491 extern void check_base_init PROTO((tree));
2492 extern void do_member_init PROTO((tree, tree, tree));
2493 extern void expand_member_init PROTO((tree, tree, tree));
2494 extern void expand_aggr_init PROTO((tree, tree, int, int));
2495 extern int is_aggr_typedef PROTO((tree, int));
2496 extern int is_aggr_type PROTO((tree, int));
2497 extern tree get_aggr_from_typedef PROTO((tree, int));
2498 extern tree get_type_value PROTO((tree));
2499 extern tree build_member_call PROTO((tree, tree, tree));
2500 extern tree build_offset_ref PROTO((tree, tree));
2501 extern tree resolve_offset_ref PROTO((tree));
2502 extern tree decl_constant_value PROTO((tree));
2503 extern tree build_new PROTO((tree, tree, tree, int));
2504 extern tree build_new_1 PROTO((tree));
2505 extern tree expand_vec_init PROTO((tree, tree, tree, tree, int));
2506 extern tree build_x_delete PROTO((tree, tree, int, tree));
2507 extern tree build_delete PROTO((tree, tree, tree, int, int));
2508 extern tree build_vbase_delete PROTO((tree, tree));
2509 extern tree build_vec_delete PROTO((tree, tree, tree, tree, int));
2510
2511 /* in input.c */
2512
2513 /* in lex.c */
2514 extern tree make_pointer_declarator PROTO((tree, tree));
2515 extern tree make_reference_declarator PROTO((tree, tree));
2516 extern tree make_call_declarator PROTO((tree, tree, tree, tree));
2517 extern void set_quals_and_spec PROTO((tree, tree, tree));
2518 extern char *operator_name_string PROTO((tree));
2519 extern void lang_init PROTO((void));
2520 extern void lang_finish PROTO((void));
2521 extern void init_filename_times PROTO((void));
2522 #if 0
2523 extern void reinit_lang_specific PROTO((void));
2524 #endif
2525 extern void reinit_parse_for_function PROTO((void));
2526 extern void print_parse_statistics PROTO((void));
2527 extern void extract_interface_info PROTO((void));
2528 extern void do_pending_inlines PROTO((void));
2529 extern void process_next_inline PROTO((tree));
2530 extern struct pending_input *save_pending_input PROTO((void));
2531 extern void restore_pending_input PROTO((struct pending_input *));
2532 extern void yyungetc PROTO((int, int));
2533 extern void reinit_parse_for_method PROTO((int, tree));
2534 extern void reinit_parse_for_block PROTO((int, struct obstack *));
2535 extern tree cons_up_default_function PROTO((tree, tree, int));
2536 extern void check_for_missing_semicolon PROTO((tree));
2537 extern void note_got_semicolon PROTO((tree));
2538 extern void note_list_got_semicolon PROTO((tree));
2539 extern void do_pending_lang_change PROTO((void));
2540 extern int identifier_type PROTO((tree));
2541 extern void see_typename PROTO((void));
2542 extern tree do_identifier PROTO((tree, int));
2543 extern tree do_scoped_id PROTO((tree, int));
2544 extern tree identifier_typedecl_value PROTO((tree));
2545 extern int real_yylex PROTO((void));
2546 extern int is_rid PROTO((tree));
2547 extern tree build_lang_decl PROTO((enum tree_code, tree, tree));
2548 extern tree build_lang_field_decl PROTO((enum tree_code, tree, tree));
2549 extern void copy_lang_decl PROTO((tree));
2550 extern tree make_lang_type PROTO((enum tree_code));
2551 extern void dump_time_statistics PROTO((void));
2552 /* extern void compiler_error PROTO((char *, HOST_WIDE_INT, HOST_WIDE_INT)); */
2553 extern void yyerror PROTO((char *));
2554 extern void clear_inline_text_obstack PROTO((void));
2555 extern void maybe_snarf_defarg PROTO((void));
2556 extern tree snarf_defarg PROTO((void));
2557 extern void add_defarg_fn PROTO((tree));
2558 extern void do_pending_defargs PROTO((void));
2559 extern int identifier_type PROTO((tree));
2560 extern void yyhook PROTO((int));
2561
2562 /* in method.c */
2563 extern void init_method PROTO((void));
2564 extern void do_inline_function_hair PROTO((tree, tree));
2565 extern char *build_overload_name PROTO((tree, int, int));
2566 extern tree build_static_name PROTO((tree, tree));
2567 extern tree build_decl_overload PROTO((tree, tree, int));
2568 extern tree build_template_decl_overload PROTO((tree, tree, tree, tree, tree, int));
2569 extern tree build_typename_overload PROTO((tree));
2570 extern tree build_overload_with_type PROTO((tree, tree));
2571 extern tree build_opfncall PROTO((enum tree_code, int, tree, tree, tree));
2572 extern tree hack_identifier PROTO((tree, tree));
2573 extern tree make_thunk PROTO((tree, int));
2574 extern void emit_thunk PROTO((tree));
2575 extern void synthesize_method PROTO((tree));
2576 extern tree get_id_2 PROTO((char *, tree));
2577
2578 /* in pt.c */
2579 extern tree innermost_args PROTO ((tree, int));
2580 extern tree tsubst PROTO ((tree, tree, tree));
2581 extern tree tsubst_expr PROTO ((tree, tree, tree));
2582 extern tree tsubst_copy PROTO ((tree, tree, tree));
2583 extern tree tsubst_chain PROTO((tree, tree));
2584 extern void maybe_begin_member_template_processing PROTO((tree));
2585 extern void maybe_end_member_template_processing PROTO((tree));
2586 extern tree finish_member_template_decl PROTO((tree, tree));
2587 extern void begin_template_parm_list PROTO((void));
2588 extern void begin_specialization PROTO((void));
2589 extern void reset_specialization PROTO((void));
2590 extern void end_specialization PROTO((void));
2591 extern void begin_explicit_instantiation PROTO((void));
2592 extern void end_explicit_instantiation PROTO((void));
2593 extern tree determine_specialization PROTO((tree, tree, tree *, int, int));
2594 extern tree check_explicit_specialization PROTO((tree, tree, int, int));
2595 extern tree process_template_parm PROTO((tree, tree));
2596 extern tree end_template_parm_list PROTO((tree));
2597 extern void end_template_decl PROTO((void));
2598 extern tree current_template_args PROTO((void));
2599 extern tree push_template_decl PROTO((tree));
2600 extern tree push_template_decl_real PROTO((tree, int));
2601 extern void redeclare_class_template PROTO((tree, tree));
2602 extern tree lookup_template_class PROTO((tree, tree, tree, tree));
2603 extern tree lookup_template_function PROTO((tree, tree));
2604 extern int uses_template_parms PROTO((tree));
2605 extern tree instantiate_class_template PROTO((tree));
2606 extern tree instantiate_template PROTO((tree, tree));
2607 extern void overload_template_name PROTO((tree));
2608 extern int fn_type_unification PROTO((tree, tree, tree, tree, tree, unification_kind_t, tree));
2609 extern int type_unification PROTO((tree, tree, tree, tree, tree, unification_kind_t, int));
2610 struct tinst_level *tinst_for_decl PROTO((void));
2611 extern void mark_decl_instantiated PROTO((tree, int));
2612 extern int more_specialized PROTO((tree, tree, tree));
2613 extern void mark_class_instantiated PROTO((tree, int));
2614 extern void do_decl_instantiation PROTO((tree, tree, tree));
2615 extern void do_type_instantiation PROTO((tree, tree));
2616 extern tree instantiate_decl PROTO((tree));
2617 extern tree lookup_nested_type_by_name PROTO((tree, tree));
2618 extern tree do_poplevel PROTO((void));
2619 extern tree get_bindings PROTO((tree, tree, tree));
2620 /* CONT ... */
2621 extern void add_tree PROTO((tree));
2622 extern void begin_tree PROTO((void));
2623 extern void end_tree PROTO((void));
2624 extern void add_maybe_template PROTO((tree, tree));
2625 extern void pop_tinst_level PROTO((void));
2626 extern tree most_specialized PROTO((tree, tree, tree));
2627 extern tree most_specialized_class PROTO((tree, tree, tree));
2628 extern int more_specialized_class PROTO((tree, tree));
2629 extern void do_pushlevel PROTO((void));
2630 extern int is_member_template PROTO((tree));
2631 extern int comp_template_parms PROTO((tree, tree));
2632 extern int template_class_depth PROTO((tree));
2633 extern int is_specialization_of PROTO((tree, tree));
2634 extern int comp_template_args PROTO((tree, tree));
2635
2636 extern int processing_specialization;
2637 extern int processing_explicit_instantiation;
2638
2639 /* in repo.c */
2640 extern void repo_template_used PROTO((tree));
2641 extern void repo_template_instantiated PROTO((tree, int));
2642 extern void init_repo PROTO((char*));
2643 extern void finish_repo PROTO((void));
2644
2645 /* in rtti.c */
2646 extern void init_rtti_processing PROTO((void));
2647 extern tree get_tinfo_fn_dynamic PROTO((tree));
2648 extern tree build_typeid PROTO((tree));
2649 extern tree build_x_typeid PROTO((tree));
2650 extern tree get_tinfo_fn PROTO((tree));
2651 extern tree get_typeid PROTO((tree));
2652 extern tree build_dynamic_cast PROTO((tree, tree));
2653 extern void synthesize_tinfo_fn PROTO((tree));
2654
2655 /* in search.c */
2656 extern int types_overlap_p PROTO((tree, tree));
2657 extern void push_memoized_context PROTO((tree, int));
2658 extern void pop_memoized_context PROTO((int));
2659 extern tree get_vbase PROTO((tree, tree));
2660 extern tree get_binfo PROTO((tree, tree, int));
2661 extern int get_base_distance PROTO((tree, tree, int, tree *));
2662 extern tree compute_access PROTO((tree, tree));
2663 extern tree lookup_field PROTO((tree, tree, int, int));
2664 extern tree lookup_nested_field PROTO((tree, int));
2665 extern tree lookup_fnfields PROTO((tree, tree, int));
2666 extern tree lookup_nested_tag PROTO((tree, tree));
2667 extern tree get_matching_virtual PROTO((tree, tree, int));
2668 extern tree get_abstract_virtuals PROTO((tree));
2669 extern tree get_baselinks PROTO((tree, tree, tree));
2670 extern tree next_baselink PROTO((tree));
2671 extern tree init_vbase_pointers PROTO((tree, tree));
2672 extern void expand_indirect_vtbls_init PROTO((tree, tree, tree));
2673 extern void clear_search_slots PROTO((tree));
2674 extern tree get_vbase_types PROTO((tree));
2675 extern void build_mi_matrix PROTO((tree));
2676 extern void free_mi_matrix PROTO((void));
2677 extern void build_mi_virtuals PROTO((int, int));
2678 extern void add_mi_virtuals PROTO((int, tree));
2679 extern void report_ambiguous_mi_virtuals PROTO((int, tree));
2680 extern void note_debug_info_needed PROTO((tree));
2681 extern void push_class_decls PROTO((tree));
2682 extern void pop_class_decls PROTO((void));
2683 extern void unuse_fields PROTO((tree));
2684 extern void unmark_finished_struct PROTO((tree));
2685 extern void print_search_statistics PROTO((void));
2686 extern void init_search_processing PROTO((void));
2687 extern void reinit_search_statistics PROTO((void));
2688 extern tree current_scope PROTO((void));
2689 extern tree lookup_conversions PROTO((tree));
2690 extern tree get_template_base PROTO((tree, tree));
2691
2692 /* in semantics.c */
2693 extern void finish_expr_stmt PROTO((tree));
2694 extern tree begin_if_stmt PROTO((void));
2695 extern void finish_if_stmt_cond PROTO((tree, tree));
2696 extern tree finish_then_clause PROTO((tree));
2697 extern void begin_else_clause PROTO((void));
2698 extern void finish_else_clause PROTO((tree));
2699 extern void finish_if_stmt PROTO((void));
2700 extern tree begin_while_stmt PROTO((void));
2701 extern void finish_while_stmt_cond PROTO((tree, tree));
2702 extern void finish_while_stmt PROTO((tree));
2703 extern tree begin_do_stmt PROTO((void));
2704 extern void finish_do_body PROTO((tree));
2705 extern void finish_do_stmt PROTO((tree, tree));
2706 extern void finish_return_stmt PROTO((tree));
2707 extern tree begin_for_stmt PROTO((void));
2708 extern void finish_for_init_stmt PROTO((tree));
2709 extern void finish_for_cond PROTO((tree, tree));
2710 extern void finish_for_expr PROTO((tree, tree));
2711 extern void finish_for_stmt PROTO((tree, tree));
2712 extern void finish_break_stmt PROTO((void));
2713 extern void finish_continue_stmt PROTO((void));
2714 extern void begin_switch_stmt PROTO((void));
2715 extern tree finish_switch_cond PROTO((tree));
2716 extern void finish_switch_stmt PROTO((tree, tree));
2717 extern void finish_case_label PROTO((tree, tree));
2718 extern void finish_goto_stmt PROTO((tree));
2719 extern tree begin_try_block PROTO((void));
2720 extern void finish_try_block PROTO((tree));
2721 extern void finish_handler_sequence PROTO((tree));
2722 extern tree begin_handler PROTO((void));
2723 extern void finish_handler_parms PROTO((tree));
2724 extern void finish_handler PROTO((tree));
2725 extern tree begin_compound_stmt PROTO((int));
2726 extern tree finish_compound_stmt PROTO((int, tree));
2727 extern void finish_asm_stmt PROTO((tree, tree, tree, tree, tree));
2728 extern tree finish_parenthesized_expr PROTO((tree));
2729 extern tree begin_stmt_expr PROTO((void));
2730 extern tree finish_stmt_expr PROTO((tree, tree));
2731 extern tree finish_call_expr PROTO((tree, tree));
2732 extern tree finish_increment_expr PROTO((tree, enum tree_code));
2733 extern tree finish_this_expr PROTO((void));
2734 extern tree finish_object_call_expr PROTO((tree, tree, tree));
2735 extern tree finish_qualified_object_call_expr PROTO((tree, tree, tree));
2736 extern tree finish_pseudo_destructor_call_expr PROTO((tree, tree, tree));
2737 extern tree finish_globally_qualified_member_call_expr PROTO ((tree, tree));
2738 extern tree finish_label_address_expr PROTO((tree));
2739 extern tree finish_unary_op_expr PROTO((enum tree_code, tree));
2740 extern tree finish_id_expr PROTO((tree));
2741 extern int begin_new_placement PROTO((void));
2742 extern tree finish_new_placement PROTO((tree, int));
2743 extern int begin_function_definition PROTO((tree, tree));
2744 extern tree begin_constructor_declarator PROTO((tree, tree));
2745 extern tree finish_declarator PROTO((tree, tree, tree, tree, int));
2746 extern void finish_translation_unit PROTO((void));
2747 extern tree finish_template_type_parm PROTO((tree, tree));
2748 extern tree finish_template_template_parm PROTO((tree, tree));
2749 extern tree finish_parmlist PROTO((tree, int));
2750 extern tree begin_class_definition PROTO((tree));
2751 extern tree finish_class_definition PROTO((tree, tree, tree, int));
2752 extern void finish_default_args PROTO((void));
2753 extern void begin_inline_definitions PROTO((void));
2754 extern tree finish_member_class_template PROTO((tree, tree));
2755
2756 /* in sig.c */
2757 extern tree build_signature_pointer_type PROTO((tree, int, int));
2758 extern tree build_signature_reference_type PROTO((tree, int, int));
2759 extern tree build_signature_pointer_constructor PROTO((tree, tree));
2760 extern tree build_signature_method_call PROTO((tree, tree));
2761 extern tree build_optr_ref PROTO((tree));
2762 extern void append_signature_fields PROTO((tree));
2763
2764 /* in spew.c */
2765 extern void init_spew PROTO((void));
2766 extern int peekyylex PROTO((void));
2767 extern int yylex PROTO((void));
2768 extern tree arbitrate_lookup PROTO((tree, tree, tree));
2769
2770 /* in tree.c */
2771 extern int member_p PROTO((tree));
2772 extern int real_lvalue_p PROTO((tree));
2773 extern tree build_min PVPROTO((enum tree_code, tree, ...));
2774 extern tree build_min_nt PVPROTO((enum tree_code, ...));
2775 extern tree min_tree_cons PROTO((tree, tree, tree));
2776 extern int lvalue_p PROTO((tree));
2777 extern int lvalue_or_else PROTO((tree, char *));
2778 extern tree build_cplus_new PROTO((tree, tree));
2779 extern tree get_target_expr PROTO((tree));
2780 extern tree break_out_cleanups PROTO((tree));
2781 extern tree break_out_calls PROTO((tree));
2782 extern tree build_cplus_method_type PROTO((tree, tree, tree));
2783 extern tree build_cplus_staticfn_type PROTO((tree, tree, tree));
2784 extern tree build_cplus_array_type PROTO((tree, tree));
2785 extern int layout_basetypes PROTO((tree, int));
2786 extern tree build_vbase_pointer_fields PROTO((tree));
2787 extern tree build_base_fields PROTO((tree));
2788 extern tree hash_tree_cons PROTO((int, int, int, tree, tree, tree));
2789 extern tree hash_tree_chain PROTO((tree, tree));
2790 extern tree hash_chainon PROTO((tree, tree));
2791 extern tree get_decl_list PROTO((tree));
2792 extern tree make_binfo PROTO((tree, tree, tree, tree, tree));
2793 extern tree binfo_value PROTO((tree, tree));
2794 extern tree reverse_path PROTO((tree));
2795 extern int count_functions PROTO((tree));
2796 extern int is_overloaded_fn PROTO((tree));
2797 extern tree get_first_fn PROTO((tree));
2798 extern tree binding_init PROTO((struct tree_binding*));
2799 extern tree ovl_cons PROTO((tree, tree));
2800 extern tree scratch_ovl_cons PROTO((tree, tree));
2801 extern int ovl_member PROTO((tree, tree));
2802 extern tree build_overload PROTO((tree, tree));
2803 extern tree fnaddr_from_vtable_entry PROTO((tree));
2804 extern tree function_arg_chain PROTO((tree));
2805 extern int promotes_to_aggr_type PROTO((tree, enum tree_code));
2806 extern int is_aggr_type_2 PROTO((tree, tree));
2807 extern char *lang_printable_name PROTO((tree, int));
2808 extern tree build_exception_variant PROTO((tree, tree));
2809 extern tree copy_template_template_parm PROTO((tree));
2810 extern tree copy_to_permanent PROTO((tree));
2811 extern void print_lang_statistics PROTO((void));
2812 extern void __eprintf
2813 PROTO((const char *, const char *, unsigned, const char *));
2814 extern tree array_type_nelts_total PROTO((tree));
2815 extern tree array_type_nelts_top PROTO((tree));
2816 extern tree break_out_target_exprs PROTO((tree));
2817 extern tree get_type_decl PROTO((tree));
2818 extern tree vec_binfo_member PROTO((tree, tree));
2819 extern tree hack_decl_function_context PROTO((tree));
2820 extern tree lvalue_type PROTO((tree));
2821 extern tree error_type PROTO((tree));
2822 extern tree make_temp_vec PROTO((int));
2823 extern tree build_ptr_wrapper PROTO((void *));
2824 extern tree build_expr_ptr_wrapper PROTO((void *));
2825 extern tree build_int_wrapper PROTO((int));
2826 extern int varargs_function_p PROTO((tree));
2827 extern int really_overloaded_fn PROTO((tree));
2828 extern int cp_tree_equal PROTO((tree, tree));
2829 extern int can_free PROTO((struct obstack *, tree));
2830 extern tree mapcar PROTO((tree, tree (*) (tree)));
2831 extern void debug_binfo PROTO((tree));
2832 extern void push_expression_obstack PROTO((void));
2833 #define scratchalloc expralloc
2834 #define scratch_tree_cons expr_tree_cons
2835 #define build_scratch_list build_expr_list
2836 #define make_scratch_vec make_temp_vec
2837 #define push_scratch_obstack push_expression_obstack
2838
2839 /* in typeck.c */
2840 extern tree condition_conversion PROTO((tree));
2841 extern tree target_type PROTO((tree));
2842 extern tree require_complete_type PROTO((tree));
2843 extern tree complete_type PROTO((tree));
2844 extern int type_unknown_p PROTO((tree));
2845 extern int fntype_p PROTO((tree));
2846 extern tree require_instantiated_type PROTO((tree, tree, tree));
2847 extern tree commonparms PROTO((tree, tree));
2848 extern tree original_type PROTO((tree));
2849 extern tree common_type PROTO((tree, tree));
2850 extern int compexcepttypes PROTO((tree, tree));
2851 extern int comptypes PROTO((tree, tree, int));
2852 extern int comp_target_types PROTO((tree, tree, int));
2853 extern int compparms PROTO((tree, tree, int));
2854 extern int comp_target_types PROTO((tree, tree, int));
2855 extern int comp_cv_qualification PROTO((tree, tree));
2856 extern int comp_cv_qual_signature PROTO((tree, tree));
2857 extern int self_promoting_args_p PROTO((tree));
2858 extern tree unsigned_type PROTO((tree));
2859 extern tree signed_type PROTO((tree));
2860 extern tree signed_or_unsigned_type PROTO((int, tree));
2861 extern tree expr_sizeof PROTO((tree));
2862 extern tree c_sizeof PROTO((tree));
2863 extern tree c_sizeof_nowarn PROTO((tree));
2864 extern tree c_alignof PROTO((tree));
2865 extern tree inline_conversion PROTO((tree));
2866 extern tree decay_conversion PROTO((tree));
2867 extern tree default_conversion PROTO((tree));
2868 extern tree build_object_ref PROTO((tree, tree, tree));
2869 extern tree build_component_ref_1 PROTO((tree, tree, int));
2870 extern tree build_component_ref PROTO((tree, tree, tree, int));
2871 extern tree build_x_component_ref PROTO((tree, tree, tree, int));
2872 extern tree build_x_indirect_ref PROTO((tree, char *));
2873 extern tree build_indirect_ref PROTO((tree, char *));
2874 extern tree build_array_ref PROTO((tree, tree));
2875 extern tree build_x_function_call PROTO((tree, tree, tree));
2876 extern tree get_member_function_from_ptrfunc PROTO((tree *, tree));
2877 extern tree build_function_call_real PROTO((tree, tree, int, int));
2878 extern tree build_function_call PROTO((tree, tree));
2879 extern tree build_function_call_maybe PROTO((tree, tree));
2880 extern tree convert_arguments PROTO((tree, tree, tree, tree, int));
2881 extern tree build_x_binary_op PROTO((enum tree_code, tree, tree));
2882 extern tree build_binary_op PROTO((enum tree_code, tree, tree, int));
2883 extern tree build_binary_op_nodefault PROTO((enum tree_code, tree, tree, enum tree_code));
2884 extern tree build_component_addr PROTO((tree, tree, char *));
2885 extern tree build_x_unary_op PROTO((enum tree_code, tree));
2886 extern tree build_unary_op PROTO((enum tree_code, tree, int));
2887 extern tree unary_complex_lvalue PROTO((enum tree_code, tree));
2888 extern int mark_addressable PROTO((tree));
2889 extern tree build_x_conditional_expr PROTO((tree, tree, tree));
2890 extern tree build_conditional_expr PROTO((tree, tree, tree));
2891 extern tree build_x_compound_expr PROTO((tree));
2892 extern tree build_compound_expr PROTO((tree));
2893 extern tree build_static_cast PROTO((tree, tree));
2894 extern tree build_reinterpret_cast PROTO((tree, tree));
2895 extern tree build_const_cast PROTO((tree, tree));
2896 extern tree build_c_cast PROTO((tree, tree));
2897 extern tree build_x_modify_expr PROTO((tree, enum tree_code, tree));
2898 extern tree build_modify_expr PROTO((tree, enum tree_code, tree));
2899 extern int language_lvalue_valid PROTO((tree));
2900 extern void warn_for_assignment PROTO((char *, char *, char *, tree, int, int));
2901 extern tree convert_for_initialization PROTO((tree, tree, tree, int, char *, tree, int));
2902 extern void c_expand_asm_operands PROTO((tree, tree, tree, tree, int, char *, int));
2903 extern void c_expand_return PROTO((tree));
2904 extern tree c_expand_start_case PROTO((tree));
2905 extern int comp_ptr_ttypes PROTO((tree, tree));
2906 extern int ptr_reasonably_similar PROTO((tree, tree));
2907 extern tree build_ptrmemfunc PROTO((tree, tree, int));
2908
2909 /* in typeck2.c */
2910 extern tree error_not_base_type PROTO((tree, tree));
2911 extern tree binfo_or_else PROTO((tree, tree));
2912 extern void readonly_error PROTO((tree, char *, int));
2913 extern void abstract_virtuals_error PROTO((tree, tree));
2914 extern void signature_error PROTO((tree, tree));
2915 extern void incomplete_type_error PROTO((tree, tree));
2916 extern void my_friendly_abort PROTO((int));
2917 extern void my_friendly_assert PROTO((int, int));
2918 extern tree store_init_value PROTO((tree, tree));
2919 extern tree digest_init PROTO((tree, tree, tree *));
2920 extern tree build_scoped_ref PROTO((tree, tree));
2921 extern tree build_x_arrow PROTO((tree));
2922 extern tree build_m_component_ref PROTO((tree, tree));
2923 extern tree build_functional_cast PROTO((tree, tree));
2924 extern char *enum_name_string PROTO((tree, tree));
2925 extern void report_case_error PROTO((int, tree, tree, tree));
2926 extern void check_for_new_type PROTO((char *,flagged_type_tree));
2927 extern tree initializer_constant_valid_p PROTO((tree, tree));
2928
2929 /* in xref.c */
2930 extern void GNU_xref_begin PROTO((char *));
2931 extern void GNU_xref_end PROTO((int));
2932 extern void GNU_xref_file PROTO((char *));
2933 extern void GNU_xref_start_scope PROTO((HOST_WIDE_INT));
2934 extern void GNU_xref_end_scope PROTO((HOST_WIDE_INT, HOST_WIDE_INT, int, int));
2935 extern void GNU_xref_ref PROTO((tree, char *));
2936 extern void GNU_xref_decl PROTO((tree, tree));
2937 extern void GNU_xref_call PROTO((tree, char *));
2938 extern void GNU_xref_function PROTO((tree, tree));
2939 extern void GNU_xref_assign PROTO((tree));
2940 extern void GNU_xref_hier PROTO((char *, char *, int, int, int));
2941 extern void GNU_xref_member PROTO((tree, tree));
2942
2943 /* -- end of C++ */
2944
2945 #endif /* not _CP_TREE_H */
This page took 0.195389 seconds and 4 git commands to generate.