]> gcc.gnu.org Git - gcc.git/blob - gcc/cp/cp-tree.h
cp-tree.h (DECL_VIRTUAL_CONTEXT): New macro.
[gcc.git] / gcc / cp / cp-tree.h
1 /* Definitions for C++ parsing and type checking.
2 Copyright (C) 1987, 92-97, 1998, 1999 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 #include "c-common.h"
23
24 #ifndef _CP_TREE_H
25 #define _CP_TREE_H
26
27 /* Usage of TREE_LANG_FLAG_?:
28 0: BINFO_MARKED (BINFO nodes).
29 COMPOUND_STMT_NO_SCOPE (in COMPOUND_STMT).
30 NEW_EXPR_USE_GLOBAL (in NEW_EXPR).
31 DELETE_EXPR_USE_GLOBAL (in DELETE_EXPR).
32 LOOKUP_EXPR_GLOBAL (in LOOKUP_EXPR).
33 TREE_NEGATED_INT (in INTEGER_CST).
34 TREE_INDIRECT_USING (in NAMESPACE_DECL).
35 IDENTIFIER_MARKED (used by search routines).
36 LOCAL_BINDING_P (in CPLUS_BINDING)
37 ICS_USER_FLAG (in _CONV)
38 1: IDENTIFIER_VIRTUAL_P.
39 TI_PENDING_TEMPLATE_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 INHERITED_VALUE_BINDING_P (in CPLUS_BINDING)
46 BASELINK_P (in TREE_LIST)
47 ICS_ELLIPSIS_FLAG (in _CONV)
48 2: IDENTIFIER_OPNAME_P.
49 BINFO_VBASE_MARKED.
50 BINFO_FIELDS_MARKED.
51 TYPE_VIRTUAL_P.
52 ICS_THIS_FLAG (in _CONV)
53 3: TYPE_USES_VIRTUAL_BASECLASSES (in a class TYPE).
54 BINFO_VTABLE_PATH_MARKED.
55 BINFO_PUSHDECLS_MARKED.
56 (TREE_REFERENCE_EXPR) (in NON_LVALUE_EXPR) (commented-out).
57 ICS_BAD_FLAG (in _CONV)
58 4: BINFO_NEW_VTABLE_MARKED.
59 TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR,
60 or FIELD_DECL).
61 NEED_TEMPORARY_P (in REF_BIND, BASE_CONV)
62 5: Not used.
63 6: Not used.
64
65 Usage of TYPE_LANG_FLAG_?:
66 0: C_TYPE_FIELDS_READONLY (in RECORD_TYPE or UNION_TYPE).
67 1: TYPE_HAS_CONSTRUCTOR.
68 2: TYPE_HAS_DESTRUCTOR.
69 3: TYPE_FOR_JAVA.
70 4: TYPE_NEEDS_DESTRUCTOR.
71 5: IS_AGGR_TYPE.
72 6: TYPE_BUILT_IN.
73
74 Usage of DECL_LANG_FLAG_?:
75 0: DECL_ERROR_REPORTED (in VAR_DECL).
76 DECL_TEMPLATE_PARM_P (in CONST_DECL, TYPE_DECL, or TEMPLATE_DECL)
77 1: C_TYPEDEF_EXPLICITLY_SIGNED (in TYPE_DECL).
78 DECL_TEMPLATE_INSTANTIATED (in a VAR_DECL or a FUNCTION_DECL)
79 2: DECL_THIS_EXTERN (in VAR_DECL or FUNCTION_DECL).
80 3: DECL_IN_AGGR_P.
81 4: DECL_MAYBE_TEMPLATE.
82 5: DECL_INTERFACE_KNOWN.
83 6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL).
84 7: DECL_DEAD_FOR_LOCAL (in VAR_DECL).
85
86 Usage of language-independent fields in a language-dependent manner:
87
88 TYPE_ALIAS_SET
89 This field is used by TYPENAME_TYPEs, TEMPLATE_TYPE_PARMs, and so
90 forth as a substitute for the mark bits provided in `lang_type'.
91 At present, only the six low-order bits are used.
92
93 TYPE_BINFO
94 For an ENUMERAL_TYPE, this is ENUM_TEMPLATE_INFO.
95 For a TYPENAME_TYPE, this is TYPENAME_TYPE_FULLNAME.
96 For a TEMPLATE_TEMPLATE_PARM, this is
97 TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
98
99 DECL_SAVED_INSNS/DECL_FIELD_SIZE
100 For a static VAR_DECL, this is DECL_INIT_PRIORITY.
101
102 BINFO_VIRTUALS
103 For a binfo, this is a TREE_LIST. The TREE_PURPOSE of each node
104 gives the amount by which to adjust the `this' pointer when
105 calling the function. The TREE_VALUE is the declaration for the
106 virtual function itself. When CLASSTYPE_COM_INTERFACE_P does not
107 hold, the first entry does not have a TREE_VALUE; it is just an
108 offset. */
109
110 /* Language-dependent contents of an identifier. */
111
112 struct lang_identifier
113 {
114 struct tree_identifier ignore;
115 tree namespace_bindings;
116 tree bindings;
117 tree class_value;
118 tree class_template_info;
119 struct lang_id2 *x;
120 };
121
122 struct lang_id2
123 {
124 tree label_value, implicit_decl;
125 tree error_locus;
126 };
127
128 typedef struct
129 {
130 tree t;
131 int new_type_flag;
132 } flagged_type_tree;
133
134 typedef struct
135 {
136 char common[sizeof (struct tree_common)];
137 struct rtx_def *rtl; /* Unused, but required to match up with what
138 the middle-end expects. */
139 HOST_WIDE_INT index;
140 HOST_WIDE_INT level;
141 HOST_WIDE_INT orig_level;
142 tree decl;
143 } template_parm_index;
144
145 typedef struct ptrmem_cst
146 {
147 char common[sizeof (struct tree_common)];
148 tree member;
149 }* ptrmem_cst_t;
150
151 /* Nonzero if this binding is for a local scope, as opposed to a class
152 or namespace scope. */
153 #define LOCAL_BINDING_P(NODE) TREE_LANG_FLAG_0(NODE)
154
155 /* Nonzero if BINDING_VALUE is from a base class of the class which is
156 currently being defined. */
157 #define INHERITED_VALUE_BINDING_P(NODE) TREE_LANG_FLAG_1(NODE)
158
159 /* For a binding between a name and an entity at a non-local scope,
160 defines the scope where the binding is declared. (Either a class
161 _TYPE node, or a NAMESPACE_DECL.) This macro should be used only
162 for namespace-level bindings; on the IDENTIFIER_BINDING list
163 BINDING_LEVEL is used instead. */
164 #define BINDING_SCOPE(NODE) (((struct tree_binding*)NODE)->scope.scope)
165
166 /* This is the declaration bound to the name. Possible values:
167 variable, overloaded function, namespace, template, enumerator. */
168 #define BINDING_VALUE(NODE) (((struct tree_binding*)NODE)->value)
169
170 /* If name is bound to a type, this is the type (struct, union, enum). */
171 #define BINDING_TYPE(NODE) TREE_TYPE(NODE)
172
173 #define IDENTIFIER_GLOBAL_VALUE(NODE) \
174 namespace_binding (NODE, global_namespace)
175 #define SET_IDENTIFIER_GLOBAL_VALUE(NODE, VAL) \
176 set_namespace_binding (NODE, global_namespace, VAL)
177 #define IDENTIFIER_NAMESPACE_VALUE(NODE) \
178 namespace_binding (NODE, current_namespace)
179 #define SET_IDENTIFIER_NAMESPACE_VALUE(NODE, VAL) \
180 set_namespace_binding (NODE, current_namespace, VAL)
181
182 struct tree_binding
183 {
184 char common[sizeof (struct tree_common)];
185 union {
186 tree scope;
187 struct binding_level *level;
188 } scope;
189 tree value;
190 };
191
192 /* The overloaded FUNCTION_DECL. */
193 #define OVL_FUNCTION(NODE) (((struct tree_overload*)NODE)->function)
194 #define OVL_CHAIN(NODE) TREE_CHAIN(NODE)
195 /* Polymorphic access to FUNCTION and CHAIN. */
196 #define OVL_CURRENT(NODE) \
197 ((TREE_CODE(NODE)==OVERLOAD) ? OVL_FUNCTION(NODE) : NODE)
198 #define OVL_NEXT(NODE) \
199 ((TREE_CODE(NODE)==OVERLOAD) ? TREE_CHAIN(NODE) : NULL_TREE)
200 /* If set, this was imported in a using declaration.
201 This is not to confuse with being used somewhere, which
202 is not important for this node. */
203 #define OVL_USED(NODE) TREE_USED(NODE)
204
205 struct tree_overload
206 {
207 char common[sizeof (struct tree_common)];
208 tree function;
209 };
210
211 /* A `baselink' is a TREE_LIST whose TREE_PURPOSE is a BINFO
212 indicating a particular base class, and whose TREE_VALUE is a
213 (possibly overloaded) function from that base class. */
214 #define BASELINK_P(NODE) \
215 (TREE_CODE (NODE) == TREE_LIST && TREE_LANG_FLAG_1 (NODE))
216 #define SET_BASELINK_P(NODE) \
217 (TREE_LANG_FLAG_1 (NODE) = 1)
218
219 #define WRAPPER_PTR(NODE) (((struct tree_wrapper*)(NODE))->u.ptr)
220 #define WRAPPER_INT(NODE) (((struct tree_wrapper*)(NODE))->u.i)
221
222 struct tree_wrapper
223 {
224 char common[sizeof (struct tree_common)];
225 union {
226 void *ptr;
227 int i;
228 } u;
229 };
230
231 #define SRCLOC_FILE(NODE) (((struct tree_srcloc*)NODE)->filename)
232 #define SRCLOC_LINE(NODE) (((struct tree_srcloc*)NODE)->linenum)
233 struct tree_srcloc
234 {
235 char common[sizeof (struct tree_common)];
236 char *filename;
237 int linenum;
238 };
239
240 /* To identify to the debug emitters if it should pay attention to the
241 flag `-Wtemplate-debugging'. */
242 #define HAVE_TEMPLATES 1
243
244 /* Macros for access to language-specific slots in an identifier. */
245
246 #define IDENTIFIER_NAMESPACE_BINDINGS(NODE) \
247 (((struct lang_identifier *)(NODE))->namespace_bindings)
248 #define IDENTIFIER_TEMPLATE(NODE) \
249 (((struct lang_identifier *)(NODE))->class_template_info)
250
251 /* The IDENTIFIER_BINDING is the innermost CPLUS_BINDING for the
252 identifier. It's TREE_CHAIN is the next outermost binding. Each
253 BINDING_VALUE is a DECL for the associated declaration. Thus,
254 name lookup consists simply of pulling off the node at the front
255 of the list (modulo oddities for looking up the names of types,
256 and such.) You can use BINDING_SCOPE or BINDING_LEVEL to
257 determine the scope that bound the name. */
258 #define IDENTIFIER_BINDING(NODE) \
259 (((struct lang_identifier*) (NODE))->bindings)
260
261 /* The IDENTIFIER_VALUE is the value of the IDENTIFIER_BINDING, or
262 NULL_TREE if there is no binding. */
263 #define IDENTIFIER_VALUE(NODE) \
264 (IDENTIFIER_BINDING (NODE) \
265 ? BINDING_VALUE (IDENTIFIER_BINDING (NODE)) \
266 : NULL_TREE)
267
268 /* If IDENTIFIER_CLASS_VALUE is set, then NODE is bound in the current
269 class, and IDENTIFIER_CLASS_VALUE is the value binding. This is
270 just a pointer to the BINDING_VALUE of one of the bindings in the
271 IDENTIFIER_BINDINGs list, so any time that this is non-NULL so is
272 IDENTIFIER_BINDING. */
273 #define IDENTIFIER_CLASS_VALUE(NODE) \
274 (((struct lang_identifier *) (NODE))->class_value)
275
276 /* The amount of time used by the file whose special "time identifier"
277 is NODE, represented as an INTEGER_CST. See get_time_identifier. */
278 #define TIME_IDENTIFIER_TIME(NODE) IDENTIFIER_BINDING(NODE)
279
280 /* For a "time identifier" this is a INTEGER_CST. The
281 TREE_INT_CST_LOW is 1 if the corresponding file is "interface only".
282 The TRE_INT_CST_HIGH is 1 if it is "interface unknown". */
283 #define TIME_IDENTIFIER_FILEINFO(NODE) IDENTIFIER_CLASS_VALUE (NODE)
284
285 /* TREE_TYPE only indicates on local and class scope the current
286 type. For namespace scope, the presence of a type in any namespace
287 is indicated with global_type_node, and the real type behind must
288 be found through lookup. */
289 #define IDENTIFIER_TYPE_VALUE(NODE) (identifier_type_value(NODE))
290 #define REAL_IDENTIFIER_TYPE_VALUE(NODE) (TREE_TYPE (NODE))
291 #define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (TREE_TYPE (NODE) = TYPE)
292 #define IDENTIFIER_HAS_TYPE_VALUE(NODE) (IDENTIFIER_TYPE_VALUE (NODE) ? 1 : 0)
293
294 #define LANG_ID_FIELD(NAME,NODE) \
295 (((struct lang_identifier *)(NODE))->x \
296 ? ((struct lang_identifier *)(NODE))->x->NAME : 0)
297 #define SET_LANG_ID(NODE,VALUE,NAME) \
298 (((struct lang_identifier *)(NODE))->x == 0 \
299 ? ((struct lang_identifier *)(NODE))->x \
300 = (struct lang_id2 *)perm_calloc (1, sizeof (struct lang_id2)) : 0, \
301 ((struct lang_identifier *)(NODE))->x->NAME = (VALUE))
302
303 #define IDENTIFIER_LABEL_VALUE(NODE) LANG_ID_FIELD(label_value, NODE)
304 #define SET_IDENTIFIER_LABEL_VALUE(NODE,VALUE) \
305 SET_LANG_ID(NODE, VALUE, label_value)
306
307 #define IDENTIFIER_IMPLICIT_DECL(NODE) LANG_ID_FIELD(implicit_decl, NODE)
308 #define SET_IDENTIFIER_IMPLICIT_DECL(NODE,VALUE) \
309 SET_LANG_ID(NODE, VALUE, implicit_decl)
310
311 #define IDENTIFIER_ERROR_LOCUS(NODE) LANG_ID_FIELD(error_locus, NODE)
312 #define SET_IDENTIFIER_ERROR_LOCUS(NODE,VALUE) \
313 SET_LANG_ID(NODE, VALUE, error_locus)
314
315
316 #define IDENTIFIER_VIRTUAL_P(NODE) TREE_LANG_FLAG_1(NODE)
317
318 /* Nonzero if this identifier is the prefix for a mangled C++ operator name. */
319 #define IDENTIFIER_OPNAME_P(NODE) TREE_LANG_FLAG_2(NODE)
320
321 /* Nonzero if this identifier is the name of a type-conversion
322 operator. */
323 #define IDENTIFIER_TYPENAME_P(NODE) \
324 (! strncmp (IDENTIFIER_POINTER (NODE), \
325 OPERATOR_TYPENAME_FORMAT, \
326 strlen (OPERATOR_TYPENAME_FORMAT)))
327
328 /* Nonzero means reject anything that ANSI standard C forbids. */
329 extern int pedantic;
330
331 /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only. */
332 #define C_TYPE_FIELDS_READONLY(type) TYPE_LANG_FLAG_0 (type)
333
334 /* Record in each node resulting from a binary operator
335 what operator was specified for it. */
336 #define C_EXP_ORIGINAL_CODE(exp) ((enum tree_code) TREE_COMPLEXITY (exp))
337
338 /* Store a value in that field. */
339 #define C_SET_EXP_ORIGINAL_CODE(exp, code) \
340 (TREE_COMPLEXITY (exp) = (int)(code))
341 \f
342 /* If non-zero, a VAR_DECL whose cleanup will cause a throw to the
343 next exception handler. */
344 extern tree exception_throw_decl;
345
346 enum cp_tree_index
347 {
348 CPTI_JAVA_BYTE_TYPE,
349 CPTI_JAVA_SHORT_TYPE,
350 CPTI_JAVA_INT_TYPE,
351 CPTI_JAVA_LONG_TYPE,
352 CPTI_JAVA_FLOAT_TYPE,
353 CPTI_JAVA_DOUBLE_TYPE,
354 CPTI_JAVA_CHAR_TYPE,
355 CPTI_JAVA_BOOLEAN_TYPE,
356
357 CPTI_VOID_ZERO,
358 CPTI_WCHAR_DECL,
359 CPTI_VTABLE_ENTRY_TYPE,
360 CPTI_DELTA_TYPE,
361
362 CPTI_TP_DESC_TYPE,
363 CPTI_ACCESS_MODE_TYPE,
364 CPTI_BLTN_DESC_TYPE,
365 CPTI_USER_DESC_TYPE,
366 CPTI_CLASS_DESC_TYPE,
367 CPTI_PTR_DESC_TYPE,
368 CPTI_ATTR_DESC_TYPE,
369 CPTI_FUNC_DESC_TYPE,
370 CPTI_PTMF_DESC_TYPE,
371 CPTI_PTMD_DESC_TYPE,
372
373 CPTI_CLASS_STAR_TYPE,
374 CPTI_CLASS_TYPE,
375 CPTI_RECORD_TYPE,
376 CPTI_UNION_TYPE,
377 CPTI_ENUM_TYPE,
378 CPTI_UNKNOWN_TYPE,
379 CPTI_OPAQUE_TYPE,
380 CPTI_SIGNATURE_TYPE,
381 CPTI_SIGTABLE_ENTRY_TYPE,
382 CPTI_VTBL_TYPE,
383 CPTI_VTBL_PTR_TYPE,
384 CPTI_STD,
385 CPTI_TYPE_INFO_TYPE,
386 CPTI_TINFO_FN_ID,
387 CPTI_TINFO_FN_TYPE,
388 CPTI_ABORT_FNDECL,
389 CPTI_GLOBAL_DELETE_FNDECL,
390
391 CPTI_MAX
392 };
393
394 extern tree cp_global_trees[CPTI_MAX];
395
396 #define java_byte_type_node cp_global_trees[CPTI_JAVA_BYTE_TYPE]
397 #define java_short_type_node cp_global_trees[CPTI_JAVA_SHORT_TYPE]
398 #define java_int_type_node cp_global_trees[CPTI_JAVA_INT_TYPE]
399 #define java_long_type_node cp_global_trees[CPTI_JAVA_LONG_TYPE]
400 #define java_float_type_node cp_global_trees[CPTI_JAVA_FLOAT_TYPE]
401 #define java_double_type_node cp_global_trees[CPTI_JAVA_DOUBLE_TYPE]
402 #define java_char_type_node cp_global_trees[CPTI_JAVA_CHAR_TYPE]
403 #define java_boolean_type_node cp_global_trees[CPTI_JAVA_BOOLEAN_TYPE]
404
405 #define void_zero_node cp_global_trees[CPTI_VOID_ZERO]
406 #define wchar_decl_node cp_global_trees[CPTI_WCHAR_DECL]
407 #define vtable_entry_type cp_global_trees[CPTI_VTABLE_ENTRY_TYPE]
408 #define delta_type_node cp_global_trees[CPTI_DELTA_TYPE]
409 #define __tp_desc_type_node cp_global_trees[CPTI_TP_DESC_TYPE]
410 #define __access_mode_type_node cp_global_trees[CPTI_ACCESS_MODE_TYPE]
411 #define __bltn_desc_type_node cp_global_trees[CPTI_BLTN_DESC_TYPE]
412 #define __user_desc_type_node cp_global_trees[CPTI_USER_DESC_TYPE]
413 #define __class_desc_type_node cp_global_trees[CPTI_CLASS_DESC_TYPE]
414 #define __ptr_desc_type_node cp_global_trees[CPTI_PTR_DESC_TYPE]
415 #define __attr_desc_type_node cp_global_trees[CPTI_ATTR_DESC_TYPE]
416 #define __func_desc_type_node cp_global_trees[CPTI_FUNC_DESC_TYPE]
417 #define __ptmf_desc_type_node cp_global_trees[CPTI_PTMF_DESC_TYPE]
418 #define __ptmd_desc_type_node cp_global_trees[CPTI_PTMD_DESC_TYPE]
419 #define class_star_type_node cp_global_trees[CPTI_CLASS_STAR_TYPE]
420 #define class_type_node cp_global_trees[CPTI_CLASS_TYPE]
421 #define record_type_node cp_global_trees[CPTI_RECORD_TYPE]
422 #define union_type_node cp_global_trees[CPTI_UNION_TYPE]
423 #define enum_type_node cp_global_trees[CPTI_ENUM_TYPE]
424 #define unknown_type_node cp_global_trees[CPTI_UNKNOWN_TYPE]
425 #define opaque_type_node cp_global_trees[CPTI_OPAQUE_TYPE]
426 #define signature_type_node cp_global_trees[CPTI_SIGNATURE_TYPE]
427 #define sigtable_entry_type cp_global_trees[CPTI_SIGTABLE_ENTRY_TYPE]
428 #define vtbl_type_node cp_global_trees[CPTI_VTBL_TYPE]
429 #define vtbl_ptr_type_node cp_global_trees[CPTI_VTBL_PTR_TYPE]
430 #define std_node cp_global_trees[CPTI_STD]
431 #define type_info_type_node cp_global_trees[CPTI_TYPE_INFO_TYPE]
432 #define tinfo_fn_id cp_global_trees[CPTI_TINFO_FN_ID]
433 #define tinfo_fn_type cp_global_trees[CPTI_TINFO_FN_TYPE]
434 #define abort_fndecl cp_global_trees[CPTI_ABORT_FNDECL]
435 #define global_delete_fndecl cp_global_trees[CPTI_GLOBAL_DELETE_FNDECL]
436
437 extern int current_function_returns_value;
438 extern int current_function_returns_null;
439 extern tree current_function_return_value;
440
441 extern tree current_namespace;
442 extern tree global_namespace;
443
444 extern tree ridpointers[];
445 extern tree ansi_opname[];
446 extern tree ansi_assopname[];
447
448 /* Nonzero means `$' can be in an identifier. */
449
450 extern int dollars_in_ident;
451
452 /* Nonzero means allow type mismatches in conditional expressions;
453 just make their values `void'. */
454
455 extern int flag_cond_mismatch;
456
457 /* Nonzero means don't recognize the keyword `asm'. */
458
459 extern int flag_no_asm;
460
461 /* For cross referencing. */
462
463 extern int flag_gnu_xref;
464
465 /* For environments where you can use GNU binutils (as, ld in particular). */
466
467 extern int flag_gnu_binutils;
468
469 /* Nonzero means warn about implicit declarations. */
470
471 extern int warn_implicit;
472
473 /* Nonzero means warn about usage of long long when `-pedantic'. */
474
475 extern int warn_long_long;
476
477 /* Nonzero means warn when all ctors or dtors are private, and the class
478 has no friends. */
479
480 extern int warn_ctor_dtor_privacy;
481
482 /* Nonzero means warn about function definitions that default the return type
483 or that use a null return and have a return-type other than void. */
484
485 extern int warn_return_type;
486
487 /* Nonzero means give string constants the type `const char *', as mandated
488 by the standard. */
489
490 extern int flag_const_strings;
491
492 /* Nonzero means warn about deprecated conversion from string constant to
493 `char *'. */
494
495 extern int warn_write_strings;
496
497 /* Nonzero means warn about sizeof(function) or addition/subtraction
498 of function pointers. */
499
500 extern int warn_pointer_arith;
501
502 /* Nonzero means warn about suggesting putting in ()'s. */
503
504 extern int warn_parentheses;
505
506 /* Nonzero means warn about multiple (redundant) decls for the same single
507 variable or function. */
508
509 extern int warn_redundant_decls;
510
511 /* Warn if initializer is not completely bracketed. */
512
513 extern int warn_missing_braces;
514
515 /* Warn about comparison of signed and unsigned values. */
516
517 extern int warn_sign_compare;
518
519 /* Warn about a subscript that has type char. */
520
521 extern int warn_char_subscripts;
522
523 /* Nonzero means warn about pointer casts that can drop a type qualifier
524 from the pointer target type. */
525
526 extern int warn_cast_qual;
527
528 /* Warn about *printf or *scanf format/argument anomalies. */
529
530 extern int warn_format;
531
532 /* Nonzero means warn about non virtual destructors in classes that have
533 virtual functions. */
534
535 extern int warn_nonvdtor;
536
537 /* Non-zero means warn when we convert a pointer to member function
538 into a pointer to (void or function). */
539
540 extern int warn_pmf2ptr;
541
542 /* Nonzero means warn about violation of some Effective C++ style rules. */
543
544 extern int warn_ecpp;
545
546 /* Nonzero means warn where overload resolution chooses a promotion from
547 unsigned to signed over a conversion to an unsigned of the same size. */
548
549 extern int warn_sign_promo;
550
551 /* Non-zero means warn when a function is declared extern and later inline. */
552
553 extern int warn_extern_inline;
554
555 /* Non-zero means warn when an old-style cast is used. */
556
557 extern int warn_old_style_cast;
558
559 /* Nonzero means to treat bitfields as unsigned unless they say `signed'. */
560
561 extern int flag_signed_bitfields;
562
563 /* True for more efficient but incompatible (not fully tested)
564 vtable implementation (using thunks).
565 0 is old behavior; 1 is new behavior. */
566 extern int flag_vtable_thunks;
567
568 /* INTERFACE_ONLY nonzero means that we are in an "interface"
569 section of the compiler. INTERFACE_UNKNOWN nonzero means
570 we cannot trust the value of INTERFACE_ONLY. If INTERFACE_UNKNOWN
571 is zero and INTERFACE_ONLY is zero, it means that we are responsible
572 for exporting definitions that others might need. */
573 extern int interface_only, interface_unknown;
574
575 /* Nonzero means we should attempt to elide constructors when possible. */
576
577 extern int flag_elide_constructors;
578
579 /* Nonzero means enable obscure ANSI features and disable GNU extensions
580 that might cause ANSI-compliant code to be miscompiled. */
581
582 extern int flag_ansi;
583
584 /* Nonzero means recognize and handle signature language constructs. */
585
586 extern int flag_handle_signatures;
587
588 /* Nonzero means that member functions defined in class scope are
589 inline by default. */
590
591 extern int flag_default_inline;
592
593 /* The name-mangling scheme to use. Versions of gcc before 2.8 use
594 version 0. */
595 extern int name_mangling_version;
596
597 /* Nonzero means that guiding declarations are allowed. */
598 extern int flag_guiding_decls;
599
600 /* Nonzero if squashed mangling is to be performed.
601 This uses the B and K codes to reference previously seen class types
602 and class qualifiers. */
603 extern int flag_do_squangling;
604
605 /* Nonzero if we want to issue diagnostics that the standard says are not
606 required. */
607 extern int flag_optional_diags;
608
609 /* Nonzero means do not consider empty argument prototype to mean function
610 takes no arguments. */
611 extern int flag_strict_prototype;
612
613 /* Nonzero means output .vtable_{entry,inherit} for use in doing vtable gc. */
614 extern int flag_vtable_gc;
615
616 /* Nonzero means make the default pedwarns warnings instead of errors.
617 The value of this flag is ignored if -pedantic is specified. */
618 extern int flag_permissive;
619
620 /* Nonzero if we want to obey access control semantics. */
621
622 extern int flag_access_control;
623
624 \f
625 /* C++ language-specific tree codes. */
626 #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
627 enum cplus_tree_code {
628 __DUMMY = LAST_AND_UNUSED_TREE_CODE,
629 #include "cp-tree.def"
630 LAST_CPLUS_TREE_CODE
631 };
632 #undef DEFTREECODE
633
634 enum languages { lang_c, lang_cplusplus, lang_java };
635
636 /* Macros to make error reporting functions' lives easier. */
637 #define TYPE_IDENTIFIER(NODE) (DECL_NAME (TYPE_NAME (NODE)))
638 #define TYPE_NAME_STRING(NODE) (IDENTIFIER_POINTER (TYPE_IDENTIFIER (NODE)))
639 #define TYPE_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (TYPE_IDENTIFIER (NODE)))
640
641 #define TYPE_ASSEMBLER_NAME_STRING(NODE) (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE))))
642 #define TYPE_ASSEMBLER_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE))))
643
644 /* The _DECL for this _TYPE. */
645 #define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE)))
646
647 /* Nonzero if T is a class (or struct or union) type. Also nonzero
648 for template type parameters, typename types, and instantiated
649 template template parameters. Despite its name,
650 this macro has nothing to do with the definition of aggregate given
651 in the standard. Think of this macro as MAYBE_CLASS_TYPE_P. */
652 #define IS_AGGR_TYPE(t) \
653 (TREE_CODE (t) == TEMPLATE_TYPE_PARM \
654 || TREE_CODE (t) == TYPENAME_TYPE \
655 || TREE_CODE (t) == TYPEOF_TYPE \
656 || (TREE_CODE (t) == TEMPLATE_TEMPLATE_PARM \
657 && TYPE_TEMPLATE_INFO (t)) \
658 || TYPE_LANG_FLAG_5 (t))
659
660 /* Set IS_AGGR_TYPE for T to VAL. T must be a class, struct, or
661 union type. */
662 #define SET_IS_AGGR_TYPE(T, VAL) \
663 (TYPE_LANG_FLAG_5 (T) = (VAL))
664
665 /* Nonzero if T is a class type. Zero for template type parameters,
666 typename types, and so forth. */
667 #define CLASS_TYPE_P(t) \
668 (IS_AGGR_TYPE_CODE (TREE_CODE (t)) && IS_AGGR_TYPE (t))
669
670 #define IS_AGGR_TYPE_CODE(t) (t == RECORD_TYPE || t == UNION_TYPE)
671 #define IS_AGGR_TYPE_2(TYPE1,TYPE2) \
672 (TREE_CODE (TYPE1) == TREE_CODE (TYPE2) \
673 && IS_AGGR_TYPE (TYPE1)&IS_AGGR_TYPE (TYPE2))
674 #define IS_OVERLOAD_TYPE(t) \
675 (IS_AGGR_TYPE (t) || TREE_CODE (t) == ENUMERAL_TYPE)
676
677 /* In a *_TYPE, nonzero means a built-in type. */
678 #define TYPE_BUILT_IN(NODE) TYPE_LANG_FLAG_6(NODE)
679
680 /* True if this a "Java" type, defined in 'extern "Java"'. */
681 #define TYPE_FOR_JAVA(NODE) TYPE_LANG_FLAG_3(NODE)
682
683 /* The type qualifiers for this type, including the qualifiers on the
684 elements for an array type. */
685 #define CP_TYPE_QUALS(NODE) \
686 ((TREE_CODE (NODE) != ARRAY_TYPE) \
687 ? TYPE_QUALS (NODE) : cp_type_quals (NODE))
688
689 /* Nonzero if this type is const-qualified. */
690 #define CP_TYPE_CONST_P(NODE) \
691 ((CP_TYPE_QUALS (NODE) & TYPE_QUAL_CONST) != 0)
692
693 /* Nonzero if this type is volatile-qualified. */
694 #define CP_TYPE_VOLATILE_P(NODE) \
695 ((CP_TYPE_QUALS (NODE) & TYPE_QUAL_VOLATILE) != 0)
696
697 /* Nonzero if this type is restrict-qualified. */
698 #define CP_TYPE_RESTRICT_P(NODE) \
699 ((CP_TYPE_QUALS (NODE) & TYPE_QUAL_RESTRICT) != 0)
700
701 /* Nonzero if this type is const-qualified, but not
702 volatile-qualified. Other qualifiers are ignored. This macro is
703 used to test whether or not it is OK to bind an rvalue to a
704 reference. */
705 #define CP_TYPE_CONST_NON_VOLATILE_P(NODE) \
706 ((CP_TYPE_QUALS (NODE) & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE)) \
707 == TYPE_QUAL_CONST)
708
709 #define DELTA_FROM_VTABLE_ENTRY(ENTRY) \
710 (!flag_vtable_thunks ? \
711 TREE_VALUE (CONSTRUCTOR_ELTS (ENTRY)) \
712 : TREE_CODE (TREE_OPERAND ((ENTRY), 0)) != THUNK_DECL ? integer_zero_node \
713 : build_int_2 (THUNK_DELTA (TREE_OPERAND ((ENTRY), 0)), 0))
714
715 /* Virtual function addresses can be gotten from a virtual function
716 table entry using this macro. */
717 #define FNADDR_FROM_VTABLE_ENTRY(ENTRY) \
718 (!flag_vtable_thunks ? \
719 TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY)))) \
720 : TREE_CODE (TREE_OPERAND ((ENTRY), 0)) != THUNK_DECL ? (ENTRY) \
721 : DECL_INITIAL (TREE_OPERAND ((ENTRY), 0)))
722 #define SET_FNADDR_FROM_VTABLE_ENTRY(ENTRY,VALUE) \
723 (TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY)))) = (VALUE))
724 #define FUNCTION_ARG_CHAIN(NODE) (TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (NODE))))
725 #define PROMOTES_TO_AGGR_TYPE(NODE,CODE) \
726 (((CODE) == TREE_CODE (NODE) \
727 && IS_AGGR_TYPE (TREE_TYPE (NODE))) \
728 || IS_AGGR_TYPE (NODE))
729
730 /* Nonzero iff TYPE is uniquely derived from PARENT. Under MI, PARENT can
731 be an ambiguous base class of TYPE, and this macro will be false. */
732 #define UNIQUELY_DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 0, (tree *)0) >= 0)
733 #define ACCESSIBLY_DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, -1, (tree *)0) >= 0)
734 #define ACCESSIBLY_UNIQUELY_DERIVED_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 1, (tree *)0) >= 0)
735 #define DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 0, (tree *)0) != -1)
736 \f
737 /* This structure provides additional information above and beyond
738 what is provide in the ordinary tree_type. In the past, we used it
739 for the types of class types, template parameters types, typename
740 types, and so forth. However, there can be many (tens to hundreds
741 of thousands) of template parameter types in a compilation, and
742 there's no need for this additional information in that case.
743 Therefore, we now use this data structure only for class types.
744
745 In the past, it was thought that there would be relatively few
746 class types. However, in the presence of heavy use of templates,
747 many (i.e., thousands) of classes can easily be generated.
748 Therefore, we should endeavor to keep the size of this structure to
749 a minimum. */
750 struct lang_type
751 {
752 struct
753 {
754 unsigned has_type_conversion : 1;
755 unsigned has_init_ref : 1;
756 unsigned has_default_ctor : 1;
757 unsigned uses_multiple_inheritance : 1;
758 unsigned const_needs_init : 1;
759 unsigned ref_needs_init : 1;
760 unsigned has_const_assign_ref : 1;
761 unsigned anon_aggr : 1;
762
763 unsigned has_nonpublic_ctor : 2;
764 unsigned has_nonpublic_assign_ref : 2;
765 unsigned vtable_needs_writing : 1;
766 unsigned has_assign_ref : 1;
767 unsigned gets_new : 2;
768
769 unsigned gets_delete : 2;
770 unsigned has_call_overloaded : 1;
771 unsigned has_array_ref_overloaded : 1;
772 unsigned has_arrow_overloaded : 1;
773 unsigned interface_only : 1;
774 unsigned interface_unknown : 1;
775 unsigned needs_virtual_reinit : 1;
776
777 unsigned marks: 6;
778 unsigned vec_delete_takes_size : 1;
779 unsigned declared_class : 1;
780
781 unsigned being_defined : 1;
782 unsigned redefined : 1;
783 unsigned debug_requested : 1;
784 unsigned use_template : 2;
785 unsigned got_semicolon : 1;
786 unsigned ptrmemfunc_flag : 1;
787 unsigned is_signature : 1;
788
789 unsigned is_signature_pointer : 1;
790 unsigned is_signature_reference : 1;
791 unsigned has_opaque_typedecls : 1;
792 unsigned sigtable_has_been_generated : 1;
793 unsigned was_anonymous : 1;
794 unsigned has_real_assign_ref : 1;
795 unsigned has_const_init_ref : 1;
796 unsigned has_complex_init_ref : 1;
797
798 unsigned has_complex_assign_ref : 1;
799 unsigned has_abstract_assign_ref : 1;
800 unsigned non_aggregate : 1;
801 unsigned is_partial_instantiation : 1;
802 unsigned has_mutable : 1;
803 unsigned com_interface : 1;
804 /* When adding a flag here, consider whether or not it ought to
805 apply to a template instance if it applies to the template.
806 If so, make sure to copy it in instantiate_class_template! */
807
808 /* The MIPS compiler gets it wrong if this struct also
809 does not fill out to a multiple of 4 bytes. Add a
810 member `dummy' with new bits if you go over the edge. */
811 unsigned dummy : 10;
812 } type_flags;
813
814 int vsize;
815 int vfield_parent;
816
817 union tree_node *vfields;
818 union tree_node *vbases;
819
820 union tree_node *tags;
821
822 union tree_node *search_slot;
823
824 unsigned char align;
825 /* Room for another three unsigned chars. */
826
827 union tree_node *size;
828
829 union tree_node *abstract_virtuals;
830 union tree_node *friend_classes;
831
832 union tree_node *rtti;
833
834 union tree_node *methods;
835
836 union tree_node *signature;
837 union tree_node *signature_pointer_to;
838 union tree_node *signature_reference_to;
839 union tree_node *template_info;
840 tree befriending_classes;
841 };
842
843 /* Indicates whether or not (and how) a template was expanded for this class.
844 0=no information yet/non-template class
845 1=implicit template instantiation
846 2=explicit template specialization
847 3=explicit template instantiation */
848 #define CLASSTYPE_USE_TEMPLATE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.use_template)
849
850 /* Fields used for storing information before the class is defined.
851 After the class is defined, these fields hold other information. */
852
853 /* List of friends which were defined inline in this class definition. */
854 #define CLASSTYPE_INLINE_FRIENDS(NODE) (TYPE_NONCOPIED_PARTS (NODE))
855
856 /* Nonzero for _CLASSTYPE means that operator new and delete are defined,
857 respectively. */
858 #define TYPE_GETS_NEW(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_new)
859 #define TYPE_GETS_DELETE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_delete)
860 #define TYPE_GETS_REG_DELETE(NODE) (TYPE_GETS_DELETE (NODE) & 1)
861
862 /* Nonzero for _CLASSTYPE means that operator vec delete is defined and
863 takes the optional size_t argument. */
864 #define TYPE_VEC_DELETE_TAKES_SIZE(NODE) \
865 (TYPE_LANG_SPECIFIC(NODE)->type_flags.vec_delete_takes_size)
866 #define TYPE_VEC_NEW_USES_COOKIE(NODE) \
867 (TYPE_NEEDS_DESTRUCTOR (NODE) \
868 || (TYPE_LANG_SPECIFIC (NODE) && TYPE_VEC_DELETE_TAKES_SIZE (NODE)))
869
870 /* Nonzero means that this _CLASSTYPE node defines ways of converting
871 itself to other types. */
872 #define TYPE_HAS_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_type_conversion)
873
874 /* Nonzero means that this _CLASSTYPE node overloads operator=(X&). */
875 #define TYPE_HAS_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_assign_ref)
876 #define TYPE_HAS_CONST_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_const_assign_ref)
877
878 /* Nonzero means that this _CLASSTYPE node has an X(X&) constructor. */
879 #define TYPE_HAS_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_init_ref)
880 #define TYPE_HAS_CONST_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_const_init_ref)
881
882 /* Nonzero means that this type is being defined. I.e., the left brace
883 starting the definition of this type has been seen. */
884 #define TYPE_BEING_DEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.being_defined)
885 /* Nonzero means that this type has been redefined. In this case, if
886 convenient, don't reprocess any methods that appear in its redefinition. */
887 #define TYPE_REDEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.redefined)
888
889 /* Nonzero means that this type is a signature. */
890 # define IS_SIGNATURE(NODE) (TYPE_LANG_SPECIFIC(NODE)?TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature:0)
891 # define SET_SIGNATURE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature=1)
892 # define CLEAR_SIGNATURE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature=0)
893
894 /* Nonzero means that this type is a signature pointer type. */
895 # define IS_SIGNATURE_POINTER(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature_pointer)
896
897 /* Nonzero means that this type is a signature reference type. */
898 # define IS_SIGNATURE_REFERENCE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature_reference)
899
900 /* Nonzero means that this signature contains opaque type declarations. */
901 #define SIGNATURE_HAS_OPAQUE_TYPEDECLS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_opaque_typedecls)
902
903 /* Nonzero means that a signature table has been generated
904 for this signature. */
905 #define SIGTABLE_HAS_BEEN_GENERATED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.sigtable_has_been_generated)
906
907 /* If NODE is a class, this is the signature type that contains NODE's
908 signature after it has been computed using sigof(). */
909 #define CLASSTYPE_SIGNATURE(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature)
910
911 /* If NODE is a signature pointer or signature reference, this is the
912 signature type the pointer/reference points to. */
913 #define SIGNATURE_TYPE(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature)
914
915 /* If NODE is a signature, this is a vector of all methods defined
916 in the signature or in its base types together with their default
917 implementations. */
918 #define SIGNATURE_METHOD_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature)
919
920 /* If NODE is a signature, this is the _TYPE node that contains NODE's
921 signature pointer type. */
922 #define SIGNATURE_POINTER_TO(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature_pointer_to)
923
924 /* If NODE is a signature, this is the _TYPE node that contains NODE's
925 signature reference type. */
926 #define SIGNATURE_REFERENCE_TO(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature_reference_to)
927
928 /* The is the basetype that contains NODE's rtti. */
929 #define CLASSTYPE_RTTI(NODE) (TYPE_LANG_SPECIFIC(NODE)->rtti)
930
931 /* Nonzero means that this _CLASSTYPE node overloads operator(). */
932 #define TYPE_OVERLOADS_CALL_EXPR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_call_overloaded)
933
934 /* Nonzero means that this _CLASSTYPE node overloads operator[]. */
935 #define TYPE_OVERLOADS_ARRAY_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_array_ref_overloaded)
936
937 /* Nonzero means that this _CLASSTYPE node overloads operator->. */
938 #define TYPE_OVERLOADS_ARROW(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_arrow_overloaded)
939
940 /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
941 multiple inheritance. If this is 0 for the root of a type
942 hierarchy, then we can use more efficient search techniques. */
943 #define TYPE_USES_MULTIPLE_INHERITANCE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.uses_multiple_inheritance)
944
945 /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
946 virtual base classes. If this is 0 for the root of a type
947 hierarchy, then we can use more efficient search techniques. */
948 #define TYPE_USES_VIRTUAL_BASECLASSES(NODE) (TREE_LANG_FLAG_3(NODE))
949
950 /* Vector member functions defined in this class. Each element is
951 either a FUNCTION_DECL, a TEMPLATE_DECL, or an OVERLOAD. All
952 functions with the same name end up in the same slot. The first
953 two elements are for constructors, and destructors, respectively.
954 These are followed by ordinary member functions. There may be
955 empty entries at the end of the vector. */
956 #define CLASSTYPE_METHOD_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->methods)
957
958 /* The first type conversion operator in the class (the others can be
959 searched with TREE_CHAIN), or the first non-constructor function if
960 there are no type conversion operators. */
961 #define CLASSTYPE_FIRST_CONVERSION(NODE) \
962 TREE_VEC_LENGTH (CLASSTYPE_METHOD_VEC (NODE)) > 2 \
963 ? TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), 2) \
964 : NULL_TREE;
965
966 /* Mark bits for depth-first and breath-first searches. */
967
968 /* Get the value of the Nth mark bit. */
969 #define CLASSTYPE_MARKED_N(NODE, N) \
970 (((CLASS_TYPE_P (NODE) ? TYPE_LANG_SPECIFIC (NODE)->type_flags.marks \
971 : TYPE_ALIAS_SET (NODE)) & (1 << N)) != 0)
972
973 /* Set the Nth mark bit. */
974 #define SET_CLASSTYPE_MARKED_N(NODE, N) \
975 (CLASS_TYPE_P (NODE) \
976 ? (TYPE_LANG_SPECIFIC (NODE)->type_flags.marks |= (1 << (N))) \
977 : (TYPE_ALIAS_SET (NODE) |= (1 << (N))))
978
979 /* Clear the Nth mark bit. */
980 #define CLEAR_CLASSTYPE_MARKED_N(NODE, N) \
981 (CLASS_TYPE_P (NODE) \
982 ? (TYPE_LANG_SPECIFIC (NODE)->type_flags.marks &= ~(1 << (N))) \
983 : (TYPE_ALIAS_SET (NODE) &= ~(1 << (N))))
984
985 /* Get the value of the mark bits. */
986 #define CLASSTYPE_MARKED(NODE) CLASSTYPE_MARKED_N(NODE, 0)
987 #define CLASSTYPE_MARKED2(NODE) CLASSTYPE_MARKED_N(NODE, 1)
988 #define CLASSTYPE_MARKED3(NODE) CLASSTYPE_MARKED_N(NODE, 2)
989 #define CLASSTYPE_MARKED4(NODE) CLASSTYPE_MARKED_N(NODE, 3)
990 #define CLASSTYPE_MARKED5(NODE) CLASSTYPE_MARKED_N(NODE, 4)
991 #define CLASSTYPE_MARKED6(NODE) CLASSTYPE_MARKED_N(NODE, 5)
992
993 /* Macros to modify the above flags */
994 #define SET_CLASSTYPE_MARKED(NODE) SET_CLASSTYPE_MARKED_N(NODE, 0)
995 #define CLEAR_CLASSTYPE_MARKED(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 0)
996 #define SET_CLASSTYPE_MARKED2(NODE) SET_CLASSTYPE_MARKED_N(NODE, 1)
997 #define CLEAR_CLASSTYPE_MARKED2(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 1)
998 #define SET_CLASSTYPE_MARKED3(NODE) SET_CLASSTYPE_MARKED_N(NODE, 2)
999 #define CLEAR_CLASSTYPE_MARKED3(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 2)
1000 #define SET_CLASSTYPE_MARKED4(NODE) SET_CLASSTYPE_MARKED_N(NODE, 3)
1001 #define CLEAR_CLASSTYPE_MARKED4(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 3)
1002 #define SET_CLASSTYPE_MARKED5(NODE) SET_CLASSTYPE_MARKED_N(NODE, 4)
1003 #define CLEAR_CLASSTYPE_MARKED5(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 4)
1004 #define SET_CLASSTYPE_MARKED6(NODE) SET_CLASSTYPE_MARKED_N(NODE, 5)
1005 #define CLEAR_CLASSTYPE_MARKED6(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 5)
1006
1007 /* A list of the nested tag-types (class, struct, union, or enum)
1008 found within this class. The TREE_PURPOSE of each node is the name
1009 of the type; the TREE_VALUE is the type itself. This list includes
1010 nested member class templates. */
1011 #define CLASSTYPE_TAGS(NODE) (TYPE_LANG_SPECIFIC(NODE)->tags)
1012
1013 /* If this class has any bases, this is the number of the base class from
1014 which our VFIELD is based, -1 otherwise. If this class has no base
1015 classes, this is not used.
1016 In D : B1, B2, PARENT would be 0, if D's vtable came from B1,
1017 1, if D's vtable came from B2. */
1018 #define CLASSTYPE_VFIELD_PARENT(NODE) (TYPE_LANG_SPECIFIC(NODE)->vfield_parent)
1019
1020 /* Remove when done merging. */
1021 #define CLASSTYPE_VFIELD(NODE) TYPE_VFIELD(NODE)
1022
1023 /* The number of virtual functions defined for this
1024 _CLASSTYPE node. */
1025 #define CLASSTYPE_VSIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->vsize)
1026 /* The virtual base classes that this type uses. */
1027 #define CLASSTYPE_VBASECLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->vbases)
1028 /* The virtual function pointer fields that this type contains. */
1029 #define CLASSTYPE_VFIELDS(NODE) (TYPE_LANG_SPECIFIC(NODE)->vfields)
1030
1031 /* Number of baseclasses defined for this type.
1032 0 means no base classes. */
1033 #define CLASSTYPE_N_BASECLASSES(NODE) \
1034 (TYPE_BINFO_BASETYPES (NODE) ? TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES(NODE)) : 0)
1035
1036 /* Used for keeping search-specific information. Any search routine
1037 which uses this must define what exactly this slot is used for. */
1038 #define CLASSTYPE_SEARCH_SLOT(NODE) (TYPE_LANG_SPECIFIC(NODE)->search_slot)
1039
1040 /* These are the size, mode and alignment of the type without its
1041 virtual base classes, for when we use this type as a base itself. */
1042 #define CLASSTYPE_SIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->size)
1043 #define CLASSTYPE_ALIGN(NODE) (TYPE_LANG_SPECIFIC(NODE)->align)
1044
1045 /* A cons list of virtual functions which cannot be inherited by
1046 derived classes. When deriving from this type, the derived
1047 class must provide its own definition for each of these functions. */
1048 #define CLASSTYPE_ABSTRACT_VIRTUALS(NODE) (TYPE_LANG_SPECIFIC(NODE)->abstract_virtuals)
1049
1050 /* Nonzero means that this aggr type has been `closed' by a semicolon. */
1051 #define CLASSTYPE_GOT_SEMICOLON(NODE) (TYPE_LANG_SPECIFIC (NODE)->type_flags.got_semicolon)
1052
1053 /* Nonzero means that the main virtual function table pointer needs to be
1054 set because base constructors have placed the wrong value there.
1055 If this is zero, it means that they placed the right value there,
1056 and there is no need to change it. */
1057 #define CLASSTYPE_NEEDS_VIRTUAL_REINIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.needs_virtual_reinit)
1058
1059 /* Nonzero means that if this type has virtual functions, that
1060 the virtual function table will be written out. */
1061 #define CLASSTYPE_VTABLE_NEEDS_WRITING(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.vtable_needs_writing)
1062
1063 /* Nonzero means that this type has an X() constructor. */
1064 #define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_default_ctor)
1065
1066 /* Nonzero means the type declared a ctor as private or protected. We
1067 use this to make sure we don't try to generate a copy ctor for a
1068 class that has a member of type NODE. */
1069 #define TYPE_HAS_NONPUBLIC_CTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_nonpublic_ctor)
1070
1071 /* Ditto, for operator=. */
1072 #define TYPE_HAS_NONPUBLIC_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_nonpublic_assign_ref)
1073
1074 /* Nonzero means that this type contains a mutable member */
1075 #define CLASSTYPE_HAS_MUTABLE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_mutable)
1076 #define TYPE_HAS_MUTABLE_P(NODE) (cp_has_mutable_p (NODE))
1077
1078 /* Nonzero means that this type is meant for communication via COM. */
1079 #define CLASSTYPE_COM_INTERFACE(NODE) \
1080 (TYPE_LANG_SPECIFIC(NODE)->type_flags.com_interface)
1081
1082 /* A list of class types of which this type is a friend. The
1083 TREE_VALUE is normally a TYPE, but will be a TEMPLATE_DECL in the
1084 case of a template friend. */
1085 #define CLASSTYPE_FRIEND_CLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->friend_classes)
1086
1087 /* A list of the classes which grant friendship to this class. */
1088 #define CLASSTYPE_BEFRIENDING_CLASSES(NODE) \
1089 (TYPE_LANG_SPECIFIC (NODE)->befriending_classes)
1090
1091 /* Say whether this node was declared as a "class" or a "struct". */
1092 #define CLASSTYPE_DECLARED_CLASS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.declared_class)
1093
1094 /* Nonzero if this class has const members which have no specified initialization. */
1095 #define CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.const_needs_init)
1096
1097 /* Nonzero if this class has ref members which have no specified initialization. */
1098 #define CLASSTYPE_REF_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.ref_needs_init)
1099
1100 /* Nonzero if this class is included from a header file which employs
1101 `#pragma interface', and it is not included in its implementation file. */
1102 #define CLASSTYPE_INTERFACE_ONLY(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_only)
1103
1104 /* Same as above, but for classes whose purpose we do not know. */
1105 #define CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown)
1106 #define CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown == 0)
1107 #define SET_CLASSTYPE_INTERFACE_UNKNOWN_X(NODE,X) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = !!(X))
1108 #define SET_CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = 1)
1109 #define SET_CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = 0)
1110
1111 /* Nonzero if a _DECL node requires us to output debug info for this class. */
1112 #define CLASSTYPE_DEBUG_REQUESTED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.debug_requested)
1113 \f
1114 /* Additional macros for inheritance information. */
1115
1116 /* The BINFO_INHERITANCE_CHAIN is used opposite to the description in
1117 gcc/tree.h. In particular if D is derived from B then the BINFO
1118 for B (in D) will have a BINFO_INHERITANCE_CHAIN pointing to
1119 D. In tree.h, this pointer is described as pointing in other
1120 direction. There is a different BINFO for each path to a virtual
1121 base; BINFOs for virtual bases are not shared. In addition, shared
1122 versions of each of the virtual class BINFOs are stored in
1123 CLASSTYPE_VBASECLASSES.
1124
1125 We use TREE_VIA_PROTECTED and TREE_VIA_PUBLIC, but private
1126 inheritance is indicated by the absence of the other two flags, not
1127 by TREE_VIAR_PRIVATE, which is unused.
1128
1129 The TREE_CHAIN is for scratch space in search.c. */
1130
1131 /* Nonzero means marked by DFS or BFS search, including searches
1132 by `get_binfo' and `get_base_distance'. */
1133 #define BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED(BINFO_TYPE(NODE)):TREE_LANG_FLAG_0(NODE))
1134 /* Macros needed because of C compilers that don't allow conditional
1135 expressions to be lvalues. Grr! */
1136 #define SET_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_0(NODE)=1))
1137 #define CLEAR_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_0(NODE)=0))
1138
1139 /* Nonzero means marked in search through virtual inheritance hierarchy. */
1140 #define BINFO_VBASE_MARKED(NODE) CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
1141 /* Modifier macros */
1142 #define SET_BINFO_VBASE_MARKED(NODE) SET_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
1143 #define CLEAR_BINFO_VBASE_MARKED(NODE) CLEAR_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
1144
1145 /* Nonzero means marked in search for members or member functions. */
1146 #define BINFO_FIELDS_MARKED(NODE) \
1147 (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED2 (BINFO_TYPE (NODE)):TREE_LANG_FLAG_2(NODE))
1148 #define SET_BINFO_FIELDS_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED2(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_2(NODE)=1))
1149 #define CLEAR_BINFO_FIELDS_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED2(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_2(NODE)=0))
1150
1151 /* Nonzero means that this class is on a path leading to a new vtable. */
1152 #define BINFO_VTABLE_PATH_MARKED(NODE) \
1153 (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):TREE_LANG_FLAG_3(NODE))
1154 #define SET_BINFO_VTABLE_PATH_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_3(NODE)=1))
1155 #define CLEAR_BINFO_VTABLE_PATH_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_3(NODE)=0))
1156
1157 /* Nonzero means that this class has a new vtable. */
1158 #define BINFO_NEW_VTABLE_MARKED(NODE) \
1159 (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):TREE_LANG_FLAG_4(NODE))
1160 #define SET_BINFO_NEW_VTABLE_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_4(NODE)=1))
1161 #define CLEAR_BINFO_NEW_VTABLE_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_4(NODE)=0))
1162
1163 /* Nonzero means this class has done dfs_pushdecls. */
1164 #define BINFO_PUSHDECLS_MARKED(NODE) BINFO_VTABLE_PATH_MARKED (NODE)
1165 #define SET_BINFO_PUSHDECLS_MARKED(NODE) SET_BINFO_VTABLE_PATH_MARKED (NODE)
1166 #define CLEAR_BINFO_PUSHDECLS_MARKED(NODE) CLEAR_BINFO_VTABLE_PATH_MARKED (NODE)
1167
1168 /* Used by various search routines. */
1169 #define IDENTIFIER_MARKED(NODE) TREE_LANG_FLAG_0 (NODE)
1170 \f
1171 /* Accessor macros for the vfield slots in structures. */
1172
1173 /* Get the assoc info that caused this vfield to exist. */
1174 #define VF_BINFO_VALUE(NODE) TREE_PURPOSE (NODE)
1175
1176 /* Get that same information as a _TYPE. */
1177 #define VF_BASETYPE_VALUE(NODE) TREE_VALUE (NODE)
1178
1179 /* Get the value of the top-most type dominating the non-`normal' vfields. */
1180 #define VF_DERIVED_VALUE(NODE) (VF_BINFO_VALUE (NODE) ? BINFO_TYPE (VF_BINFO_VALUE (NODE)) : NULL_TREE)
1181
1182 /* Get the value of the top-most type that's `normal' for the vfield. */
1183 #define VF_NORMAL_VALUE(NODE) TREE_TYPE (NODE)
1184 \f
1185 /* Nonzero for TREE_LIST node means that this list of things
1186 is a list of parameters, as opposed to a list of expressions. */
1187 #define TREE_PARMLIST(NODE) ((NODE)->common.unsigned_flag) /* overloaded! */
1188
1189 /* For FUNCTION_TYPE or METHOD_TYPE, a list of the exceptions that
1190 this type can raise. Each TREE_VALUE is a _TYPE. The TREE_VALUE
1191 will be NULL_TREE to indicate a throw specification of `()', or
1192 no exceptions allowed. */
1193 #define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_NONCOPIED_PARTS (NODE)
1194
1195 /* For FUNCTION_TYPE or METHOD_TYPE, return 1 iff it is declared `throw()'. */
1196 #define TYPE_NOTHROW_P(NODE) \
1197 (TYPE_RAISES_EXCEPTIONS (NODE) \
1198 && TREE_VALUE (TYPE_RAISES_EXCEPTIONS (NODE)) == NULL_TREE)
1199
1200 /* The binding level associated with the namespace. */
1201 #define NAMESPACE_LEVEL(NODE) \
1202 (DECL_LANG_SPECIFIC(NODE)->decl_flags.u.level)
1203 \f
1204
1205 /* If a DECL has DECL_LANG_SPECIFIC, it is either a lang_decl_flags or
1206 a lang_decl (which has lang_decl_flags as its initial prefix). A
1207 FUNCTION_DECL, NAMESPACE_DECL, TYPE_DECL, or USING_DECL may have a
1208 full lang_decl. A FIELD_DECL, or a static data member VAR_DECL,
1209 will have only lang_decl_flags. Thus, one should only access the
1210 members of lang_decl that are not in lang_decl_flags for DECLs that
1211 are not FIELD_DECLs or VAR_DECLs. */
1212
1213 struct lang_decl_flags
1214 {
1215 #ifdef ONLY_INT_FIELDS
1216 int language : 8;
1217 #else
1218 enum languages language : 8;
1219 #endif
1220
1221 unsigned operator_attr : 1;
1222 unsigned constructor_attr : 1;
1223 unsigned friend_attr : 1;
1224 unsigned static_function : 1;
1225 unsigned const_memfunc : 1;
1226 unsigned volatile_memfunc : 1;
1227
1228 unsigned abstract_virtual : 1;
1229 unsigned permanent_attr : 1 ;
1230 unsigned constructor_for_vbase_attr : 1;
1231 unsigned mutable_flag : 1;
1232 unsigned is_default_implementation : 1;
1233 unsigned saved_inline : 1;
1234 unsigned use_template : 2;
1235
1236 unsigned nonconverting : 1;
1237 unsigned declared_inline : 1;
1238 unsigned not_really_extern : 1;
1239 unsigned needs_final_overrider : 1;
1240 unsigned bitfield : 1;
1241 unsigned defined_in_class : 1;
1242 unsigned dummy : 4;
1243
1244 tree access;
1245 tree context;
1246
1247 /* In a template FUNCTION_DECL, this is DECL_SAVED_TREE.
1248 In a non-template FUNCTION_DECL, this is DECL_MEMFUNC_POINTER_TO.
1249 In a FIELD_DECL, this is DECL_MEMFUNC_POINTING_TO. */
1250 tree memfunc_pointer_to;
1251
1252 union {
1253 /* In a FUNCTION_DECL, this is DECL_TEMPLATE_INFO. */
1254 tree template_info;
1255
1256 /* In a NAMESPACE_DECL, this is NAMESPACE_LEVEL. */
1257 struct binding_level *level;
1258 } u;
1259 };
1260
1261 struct lang_decl
1262 {
1263 struct lang_decl_flags decl_flags;
1264
1265 tree main_decl_variant;
1266 tree befriending_classes;
1267 union
1268 {
1269 tree sorted_fields;
1270 struct pending_inline *pending_inline_info;
1271 } u;
1272 };
1273
1274 /* Non-zero if NODE is a _DECL with TREE_READONLY set. */
1275 #define TREE_READONLY_DECL_P(NODE) \
1276 (TREE_READONLY (NODE) && TREE_CODE_CLASS (TREE_CODE (NODE)) == 'd')
1277
1278 /* Non-zero iff DECL is memory-based. The DECL_RTL of
1279 certain const variables might be a CONST_INT, or a REG
1280 in some cases. We cannot use `memory_operand' as a test
1281 here because on most RISC machines, a variable's address
1282 is not, by itself, a legitimate address. */
1283 #define DECL_IN_MEMORY_P(NODE) \
1284 (DECL_RTL (NODE) != NULL_RTX && GET_CODE (DECL_RTL (NODE)) == MEM)
1285
1286 /* For FUNCTION_DECLs: return the language in which this decl
1287 was declared. */
1288 #define DECL_LANGUAGE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.language)
1289
1290 /* For FUNCTION_DECLs: nonzero means that this function is a constructor. */
1291 #define DECL_CONSTRUCTOR_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_attr)
1292
1293 /* There ought to be a better way to find out whether or not something is
1294 a destructor. */
1295 #define DECL_DESTRUCTOR_P(NODE) \
1296 (DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (NODE)) \
1297 && DECL_LANGUAGE (NODE) == lang_cplusplus)
1298
1299 #define DECL_CONV_FN_P(NODE) \
1300 (IDENTIFIER_TYPENAME_P (DECL_NAME (NODE)) && TREE_TYPE (DECL_NAME (NODE)))
1301
1302 /* For FUNCTION_DECLs: nonzero means that this function is a constructor
1303 for an object with virtual baseclasses. */
1304 #define DECL_CONSTRUCTOR_FOR_VBASE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_for_vbase_attr)
1305
1306 /* Non-zero for a FUNCTION_DECL that declares a type-info function. */
1307 #define DECL_TINFO_FN_P(NODE) \
1308 (TREE_CODE (NODE) == FUNCTION_DECL \
1309 && DECL_ARTIFICIAL (NODE) \
1310 && DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag)
1311
1312 /* Mark NODE as a type-info function. */
1313 #define SET_DECL_TINFO_FN_P(NODE) \
1314 (DECL_LANG_SPECIFIC((NODE))->decl_flags.mutable_flag = 1)
1315
1316 /* For FUNCTION_DECLs: nonzero means that this function is a default
1317 implementation of a signature method. */
1318 #define IS_DEFAULT_IMPLEMENTATION(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.is_default_implementation)
1319
1320 /* Nonzero for _DECL means that this decl appears in (or will appear
1321 in) as a member in a RECORD_TYPE or UNION_TYPE node. It is also for
1322 detecting circularity in case members are multiply defined. In the
1323 case of a VAR_DECL, it is also used to determine how program storage
1324 should be allocated. */
1325 #define DECL_IN_AGGR_P(NODE) (DECL_LANG_FLAG_3(NODE))
1326
1327 /* Nonzero if the DECL was defined in the class definition itself,
1328 rather than outside the class. */
1329 #define DECL_DEFINED_IN_CLASS_P(DECL) \
1330 (DECL_LANG_SPECIFIC (DECL)->decl_flags.defined_in_class)
1331
1332 /* Nonzero for FUNCTION_DECL means that this decl is just a
1333 friend declaration, and should not be added to the list of
1334 member functions for this class. */
1335 #define DECL_FRIEND_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.friend_attr)
1336
1337 /* A TREE_LIST of the types which have befriended this FUNCTION_DECL. */
1338 #define DECL_BEFRIENDING_CLASSES(NODE) \
1339 (DECL_LANG_SPECIFIC(NODE)->befriending_classes)
1340
1341 /* Nonzero for FUNCTION_DECL means that this decl is a static
1342 member function. */
1343 #define DECL_STATIC_FUNCTION_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.static_function)
1344
1345 /* Nonzero for a class member means that it is shared between all objects
1346 of that class. */
1347 #define SHARED_MEMBER_P(NODE) \
1348 (TREE_CODE (NODE) == VAR_DECL || TREE_CODE (NODE) == TYPE_DECL \
1349 || TREE_CODE (NODE) == CONST_DECL)
1350
1351 /* Nonzero for FUNCTION_DECL means that this decl is a non-static
1352 member function. */
1353 #define DECL_NONSTATIC_MEMBER_FUNCTION_P(NODE) \
1354 (TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE)
1355
1356 /* Nonzero for FUNCTION_DECL means that this decl is a member function
1357 (static or non-static). */
1358 #define DECL_FUNCTION_MEMBER_P(NODE) \
1359 (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE) || DECL_STATIC_FUNCTION_P (NODE))
1360
1361 /* Nonzero for FUNCTION_DECL means that this member function
1362 has `this' as const X *const. */
1363 #define DECL_CONST_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.const_memfunc)
1364
1365 /* Nonzero for FUNCTION_DECL means that this member function
1366 has `this' as volatile X *const. */
1367 #define DECL_VOLATILE_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.volatile_memfunc)
1368
1369 /* Nonzero for a DECL means that this member is a non-static member. */
1370 #define DECL_NONSTATIC_MEMBER_P(NODE) \
1371 ((TREE_CODE (NODE) == FUNCTION_DECL \
1372 && DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE)) \
1373 || TREE_CODE (NODE) == FIELD_DECL)
1374
1375 /* Nonzero for _DECL means that this member object type
1376 is mutable. */
1377 #define DECL_MUTABLE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag)
1378
1379 /* Nonzero for _DECL means that this constructor is a non-converting
1380 constructor. */
1381 #define DECL_NONCONVERTING_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.nonconverting)
1382
1383 /* Nonzero for FUNCTION_DECL means that this member function
1384 exists as part of an abstract class's interface. */
1385 #define DECL_ABSTRACT_VIRTUAL_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.abstract_virtual)
1386
1387 /* Nonzero for FUNCTION_DECL means that this member function
1388 must be overridden by derived classes. */
1389 #define DECL_NEEDS_FINAL_OVERRIDER_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.needs_final_overrider)
1390
1391 /* Nonzero if allocated on permanent_obstack. */
1392 #define LANG_DECL_PERMANENT(LANGDECL) ((LANGDECL)->decl_flags.permanent_attr)
1393
1394 /* The _TYPE context in which this _DECL appears. This field holds the
1395 class where a virtual function instance is actually defined, and the
1396 lexical scope of a friend function defined in a class body. */
1397 #define DECL_CLASS_CONTEXT(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.context)
1398 #define DECL_REAL_CONTEXT(NODE) \
1399 ((TREE_CODE (NODE) == FUNCTION_DECL && DECL_FUNCTION_MEMBER_P (NODE)) \
1400 ? DECL_CLASS_CONTEXT (NODE) : CP_DECL_CONTEXT (NODE))
1401
1402 /* NULL_TREE in DECL_CONTEXT represents the global namespace. */
1403 #define CP_DECL_CONTEXT(NODE) \
1404 (DECL_CONTEXT (NODE) ? DECL_CONTEXT (NODE) : global_namespace)
1405 #define FROB_CONTEXT(NODE) ((NODE) == global_namespace ? NULL_TREE : (NODE))
1406
1407 /* For a virtual function, the base where we find its vtable entry.
1408 For a non-virtual function, the base where it is defined. */
1409 #define DECL_VIRTUAL_CONTEXT(NODE) DECL_CONTEXT (NODE)
1410
1411 /* 1 iff NODE has namespace scope, including the global namespace. */
1412 #define DECL_NAMESPACE_SCOPE_P(NODE) \
1413 (DECL_CONTEXT (NODE) == NULL_TREE \
1414 || TREE_CODE (DECL_CONTEXT (NODE)) == NAMESPACE_DECL)
1415
1416 /* 1 iff NODE is a class member. */
1417 #define DECL_CLASS_SCOPE_P(NODE) \
1418 (DECL_CONTEXT (NODE) \
1419 && TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (NODE))) == 't')
1420
1421 /* 1 iff NODE is function-local. */
1422 #define DECL_FUNCTION_SCOPE_P(NODE) \
1423 (DECL_CONTEXT (NODE) \
1424 && TREE_CODE (DECL_CONTEXT (NODE)) == FUNCTION_DECL)
1425
1426 /* For a NAMESPACE_DECL: the list of using namespace directives
1427 The PURPOSE is the used namespace, the value is the namespace
1428 that is the common ancestor. */
1429 #define DECL_NAMESPACE_USING(NODE) DECL_VINDEX(NODE)
1430
1431 /* In a NAMESPACE_DECL, the DECL_INITIAL is used to record all users
1432 of a namespace, to record the transitive closure of using namespace. */
1433 #define DECL_NAMESPACE_USERS(NODE) DECL_INITIAL (NODE)
1434
1435 /* In a NAMESPACE_DECL, points to the original namespace if this is
1436 a namespace alias. */
1437 #define DECL_NAMESPACE_ALIAS(NODE) DECL_ABSTRACT_ORIGIN (NODE)
1438 #define ORIGINAL_NAMESPACE(NODE) \
1439 (DECL_NAMESPACE_ALIAS (NODE) ? DECL_NAMESPACE_ALIAS (NODE) : (NODE))
1440
1441 /* In a non-local VAR_DECL with static storage duration, this is the
1442 initialization priority. If this value is zero, the NODE will be
1443 initialized at the DEFAULT_INIT_PRIORITY. */
1444 #define DECL_INIT_PRIORITY(NODE) (DECL_FIELD_SIZE ((NODE)))
1445
1446 /* In a TREE_LIST concatenating using directives, indicate indirekt
1447 directives */
1448 #define TREE_INDIRECT_USING(NODE) ((NODE)->common.lang_flag_0)
1449
1450 /* In a VAR_DECL for a variable declared in a for statement,
1451 this is the shadowed (local) variable. */
1452 #define DECL_SHADOWED_FOR_VAR(NODE) DECL_RESULT(NODE)
1453
1454 /* Points back to the decl which caused this lang_decl to be allocated. */
1455 #define DECL_MAIN_VARIANT(NODE) (DECL_LANG_SPECIFIC(NODE)->main_decl_variant)
1456
1457 /* For a FUNCTION_DECL: if this function was declared inline inside of
1458 a class declaration, this is where the text for the function is
1459 squirreled away. */
1460 #define DECL_PENDING_INLINE_INFO(NODE) (DECL_LANG_SPECIFIC(NODE)->u.pending_inline_info)
1461
1462 /* For a TYPE_DECL: if this function has many fields, we'll sort them
1463 and put them into a TREE_VEC. */
1464 #define DECL_SORTED_FIELDS(NODE) (DECL_LANG_SPECIFIC(NODE)->u.sorted_fields)
1465
1466 /* True if on the saved_inlines (see decl2.c) list. */
1467 #define DECL_SAVED_INLINE(DECL) \
1468 (DECL_LANG_SPECIFIC(DECL)->decl_flags.saved_inline)
1469
1470 /* For a FUNCTION_DECL: if this function was declared inside a signature
1471 declaration, this is the corresponding member function pointer that was
1472 created for it. */
1473 #define DECL_MEMFUNC_POINTER_TO(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.memfunc_pointer_to)
1474
1475 /* For a FIELD_DECL: this points to the signature member function from
1476 which this signature member function pointer was created. */
1477 #define DECL_MEMFUNC_POINTING_TO(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.memfunc_pointer_to)
1478
1479 /* For a VAR_DECL or FUNCTION_DECL: template-specific information. */
1480 #define DECL_TEMPLATE_INFO(NODE) \
1481 (DECL_LANG_SPECIFIC(NODE)->decl_flags.u.template_info)
1482
1483 /* Template information for a RECORD_TYPE or UNION_TYPE. */
1484 #define CLASSTYPE_TEMPLATE_INFO(NODE) (TYPE_LANG_SPECIFIC(NODE)->template_info)
1485
1486 /* Template information for an ENUMERAL_TYPE. Although an enumeration may
1487 not be a primary template, it may be declared within the scope of a
1488 primary template and the enumeration constants may depend on
1489 non-type template parameters. */
1490 #define ENUM_TEMPLATE_INFO(NODE) (TYPE_BINFO (NODE))
1491
1492 /* Template information for a template template parameter. */
1493 #define TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO(NODE) (TYPE_BINFO (NODE))
1494
1495 /* Template information for an ENUMERAL_, RECORD_, or UNION_TYPE. */
1496 #define TYPE_TEMPLATE_INFO(NODE) \
1497 (TREE_CODE (NODE) == ENUMERAL_TYPE \
1498 ? ENUM_TEMPLATE_INFO (NODE) : \
1499 (TREE_CODE (NODE) == TEMPLATE_TEMPLATE_PARM \
1500 ? TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (NODE) \
1501 : CLASSTYPE_TEMPLATE_INFO (NODE)))
1502
1503 /* Set the template information for an ENUMERAL_, RECORD_, or
1504 UNION_TYPE to VAL. */
1505 #define SET_TYPE_TEMPLATE_INFO(NODE, VAL) \
1506 (TREE_CODE (NODE) == ENUMERAL_TYPE \
1507 ? (ENUM_TEMPLATE_INFO (NODE) = VAL) \
1508 : (CLASSTYPE_TEMPLATE_INFO (NODE) = VAL))
1509
1510 #define TI_TEMPLATE(NODE) (TREE_PURPOSE (NODE))
1511 #define TI_ARGS(NODE) (TREE_VALUE (NODE))
1512 #define TI_SPEC_INFO(NODE) (TREE_CHAIN (NODE))
1513 #define TI_PENDING_TEMPLATE_FLAG(NODE) TREE_LANG_FLAG_1 (NODE)
1514
1515 /* The TEMPLATE_DECL instantiated or specialized by NODE. This
1516 TEMPLATE_DECL will be the immediate parent, not the most general
1517 template. For example, in:
1518
1519 template <class T> struct S { template <class U> void f(U); }
1520
1521 the FUNCTION_DECL for S<int>::f<double> will have, as its
1522 DECL_TI_TEMPLATE, `template <class U> S<int>::f<U>'.
1523
1524 As a special case, for a member friend template of a template
1525 class, this value will not be a TEMPLATE_DECL, but rather a
1526 LOOKUP_EXPR or IDENTIFIER_NODE indicating the name of the template
1527 and any explicit template arguments provided. For example, in:
1528
1529 template <class T> struct S { friend void f<int>(int, double); }
1530
1531 the DECL_TI_TEMPLATE will be a LOOKUP_EXPR for `f' and the
1532 DECL_TI_ARGS will be {int}. */
1533 #define DECL_TI_TEMPLATE(NODE) TI_TEMPLATE (DECL_TEMPLATE_INFO (NODE))
1534
1535 /* The template arguments used to obtain this decl from the most
1536 general form of DECL_TI_TEMPLATE. For the example given for
1537 DECL_TI_TEMPLATE, the DECL_TI_ARGS will be {int, double}. These
1538 are always the full set of arguments required to instantiate this
1539 declaration from the most general template specialized here. */
1540 #define DECL_TI_ARGS(NODE) TI_ARGS (DECL_TEMPLATE_INFO (NODE))
1541 #define CLASSTYPE_TI_TEMPLATE(NODE) TI_TEMPLATE (CLASSTYPE_TEMPLATE_INFO (NODE))
1542 #define CLASSTYPE_TI_ARGS(NODE) TI_ARGS (CLASSTYPE_TEMPLATE_INFO (NODE))
1543 #define CLASSTYPE_TI_SPEC_INFO(NODE) TI_SPEC_INFO (CLASSTYPE_TEMPLATE_INFO (NODE))
1544 #define ENUM_TI_TEMPLATE(NODE) \
1545 TI_TEMPLATE (ENUM_TEMPLATE_INFO (NODE))
1546 #define ENUM_TI_ARGS(NODE) \
1547 TI_ARGS (ENUM_TEMPLATE_INFO (NODE))
1548
1549 /* Like DECL_TI_TEMPLATE, but for an ENUMERAL_, RECORD_, or UNION_TYPE. */
1550 #define TYPE_TI_TEMPLATE(NODE) \
1551 (TI_TEMPLATE (TYPE_TEMPLATE_INFO (NODE)))
1552
1553 /* Like DECL_TI_ARGS, , but for an ENUMERAL_, RECORD_, or UNION_TYPE. */
1554 #define TYPE_TI_ARGS(NODE) \
1555 (TI_ARGS (TYPE_TEMPLATE_INFO (NODE)))
1556
1557 #define INNERMOST_TEMPLATE_PARMS(NODE) TREE_VALUE(NODE)
1558
1559 /* Nonzero if the NODE corresponds to the template parameters for a
1560 member template, whose inline definition is being processed after
1561 the class definition is complete. */
1562 #define TEMPLATE_PARMS_FOR_INLINE(NODE) TREE_LANG_FLAG_1 (NODE)
1563
1564 /* In a template FUNCTION_DECL, the tree structure that will be
1565 substituted into to obtain instantiations. */
1566 #define DECL_SAVED_TREE(NODE) DECL_MEMFUNC_POINTER_TO (NODE)
1567
1568 #define COMPOUND_STMT_NO_SCOPE(NODE) TREE_LANG_FLAG_0 (NODE)
1569 #define NEW_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
1570 #define DELETE_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
1571 #define DELETE_EXPR_USE_VEC(NODE) TREE_LANG_FLAG_1 (NODE)
1572 #define LOOKUP_EXPR_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
1573
1574 /* The TYPE_MAIN_DECL for a class template type is a TYPE_DECL, not a
1575 TEMPLATE_DECL. This macro determines whether or not a given class
1576 type is really a template type, as opposed to an instantiation or
1577 specialization of one. */
1578 #define CLASSTYPE_IS_TEMPLATE(NODE) \
1579 (CLASSTYPE_TEMPLATE_INFO (NODE) \
1580 && !CLASSTYPE_USE_TEMPLATE (NODE) \
1581 && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (NODE)))
1582
1583 /* The name used by the user to name the typename type. Typically,
1584 this is an IDENTIFIER_NODE, and the same as the DECL_NAME on the
1585 corresponding TYPE_DECL. However, this may also be a
1586 TEMPLATE_ID_EXPR if we had something like `typename X::Y<T>'. */
1587 #define TYPENAME_TYPE_FULLNAME(NODE) TYPE_BINFO (NODE)
1588
1589 /* Nonzero if NODE is an implicit typename. */
1590 #define IMPLICIT_TYPENAME_P(NODE) \
1591 (TREE_CODE (NODE) == TYPENAME_TYPE && TREE_TYPE (NODE))
1592
1593 /* Nonzero if NODE is a TYPE_DECL that should not be visible because
1594 it is from a dependent base class. */
1595 #define IMPLICIT_TYPENAME_TYPE_DECL_P(NODE) \
1596 (TREE_CODE (NODE) == TYPE_DECL \
1597 && DECL_ARTIFICIAL (NODE) \
1598 && IMPLICIT_TYPENAME_P (TREE_TYPE (NODE)))
1599
1600 /* Nonzero in INTEGER_CST means that this int is negative by dint of
1601 using a twos-complement negated operand. */
1602 #define TREE_NEGATED_INT(NODE) (TREE_LANG_FLAG_0 (NODE))
1603
1604 #if 0 /* UNUSED */
1605 /* Nonzero in any kind of _EXPR or _REF node means that it is a call
1606 to a storage allocation routine. If, later, alternate storage
1607 is found to hold the object, this call can be ignored. */
1608 #define TREE_CALLS_NEW(NODE) (TREE_LANG_FLAG_1 (NODE))
1609 #endif
1610
1611 /* Nonzero in any kind of _TYPE that uses multiple inheritance
1612 or virtual baseclasses. */
1613 #define TYPE_USES_COMPLEX_INHERITANCE(NODE) (TREE_LANG_FLAG_1 (NODE))
1614
1615 #if 0 /* UNUSED */
1616 /* Nonzero in IDENTIFIER_NODE means that this name is not the name the user
1617 gave; it's a DECL_NESTED_TYPENAME. Someone may want to set this on
1618 mangled function names, too, but it isn't currently. */
1619 #define TREE_MANGLED(NODE) (FOO)
1620 #endif
1621
1622 #if 0 /* UNUSED */
1623 /* Nonzero in IDENTIFIER_NODE means that this name is overloaded, and
1624 should be looked up in a non-standard way. */
1625 #define DECL_OVERLOADED(NODE) (FOO)
1626 #endif
1627
1628 /* Nonzero if this (non-TYPE)_DECL has its virtual attribute set.
1629 For a FUNCTION_DECL, this is when the function is a virtual function.
1630 For a VAR_DECL, this is when the variable is a virtual function table.
1631 For a FIELD_DECL, when the field is the field for the virtual function table.
1632 For an IDENTIFIER_NODE, nonzero if any function with this name
1633 has been declared virtual.
1634
1635 For a _TYPE if it uses virtual functions (or is derived from
1636 one that does). */
1637 #define TYPE_VIRTUAL_P(NODE) (TREE_LANG_FLAG_2 (NODE))
1638
1639 extern int flag_new_for_scope;
1640
1641 /* This flag is true of a local VAR_DECL if it was declared in a for
1642 statement, but we are no longer in the scope of the for. */
1643 #define DECL_DEAD_FOR_LOCAL(NODE) DECL_LANG_FLAG_7 (NODE)
1644
1645 /* This flag is set on a VAR_DECL that is a DECL_DEAD_FOR_LOCAL
1646 if we already emitted a warning about using it. */
1647 #define DECL_ERROR_REPORTED(NODE) DECL_LANG_FLAG_0 (NODE)
1648
1649 /* This _DECL represents a compiler-generated entity. */
1650 #define SET_DECL_ARTIFICIAL(NODE) (DECL_ARTIFICIAL (NODE) = 1)
1651
1652 /* Record whether a typedef for type `int' was actually `signed int'. */
1653 #define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp))
1654
1655 /* In a FIELD_DECL, nonzero if the decl was originally a bitfield. */
1656 #define DECL_C_BIT_FIELD(NODE) \
1657 (DECL_LANG_SPECIFIC (NODE) && DECL_LANG_SPECIFIC (NODE)->decl_flags.bitfield)
1658 #define SET_DECL_C_BIT_FIELD(NODE) \
1659 (DECL_LANG_SPECIFIC (NODE)->decl_flags.bitfield = 1)
1660
1661 /* Nonzero if the type T promotes to itself.
1662 ANSI C states explicitly the list of types that promote;
1663 in particular, short promotes to int even if they have the same width. */
1664 #define C_PROMOTING_INTEGER_TYPE_P(t) \
1665 (TREE_CODE ((t)) == INTEGER_TYPE \
1666 && (TYPE_MAIN_VARIANT (t) == char_type_node \
1667 || TYPE_MAIN_VARIANT (t) == signed_char_type_node \
1668 || TYPE_MAIN_VARIANT (t) == unsigned_char_type_node \
1669 || TYPE_MAIN_VARIANT (t) == short_integer_type_node \
1670 || TYPE_MAIN_VARIANT (t) == short_unsigned_type_node))
1671
1672 #define INTEGRAL_CODE_P(CODE) \
1673 (CODE == INTEGER_TYPE || CODE == ENUMERAL_TYPE || CODE == BOOLEAN_TYPE)
1674
1675 /* [basic.fundamental]
1676
1677 Types bool, char, wchar_t, and the signed and unsigned integer types
1678 are collectively called integral types.
1679
1680 Note that INTEGRAL_TYPE_P, as defined in tree.h, allows enumeration
1681 types as well, which is incorrect in C++. */
1682 #define CP_INTEGRAL_TYPE_P(TYPE) \
1683 (TREE_CODE ((TYPE)) == BOOLEAN_TYPE \
1684 || TREE_CODE ((TYPE)) == INTEGER_TYPE)
1685
1686 /* [basic.fundamental]
1687
1688 Integral and floating types are collectively called arithmetic
1689 types. */
1690 #define ARITHMETIC_TYPE_P(TYPE) \
1691 (CP_INTEGRAL_TYPE_P (TYPE) || TREE_CODE (TYPE) == REAL_TYPE)
1692
1693 /* Mark which labels are explicitly declared.
1694 These may be shadowed, and may be referenced from nested functions. */
1695 #define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label)
1696
1697 /* Nonzero for _TYPE means that the _TYPE defines
1698 at least one constructor. */
1699 #define TYPE_HAS_CONSTRUCTOR(NODE) (TYPE_LANG_FLAG_1(NODE))
1700
1701 /* When appearing in an INDIRECT_REF, it means that the tree structure
1702 underneath is actually a call to a constructor. This is needed
1703 when the constructor must initialize local storage (which can
1704 be automatically destroyed), rather than allowing it to allocate
1705 space from the heap.
1706
1707 When appearing in a SAVE_EXPR, it means that underneath
1708 is a call to a constructor.
1709
1710 When appearing in a CONSTRUCTOR, it means that it was
1711 a GNU C constructor expression.
1712
1713 When appearing in a FIELD_DECL, it means that this field
1714 has been duly initialized in its constructor. */
1715 #define TREE_HAS_CONSTRUCTOR(NODE) (TREE_LANG_FLAG_4(NODE))
1716
1717 #define EMPTY_CONSTRUCTOR_P(NODE) (TREE_CODE (NODE) == CONSTRUCTOR \
1718 && CONSTRUCTOR_ELTS (NODE) == NULL_TREE \
1719 && ! TREE_HAS_CONSTRUCTOR (NODE))
1720
1721 #if 0
1722 /* Indicates that a NON_LVALUE_EXPR came from a C++ reference.
1723 Used to generate more helpful error message in case somebody
1724 tries to take its address. */
1725 #define TREE_REFERENCE_EXPR(NODE) (TREE_LANG_FLAG_3(NODE))
1726 #endif
1727
1728 /* Nonzero for _TYPE means that the _TYPE defines a destructor. */
1729 #define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2(NODE))
1730
1731 #if 0
1732 /* Nonzero for _TYPE node means that creating an object of this type
1733 will involve a call to a constructor. This can apply to objects
1734 of ARRAY_TYPE if the type of the elements needs a constructor. */
1735 #define TYPE_NEEDS_CONSTRUCTING(NODE) ... defined in ../tree.h ...
1736 #endif
1737
1738 /* Nonzero means that an object of this type can not be initialized using
1739 an initializer list. */
1740 #define CLASSTYPE_NON_AGGREGATE(NODE) \
1741 (TYPE_LANG_SPECIFIC (NODE)->type_flags.non_aggregate)
1742 #define TYPE_NON_AGGREGATE_CLASS(NODE) \
1743 (IS_AGGR_TYPE (NODE) && CLASSTYPE_NON_AGGREGATE (NODE))
1744
1745 /* Nonzero if there is a user-defined X::op=(x&) for this class. */
1746 #define TYPE_HAS_REAL_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_real_assign_ref)
1747 #define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_complex_assign_ref)
1748 #define TYPE_HAS_ABSTRACT_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_abstract_assign_ref)
1749 #define TYPE_HAS_COMPLEX_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_complex_init_ref)
1750
1751 /* Nonzero for _TYPE node means that destroying an object of this type
1752 will involve a call to a destructor. This can apply to objects
1753 of ARRAY_TYPE is the type of the elements needs a destructor. */
1754 #define TYPE_NEEDS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_4(NODE))
1755
1756 /* Nonzero for class type means that initialization of this type can use
1757 a bitwise copy. */
1758 #define TYPE_HAS_TRIVIAL_INIT_REF(NODE) \
1759 (TYPE_HAS_INIT_REF (NODE) && ! TYPE_HAS_COMPLEX_INIT_REF (NODE))
1760
1761 /* Nonzero for class type means that assignment of this type can use
1762 a bitwise copy. */
1763 #define TYPE_HAS_TRIVIAL_ASSIGN_REF(NODE) \
1764 (TYPE_HAS_ASSIGN_REF (NODE) && ! TYPE_HAS_COMPLEX_ASSIGN_REF (NODE))
1765
1766 #define TYPE_PTRMEM_P(NODE) \
1767 (TREE_CODE (NODE) == POINTER_TYPE \
1768 && TREE_CODE (TREE_TYPE (NODE)) == OFFSET_TYPE)
1769 #define TYPE_PTR_P(NODE) \
1770 (TREE_CODE (NODE) == POINTER_TYPE \
1771 && TREE_CODE (TREE_TYPE (NODE)) != OFFSET_TYPE)
1772 #define TYPE_PTROB_P(NODE) \
1773 (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE \
1774 && TREE_CODE (TREE_TYPE (NODE)) != VOID_TYPE)
1775 #define TYPE_PTROBV_P(NODE) \
1776 (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE)
1777 #define TYPE_PTRFN_P(NODE) \
1778 (TREE_CODE (NODE) == POINTER_TYPE \
1779 && TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE)
1780
1781 /* Nonzero for _TYPE node means that this type is a pointer to member
1782 function type. */
1783 #define TYPE_PTRMEMFUNC_P(NODE) \
1784 (TREE_CODE(NODE) == RECORD_TYPE && TYPE_PTRMEMFUNC_FLAG (NODE))
1785 #define TYPE_PTRMEMFUNC_FLAG(NODE) \
1786 (TYPE_LANG_SPECIFIC(NODE)->type_flags.ptrmemfunc_flag)
1787
1788 /* A pointer-to-function member type looks like:
1789
1790 struct {
1791 short __delta;
1792 short __index;
1793 union {
1794 P __pfn;
1795 short __delta2;
1796 } __pfn_or_delta2;
1797 };
1798
1799 where P is a POINTER_TYPE to a METHOD_TYPE appropriate for the
1800 pointer to member. The fields are used as follows:
1801
1802 If __INDEX is -1, then the function to call is non-virtual, and
1803 is located at the address given by __PFN.
1804
1805 If __INDEX is zero, then this a NULL pointer-to-member.
1806
1807 Otherwise, the function to call is virtual. Then, __DELTA2 gives
1808 the offset from an instance of the object to the virtual function
1809 table, and __INDEX - 1 is the index into the vtable to use to
1810 find the function.
1811
1812 The value to use for the THIS parameter is the address of the
1813 object plus __DELTA.
1814
1815 For example, given:
1816
1817 struct B1 {
1818 int i;
1819 };
1820
1821 struct B2 {
1822 double d;
1823 void f();
1824 };
1825
1826 struct S : public B1, B2 {};
1827
1828 the pointer-to-member for `&S::f' looks like:
1829
1830 { 4, -1, { &f__2B2 } };
1831
1832 The `4' means that given an `S*' you have to add 4 bytes to get to
1833 the address of the `B2*'. Then, the -1 indicates that this is a
1834 non-virtual function. Of course, `&f__2B2' is the name of that
1835 function.
1836
1837 (Of course, the exact values may differ depending on the mangling
1838 scheme, sizes of types, and such.). */
1839
1840 /* Get the POINTER_TYPE to the METHOD_TYPE associated with this
1841 pointer to member function. TYPE_PTRMEMFUNC_P _must_ be true,
1842 before using this macro. */
1843 #define TYPE_PTRMEMFUNC_FN_TYPE(NODE) (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (NODE)))))))
1844
1845 /* Returns `A' for a type like `int (A::*)(double)' */
1846 #define TYPE_PTRMEMFUNC_OBJECT_TYPE(NODE) \
1847 TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (NODE)))
1848
1849 /* These are use to manipulate the canonical RECORD_TYPE from the
1850 hashed POINTER_TYPE, and can only be used on the POINTER_TYPE. */
1851 #define TYPE_GET_PTRMEMFUNC_TYPE(NODE) ((tree)TYPE_LANG_SPECIFIC(NODE))
1852 #define TYPE_SET_PTRMEMFUNC_TYPE(NODE, VALUE) (TYPE_LANG_SPECIFIC(NODE) = ((struct lang_type *)(void*)(VALUE)))
1853 /* These are to get the delta2 and pfn fields from a TYPE_PTRMEMFUNC_P. */
1854 #define DELTA2_FROM_PTRMEMFUNC(NODE) delta2_from_ptrmemfunc ((NODE))
1855 #define PFN_FROM_PTRMEMFUNC(NODE) pfn_from_ptrmemfunc ((NODE))
1856
1857 /* For a pointer-to-member constant `X::Y' this is the RECORD_TYPE for
1858 `X'. */
1859 #define PTRMEM_CST_CLASS(NODE) \
1860 (TYPE_PTRMEM_P (TREE_TYPE (NODE)) \
1861 ? TYPE_OFFSET_BASETYPE (TREE_TYPE (TREE_TYPE (NODE))) \
1862 : TYPE_PTRMEMFUNC_OBJECT_TYPE (TREE_TYPE (NODE)))
1863
1864 /* For a pointer-to-member constant `X::Y' this is the _DECL for
1865 `Y'. */
1866 #define PTRMEM_CST_MEMBER(NODE) (((ptrmem_cst_t) NODE)->member)
1867
1868 /* Nonzero for VAR_DECL and FUNCTION_DECL node means that `extern' was
1869 specified in its declaration. */
1870 #define DECL_THIS_EXTERN(NODE) (DECL_LANG_FLAG_2(NODE))
1871
1872 /* Nonzero for VAR_DECL and FUNCTION_DECL node means that `static' was
1873 specified in its declaration. */
1874 #define DECL_THIS_STATIC(NODE) (DECL_LANG_FLAG_6(NODE))
1875
1876 /* Nonzero in FUNCTION_DECL means it is really an operator.
1877 Just used to communicate formatting information to dbxout.c. */
1878 #define DECL_OPERATOR(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.operator_attr)
1879
1880 /* Nonzero if TYPE is an anonymous union or struct type. We have to use a
1881 flag for this because "A union for which objects or pointers are
1882 declared is not an anonymous union" [class.union]. */
1883 #define ANON_AGGR_TYPE_P(NODE) \
1884 (CLASS_TYPE_P (NODE) && TYPE_LANG_SPECIFIC (NODE)->type_flags.anon_aggr)
1885 #define SET_ANON_AGGR_TYPE_P(NODE) \
1886 (TYPE_LANG_SPECIFIC (NODE)->type_flags.anon_aggr = 1)
1887
1888 #define UNKNOWN_TYPE LANG_TYPE
1889
1890 /* Define fields and accessors for nodes representing declared names. */
1891
1892 #if 0
1893 /* C++: A derived class may be able to directly use the virtual
1894 function table of a base class. When it does so, it may
1895 still have a decl node used to access the virtual function
1896 table (so that variables of this type can initialize their
1897 virtual function table pointers by name). When such thievery
1898 is committed, know exactly which base class's virtual function
1899 table is the one being stolen. This effectively computes the
1900 transitive closure. */
1901 #define DECL_VPARENT(NODE) ((NODE)->decl.arguments)
1902 #endif
1903
1904 #define TYPE_WAS_ANONYMOUS(NODE) (TYPE_LANG_SPECIFIC (NODE)->type_flags.was_anonymous)
1905
1906 /* C++: all of these are overloaded! These apply only to TYPE_DECLs. */
1907
1908 /* The format of each node in the DECL_FRIENDLIST is as follows:
1909
1910 The TREE_PURPOSE will be the name of a function, i.e., an
1911 IDENTIFIER_NODE. The TREE_VALUE will be itself a TREE_LIST, the
1912 list of functions with that name which are friends. The
1913 TREE_PURPOSE of each node in this sublist will be error_mark_node,
1914 if the function was declared a friend individually, in which case
1915 the TREE_VALUE will be the function_decl. If, however, all
1916 functions with a given name in a class were declared to be friends,
1917 the TREE_PUROSE will be the class type, and the TREE_VALUE will be
1918 NULL_TREE. */
1919 #define DECL_FRIENDLIST(NODE) (DECL_INITIAL (NODE))
1920 #define FRIEND_NAME(LIST) (TREE_PURPOSE (LIST))
1921 #define FRIEND_DECLS(LIST) (TREE_VALUE (LIST))
1922
1923 /* The DECL_ACCESS, if non-NULL, is a TREE_LIST. The TREE_PURPOSE of
1924 each node is a type; the TREE_VALUE is the access granted for this
1925 DECL in that type. The DECL_ACCESS is set by access declarations.
1926 For example, if a member that would normally be public in a
1927 derived class is made protected, then the derived class and the
1928 protected_access_node will appear in the DECL_ACCESS for the node. */
1929 #define DECL_ACCESS(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.access)
1930
1931 /* C++: all of these are overloaded!
1932 These apply to PARM_DECLs and VAR_DECLs. */
1933 #define DECL_REFERENCE_SLOT(NODE) ((tree)(NODE)->decl.arguments)
1934 #define SET_DECL_REFERENCE_SLOT(NODE,VAL) ((NODE)->decl.arguments=VAL)
1935
1936 /* Accessor macros for C++ template decl nodes. */
1937
1938 /* The DECL_TEMPLATE_PARMS are a list. The TREE_PURPOSE of each node
1939 is a INT_CST whose TREE_INT_CST_HIGH indicates the level of the
1940 template parameters, with 1 being the outermost set of template
1941 parameters. The TREE_VALUE is a vector, whose elements are the
1942 template parameters at each level. Each element in the vector is a
1943 TREE_LIST, whose TREE_VALUE is a PARM_DECL (if the parameter is a
1944 non-type parameter), or a TYPE_DECL (if the parameter is a type
1945 parameter). The TREE_PURPOSE is the default value, if any. The
1946 TEMPLATE_PARM_INDEX for the parameter is avilable as the
1947 DECL_INITIAL (for a PARM_DECL) or as the TREE_TYPE (for a
1948 TYPE_DECL). */
1949 #define DECL_TEMPLATE_PARMS(NODE) DECL_ARGUMENTS(NODE)
1950 #define DECL_INNERMOST_TEMPLATE_PARMS(NODE) \
1951 INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (NODE))
1952 #define DECL_NTPARMS(NODE) \
1953 TREE_VEC_LENGTH (DECL_INNERMOST_TEMPLATE_PARMS (NODE))
1954 /* For function, method, class-data templates. */
1955 #define DECL_TEMPLATE_RESULT(NODE) DECL_RESULT(NODE)
1956 /* For a static member variable template, the
1957 DECL_TEMPLATE_INSTANTIATIONS list contains the explicitly and
1958 implicitly generated instantiations of the variable. There are no
1959 partial instantiations of static member variables, so all of these
1960 will be full instantiations.
1961
1962 For a class template the DECL_TEMPLATE_INSTANTIATIONS lists holds
1963 all instantiations and specializations of the class type, including
1964 partial instantiations and partial specializations.
1965
1966 In both cases, the TREE_PURPOSE of each node contains the arguments
1967 used; the TREE_VALUE contains the generated variable. The template
1968 arguments are always complete. For example, given:
1969
1970 template <class T> struct S1 {
1971 template <class U> struct S2 {};
1972 template <class U> struct S2<U*> {};
1973 };
1974
1975 the record for the partial specialization will contain, as its
1976 argument list, { {T}, {U*} }, and will be on the
1977 DECL_TEMPLATE_INSTANTIATIONS list for `template <class T> template
1978 <class U> struct S1<T>::S2'.
1979
1980 This list is not used for function templates. */
1981 #define DECL_TEMPLATE_INSTANTIATIONS(NODE) DECL_VINDEX(NODE)
1982 /* For a function template, the DECL_TEMPLATE_SPECIALIZATIONS lists
1983 contains all instantiations and specializations of the function,
1984 including partial instantiations. For a partial instantiation
1985 which is a specialization, this list holds only full
1986 specializations of the template that are instantiations of the
1987 partial instantiation. For example, given:
1988
1989 template <class T> struct S {
1990 template <class U> void f(U);
1991 template <> void f(T);
1992 };
1993
1994 the `S<int>::f<int>(int)' function will appear on the
1995 DECL_TEMPLATE_SPECIALIZATIONS list for both `template <class T>
1996 template <class U> void S<T>::f(U)' and `template <class T> void
1997 S<int>::f(T)'. In the latter case, however, it will have only the
1998 innermost set of arguments (T, in this case). The DECL_TI_TEMPLATE
1999 for the function declaration will point at the specialization, not
2000 the fully general template.
2001
2002 For a class template, this list contains the partial
2003 specializations of this template. (Full specializations are not
2004 recorded on this list.) The TREE_PURPOSE holds the innermost
2005 arguments used in the partial specialization (e.g., for `template
2006 <class T> struct S<T*, int>' this will be `T*'.) The TREE_VALUE
2007 holds the innermost template parameters for the specialization
2008 (e.g., `T' in the example above.) The TREE_TYPE is the _TYPE node
2009 for the partial specialization.
2010
2011 This list is not used for static variable templates. */
2012 #define DECL_TEMPLATE_SPECIALIZATIONS(NODE) DECL_SIZE(NODE)
2013
2014 /* Nonzero for a DECL which is actually a template parameter. */
2015 #define DECL_TEMPLATE_PARM_P(NODE) \
2016 DECL_LANG_FLAG_0 (NODE)
2017
2018 #define DECL_TEMPLATE_TEMPLATE_PARM_P(NODE) \
2019 (TREE_CODE (NODE) == TEMPLATE_DECL && DECL_TEMPLATE_PARM_P (NODE))
2020
2021 #define DECL_FUNCTION_TEMPLATE_P(NODE) \
2022 (TREE_CODE (NODE) == TEMPLATE_DECL \
2023 && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == FUNCTION_DECL)
2024
2025 /* Nonzero for a DECL that represents a template class. */
2026 #define DECL_CLASS_TEMPLATE_P(NODE) \
2027 (TREE_CODE (NODE) == TEMPLATE_DECL \
2028 && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == TYPE_DECL \
2029 && !DECL_TEMPLATE_TEMPLATE_PARM_P (NODE))
2030
2031 /* Nonzero if NODE which declares a type. */
2032 #define DECL_DECLARES_TYPE_P(NODE) \
2033 (TREE_CODE (NODE) == TYPE_DECL || DECL_CLASS_TEMPLATE_P (NODE))
2034
2035 /* A `primary' template is one that has its own template header. A
2036 member function of a class template is a template, but not primary.
2037 A member template is primary. Friend templates are primary, too. */
2038
2039 /* Returns the primary template corresponding to these parameters. */
2040 #define DECL_PRIMARY_TEMPLATE(NODE) \
2041 (TREE_TYPE (DECL_INNERMOST_TEMPLATE_PARMS (NODE)))
2042
2043 /* Returns non-zero if NODE is a primary template. */
2044 #define PRIMARY_TEMPLATE_P(NODE) (DECL_PRIMARY_TEMPLATE (NODE) == NODE)
2045
2046 #define CLASSTYPE_TEMPLATE_LEVEL(NODE) \
2047 (TREE_INT_CST_HIGH (TREE_PURPOSE (CLASSTYPE_TI_TEMPLATE (NODE))))
2048
2049 /* Indicates whether or not (and how) a template was expanded for this
2050 FUNCTION_DECL or VAR_DECL.
2051 0=normal declaration, e.g. int min (int, int);
2052 1=implicit template instantiation
2053 2=explicit template specialization, e.g. int min<int> (int, int);
2054 3=explicit template instantiation, e.g. template int min<int> (int, int); */
2055 #define DECL_USE_TEMPLATE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.use_template)
2056
2057 #define DECL_TEMPLATE_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) & 1)
2058 #define CLASSTYPE_TEMPLATE_INSTANTIATION(NODE) \
2059 (CLASSTYPE_USE_TEMPLATE (NODE) & 1)
2060
2061 #define DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) == 2)
2062 #define SET_DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) = 2)
2063 #define CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \
2064 (CLASSTYPE_USE_TEMPLATE (NODE) == 2)
2065 #define SET_CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \
2066 (CLASSTYPE_USE_TEMPLATE (NODE) = 2)
2067
2068 #define DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 1)
2069 #define SET_DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) = 1)
2070 #define CLASSTYPE_IMPLICIT_INSTANTIATION(NODE) \
2071 (CLASSTYPE_USE_TEMPLATE(NODE) == 1)
2072 #define SET_CLASSTYPE_IMPLICIT_INSTANTIATION(NODE) \
2073 (CLASSTYPE_USE_TEMPLATE(NODE) = 1)
2074
2075 #define DECL_EXPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 3)
2076 #define SET_DECL_EXPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) = 3)
2077 #define CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \
2078 (CLASSTYPE_USE_TEMPLATE(NODE) == 3)
2079 #define SET_CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \
2080 (CLASSTYPE_USE_TEMPLATE(NODE) = 3)
2081
2082 /* Non-zero if DECL is a friend function which is an instantiation
2083 from the point of view of the compiler, but not from the point of
2084 view of the language. For example given:
2085 template <class T> struct S { friend void f(T) {}; };
2086 the declaration of `void f(int)' generated when S<int> is
2087 instantiated will not be a DECL_TEMPLATE_INSTANTIATION, but will be
2088 a DECL_FRIEND_PSUEDO_TEMPLATE_INSTANTIATION. */
2089 #define DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION(DECL) \
2090 (DECL_TEMPLATE_INFO (DECL) && !DECL_USE_TEMPLATE (DECL))
2091
2092 /* Non-zero if TYPE is a partial instantiation of a template class,
2093 i.e., an instantiation whose instantiation arguments involve
2094 template types. */
2095 #define PARTIAL_INSTANTIATION_P(TYPE) \
2096 (TYPE_LANG_SPECIFIC (TYPE)->type_flags.is_partial_instantiation)
2097
2098 /* Non-zero iff we are currently processing a declaration for an
2099 entity with its own template parameter list, and which is not a
2100 full specialization. */
2101 #define PROCESSING_REAL_TEMPLATE_DECL_P() \
2102 (processing_template_decl > template_class_depth (current_class_type))
2103
2104 /* This function may be a guiding decl for a template. */
2105 #define DECL_MAYBE_TEMPLATE(NODE) DECL_LANG_FLAG_4 (NODE)
2106
2107 /* Nonzero if this VAR_DECL or FUNCTION_DECL has already been
2108 instantiated, i.e. its definition has been generated from the
2109 pattern given in the the template. */
2110 #define DECL_TEMPLATE_INSTANTIATED(NODE) DECL_LANG_FLAG_1(NODE)
2111
2112 /* We know what we're doing with this decl now. */
2113 #define DECL_INTERFACE_KNOWN(NODE) DECL_LANG_FLAG_5 (NODE)
2114
2115 /* This function was declared inline. This flag controls the linkage
2116 semantics of 'inline'; whether or not the function is inlined is
2117 controlled by DECL_INLINE. */
2118 #define DECL_THIS_INLINE(NODE) \
2119 (DECL_LANG_SPECIFIC (NODE)->decl_flags.declared_inline)
2120
2121 /* DECL_EXTERNAL must be set on a decl until the decl is actually emitted,
2122 so that assemble_external will work properly. So we have this flag to
2123 tell us whether the decl is really not external. */
2124 #define DECL_NOT_REALLY_EXTERN(NODE) \
2125 (DECL_LANG_SPECIFIC (NODE)->decl_flags.not_really_extern)
2126
2127 #define DECL_REALLY_EXTERN(NODE) \
2128 (DECL_EXTERNAL (NODE) && ! DECL_NOT_REALLY_EXTERN (NODE))
2129
2130 #define THUNK_DELTA(DECL) ((DECL)->decl.frame_size.i)
2131
2132 /* ...and for unexpanded-parameterized-type nodes. */
2133 #define UPT_TEMPLATE(NODE) TREE_PURPOSE(TYPE_VALUES(NODE))
2134 #define UPT_PARMS(NODE) TREE_VALUE(TYPE_VALUES(NODE))
2135
2136 /* An un-parsed default argument looks like an identifier. */
2137 #define DEFARG_NODE_CHECK(t) TREE_CHECK(t, DEFAULT_ARG)
2138 #define DEFARG_LENGTH(NODE) (DEFARG_NODE_CHECK(NODE)->identifier.length)
2139 #define DEFARG_POINTER(NODE) (DEFARG_NODE_CHECK(NODE)->identifier.pointer)
2140
2141 /* These macros provide convenient access to the various _STMT nodes
2142 created when parsing template declarations. */
2143 #define IF_COND(NODE) TREE_OPERAND (NODE, 0)
2144 #define THEN_CLAUSE(NODE) TREE_OPERAND (NODE, 1)
2145 #define ELSE_CLAUSE(NODE) TREE_OPERAND (NODE, 2)
2146 #define WHILE_COND(NODE) TREE_OPERAND (NODE, 0)
2147 #define WHILE_BODY(NODE) TREE_OPERAND (NODE, 1)
2148 #define DO_COND(NODE) TREE_OPERAND (NODE, 0)
2149 #define DO_BODY(NODE) TREE_OPERAND (NODE, 1)
2150 #define RETURN_EXPR(NODE) TREE_OPERAND (NODE, 0)
2151 #define EXPR_STMT_EXPR(NODE) TREE_OPERAND (NODE, 0)
2152 #define FOR_INIT_STMT(NODE) TREE_OPERAND (NODE, 0)
2153 #define FOR_COND(NODE) TREE_OPERAND (NODE, 1)
2154 #define FOR_EXPR(NODE) TREE_OPERAND (NODE, 2)
2155 #define FOR_BODY(NODE) TREE_OPERAND (NODE, 3)
2156 #define SWITCH_COND(NODE) TREE_OPERAND (NODE, 0)
2157 #define SWITCH_BODY(NODE) TREE_OPERAND (NODE, 1)
2158 #define CASE_LOW(NODE) TREE_OPERAND (NODE, 0)
2159 #define CASE_HIGH(NODE) TREE_OPERAND (NODE, 1)
2160 #define GOTO_DESTINATION(NODE) TREE_OPERAND (NODE, 0)
2161 #define TRY_STMTS(NODE) TREE_OPERAND (NODE, 0)
2162 #define TRY_HANDLERS(NODE) TREE_OPERAND (NODE, 1)
2163 #define HANDLER_PARMS(NODE) TREE_OPERAND (NODE, 0)
2164 #define HANDLER_BODY(NODE) TREE_OPERAND (NODE, 1)
2165 #define COMPOUND_BODY(NODE) TREE_OPERAND (NODE, 0)
2166 #define ASM_CV_QUAL(NODE) TREE_OPERAND (NODE, 0)
2167 #define ASM_STRING(NODE) TREE_OPERAND (NODE, 1)
2168 #define ASM_OUTPUTS(NODE) TREE_OPERAND (NODE, 2)
2169 #define ASM_INPUTS(NODE) TREE_OPERAND (NODE, 3)
2170 #define ASM_CLOBBERS(NODE) TREE_OPERAND (NODE, 4)
2171
2172 /* An enumeration of the kind of tags that C++ accepts. */
2173 enum tag_types { record_type, class_type, union_type, enum_type,
2174 signature_type };
2175
2176 /* The various kinds of lvalues we distinguish. */
2177 typedef enum cp_lvalue_kind {
2178 clk_none = 0, /* Things that are not an lvalue. */
2179 clk_ordinary = 1, /* An ordinary lvalue. */
2180 clk_class = 2, /* An rvalue of class-type. */
2181 clk_bitfield = 4, /* An lvalue for a bit-field. */
2182 } cp_lvalue_kind;
2183
2184 /* Zero means prototype weakly, as in ANSI C (no args means nothing).
2185 Each language context defines how this variable should be set. */
2186 extern int strict_prototype;
2187 extern int strict_prototypes_lang_c, strict_prototypes_lang_cplusplus;
2188
2189 /* Non-zero means that if a label exists, and no other identifier
2190 applies, use the value of the label. */
2191 extern int flag_labels_ok;
2192
2193 /* Non-zero means to collect statistics which might be expensive
2194 and to print them when we are done. */
2195 extern int flag_detailed_statistics;
2196
2197 /* Non-zero means warn in function declared in derived class has the
2198 same name as a virtual in the base class, but fails to match the
2199 type signature of any virtual function in the base class. */
2200 extern int warn_overloaded_virtual;
2201
2202 /* Nonzero means warn about use of multicharacter literals. */
2203 extern int warn_multichar;
2204
2205 /* Non-zero means warn if a non-templatized friend function is
2206 declared in a templatized class. This behavior is warned about with
2207 flag_guiding_decls in do_friend. */
2208 extern int warn_nontemplate_friend;
2209
2210 /* in c-common.c */
2211 extern void declare_function_name PROTO((void));
2212 extern void decl_attributes PROTO((tree, tree, tree));
2213 extern void init_function_format_info PROTO((void));
2214 extern void record_function_format PROTO((tree, tree, int, int, int));
2215 extern void check_function_format PROTO((tree, tree, tree));
2216 /* Print an error message for invalid operands to arith operation CODE.
2217 NOP_EXPR is used as a special case (see truthvalue_conversion). */
2218 extern void binary_op_error PROTO((enum tree_code));
2219 extern tree canonical_type_variant PROTO((tree));
2220 extern void c_expand_expr_stmt PROTO((tree));
2221 /* Validate the expression after `case' and apply default promotions. */
2222 extern tree check_case_value PROTO((tree));
2223 /* Concatenate a list of STRING_CST nodes into one STRING_CST. */
2224 extern tree combine_strings PROTO((tree));
2225 extern void constant_expression_warning PROTO((tree));
2226 extern tree convert_and_check PROTO((tree, tree));
2227 extern void overflow_warning PROTO((tree));
2228 extern void unsigned_conversion_warning PROTO((tree, tree));
2229 extern void c_apply_type_quals_to_decl PROTO((int, tree));
2230
2231 /* Read the rest of the current #-directive line. */
2232 #if USE_CPPLIB
2233 extern char *get_directive_line PROTO((void));
2234 #define GET_DIRECTIVE_LINE() get_directive_line ()
2235 #else
2236 extern char *get_directive_line PROTO((FILE *));
2237 #define GET_DIRECTIVE_LINE() get_directive_line (finput)
2238 #endif
2239 /* Subroutine of build_binary_op, used for comparison operations.
2240 See if the operands have both been converted from subword integer types
2241 and, if so, perhaps change them both back to their original type. */
2242 extern tree shorten_compare PROTO((tree *, tree *, tree *, enum tree_code *));
2243 /* Prepare expr to be an argument of a TRUTH_NOT_EXPR,
2244 or validate its data type for an `if' or `while' statement or ?..: exp. */
2245 extern tree truthvalue_conversion PROTO((tree));
2246 extern tree type_for_mode PROTO((enum machine_mode, int));
2247 extern tree type_for_size PROTO((unsigned, int));
2248 extern int c_get_alias_set PROTO((tree));
2249
2250 /* in decl{2}.c */
2251 extern tree this_identifier;
2252 extern tree ctor_identifier, dtor_identifier;
2253 extern tree pfn_identifier;
2254 extern tree index_identifier;
2255 extern tree delta_identifier;
2256 extern tree delta2_identifier;
2257 extern tree pfn_or_delta2_identifier;
2258 extern tree tag_identifier;
2259 extern tree vt_off_identifier;
2260
2261 /* A node that is a list (length 1) of error_mark_nodes. */
2262 extern tree error_mark_list;
2263
2264 /* Node for "pointer to (virtual) function".
2265 This may be distinct from ptr_type_node so gdb can distinguish them. */
2266 #define vfunc_ptr_type_node \
2267 (flag_vtable_thunks ? vtable_entry_type : ptr_type_node)
2268
2269
2270 /* For building calls to `delete'. */
2271 extern tree integer_two_node, integer_three_node;
2272
2273 extern tree null_node;
2274
2275 extern tree anonymous_namespace_name;
2276
2277 /* in pt.c */
2278
2279 /* These values are used for the `STRICT' parameter to type_unfication and
2280 fn_type_unification. Their meanings are described with the
2281 documentation for fn_type_unification. */
2282
2283 typedef enum unification_kind_t {
2284 DEDUCE_CALL,
2285 DEDUCE_CONV,
2286 DEDUCE_EXACT
2287 } unification_kind_t;
2288
2289 extern tree current_template_parms;
2290 extern HOST_WIDE_INT processing_template_decl;
2291 extern tree last_tree;
2292
2293 /* The template currently being instantiated, and where the instantiation
2294 was triggered. */
2295 struct tinst_level
2296 {
2297 tree decl;
2298 int line;
2299 char *file;
2300 struct tinst_level *next;
2301 };
2302
2303 extern int minimal_parse_mode;
2304
2305 extern void maybe_print_template_context PROTO ((void));
2306
2307 /* in class.c */
2308
2309 /* When parsing a class definition, the access specifier most recently
2310 given by the user, or, if no access specifier was given, the
2311 default value appropriate for the kind of class (i.e., struct,
2312 class, or union). */
2313 extern tree current_access_specifier;
2314
2315 extern tree current_class_name;
2316 extern tree current_class_type;
2317 extern tree current_class_ptr;
2318 extern tree previous_class_type;
2319 extern tree current_class_ref;
2320 extern int current_class_depth;
2321
2322 extern tree current_lang_name;
2323 extern tree lang_name_cplusplus, lang_name_c, lang_name_java;
2324
2325 /* The low-water mark on the class-cache obstack. */
2326 extern char *class_cache_firstobj;
2327
2328 /* Points to the name of that function. May not be the DECL_NAME
2329 of CURRENT_FUNCTION_DECL due to overloading */
2330 extern tree original_function_name;
2331
2332 /* in init.c */
2333 extern tree global_base_init_list;
2334 extern tree current_base_init_list, current_member_init_list;
2335
2336 extern int current_function_just_assigned_this;
2337 extern int current_function_parms_stored;
2338 \f
2339 /* Here's where we control how name mangling takes place. */
2340
2341 #define OPERATOR_ASSIGN_FORMAT "__a%s"
2342 #define OPERATOR_FORMAT "__%s"
2343 #define OPERATOR_TYPENAME_FORMAT "__op"
2344
2345 /* Cannot use '$' up front, because this confuses gdb
2346 (names beginning with '$' are gdb-local identifiers).
2347
2348 Note that all forms in which the '$' is significant are long enough
2349 for direct indexing (meaning that if we know there is a '$'
2350 at a particular location, we can index into the string at
2351 any other location that provides distinguishing characters). */
2352
2353 /* Define NO_DOLLAR_IN_LABEL in your favorite tm file if your assembler
2354 doesn't allow '$' in symbol names. */
2355 #ifndef NO_DOLLAR_IN_LABEL
2356
2357 #define JOINER '$'
2358
2359 #define VPTR_NAME "$v"
2360 #define THROW_NAME "$eh_throw"
2361 #define DESTRUCTOR_DECL_PREFIX "_$_"
2362 #define AUTO_VTABLE_NAME "__vtbl$me__"
2363 #define AUTO_TEMP_NAME "_$tmp_"
2364 #define AUTO_TEMP_FORMAT "_$tmp_%d"
2365 #define VTABLE_BASE "$vb"
2366 #define VTABLE_NAME_FORMAT (flag_vtable_thunks ? "__vt_%s" : "_vt$%s")
2367 #define VFIELD_BASE "$vf"
2368 #define VFIELD_NAME "_vptr$"
2369 #define VFIELD_NAME_FORMAT "_vptr$%s"
2370 #define VBASE_NAME "_vb$"
2371 #define VBASE_NAME_FORMAT "_vb$%s"
2372 #define STATIC_NAME_FORMAT "_%s$%s"
2373 #define ANON_AGGRNAME_FORMAT "$_%d"
2374
2375 #else /* NO_DOLLAR_IN_LABEL */
2376
2377 #ifndef NO_DOT_IN_LABEL
2378
2379 #define JOINER '.'
2380
2381 #define VPTR_NAME ".v"
2382 #define THROW_NAME ".eh_throw"
2383 #define DESTRUCTOR_DECL_PREFIX "_._"
2384 #define AUTO_VTABLE_NAME "__vtbl.me__"
2385 #define AUTO_TEMP_NAME "_.tmp_"
2386 #define AUTO_TEMP_FORMAT "_.tmp_%d"
2387 #define VTABLE_BASE ".vb"
2388 #define VTABLE_NAME_FORMAT (flag_vtable_thunks ? "__vt_%s" : "_vt.%s")
2389 #define VFIELD_BASE ".vf"
2390 #define VFIELD_NAME "_vptr."
2391 #define VFIELD_NAME_FORMAT "_vptr.%s"
2392 #define VBASE_NAME "_vb."
2393 #define VBASE_NAME_FORMAT "_vb.%s"
2394 #define STATIC_NAME_FORMAT "_%s.%s"
2395
2396 #define ANON_AGGRNAME_FORMAT "._%d"
2397
2398 #else /* NO_DOT_IN_LABEL */
2399
2400 #define VPTR_NAME "__vptr"
2401 #define VPTR_NAME_P(ID_NODE) \
2402 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VPTR_NAME, sizeof (VPTR_NAME) - 1))
2403 #define THROW_NAME "__eh_throw"
2404 #define DESTRUCTOR_DECL_PREFIX "__destr_"
2405 #define DESTRUCTOR_NAME_P(ID_NODE) \
2406 (!strncmp (IDENTIFIER_POINTER (ID_NODE), DESTRUCTOR_DECL_PREFIX, \
2407 sizeof (DESTRUCTOR_DECL_PREFIX) - 1))
2408 #define IN_CHARGE_NAME "__in_chrg"
2409 #define AUTO_VTABLE_NAME "__vtbl_me__"
2410 #define AUTO_TEMP_NAME "__tmp_"
2411 #define TEMP_NAME_P(ID_NODE) \
2412 (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, \
2413 sizeof (AUTO_TEMP_NAME) - 1))
2414 #define AUTO_TEMP_FORMAT "__tmp_%d"
2415 #define VTABLE_BASE "__vtb"
2416 #define VTABLE_NAME "__vt_"
2417 #define VTABLE_NAME_FORMAT (flag_vtable_thunks ? "__vt_%s" : "_vt_%s")
2418 #define VTABLE_NAME_P(ID_NODE) \
2419 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VTABLE_NAME, \
2420 sizeof (VTABLE_NAME) - 1))
2421 #define VFIELD_BASE "__vfb"
2422 #define VFIELD_NAME "__vptr_"
2423 #define VFIELD_NAME_P(ID_NODE) \
2424 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, \
2425 sizeof (VFIELD_NAME) - 1))
2426 #define VFIELD_NAME_FORMAT "_vptr_%s"
2427 #define VBASE_NAME "__vb_"
2428 #define VBASE_NAME_P(ID_NODE) \
2429 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VBASE_NAME, \
2430 sizeof (VBASE_NAME) - 1))
2431 #define VBASE_NAME_FORMAT "__vb_%s"
2432 #define STATIC_NAME_FORMAT "__static_%s_%s"
2433
2434 #define ANON_AGGRNAME_PREFIX "__anon_"
2435 #define ANON_AGGRNAME_P(ID_NODE) \
2436 (!strncmp (IDENTIFIER_POINTER (ID_NODE), ANON_AGGRNAME_PREFIX, \
2437 sizeof (ANON_AGGRNAME_PREFIX) - 1))
2438 #define ANON_AGGRNAME_FORMAT "__anon_%d"
2439 #define ANON_PARMNAME_FORMAT "__%d"
2440 #define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \
2441 && IDENTIFIER_POINTER (ID_NODE)[1] == '_' \
2442 && IDENTIFIER_POINTER (ID_NODE)[2] <= '9')
2443
2444 #endif /* NO_DOT_IN_LABEL */
2445 #endif /* NO_DOLLAR_IN_LABEL */
2446
2447 #define THIS_NAME "this"
2448 #define DESTRUCTOR_NAME_FORMAT "~%s"
2449 #define FILE_FUNCTION_PREFIX_LEN 9
2450 #define CTOR_NAME "__ct"
2451 #define DTOR_NAME "__dt"
2452
2453 #define IN_CHARGE_NAME "__in_chrg"
2454
2455 #define VTBL_PTR_TYPE "__vtbl_ptr_type"
2456 #define VTABLE_DELTA_NAME "__delta"
2457 #define VTABLE_INDEX_NAME "__index"
2458 #define VTABLE_PFN_NAME "__pfn"
2459 #define VTABLE_DELTA2_NAME "__delta2"
2460
2461 #define SIGNATURE_FIELD_NAME "__s_"
2462 #define SIGNATURE_FIELD_NAME_FORMAT "__s_%s"
2463 #define SIGNATURE_OPTR_NAME "__optr"
2464 #define SIGNATURE_SPTR_NAME "__sptr"
2465 #define SIGNATURE_POINTER_NAME "__sp_"
2466 #define SIGNATURE_POINTER_NAME_FORMAT "__%s%s%ssp_%s"
2467 #define SIGNATURE_REFERENCE_NAME "__sr_"
2468 #define SIGNATURE_REFERENCE_NAME_FORMAT "__%s%s%ssr_%s"
2469
2470 #define SIGTABLE_PTR_TYPE "__sigtbl_ptr_type"
2471 #define SIGTABLE_NAME_FORMAT "__st_%s_%s"
2472 #define SIGTABLE_NAME_FORMAT_LONG "__st_%s_%s_%d"
2473 #define SIGTABLE_TAG_NAME "__tag"
2474 #define SIGTABLE_VB_OFF_NAME "__vb_off"
2475 #define SIGTABLE_VT_OFF_NAME "__vt_off"
2476 #define EXCEPTION_CLEANUP_NAME "exception cleanup"
2477
2478 #define THIS_NAME_P(ID_NODE) (strcmp(IDENTIFIER_POINTER (ID_NODE), "this") == 0)
2479
2480 #if !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL)
2481
2482 #define VPTR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
2483 && IDENTIFIER_POINTER (ID_NODE)[1] == 'v')
2484 #define DESTRUCTOR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == JOINER \
2485 && IDENTIFIER_POINTER (ID_NODE)[2] == '_')
2486
2487 #define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \
2488 && IDENTIFIER_POINTER (ID_NODE)[2] == 't' \
2489 && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER)
2490
2491 #define VBASE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \
2492 && IDENTIFIER_POINTER (ID_NODE)[2] == 'b' \
2493 && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER)
2494
2495 #define TEMP_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, sizeof (AUTO_TEMP_NAME)-1))
2496 #define VFIELD_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, sizeof(VFIELD_NAME)-1))
2497
2498 /* For anonymous aggregate types, we need some sort of name to
2499 hold on to. In practice, this should not appear, but it should
2500 not be harmful if it does. */
2501 #define ANON_AGGRNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
2502 && IDENTIFIER_POINTER (ID_NODE)[1] == '_')
2503 #define ANON_PARMNAME_FORMAT "_%d"
2504 #define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \
2505 && IDENTIFIER_POINTER (ID_NODE)[1] <= '9')
2506 #endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */
2507
2508 /* Store the vbase pointer field name for type TYPE into pointer BUF. */
2509 #define FORMAT_VBASE_NAME(BUF,TYPE) do { \
2510 char *wbuf = (char *) alloca (TYPE_ASSEMBLER_NAME_LENGTH (TYPE) \
2511 + sizeof (VBASE_NAME) + 1); \
2512 sprintf (wbuf, VBASE_NAME_FORMAT, TYPE_ASSEMBLER_NAME_STRING (TYPE)); \
2513 (BUF) = wbuf; \
2514 } while (0)
2515
2516 /* Returns non-zero iff ID_NODE is an IDENTIFIER_NODE whose name is
2517 `main'. */
2518 #define MAIN_NAME_P(ID_NODE) \
2519 (strcmp (IDENTIFIER_POINTER (ID_NODE), "main") == 0)
2520
2521 /* Returns non-zero iff NODE is a declaration for the global function
2522 `main'. */
2523 #define DECL_MAIN_P(NODE) \
2524 (TREE_CODE (NODE) == FUNCTION_DECL \
2525 && DECL_LANGUAGE (NODE) == lang_c \
2526 && DECL_NAME (NODE) != NULL_TREE \
2527 && MAIN_NAME_P (DECL_NAME (NODE)))
2528
2529 \f
2530 /* Define the sets of attributes that member functions and baseclasses
2531 can have. These are sensible combinations of {public,private,protected}
2532 cross {virtual,non-virtual}. */
2533
2534 /* in class.c. */
2535 extern tree access_default_node; /* 0 */
2536 extern tree access_public_node; /* 1 */
2537 extern tree access_protected_node; /* 2 */
2538 extern tree access_private_node; /* 3 */
2539 extern tree access_default_virtual_node; /* 4 */
2540 extern tree access_public_virtual_node; /* 5 */
2541 extern tree access_protected_virtual_node; /* 6 */
2542 extern tree access_private_virtual_node; /* 7 */
2543
2544 /* Things for handling inline functions. */
2545
2546 struct pending_inline
2547 {
2548 struct pending_inline *next; /* pointer to next in chain */
2549 int lineno; /* line number we got the text from */
2550 char *filename; /* name of file we were processing */
2551 tree fndecl; /* FUNCTION_DECL that brought us here */
2552 int token; /* token we were scanning */
2553 int token_value; /* value of token we were scanning (YYSTYPE) */
2554
2555 char *buf; /* pointer to character stream */
2556 int len; /* length of stream */
2557 unsigned int can_free : 1; /* free this after we're done with it? */
2558 unsigned int deja_vu : 1; /* set iff we don't want to see it again. */
2559 unsigned int interface : 2; /* 0=interface 1=unknown 2=implementation */
2560 };
2561
2562 /* in method.c */
2563 extern struct pending_inline *pending_inlines;
2564
2565 /* Positive values means that we cannot make optimizing assumptions about
2566 `this'. Negative values means we know `this' to be of static type. */
2567
2568 extern int flag_this_is_variable;
2569
2570 /* Nonzero means generate 'rtti' that give run-time type information. */
2571
2572 extern int flag_rtti;
2573
2574 /* Nonzero means do emit exported implementations of functions even if
2575 they can be inlined. */
2576
2577 extern int flag_implement_inlines;
2578
2579 /* Nonzero means templates obey #pragma interface and implementation. */
2580
2581 extern int flag_external_templates;
2582
2583 /* Nonzero means templates are emitted where they are instantiated. */
2584
2585 extern int flag_alt_external_templates;
2586
2587 /* Nonzero means implicit template instantiations are emitted. */
2588
2589 extern int flag_implicit_templates;
2590
2591 /* Nonzero if we want to emit defined symbols with common-like linkage as
2592 weak symbols where possible, in order to conform to C++ semantics.
2593 Otherwise, emit them as local symbols. */
2594
2595 extern int flag_weak;
2596
2597 /* Nonzero to enable experimental ABI changes. */
2598
2599 extern int flag_new_abi;
2600
2601 /* Nonzero to not ignore namespace std. */
2602
2603 extern int flag_honor_std;
2604
2605 /* Nonzero if we're done parsing and into end-of-file activities. */
2606
2607 extern int at_eof;
2608
2609 enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
2610
2611 /* The following two can be derived from the previous one */
2612 extern tree current_class_name; /* IDENTIFIER_NODE: name of current class */
2613
2614 /* Some macros for char-based bitfields. */
2615 #define B_SET(a,x) (a[x>>3] |= (1 << (x&7)))
2616 #define B_CLR(a,x) (a[x>>3] &= ~(1 << (x&7)))
2617 #define B_TST(a,x) (a[x>>3] & (1 << (x&7)))
2618
2619 /* These are uses as bits in flags passed to build_method_call
2620 to control its error reporting behavior.
2621
2622 LOOKUP_PROTECT means flag access violations.
2623 LOOKUP_COMPLAIN mean complain if no suitable member function
2624 matching the arguments is found.
2625 LOOKUP_NORMAL is just a combination of these two.
2626 LOOKUP_NONVIRTUAL means make a direct call to the member function found
2627 LOOKUP_GLOBAL means search through the space of overloaded functions,
2628 as well as the space of member functions.
2629 LOOKUP_HAS_IN_CHARGE means that the "in charge" variable is already
2630 in the parameter list.
2631 LOOKUP_ONLYCONVERTING means that non-conversion constructors are not tried.
2632 DIRECT_BIND means that if a temporary is created, it should be created so
2633 that it lives as long as the current variable bindings; otherwise it
2634 only lives until the end of the complete-expression.
2635 LOOKUP_SPECULATIVELY means return NULL_TREE if we cannot find what we are
2636 after. Note, LOOKUP_COMPLAIN is checked and error messages printed
2637 before LOOKUP_SPECULATIVELY is checked.
2638 LOOKUP_NO_CONVERSION means that user-defined conversions are not
2639 permitted. Built-in conversions are permitted.
2640 LOOKUP_DESTRUCTOR means explicit call to destructor.
2641 LOOKUP_NO_TEMP_BIND means temporaries will not be bound to references.
2642
2643 These are used in global lookup to support elaborated types and
2644 qualifiers.
2645
2646 LOOKUP_PREFER_TYPES means not to accept objects, and possibly namespaces.
2647 LOOKUP_PREFER_NAMESPACES means not to accept objects, and possibly types.
2648 LOOKUP_PREFER_BOTH means class-or-namespace-name.
2649 LOOKUP_TEMPLATES_EXPECTED means that class templates also count
2650 as types. */
2651
2652 #define LOOKUP_PROTECT (1)
2653 #define LOOKUP_COMPLAIN (2)
2654 #define LOOKUP_NORMAL (3)
2655 /* #define LOOKUP_UNUSED (4) */
2656 #define LOOKUP_NONVIRTUAL (8)
2657 #define LOOKUP_GLOBAL (16)
2658 #define LOOKUP_HAS_IN_CHARGE (32)
2659 #define LOOKUP_SPECULATIVELY (64)
2660 #define LOOKUP_ONLYCONVERTING (128)
2661 #define DIRECT_BIND (256)
2662 #define LOOKUP_NO_CONVERSION (512)
2663 #define LOOKUP_DESTRUCTOR (512)
2664 #define LOOKUP_NO_TEMP_BIND (1024)
2665 #define LOOKUP_PREFER_TYPES (2048)
2666 #define LOOKUP_PREFER_NAMESPACES (4096)
2667 #define LOOKUP_PREFER_BOTH (6144)
2668 #define LOOKUP_TEMPLATES_EXPECTED (8192)
2669
2670 #define LOOKUP_NAMESPACES_ONLY(f) \
2671 (((f) & LOOKUP_PREFER_NAMESPACES) && !((f) & LOOKUP_PREFER_TYPES))
2672 #define LOOKUP_TYPES_ONLY(f) \
2673 (!((f) & LOOKUP_PREFER_NAMESPACES) && ((f) & LOOKUP_PREFER_TYPES))
2674 #define LOOKUP_QUALIFIERS_ONLY(f) ((f) & LOOKUP_PREFER_BOTH)
2675
2676
2677 /* These flags are used by the conversion code.
2678 CONV_IMPLICIT : Perform implicit conversions (standard and user-defined).
2679 CONV_STATIC : Perform the explicit conversions for static_cast.
2680 CONV_CONST : Perform the explicit conversions for const_cast.
2681 CONV_REINTERPRET: Perform the explicit conversions for reinterpret_cast.
2682 CONV_PRIVATE : Perform upcasts to private bases.
2683 CONV_FORCE_TEMP : Require a new temporary when converting to the same
2684 aggregate type. */
2685
2686 #define CONV_IMPLICIT 1
2687 #define CONV_STATIC 2
2688 #define CONV_CONST 4
2689 #define CONV_REINTERPRET 8
2690 #define CONV_PRIVATE 16
2691 /* #define CONV_NONCONVERTING 32 */
2692 #define CONV_FORCE_TEMP 64
2693 #define CONV_STATIC_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_FORCE_TEMP)
2694 #define CONV_OLD_CONVERT (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \
2695 | CONV_REINTERPRET)
2696 #define CONV_C_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \
2697 | CONV_REINTERPRET | CONV_PRIVATE | CONV_FORCE_TEMP)
2698
2699 /* Used by build_expr_type_conversion to indicate which types are
2700 acceptable as arguments to the expression under consideration. */
2701
2702 #define WANT_INT 1 /* integer types, including bool */
2703 #define WANT_FLOAT 2 /* floating point types */
2704 #define WANT_ENUM 4 /* enumerated types */
2705 #define WANT_POINTER 8 /* pointer types */
2706 #define WANT_NULL 16 /* null pointer constant */
2707 #define WANT_ARITH (WANT_INT | WANT_FLOAT)
2708
2709 /* Used with comptypes, and related functions, to guide type
2710 comparison. */
2711
2712 #define COMPARE_STRICT 0 /* Just check if the types are the
2713 same. */
2714 #define COMPARE_BASE 1 /* Check to see if the second type is
2715 derived from the first, or if both
2716 are pointers (or references) and
2717 the types pointed to by the second
2718 type is derived from the pointed to
2719 by the first. */
2720 #define COMPARE_RELAXED 2 /* Like COMPARE_DERIVED, but in
2721 reverse. Also treat enmeration
2722 types as the same as integer types
2723 of the same width. */
2724 #define COMPARE_REDECLARATION 4 /* The comparsion is being done when
2725 another declaration of an existing
2726 entity is seen. */
2727 #define COMPARE_NO_ATTRIBUTES 8 /* The comparison should ignore
2728 extra-linguistic type attributes. */
2729
2730 /* Used with push_overloaded_decl. */
2731 #define PUSH_GLOBAL 0 /* Push the DECL into namespace scope,
2732 regardless of the current scope. */
2733 #define PUSH_LOCAL 1 /* Push the DECL into the current
2734 scope. */
2735 #define PUSH_USING 2 /* We are pushing this DECL as the
2736 result of a using declaration. */
2737
2738 /* Returns nonzero iff TYPE1 and TYPE2 are the same type, in the usual
2739 sense of `same'. */
2740 #define same_type_p(type1, type2) \
2741 comptypes ((type1), (type2), COMPARE_STRICT)
2742
2743 /* Returns nonzero iff TYPE1 and TYPE2 are the same type, or if TYPE2
2744 is derived from TYPE1, or if TYPE2 is a pointer (reference) to a
2745 class derived from the type pointed to (referred to) by TYPE1. */
2746 #define same_or_base_type_p(type1, type2) \
2747 comptypes ((type1), (type2), COMPARE_BASE)
2748
2749 /* These macros are used to access a TEMPLATE_PARM_INDEX. */
2750 #define TEMPLATE_PARM_IDX(NODE) (((template_parm_index*) NODE)->index)
2751 #define TEMPLATE_PARM_LEVEL(NODE) (((template_parm_index*) NODE)->level)
2752 #define TEMPLATE_PARM_DESCENDANTS(NODE) (TREE_CHAIN (NODE))
2753 #define TEMPLATE_PARM_ORIG_LEVEL(NODE) (((template_parm_index*) NODE)->orig_level)
2754 #define TEMPLATE_PARM_DECL(NODE) (((template_parm_index*) NODE)->decl)
2755
2756 /* These macros are for accessing the fields of TEMPLATE_TYPE_PARM
2757 and TEMPLATE_TEMPLATE_PARM nodes. */
2758 #define TEMPLATE_TYPE_PARM_INDEX(NODE) (TYPE_FIELDS (NODE))
2759 #define TEMPLATE_TYPE_IDX(NODE) \
2760 (TEMPLATE_PARM_IDX (TEMPLATE_TYPE_PARM_INDEX (NODE)))
2761 #define TEMPLATE_TYPE_LEVEL(NODE) \
2762 (TEMPLATE_PARM_LEVEL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
2763 #define TEMPLATE_TYPE_ORIG_LEVEL(NODE) \
2764 (TEMPLATE_PARM_ORIG_LEVEL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
2765 #define TEMPLATE_TYPE_DECL(NODE) \
2766 (TEMPLATE_PARM_DECL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
2767
2768 /* in lex.c */
2769 /* Indexed by TREE_CODE, these tables give C-looking names to
2770 operators represented by TREE_CODES. For example,
2771 opname_tab[(int) MINUS_EXPR] == "-". */
2772 extern char **opname_tab, **assignop_tab;
2773 \f
2774 /* in call.c */
2775 extern int check_dtor_name PROTO((tree, tree));
2776 extern int get_arglist_len_in_bytes PROTO((tree));
2777
2778 extern tree build_vfield_ref PROTO((tree, tree));
2779 extern tree resolve_scope_to_name PROTO((tree, tree));
2780 extern tree build_scoped_method_call PROTO((tree, tree, tree, tree));
2781 extern tree build_addr_func PROTO((tree));
2782 extern tree build_call PROTO((tree, tree, tree));
2783 extern tree build_method_call PROTO((tree, tree, tree, tree, int));
2784 extern int null_ptr_cst_p PROTO((tree));
2785 extern tree type_decays_to PROTO((tree));
2786 extern tree build_user_type_conversion PROTO((tree, tree, int));
2787 extern tree build_new_function_call PROTO((tree, tree));
2788 extern tree build_new_op PROTO((enum tree_code, int, tree, tree, tree));
2789 extern tree build_op_new_call PROTO((enum tree_code, tree, tree, int));
2790 extern tree build_op_delete_call PROTO((enum tree_code, tree, tree, int, tree));
2791 extern int can_convert PROTO((tree, tree));
2792 extern int can_convert_arg PROTO((tree, tree, tree));
2793 extern int enforce_access PROTO((tree, tree));
2794 extern tree convert_default_arg PROTO((tree, tree, tree));
2795 extern tree convert_arg_to_ellipsis PROTO((tree));
2796 extern int is_properly_derived_from PROTO((tree, tree));
2797 extern tree initialize_reference PROTO((tree, tree));
2798 extern tree strip_top_quals PROTO((tree));
2799 extern tree perform_implicit_conversion PROTO((tree, tree));
2800
2801 /* in class.c */
2802 extern tree build_vbase_path PROTO((enum tree_code, tree, tree, tree, int));
2803 extern tree build_vtbl_ref PROTO((tree, tree));
2804 extern tree build_vfn_ref PROTO((tree *, tree, tree));
2805 extern void add_method PROTO((tree, tree *, tree));
2806 extern int currently_open_class PROTO((tree));
2807 extern tree get_vfield_offset PROTO((tree));
2808 extern void duplicate_tag_error PROTO((tree));
2809 extern tree finish_struct PROTO((tree, tree));
2810 extern void finish_struct_1 PROTO((tree));
2811 extern int resolves_to_fixed_type_p PROTO((tree, int *));
2812 extern void init_class_processing PROTO((void));
2813 extern int is_empty_class PROTO((tree));
2814 extern void pushclass PROTO((tree, int));
2815 extern void popclass PROTO((void));
2816 extern void push_nested_class PROTO((tree, int));
2817 extern void pop_nested_class PROTO((void));
2818 extern void push_lang_context PROTO((tree));
2819 extern void pop_lang_context PROTO((void));
2820 extern tree instantiate_type PROTO((tree, tree, int));
2821 extern void print_class_statistics PROTO((void));
2822 extern void push_cache_obstack PROTO((void));
2823 extern unsigned HOST_WIDE_INT skip_rtti_stuff PROTO((tree *, tree));
2824 extern void build_self_reference PROTO((void));
2825 extern void warn_hidden PROTO((tree));
2826 extern tree get_enclosing_class PROTO((tree));
2827 int is_base_of_enclosing_class PROTO((tree, tree));
2828 extern void unreverse_member_declarations PROTO((tree));
2829 extern void invalidate_class_lookup_cache PROTO((void));
2830 extern void maybe_note_name_used_in_class PROTO((tree, tree));
2831 extern void note_name_declared_in_class PROTO((tree, tree));
2832
2833 /* in cvt.c */
2834 extern tree convert_to_reference PROTO((tree, tree, int, int, tree));
2835 extern tree convert_from_reference PROTO((tree));
2836 extern tree convert_pointer_to_real PROTO((tree, tree));
2837 extern tree convert_pointer_to PROTO((tree, tree));
2838 extern tree ocp_convert PROTO((tree, tree, int, int));
2839 extern tree cp_convert PROTO((tree, tree));
2840 extern tree convert PROTO((tree, tree));
2841 extern tree convert_force PROTO((tree, tree, int));
2842 extern tree build_type_conversion PROTO((tree, tree, int));
2843 extern tree build_expr_type_conversion PROTO((int, tree, int));
2844 extern tree type_promotes_to PROTO((tree));
2845 extern tree perform_qualification_conversions PROTO((tree, tree));
2846
2847 /* decl.c */
2848 /* resume_binding_level */
2849 extern void set_identifier_local_value PROTO((tree, tree));
2850 extern int global_bindings_p PROTO((void));
2851 extern int toplevel_bindings_p PROTO((void));
2852 extern int namespace_bindings_p PROTO((void));
2853 extern void keep_next_level PROTO((void));
2854 extern int kept_level_p PROTO((void));
2855 extern void declare_parm_level PROTO((void));
2856 extern void declare_pseudo_global_level PROTO((void));
2857 extern int pseudo_global_level_p PROTO((void));
2858 extern void set_class_shadows PROTO((tree));
2859 extern void pushlevel PROTO((int));
2860 extern void note_level_for_for PROTO((void));
2861 extern void pushlevel_temporary PROTO((int));
2862 extern tree poplevel PROTO((int, int, int));
2863 extern void resume_level PROTO((struct binding_level *));
2864 extern void delete_block PROTO((tree));
2865 extern void insert_block PROTO((tree));
2866 extern void add_block_current_level PROTO((tree));
2867 extern void set_block PROTO((tree));
2868 extern void pushlevel_class PROTO((void));
2869 extern void print_binding_stack PROTO((void));
2870 extern void print_binding_level PROTO((struct binding_level *));
2871 extern void push_namespace PROTO((tree));
2872 extern void pop_namespace PROTO((void));
2873 extern void push_nested_namespace PROTO((tree));
2874 extern void pop_nested_namespace PROTO((tree));
2875 extern void maybe_push_to_top_level PROTO((int));
2876 extern void push_to_top_level PROTO((void));
2877 extern void pop_from_top_level PROTO((void));
2878 extern tree identifier_type_value PROTO((tree));
2879 extern void set_identifier_type_value PROTO((tree, tree));
2880 extern void pop_everything PROTO((void));
2881 extern void pushtag PROTO((tree, tree, int));
2882 extern tree make_anon_name PROTO((void));
2883 extern void clear_anon_tags PROTO((void));
2884 extern int decls_match PROTO((tree, tree));
2885 extern int duplicate_decls PROTO((tree, tree));
2886 extern tree pushdecl PROTO((tree));
2887 extern tree pushdecl_top_level PROTO((tree));
2888 extern void pushdecl_class_level PROTO((tree));
2889 #if 0
2890 extern void pushdecl_nonclass_level PROTO((tree));
2891 #endif
2892 extern tree pushdecl_namespace_level PROTO((tree));
2893 extern tree push_using_decl PROTO((tree, tree));
2894 extern tree push_using_directive PROTO((tree));
2895 extern void push_class_level_binding PROTO((tree, tree));
2896 extern tree implicitly_declare PROTO((tree));
2897 extern tree lookup_label PROTO((tree));
2898 extern tree shadow_label PROTO((tree));
2899 extern tree define_label PROTO((char *, int, tree));
2900 extern void push_switch PROTO((void));
2901 extern void pop_switch PROTO((void));
2902 extern void define_case_label PROTO((void));
2903 extern tree getdecls PROTO((void));
2904 extern tree gettags PROTO((void));
2905 #if 0
2906 extern void set_current_level_tags_transparency PROTO((int));
2907 #endif
2908 extern tree binding_for_name PROTO((tree, tree));
2909 extern tree namespace_binding PROTO((tree, tree));
2910 extern void set_namespace_binding PROTO((tree, tree, tree));
2911 extern tree lookup_namespace_name PROTO((tree, tree));
2912 extern tree build_typename_type PROTO((tree, tree, tree, tree));
2913 extern tree make_typename_type PROTO((tree, tree));
2914 extern tree lookup_name_nonclass PROTO((tree));
2915 extern tree lookup_function_nonclass PROTO((tree, tree));
2916 extern tree lookup_name PROTO((tree, int));
2917 extern tree lookup_name_current_level PROTO((tree));
2918 extern tree lookup_type_current_level PROTO((tree));
2919 extern tree lookup_name_namespace_only PROTO((tree));
2920 extern void begin_only_namespace_names PROTO((void));
2921 extern void end_only_namespace_names PROTO((void));
2922 extern tree namespace_ancestor PROTO((tree, tree));
2923 extern int lookup_using_namespace PROTO((tree,tree,tree,tree,int));
2924 extern int qualified_lookup_using_namespace PROTO((tree,tree,tree,int));
2925 extern tree auto_function PROTO((tree, tree, enum built_in_function));
2926 extern void init_decl_processing PROTO((void));
2927 extern int init_type_desc PROTO((void));
2928 extern tree define_function
2929 PROTO((const char *, tree, enum built_in_function,
2930 void (*) (tree), const char *));
2931 extern tree check_tag_decl PROTO((tree));
2932 extern void shadow_tag PROTO((tree));
2933 extern tree groktypename PROTO((tree));
2934 extern tree start_decl PROTO((tree, tree, int, tree, tree));
2935 extern void start_decl_1 PROTO((tree));
2936 extern void cp_finish_decl PROTO((tree, tree, tree, int, int));
2937 extern void finish_decl PROTO((tree, tree, tree));
2938 extern void expand_static_init PROTO((tree, tree));
2939 extern int complete_array_type PROTO((tree, tree, int));
2940 extern tree build_ptrmemfunc_type PROTO((tree));
2941 /* the grokdeclarator prototype is in decl.h */
2942 extern int parmlist_is_exprlist PROTO((tree));
2943 extern int copy_args_p PROTO((tree));
2944 extern int grok_ctor_properties PROTO((tree, tree));
2945 extern void grok_op_properties PROTO((tree, int, int));
2946 extern tree xref_tag PROTO((tree, tree, int));
2947 extern tree xref_tag_from_type PROTO((tree, tree, int));
2948 extern void xref_basetypes PROTO((tree, tree, tree, tree));
2949 extern tree start_enum PROTO((tree));
2950 extern tree finish_enum PROTO((tree));
2951 extern tree build_enumerator PROTO((tree, tree, tree));
2952 extern int start_function PROTO((tree, tree, tree, int));
2953 extern void expand_start_early_try_stmts PROTO((void));
2954 extern void store_parm_decls PROTO((void));
2955 extern void store_return_init PROTO((tree, tree));
2956 extern void finish_function PROTO((int, int, int));
2957 extern tree start_method PROTO((tree, tree, tree));
2958 extern tree finish_method PROTO((tree));
2959 extern void hack_incomplete_structures PROTO((tree));
2960 extern tree maybe_build_cleanup_and_delete PROTO((tree));
2961 extern tree maybe_build_cleanup PROTO((tree));
2962 extern void cplus_expand_expr_stmt PROTO((tree));
2963 extern void finish_stmt PROTO((void));
2964 extern void push_cp_function_context PROTO((tree));
2965 extern void pop_cp_function_context PROTO((tree));
2966 extern int in_function_p PROTO((void));
2967 extern void replace_defarg PROTO((tree, tree));
2968 extern void print_other_binding_stack PROTO((struct binding_level *));
2969 extern void revert_static_member_fn PROTO((tree*, tree*, tree*));
2970 extern void fixup_anonymous_aggr PROTO((tree));
2971 extern int check_static_variable_definition PROTO((tree, tree));
2972 extern void push_local_binding PROTO((tree, tree, int));
2973 extern int push_class_binding PROTO((tree, tree));
2974 extern tree check_default_argument PROTO((tree, tree));
2975 extern tree push_overloaded_decl PROTO((tree, int));
2976 extern void clear_identifier_class_values PROTO((void));
2977 extern void storetags PROTO((tree));
2978 extern int vtable_decl_p PROTO((tree, void *));
2979 extern int vtype_decl_p PROTO((tree, void *));
2980 extern int sigtable_decl_p PROTO((tree, void *));
2981 typedef int (*walk_globals_pred) PROTO((tree, void *));
2982 typedef int (*walk_globals_fn) PROTO((tree *, void *));
2983 extern int walk_globals PROTO((walk_globals_pred,
2984 walk_globals_fn,
2985 void *));
2986 typedef int (*walk_namespaces_fn) PROTO((tree, void *));
2987 extern int walk_namespaces PROTO((walk_namespaces_fn,
2988 void *));
2989 extern int wrapup_globals_for_namespace PROTO((tree, void *));
2990
2991 /* in decl2.c */
2992 extern int check_java_method PROTO((tree));
2993 extern int lang_decode_option PROTO((int, char **));
2994 extern tree grok_method_quals PROTO((tree, tree, tree));
2995 extern void warn_if_unknown_interface PROTO((tree));
2996 extern void grok_x_components PROTO((tree));
2997 extern void maybe_retrofit_in_chrg PROTO((tree));
2998 extern void maybe_make_one_only PROTO((tree));
2999 extern void grokclassfn PROTO((tree, tree, enum overload_flags, tree));
3000 extern tree grok_alignof PROTO((tree));
3001 extern tree grok_array_decl PROTO((tree, tree));
3002 extern tree delete_sanity PROTO((tree, tree, int, int));
3003 extern tree check_classfn PROTO((tree, tree));
3004 extern void check_member_template PROTO((tree));
3005 extern tree grokfield PROTO((tree, tree, tree, tree, tree));
3006 extern tree grokbitfield PROTO((tree, tree, tree));
3007 extern tree groktypefield PROTO((tree, tree));
3008 extern tree grokoptypename PROTO((tree, tree));
3009 extern int copy_assignment_arg_p PROTO((tree, int));
3010 extern void cplus_decl_attributes PROTO((tree, tree, tree));
3011 extern tree constructor_name_full PROTO((tree));
3012 extern tree constructor_name PROTO((tree));
3013 extern void setup_vtbl_ptr PROTO((void));
3014 extern void mark_inline_for_output PROTO((tree));
3015 extern void clear_temp_name PROTO((void));
3016 extern tree get_temp_name PROTO((tree, int));
3017 extern tree get_temp_regvar PROTO((tree, tree));
3018 extern void finish_anon_union PROTO((tree));
3019 extern tree finish_table PROTO((tree, tree, tree, int));
3020 extern void finish_builtin_type PROTO((tree, const char *,
3021 tree *, int, tree));
3022 extern tree coerce_new_type PROTO((tree));
3023 extern tree coerce_delete_type PROTO((tree));
3024 extern void comdat_linkage PROTO((tree));
3025 extern void import_export_class PROTO((tree));
3026 extern void import_export_vtable PROTO((tree, tree, int));
3027 extern void import_export_decl PROTO((tree));
3028 extern tree build_cleanup PROTO((tree));
3029 extern void finish_file PROTO((void));
3030 extern tree reparse_absdcl_as_expr PROTO((tree, tree));
3031 extern tree reparse_absdcl_as_casts PROTO((tree, tree));
3032 extern tree build_expr_from_tree PROTO((tree));
3033 extern tree reparse_decl_as_expr PROTO((tree, tree));
3034 extern tree finish_decl_parsing PROTO((tree));
3035 extern tree check_cp_case_value PROTO((tree));
3036 extern void set_decl_namespace PROTO((tree, tree, int));
3037 extern tree current_decl_namespace PROTO((void));
3038 extern void push_decl_namespace PROTO((tree));
3039 extern void pop_decl_namespace PROTO((void));
3040 extern void push_scope PROTO((tree));
3041 extern void pop_scope PROTO((tree));
3042 extern void do_namespace_alias PROTO((tree, tree));
3043 extern void do_toplevel_using_decl PROTO((tree));
3044 extern void do_local_using_decl PROTO((tree));
3045 extern tree do_class_using_decl PROTO((tree));
3046 extern void do_using_directive PROTO((tree));
3047 extern void check_default_args PROTO((tree));
3048 extern void mark_used PROTO((tree));
3049 extern tree handle_class_head PROTO((tree, tree, tree));
3050 extern tree lookup_arg_dependent PROTO((tree, tree, tree));
3051 extern void finish_static_data_member_decl PROTO((tree, tree, tree, int, int));
3052
3053 /* in errfn.c */
3054 /* The cp_* functions aren't suitable for ATTRIBUTE_PRINTF. */
3055 extern void cp_error PVPROTO((const char *, ...));
3056 extern void cp_error_at PVPROTO((const char *, ...));
3057 extern void cp_warning PVPROTO((const char *, ...));
3058 extern void cp_warning_at PVPROTO((const char *, ...));
3059 extern void cp_pedwarn PVPROTO((const char *, ...));
3060 extern void cp_pedwarn_at PVPROTO((const char *, ...));
3061 extern void cp_compiler_error PVPROTO((const char *, ...));
3062 extern void cp_sprintf PVPROTO((const char *, ...));
3063 extern void cp_deprecated PROTO((const char*));
3064
3065 /* in error.c */
3066 extern void init_error PROTO((void));
3067 extern char *fndecl_as_string PROTO((tree, int));
3068 extern char *type_as_string PROTO((tree, int));
3069 extern char *type_as_string_real PROTO((tree, int, int));
3070 extern char *args_as_string PROTO((tree, int));
3071 extern char *decl_as_string PROTO((tree, int));
3072 extern char *expr_as_string PROTO((tree, int));
3073 extern char *code_as_string PROTO((enum tree_code, int));
3074 extern char *language_as_string PROTO((enum languages, int));
3075 extern char *parm_as_string PROTO((int, int));
3076 extern char *op_as_string PROTO((enum tree_code, int));
3077 extern char *assop_as_string PROTO((enum tree_code, int));
3078 extern char *cv_as_string PROTO((tree, int));
3079 extern char *lang_decl_name PROTO((tree, int));
3080 extern char *cp_file_of PROTO((tree));
3081 extern int cp_line_of PROTO((tree));
3082
3083 /* in except.c */
3084 extern void init_exception_processing PROTO((void));
3085 extern void expand_start_catch_block PROTO((tree, tree));
3086 extern void expand_end_catch_block PROTO((void));
3087 extern void expand_builtin_throw PROTO((void));
3088 extern void expand_start_eh_spec PROTO((void));
3089 extern void expand_exception_blocks PROTO((void));
3090 extern tree start_anon_func PROTO((void));
3091 extern void end_anon_func PROTO((void));
3092 extern void expand_throw PROTO((tree));
3093 extern tree build_throw PROTO((tree));
3094 extern void mark_all_runtime_matches PROTO((void));
3095
3096 /* in expr.c */
3097 extern void init_cplus_expand PROTO((void));
3098 extern void fixup_result_decl PROTO((tree, struct rtx_def *));
3099 extern int extract_init PROTO((tree, tree));
3100 extern void do_case PROTO((tree, tree));
3101 extern tree cplus_expand_constant PROTO((tree));
3102
3103 /* friend.c */
3104 extern int is_friend PROTO((tree, tree));
3105 extern void make_friend_class PROTO((tree, tree));
3106 extern void add_friend PROTO((tree, tree));
3107 extern void add_friends PROTO((tree, tree, tree));
3108 extern tree do_friend PROTO((tree, tree, tree, tree, tree, enum overload_flags, tree, int));
3109
3110 /* in init.c */
3111 extern void init_init_processing PROTO((void));
3112 extern void expand_direct_vtbls_init PROTO((tree, tree, int, int, tree));
3113 extern void emit_base_init PROTO((tree, int));
3114 extern void check_base_init PROTO((tree));
3115 extern void expand_member_init PROTO((tree, tree, tree));
3116 extern void expand_aggr_init PROTO((tree, tree, int));
3117 extern int is_aggr_typedef PROTO((tree, int));
3118 extern int is_aggr_type PROTO((tree, int));
3119 extern tree get_aggr_from_typedef PROTO((tree, int));
3120 extern tree get_type_value PROTO((tree));
3121 extern tree build_member_call PROTO((tree, tree, tree));
3122 extern tree build_offset_ref PROTO((tree, tree));
3123 extern tree resolve_offset_ref PROTO((tree));
3124 extern tree decl_constant_value PROTO((tree));
3125 extern tree build_new PROTO((tree, tree, tree, int));
3126 extern tree build_new_1 PROTO((tree));
3127 extern tree expand_vec_init PROTO((tree, tree, tree, tree, int));
3128 extern tree build_x_delete PROTO((tree, int, tree));
3129 extern tree build_delete PROTO((tree, tree, tree, int, int));
3130 extern tree build_vbase_delete PROTO((tree, tree));
3131 extern tree build_vec_delete PROTO((tree, tree, tree, tree, int));
3132
3133 /* in input.c */
3134
3135 /* in lex.c */
3136 extern char *file_name_nondirectory PROTO((const char *));
3137 extern tree make_pointer_declarator PROTO((tree, tree));
3138 extern tree make_reference_declarator PROTO((tree, tree));
3139 extern tree make_call_declarator PROTO((tree, tree, tree, tree));
3140 extern void set_quals_and_spec PROTO((tree, tree, tree));
3141 extern char *operator_name_string PROTO((tree));
3142 extern void lang_init PROTO((void));
3143 extern void lang_finish PROTO((void));
3144 #if 0
3145 extern void reinit_lang_specific PROTO((void));
3146 #endif
3147 extern void reinit_parse_for_function PROTO((void));
3148 extern void print_parse_statistics PROTO((void));
3149 extern void extract_interface_info PROTO((void));
3150 extern void do_pending_inlines PROTO((void));
3151 extern void process_next_inline PROTO((tree));
3152 extern struct pending_input *save_pending_input PROTO((void));
3153 extern void restore_pending_input PROTO((struct pending_input *));
3154 extern void yyungetc PROTO((int, int));
3155 extern void reinit_parse_for_method PROTO((int, tree));
3156 extern void reinit_parse_for_block PROTO((int, struct obstack *));
3157 extern tree cons_up_default_function PROTO((tree, tree, int));
3158 extern void check_for_missing_semicolon PROTO((tree));
3159 extern void note_got_semicolon PROTO((tree));
3160 extern void note_list_got_semicolon PROTO((tree));
3161 extern void do_pending_lang_change PROTO((void));
3162 extern int identifier_type PROTO((tree));
3163 extern void see_typename PROTO((void));
3164 extern tree do_identifier PROTO((tree, int, tree));
3165 extern tree do_scoped_id PROTO((tree, int));
3166 extern tree identifier_typedecl_value PROTO((tree));
3167 extern int real_yylex PROTO((void));
3168 extern int is_rid PROTO((tree));
3169 extern tree build_lang_decl PROTO((enum tree_code, tree, tree));
3170 extern void retrofit_lang_decl PROTO((tree));
3171 extern tree build_lang_field_decl PROTO((enum tree_code, tree, tree));
3172 extern void copy_lang_decl PROTO((tree));
3173 extern tree make_lang_type PROTO((enum tree_code));
3174 extern void dump_time_statistics PROTO((void));
3175 extern void compiler_error PVPROTO((const char *, ...))
3176 ATTRIBUTE_PRINTF_1;
3177 extern void yyerror PROTO((const char *));
3178 extern void clear_inline_text_obstack PROTO((void));
3179 extern void maybe_snarf_defarg PROTO((void));
3180 extern tree snarf_defarg PROTO((void));
3181 extern void add_defarg_fn PROTO((tree));
3182 extern void do_pending_defargs PROTO((void));
3183 extern int identifier_type PROTO((tree));
3184 extern void yyhook PROTO((int));
3185 extern int cp_type_qual_from_rid PROTO((tree));
3186
3187 /* in method.c */
3188 extern void init_method PROTO((void));
3189 extern void do_inline_function_hair PROTO((tree, tree));
3190 extern char *build_overload_name PROTO((tree, int, int));
3191 extern tree build_static_name PROTO((tree, tree));
3192 extern tree build_decl_overload PROTO((tree, tree, int));
3193 extern tree build_decl_overload_real PROTO((tree, tree, tree, tree,
3194 tree, int));
3195 extern void set_mangled_name_for_decl PROTO((tree));
3196 extern tree build_typename_overload PROTO((tree));
3197 extern tree build_overload_with_type PROTO((tree, tree));
3198 extern tree build_destructor_name PROTO((tree));
3199 extern tree build_opfncall PROTO((enum tree_code, int, tree, tree, tree));
3200 extern tree hack_identifier PROTO((tree, tree));
3201 extern tree make_thunk PROTO((tree, int));
3202 extern void emit_thunk PROTO((tree));
3203 extern void synthesize_method PROTO((tree));
3204 extern tree get_id_2 PROTO((char *, tree));
3205
3206 /* in pt.c */
3207 extern void check_template_shadow PROTO ((tree));
3208 extern tree innermost_args PROTO ((tree));
3209 extern tree tsubst PROTO ((tree, tree, int, tree));
3210 extern tree tsubst_expr PROTO ((tree, tree, int, tree));
3211 extern tree tsubst_copy PROTO ((tree, tree, int, tree));
3212 extern void maybe_begin_member_template_processing PROTO((tree));
3213 extern void maybe_end_member_template_processing PROTO((void));
3214 extern tree finish_member_template_decl PROTO((tree));
3215 extern void begin_template_parm_list PROTO((void));
3216 extern void begin_specialization PROTO((void));
3217 extern void reset_specialization PROTO((void));
3218 extern void end_specialization PROTO((void));
3219 extern void begin_explicit_instantiation PROTO((void));
3220 extern void end_explicit_instantiation PROTO((void));
3221 extern tree check_explicit_specialization PROTO((tree, tree, int, int));
3222 extern tree process_template_parm PROTO((tree, tree));
3223 extern tree end_template_parm_list PROTO((tree));
3224 extern void end_template_decl PROTO((void));
3225 extern tree current_template_args PROTO((void));
3226 extern tree push_template_decl PROTO((tree));
3227 extern tree push_template_decl_real PROTO((tree, int));
3228 extern void redeclare_class_template PROTO((tree, tree));
3229 extern tree lookup_template_class PROTO((tree, tree, tree, tree, int));
3230 extern tree lookup_template_function PROTO((tree, tree));
3231 extern int uses_template_parms PROTO((tree));
3232 extern tree instantiate_class_template PROTO((tree));
3233 extern tree instantiate_template PROTO((tree, tree));
3234 extern void overload_template_name PROTO((tree));
3235 extern int fn_type_unification PROTO((tree, tree, tree, tree, tree, unification_kind_t));
3236 struct tinst_level *tinst_for_decl PROTO((void));
3237 extern void mark_decl_instantiated PROTO((tree, int));
3238 extern int more_specialized PROTO((tree, tree, tree));
3239 extern void mark_class_instantiated PROTO((tree, int));
3240 extern void do_decl_instantiation PROTO((tree, tree, tree));
3241 extern void do_type_instantiation PROTO((tree, tree));
3242 extern tree instantiate_decl PROTO((tree));
3243 extern tree do_poplevel PROTO((void));
3244 extern tree get_bindings PROTO((tree, tree, tree));
3245 /* CONT ... */
3246 extern void add_tree PROTO((tree));
3247 extern void begin_tree PROTO((void));
3248 extern void end_tree PROTO((void));
3249 extern void add_maybe_template PROTO((tree, tree));
3250 extern void pop_tinst_level PROTO((void));
3251 extern int more_specialized_class PROTO((tree, tree));
3252 extern void do_pushlevel PROTO((void));
3253 extern int is_member_template PROTO((tree));
3254 extern int template_parms_equal PROTO((tree, tree));
3255 extern int comp_template_parms PROTO((tree, tree));
3256 extern int template_class_depth PROTO((tree));
3257 extern int is_specialization_of PROTO((tree, tree));
3258 extern int comp_template_args PROTO((tree, tree));
3259 extern void maybe_process_partial_specialization PROTO((tree));
3260 extern void maybe_check_template_type PROTO((tree));
3261 extern tree most_specialized_instantiation PROTO((tree, tree));
3262 extern void print_candidates PROTO((tree));
3263 extern int instantiate_pending_templates PROTO((void));
3264
3265 extern int processing_specialization;
3266 extern int processing_explicit_instantiation;
3267 extern int processing_template_parmlist;
3268
3269 /* in repo.c */
3270 extern void repo_template_used PROTO((tree));
3271 extern void repo_template_instantiated PROTO((tree, int));
3272 extern void init_repo PROTO((const char *));
3273 extern void finish_repo PROTO((void));
3274
3275 /* in rtti.c */
3276 extern void init_rtti_processing PROTO((void));
3277 extern tree get_tinfo_fn_dynamic PROTO((tree));
3278 extern tree build_typeid PROTO((tree));
3279 extern tree build_x_typeid PROTO((tree));
3280 extern tree get_tinfo_fn PROTO((tree));
3281 extern tree get_typeid PROTO((tree));
3282 extern tree get_typeid_1 PROTO((tree));
3283 extern tree build_dynamic_cast PROTO((tree, tree));
3284 extern void synthesize_tinfo_fn PROTO((tree));
3285
3286 /* in search.c */
3287 extern int types_overlap_p PROTO((tree, tree));
3288 extern tree get_vbase PROTO((tree, tree));
3289 extern tree get_binfo PROTO((tree, tree, int));
3290 extern int get_base_distance PROTO((tree, tree, int, tree *));
3291 extern int accessible_p PROTO((tree, tree));
3292 extern tree lookup_field PROTO((tree, tree, int, int));
3293 extern int lookup_fnfields_1 PROTO((tree, tree));
3294 extern tree lookup_fnfields PROTO((tree, tree, int));
3295 extern tree lookup_member PROTO((tree, tree, int, int));
3296 extern tree lookup_nested_tag PROTO((tree, tree));
3297 extern tree get_matching_virtual PROTO((tree, tree, int));
3298 extern tree get_abstract_virtuals PROTO((tree));
3299 extern tree init_vbase_pointers PROTO((tree, tree));
3300 extern void expand_indirect_vtbls_init PROTO((tree, tree, tree));
3301 extern void clear_search_slots PROTO((tree));
3302 extern tree get_vbase_types PROTO((tree));
3303 extern void note_debug_info_needed PROTO((tree));
3304 extern void push_class_decls PROTO((tree));
3305 extern void pop_class_decls PROTO((void));
3306 extern void unuse_fields PROTO((tree));
3307 extern void print_search_statistics PROTO((void));
3308 extern void init_search_processing PROTO((void));
3309 extern void reinit_search_statistics PROTO((void));
3310 extern tree current_scope PROTO((void));
3311 extern tree lookup_conversions PROTO((tree));
3312 extern tree binfo_for_vtable PROTO((tree));
3313 extern tree dfs_walk PROTO((tree,
3314 tree (*)(tree, void *),
3315 tree (*) (tree, void *),
3316 void *));
3317 extern tree dfs_unmark PROTO((tree, void *));
3318 extern tree markedp PROTO((tree, void *));
3319
3320 /* in semantics.c */
3321 extern void finish_expr_stmt PROTO((tree));
3322 extern tree begin_if_stmt PROTO((void));
3323 extern void finish_if_stmt_cond PROTO((tree, tree));
3324 extern tree finish_then_clause PROTO((tree));
3325 extern void begin_else_clause PROTO((void));
3326 extern void finish_else_clause PROTO((tree));
3327 extern void finish_if_stmt PROTO((void));
3328 extern tree begin_while_stmt PROTO((void));
3329 extern void finish_while_stmt_cond PROTO((tree, tree));
3330 extern void finish_while_stmt PROTO((tree));
3331 extern tree begin_do_stmt PROTO((void));
3332 extern void finish_do_body PROTO((tree));
3333 extern void finish_do_stmt PROTO((tree, tree));
3334 extern void finish_return_stmt PROTO((tree));
3335 extern tree begin_for_stmt PROTO((void));
3336 extern void finish_for_init_stmt PROTO((tree));
3337 extern void finish_for_cond PROTO((tree, tree));
3338 extern void finish_for_expr PROTO((tree, tree));
3339 extern void finish_for_stmt PROTO((tree, tree));
3340 extern void finish_break_stmt PROTO((void));
3341 extern void finish_continue_stmt PROTO((void));
3342 extern void begin_switch_stmt PROTO((void));
3343 extern tree finish_switch_cond PROTO((tree));
3344 extern void finish_switch_stmt PROTO((tree, tree));
3345 extern void finish_case_label PROTO((tree, tree));
3346 extern void finish_goto_stmt PROTO((tree));
3347 extern tree begin_try_block PROTO((void));
3348 extern void finish_try_block PROTO((tree));
3349 extern void finish_handler_sequence PROTO((tree));
3350 extern tree begin_handler PROTO((void));
3351 extern void finish_handler_parms PROTO((tree));
3352 extern void finish_handler PROTO((tree));
3353 extern tree begin_compound_stmt PROTO((int));
3354 extern tree finish_compound_stmt PROTO((int, tree));
3355 extern void finish_asm_stmt PROTO((tree, tree, tree, tree, tree));
3356 extern tree finish_parenthesized_expr PROTO((tree));
3357 extern tree begin_stmt_expr PROTO((void));
3358 extern tree finish_stmt_expr PROTO((tree, tree));
3359 extern tree finish_call_expr PROTO((tree, tree, int));
3360 extern tree finish_increment_expr PROTO((tree, enum tree_code));
3361 extern tree finish_this_expr PROTO((void));
3362 extern tree finish_object_call_expr PROTO((tree, tree, tree));
3363 extern tree finish_qualified_object_call_expr PROTO((tree, tree, tree));
3364 extern tree finish_pseudo_destructor_call_expr PROTO((tree, tree, tree));
3365 extern tree finish_qualified_call_expr PROTO ((tree, tree));
3366 extern tree finish_label_address_expr PROTO((tree));
3367 extern tree finish_unary_op_expr PROTO((enum tree_code, tree));
3368 extern tree finish_id_expr PROTO((tree));
3369 extern int begin_new_placement PROTO((void));
3370 extern tree finish_new_placement PROTO((tree, int));
3371 extern int begin_function_definition PROTO((tree, tree));
3372 extern tree begin_constructor_declarator PROTO((tree, tree));
3373 extern tree finish_declarator PROTO((tree, tree, tree, tree, int));
3374 extern void finish_translation_unit PROTO((void));
3375 extern tree finish_template_type_parm PROTO((tree, tree));
3376 extern tree finish_template_template_parm PROTO((tree, tree));
3377 extern tree finish_parmlist PROTO((tree, int));
3378 extern tree begin_class_definition PROTO((tree));
3379 extern tree finish_class_definition PROTO((tree, tree, int, int));
3380 extern void finish_default_args PROTO((void));
3381 extern void begin_inline_definitions PROTO((void));
3382 extern void finish_inline_definitions PROTO((void));
3383 extern tree finish_member_class_template PROTO((tree));
3384 extern void finish_template_decl PROTO((tree));
3385 extern tree finish_template_type PROTO((tree, tree, int));
3386 extern void enter_scope_of PROTO((tree));
3387 extern tree finish_base_specifier PROTO((tree, tree, int));
3388 extern void finish_member_declaration PROTO((tree));
3389 extern void check_multiple_declarators PROTO((void));
3390 extern tree finish_typeof PROTO((tree));
3391
3392 /* in sig.c */
3393 extern tree build_signature_pointer_type PROTO((tree));
3394 extern tree build_signature_reference_type PROTO((tree));
3395 extern tree build_signature_pointer_constructor PROTO((tree, tree));
3396 extern tree build_signature_method_call PROTO((tree, tree));
3397 extern tree build_optr_ref PROTO((tree));
3398 extern void append_signature_fields PROTO((tree));
3399
3400 /* in spew.c */
3401 extern void init_spew PROTO((void));
3402 extern int peekyylex PROTO((void));
3403 extern int yylex PROTO((void));
3404 extern tree arbitrate_lookup PROTO((tree, tree, tree));
3405
3406 /* in tree.c */
3407 extern int pod_type_p PROTO((tree));
3408 extern void unshare_base_binfos PROTO((tree));
3409 extern int member_p PROTO((tree));
3410 extern cp_lvalue_kind real_lvalue_p PROTO((tree));
3411 extern tree build_min PVPROTO((enum tree_code, tree, ...));
3412 extern tree build_min_nt PVPROTO((enum tree_code, ...));
3413 extern tree min_tree_cons PROTO((tree, tree, tree));
3414 extern int lvalue_p PROTO((tree));
3415 extern int lvalue_or_else PROTO((tree, const char *));
3416 extern tree build_cplus_new PROTO((tree, tree));
3417 extern tree get_target_expr PROTO((tree));
3418 extern tree break_out_cleanups PROTO((tree));
3419 extern tree break_out_calls PROTO((tree));
3420 extern tree build_cplus_method_type PROTO((tree, tree, tree));
3421 extern tree build_cplus_staticfn_type PROTO((tree, tree, tree));
3422 extern tree build_cplus_array_type PROTO((tree, tree));
3423 extern int layout_basetypes PROTO((tree, int));
3424 extern tree build_vbase_pointer_fields PROTO((tree));
3425 extern tree build_base_fields PROTO((tree));
3426 extern tree hash_tree_cons PROTO((tree, tree, tree));
3427 extern tree hash_tree_chain PROTO((tree, tree));
3428 extern tree hash_chainon PROTO((tree, tree));
3429 extern tree make_binfo PROTO((tree, tree, tree, tree));
3430 extern tree binfo_value PROTO((tree, tree));
3431 extern tree reverse_path PROTO((tree));
3432 extern int count_functions PROTO((tree));
3433 extern int is_overloaded_fn PROTO((tree));
3434 extern tree get_first_fn PROTO((tree));
3435 extern tree binding_init PROTO((struct tree_binding*));
3436 extern int bound_pmf_p PROTO((tree));
3437 extern tree ovl_cons PROTO((tree, tree));
3438 extern tree scratch_ovl_cons PROTO((tree, tree));
3439 extern int ovl_member PROTO((tree, tree));
3440 extern tree build_overload PROTO((tree, tree));
3441 extern tree fnaddr_from_vtable_entry PROTO((tree));
3442 extern tree function_arg_chain PROTO((tree));
3443 extern int promotes_to_aggr_type PROTO((tree, enum tree_code));
3444 extern int is_aggr_type_2 PROTO((tree, tree));
3445 extern char *lang_printable_name PROTO((tree, int));
3446 extern tree build_exception_variant PROTO((tree, tree));
3447 extern tree copy_template_template_parm PROTO((tree));
3448 extern tree copy_to_permanent PROTO((tree));
3449 extern tree permanent_p PROTO((tree));
3450 extern void print_lang_statistics PROTO((void));
3451 extern void __eprintf
3452 PROTO((const char *, const char *, unsigned, const char *));
3453 extern tree array_type_nelts_total PROTO((tree));
3454 extern tree array_type_nelts_top PROTO((tree));
3455 extern tree break_out_target_exprs PROTO((tree));
3456 extern tree get_type_decl PROTO((tree));
3457 extern tree vec_binfo_member PROTO((tree, tree));
3458 extern tree hack_decl_function_context PROTO((tree));
3459 extern tree decl_namespace_context PROTO((tree));
3460 extern tree lvalue_type PROTO((tree));
3461 extern tree error_type PROTO((tree));
3462 extern tree make_temp_vec PROTO((int));
3463 extern tree build_ptr_wrapper PROTO((void *));
3464 extern tree build_expr_ptr_wrapper PROTO((void *));
3465 extern tree build_int_wrapper PROTO((int));
3466 extern tree build_srcloc_here PROTO((void));
3467 extern int varargs_function_p PROTO((tree));
3468 extern int really_overloaded_fn PROTO((tree));
3469 extern int cp_tree_equal PROTO((tree, tree));
3470 extern int can_free PROTO((struct obstack *, tree));
3471 extern tree mapcar PROTO((tree, tree (*) (tree)));
3472 extern tree no_linkage_check PROTO((tree));
3473 extern void debug_binfo PROTO((tree));
3474 extern void push_expression_obstack PROTO((void));
3475 extern tree build_dummy_object PROTO((tree));
3476 extern tree maybe_dummy_object PROTO((tree, tree *));
3477 extern int is_dummy_object PROTO((tree));
3478 extern tree search_tree PROTO((tree, tree (*)(tree)));
3479 extern int cp_valid_lang_attribute PROTO((tree, tree, tree, tree));
3480 extern tree make_ptrmem_cst PROTO((tree, tree));
3481 extern tree cp_build_qualified_type_real PROTO((tree, int, int));
3482 #define cp_build_qualified_type(TYPE, QUALS) \
3483 cp_build_qualified_type_real ((TYPE), (QUALS), /*complain=*/1)
3484
3485 #define scratchalloc expralloc
3486 #define scratch_tree_cons expr_tree_cons
3487 #define build_scratch_list build_expr_list
3488 #define make_scratch_vec make_temp_vec
3489 #define push_scratch_obstack push_expression_obstack
3490
3491 /* in typeck.c */
3492 extern int string_conv_p PROTO((tree, tree, int));
3493 extern tree condition_conversion PROTO((tree));
3494 extern tree target_type PROTO((tree));
3495 extern tree require_complete_type PROTO((tree));
3496 extern tree require_complete_type_in_void PROTO((tree));
3497 extern tree complete_type PROTO((tree));
3498 extern tree complete_type_or_else PROTO((tree, tree));
3499 extern int type_unknown_p PROTO((tree));
3500 extern int fntype_p PROTO((tree));
3501 extern tree commonparms PROTO((tree, tree));
3502 extern tree original_type PROTO((tree));
3503 extern tree common_type PROTO((tree, tree));
3504 extern int compexcepttypes PROTO((tree, tree));
3505 extern int comptypes PROTO((tree, tree, int));
3506 extern int comp_target_types PROTO((tree, tree, int));
3507 extern int compparms PROTO((tree, tree));
3508 extern int comp_target_types PROTO((tree, tree, int));
3509 extern int comp_cv_qualification PROTO((tree, tree));
3510 extern int comp_cv_qual_signature PROTO((tree, tree));
3511 extern int self_promoting_args_p PROTO((tree));
3512 extern tree unsigned_type PROTO((tree));
3513 extern tree signed_type PROTO((tree));
3514 extern tree signed_or_unsigned_type PROTO((int, tree));
3515 extern tree expr_sizeof PROTO((tree));
3516 extern tree c_sizeof PROTO((tree));
3517 extern tree c_sizeof_nowarn PROTO((tree));
3518 extern tree c_alignof PROTO((tree));
3519 extern tree inline_conversion PROTO((tree));
3520 extern tree decay_conversion PROTO((tree));
3521 extern tree default_conversion PROTO((tree));
3522 extern tree build_object_ref PROTO((tree, tree, tree));
3523 extern tree build_component_ref_1 PROTO((tree, tree, int));
3524 extern tree build_component_ref PROTO((tree, tree, tree, int));
3525 extern tree build_x_component_ref PROTO((tree, tree, tree, int));
3526 extern tree build_x_indirect_ref PROTO((tree, const char *));
3527 extern tree build_indirect_ref PROTO((tree, const char *));
3528 extern tree build_array_ref PROTO((tree, tree));
3529 extern tree build_x_function_call PROTO((tree, tree, tree));
3530 extern tree get_member_function_from_ptrfunc PROTO((tree *, tree));
3531 extern tree build_function_call_real PROTO((tree, tree, int, int));
3532 extern tree build_function_call PROTO((tree, tree));
3533 extern tree build_function_call_maybe PROTO((tree, tree));
3534 extern tree convert_arguments PROTO((tree, tree, tree, int));
3535 extern tree build_x_binary_op PROTO((enum tree_code, tree, tree));
3536 extern tree build_binary_op PROTO((enum tree_code, tree, tree));
3537 extern tree build_binary_op_nodefault PROTO((enum tree_code, tree, tree, enum tree_code));
3538 extern tree build_x_unary_op PROTO((enum tree_code, tree));
3539 extern tree build_unary_op PROTO((enum tree_code, tree, int));
3540 extern tree unary_complex_lvalue PROTO((enum tree_code, tree));
3541 extern int mark_addressable PROTO((tree));
3542 extern tree build_x_conditional_expr PROTO((tree, tree, tree));
3543 extern tree build_conditional_expr PROTO((tree, tree, tree));
3544 extern tree build_x_compound_expr PROTO((tree));
3545 extern tree build_compound_expr PROTO((tree));
3546 extern tree build_static_cast PROTO((tree, tree));
3547 extern tree build_reinterpret_cast PROTO((tree, tree));
3548 extern tree build_const_cast PROTO((tree, tree));
3549 extern tree build_c_cast PROTO((tree, tree));
3550 extern tree build_x_modify_expr PROTO((tree, enum tree_code, tree));
3551 extern tree build_modify_expr PROTO((tree, enum tree_code, tree));
3552 extern tree convert_for_initialization PROTO((tree, tree, tree, int, const char *, tree, int));
3553 extern void c_expand_asm_operands PROTO((tree, tree, tree, tree, int, char *, int));
3554 extern void c_expand_return PROTO((tree));
3555 extern tree c_expand_start_case PROTO((tree));
3556 extern int comp_ptr_ttypes PROTO((tree, tree));
3557 extern int ptr_reasonably_similar PROTO((tree, tree));
3558 extern tree build_ptrmemfunc PROTO((tree, tree, int));
3559 extern int cp_type_quals PROTO((tree));
3560 extern int cp_has_mutable_p PROTO((tree));
3561 extern int at_least_as_qualified_p PROTO((tree, tree));
3562 extern int more_qualified_p PROTO((tree, tree));
3563 extern tree build_ptrmemfunc1 PROTO((tree, tree, tree, tree, tree));
3564 extern void expand_ptrmemfunc_cst PROTO((tree, tree *, tree *, tree *, tree *));
3565 extern tree delta2_from_ptrmemfunc PROTO((tree));
3566 extern tree pfn_from_ptrmemfunc PROTO((tree));
3567 extern tree type_after_usual_arithmetic_conversions PROTO((tree, tree));
3568 extern tree composite_pointer_type PROTO((tree, tree, tree, tree, char*));
3569
3570 /* in typeck2.c */
3571 extern tree error_not_base_type PROTO((tree, tree));
3572 extern tree binfo_or_else PROTO((tree, tree));
3573 extern void readonly_error PROTO((tree, const char *, int));
3574 extern int abstract_virtuals_error PROTO((tree, tree));
3575 extern void signature_error PROTO((tree, tree));
3576 extern void incomplete_type_error PROTO((tree, tree));
3577 extern void my_friendly_abort PROTO((int))
3578 ATTRIBUTE_NORETURN;
3579 extern void my_friendly_assert PROTO((int, int));
3580 extern tree store_init_value PROTO((tree, tree));
3581 extern tree digest_init PROTO((tree, tree, tree *));
3582 extern tree build_scoped_ref PROTO((tree, tree));
3583 extern tree build_x_arrow PROTO((tree));
3584 extern tree build_m_component_ref PROTO((tree, tree));
3585 extern tree build_functional_cast PROTO((tree, tree));
3586 extern char *enum_name_string PROTO((tree, tree));
3587 extern void report_case_error PROTO((int, tree, tree, tree));
3588 extern void check_for_new_type PROTO((const char *, flagged_type_tree));
3589 extern tree initializer_constant_valid_p PROTO((tree, tree));
3590
3591 /* in xref.c */
3592 extern void GNU_xref_begin PROTO((const char *));
3593 extern void GNU_xref_end PROTO((int));
3594 extern void GNU_xref_file PROTO((const char *));
3595 extern void GNU_xref_start_scope PROTO((HOST_WIDE_INT));
3596 extern void GNU_xref_end_scope PROTO((HOST_WIDE_INT, HOST_WIDE_INT, int, int));
3597 extern void GNU_xref_ref PROTO((tree, const char *));
3598 extern void GNU_xref_decl PROTO((tree, tree));
3599 extern void GNU_xref_call PROTO((tree, const char *));
3600 extern void GNU_xref_function PROTO((tree, tree));
3601 extern void GNU_xref_assign PROTO((tree));
3602 extern void GNU_xref_hier PROTO((tree, tree, int, int, int));
3603 extern void GNU_xref_member PROTO((tree, tree));
3604
3605 /* -- end of C++ */
3606
3607 #endif /* not _CP_TREE_H */
This page took 0.226719 seconds and 6 git commands to generate.