* cp-tree.h (make_typename_type): Change prototype.
[official-gcc.git] / gcc / cp / cp-tree.h
blob529fce46a20e8201af9a7336ea64ef42c291448f
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)
5 This file is part of GNU CC.
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.
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.
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. */
22 #include "c-common.h"
23 #include "function.h"
24 #include "varray.h"
26 #ifndef _CP_TREE_H
27 #define _CP_TREE_H
29 /* Usage of TREE_LANG_FLAG_?:
30 0: BINFO_MARKED (BINFO nodes).
31 COMPOUND_STMT_NO_SCOPE (in COMPOUND_STMT).
32 NEW_EXPR_USE_GLOBAL (in NEW_EXPR).
33 DELETE_EXPR_USE_GLOBAL (in DELETE_EXPR).
34 LOOKUP_EXPR_GLOBAL (in LOOKUP_EXPR).
35 TREE_NEGATED_INT (in INTEGER_CST).
36 TREE_INDIRECT_USING (in NAMESPACE_DECL).
37 IDENTIFIER_MARKED (used by search routines).
38 LOCAL_BINDING_P (in CPLUS_BINDING)
39 ICS_USER_FLAG (in _CONV)
40 CLEANUP_P (in TRY_BLOCK)
41 AGGR_INIT_VIA_CTOR_P (in AGGR_INIT_EXPR)
42 SCOPE_BEGIN_P (in SCOPE_STMT)
43 1: IDENTIFIER_VIRTUAL_P.
44 TI_PENDING_TEMPLATE_FLAG.
45 TEMPLATE_PARMS_FOR_INLINE.
46 DELETE_EXPR_USE_VEC (in DELETE_EXPR).
47 (TREE_CALLS_NEW) (in _EXPR or _REF) (commented-out).
48 TYPE_USES_COMPLEX_INHERITANCE (in _TYPE).
49 C_DECLARED_LABEL_FLAG (in LABEL_DECL)
50 INHERITED_VALUE_BINDING_P (in CPLUS_BINDING)
51 BASELINK_P (in TREE_LIST)
52 ICS_ELLIPSIS_FLAG (in _CONV)
53 STMT_IS_FULL_EXPR_P (in _STMT)
54 2: IDENTIFIER_OPNAME_P.
55 BINFO_VBASE_MARKED.
56 BINFO_FIELDS_MARKED.
57 TYPE_VIRTUAL_P.
58 ICS_THIS_FLAG (in _CONV)
59 STMT_LINENO_FOR_FN_P (in _STMT)
60 BINDING_HAS_LEVEL_P (in CPLUS_BINDING)
61 3: TYPE_USES_VIRTUAL_BASECLASSES (in a class TYPE).
62 BINFO_VTABLE_PATH_MARKED.
63 BINFO_PUSHDECLS_MARKED.
64 (TREE_REFERENCE_EXPR) (in NON_LVALUE_EXPR) (commented-out).
65 ICS_BAD_FLAG (in _CONV)
66 FN_TRY_BLOCK_P (in TRY_BLOCK)
67 SCOPE_NULLIFIED_P (in SCOPE_STMT)
68 4: BINFO_NEW_VTABLE_MARKED.
69 TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR,
70 or FIELD_DECL).
71 NEED_TEMPORARY_P (in REF_BIND, BASE_CONV)
72 SCOPE_PARTIAL_P (in SCOPE_STMT)
73 5: Not used.
74 6: Not used.
76 Usage of TYPE_LANG_FLAG_?:
77 0: C_TYPE_FIELDS_READONLY (in RECORD_TYPE or UNION_TYPE).
78 1: TYPE_HAS_CONSTRUCTOR.
79 2: TYPE_HAS_DESTRUCTOR.
80 3: TYPE_FOR_JAVA.
81 4: TYPE_NEEDS_DESTRUCTOR.
82 5: IS_AGGR_TYPE.
83 6: TYPE_BUILT_IN.
85 Usage of DECL_LANG_FLAG_?:
86 0: DECL_ERROR_REPORTED (in VAR_DECL).
87 DECL_TEMPLATE_PARM_P (in CONST_DECL, TYPE_DECL, or TEMPLATE_DECL)
88 1: C_TYPEDEF_EXPLICITLY_SIGNED (in TYPE_DECL).
89 DECL_TEMPLATE_INSTANTIATED (in a VAR_DECL or a FUNCTION_DECL)
90 2: DECL_THIS_EXTERN (in VAR_DECL or FUNCTION_DECL).
91 DECL_IMPLICIT_TYPEDEF_P (in a TYPE_DECL)
92 3: DECL_IN_AGGR_P.
93 4: DECL_MAYBE_TEMPLATE.
94 5: DECL_INTERFACE_KNOWN.
95 6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL).
96 7: DECL_DEAD_FOR_LOCAL (in VAR_DECL).
98 Usage of language-independent fields in a language-dependent manner:
100 TYPE_ALIAS_SET
101 This field is used by TYPENAME_TYPEs, TEMPLATE_TYPE_PARMs, and so
102 forth as a substitute for the mark bits provided in `lang_type'.
103 At present, only the six low-order bits are used.
105 TYPE_BINFO
106 For an ENUMERAL_TYPE, this is ENUM_TEMPLATE_INFO.
107 For a TYPENAME_TYPE, this is TYPENAME_TYPE_FULLNAME.
108 For a TEMPLATE_TEMPLATE_PARM, this is
109 TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
111 DECL_SAVED_INSNS/DECL_FIELD_SIZE
112 For a static VAR_DECL, this is DECL_INIT_PRIORITY.
114 BINFO_VIRTUALS
115 For a binfo, this is a TREE_LIST. The TREE_PURPOSE of each node
116 gives the amount by which to adjust the `this' pointer when
117 calling the function. The TREE_VALUE is the declaration for the
118 virtual function itself. When CLASSTYPE_COM_INTERFACE_P does not
119 hold, the first entry does not have a TREE_VALUE; it is just an
120 offset.
122 DECL_ARGUMENTS
123 For a VAR_DECL this is DECL_ANON_UNION_ELEMS. */
125 /* Language-specific tree checkers. */
127 #if defined ENABLE_CHECKING && HAVE_GCC_VERSION(2,7)
129 #define VAR_OR_FUNCTION_DECL_CHECK(NODE) \
130 ({ const tree __t = NODE; \
131 enum tree_code __c = TREE_CODE(__t); \
132 if (__c != VAR_DECL && __c != FUNCTION_DECL) \
133 tree_check_failed (__t, VAR_DECL, __FILE__, \
134 __LINE__, __PRETTY_FUNCTION__); \
135 __t; })
137 #define RECORD_OR_UNION_TYPE_CHECK(NODE) \
138 ({ const tree __t = NODE; \
139 enum tree_code __c = TREE_CODE(__t); \
140 if (__c != RECORD_TYPE && __c != UNION_TYPE) \
141 tree_check_failed (__t, RECORD_TYPE, __FILE__, \
142 __LINE__, __PRETTY_FUNCTION__); \
143 __t; })
145 #else /* not ENABLE_CHECKING, or not gcc */
147 #define VAR_OR_FUNCTION_DECL_CHECK(NODE) NODE
148 #define RECORD_OR_UNION_TYPE_CHECK(NODE) NODE
150 #endif
152 /* Language-dependent contents of an identifier. */
154 struct lang_identifier
156 struct tree_identifier ignore;
157 tree namespace_bindings;
158 tree bindings;
159 tree class_value;
160 tree class_template_info;
161 struct lang_id2 *x;
164 #define LANG_IDENTIFIER_CAST(NODE) \
165 ((struct lang_identifier*)IDENTIFIER_NODE_CHECK (NODE))
167 struct lang_id2
169 tree label_value, implicit_decl;
170 tree error_locus;
173 typedef struct
175 tree t;
176 int new_type_flag;
177 } flagged_type_tree;
179 typedef struct
181 char common[sizeof (struct tree_common)];
182 HOST_WIDE_INT index;
183 HOST_WIDE_INT level;
184 HOST_WIDE_INT orig_level;
185 tree decl;
186 } template_parm_index;
188 typedef struct ptrmem_cst
190 char common[sizeof (struct tree_common)];
191 /* This isn't used, but the middle-end expects all constants to have
192 this field. */
193 struct rtx_def *rtl;
194 tree member;
195 }* ptrmem_cst_t;
197 /* Nonzero if this binding is for a local scope, as opposed to a class
198 or namespace scope. */
199 #define LOCAL_BINDING_P(NODE) TREE_LANG_FLAG_0(NODE)
201 /* Nonzero if BINDING_VALUE is from a base class of the class which is
202 currently being defined. */
203 #define INHERITED_VALUE_BINDING_P(NODE) TREE_LANG_FLAG_1(NODE)
205 /* For a binding between a name and an entity at a non-local scope,
206 defines the scope where the binding is declared. (Either a class
207 _TYPE node, or a NAMESPACE_DECL.) This macro should be used only
208 for namespace-level bindings; on the IDENTIFIER_BINDING list
209 BINDING_LEVEL is used instead. */
210 #define BINDING_SCOPE(NODE) (((struct tree_binding*)CPLUS_BINDING_CHECK (NODE))->scope.scope)
212 /* Nonzero if NODE has BINDING_LEVEL, rather than BINDING_SCOPE. */
213 #define BINDING_HAS_LEVEL_P(NODE) TREE_LANG_FLAG_2 ((NODE))
215 /* This is the declaration bound to the name. Possible values:
216 variable, overloaded function, namespace, template, enumerator. */
217 #define BINDING_VALUE(NODE) (((struct tree_binding*)CPLUS_BINDING_CHECK (NODE))->value)
219 /* If name is bound to a type, this is the type (struct, union, enum). */
220 #define BINDING_TYPE(NODE) TREE_TYPE(NODE)
222 #define IDENTIFIER_GLOBAL_VALUE(NODE) \
223 namespace_binding (NODE, global_namespace)
224 #define SET_IDENTIFIER_GLOBAL_VALUE(NODE, VAL) \
225 set_namespace_binding (NODE, global_namespace, VAL)
226 #define IDENTIFIER_NAMESPACE_VALUE(NODE) \
227 namespace_binding (NODE, current_namespace)
228 #define SET_IDENTIFIER_NAMESPACE_VALUE(NODE, VAL) \
229 set_namespace_binding (NODE, current_namespace, VAL)
231 struct tree_binding
233 char common[sizeof (struct tree_common)];
234 union {
235 tree scope;
236 struct binding_level *level;
237 } scope;
238 tree value;
241 /* The overloaded FUNCTION_DECL. */
242 #define OVL_FUNCTION(NODE) (((struct tree_overload*)OVERLOAD_CHECK (NODE))->function)
243 #define OVL_CHAIN(NODE) TREE_CHAIN(NODE)
244 /* Polymorphic access to FUNCTION and CHAIN. */
245 #define OVL_CURRENT(NODE) \
246 ((TREE_CODE(NODE)==OVERLOAD) ? OVL_FUNCTION(NODE) : NODE)
247 #define OVL_NEXT(NODE) \
248 ((TREE_CODE(NODE)==OVERLOAD) ? TREE_CHAIN(NODE) : NULL_TREE)
249 /* If set, this was imported in a using declaration.
250 This is not to confuse with being used somewhere, which
251 is not important for this node. */
252 #define OVL_USED(NODE) TREE_USED(NODE)
254 struct tree_overload
256 char common[sizeof (struct tree_common)];
257 tree function;
260 /* A `baselink' is a TREE_LIST whose TREE_PURPOSE is a BINFO
261 indicating a particular base class, and whose TREE_VALUE is a
262 (possibly overloaded) function from that base class. */
263 #define BASELINK_P(NODE) \
264 (TREE_CODE (NODE) == TREE_LIST && TREE_LANG_FLAG_1 (NODE))
265 #define SET_BASELINK_P(NODE) \
266 (TREE_LANG_FLAG_1 (NODE) = 1)
268 #define WRAPPER_PTR(NODE) (((struct tree_wrapper*)WRAPPER_CHECK (NODE))->u.ptr)
269 #define WRAPPER_INT(NODE) (((struct tree_wrapper*)WRAPPER_CHECK (NODE))->u.i)
271 struct tree_wrapper
273 char common[sizeof (struct tree_common)];
274 union {
275 void *ptr;
276 int i;
277 } u;
280 #define SRCLOC_FILE(NODE) (((struct tree_srcloc*)SRCLOC_CHECK (NODE))->filename)
281 #define SRCLOC_LINE(NODE) (((struct tree_srcloc*)SRCLOC_CHECK (NODE))->linenum)
282 struct tree_srcloc
284 char common[sizeof (struct tree_common)];
285 char *filename;
286 int linenum;
289 /* To identify to the debug emitters if it should pay attention to the
290 flag `-Wtemplate-debugging'. */
291 #define HAVE_TEMPLATES 1
293 /* Macros for access to language-specific slots in an identifier. */
295 #define IDENTIFIER_NAMESPACE_BINDINGS(NODE) \
296 (LANG_IDENTIFIER_CAST (NODE)->namespace_bindings)
297 #define IDENTIFIER_TEMPLATE(NODE) \
298 (LANG_IDENTIFIER_CAST (NODE)->class_template_info)
300 /* The IDENTIFIER_BINDING is the innermost CPLUS_BINDING for the
301 identifier. It's TREE_CHAIN is the next outermost binding. Each
302 BINDING_VALUE is a DECL for the associated declaration. Thus,
303 name lookup consists simply of pulling off the node at the front
304 of the list (modulo oddities for looking up the names of types,
305 and such.) You can use BINDING_SCOPE or BINDING_LEVEL to
306 determine the scope that bound the name. */
307 #define IDENTIFIER_BINDING(NODE) \
308 (LANG_IDENTIFIER_CAST (NODE)->bindings)
310 /* The IDENTIFIER_VALUE is the value of the IDENTIFIER_BINDING, or
311 NULL_TREE if there is no binding. */
312 #define IDENTIFIER_VALUE(NODE) \
313 (IDENTIFIER_BINDING (NODE) \
314 ? BINDING_VALUE (IDENTIFIER_BINDING (NODE)) \
315 : NULL_TREE)
317 /* If IDENTIFIER_CLASS_VALUE is set, then NODE is bound in the current
318 class, and IDENTIFIER_CLASS_VALUE is the value binding. This is
319 just a pointer to the BINDING_VALUE of one of the bindings in the
320 IDENTIFIER_BINDINGs list, so any time that this is non-NULL so is
321 IDENTIFIER_BINDING. */
322 #define IDENTIFIER_CLASS_VALUE(NODE) \
323 (LANG_IDENTIFIER_CAST (NODE)->class_value)
325 /* The amount of time used by the file whose special "time identifier"
326 is NODE, represented as an INTEGER_CST. See get_time_identifier. */
327 #define TIME_IDENTIFIER_TIME(NODE) IDENTIFIER_BINDING(NODE)
329 /* For a "time identifier" this is a INTEGER_CST. The
330 TREE_INT_CST_LOW is 1 if the corresponding file is "interface only".
331 The TRE_INT_CST_HIGH is 1 if it is "interface unknown". */
332 #define TIME_IDENTIFIER_FILEINFO(NODE) IDENTIFIER_CLASS_VALUE (NODE)
334 /* TREE_TYPE only indicates on local and class scope the current
335 type. For namespace scope, the presence of a type in any namespace
336 is indicated with global_type_node, and the real type behind must
337 be found through lookup. */
338 #define IDENTIFIER_TYPE_VALUE(NODE) (identifier_type_value(NODE))
339 #define REAL_IDENTIFIER_TYPE_VALUE(NODE) (TREE_TYPE (NODE))
340 #define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (TREE_TYPE (NODE) = TYPE)
341 #define IDENTIFIER_HAS_TYPE_VALUE(NODE) (IDENTIFIER_TYPE_VALUE (NODE) ? 1 : 0)
343 #define LANG_ID_FIELD(NAME,NODE) \
344 (LANG_IDENTIFIER_CAST (NODE)->x \
345 ? LANG_IDENTIFIER_CAST (NODE)->x->NAME : 0)
347 #define SET_LANG_ID(NODE,VALUE,NAME) \
348 (LANG_IDENTIFIER_CAST (NODE)->x == 0 \
349 ? LANG_IDENTIFIER_CAST (NODE)->x \
350 = (struct lang_id2 *)perm_calloc (1, sizeof (struct lang_id2)) : 0, \
351 LANG_IDENTIFIER_CAST (NODE)->x->NAME = (VALUE))
353 #define IDENTIFIER_LABEL_VALUE(NODE) LANG_ID_FIELD(label_value, NODE)
354 #define SET_IDENTIFIER_LABEL_VALUE(NODE,VALUE) \
355 SET_LANG_ID(NODE, VALUE, label_value)
357 #define IDENTIFIER_IMPLICIT_DECL(NODE) LANG_ID_FIELD(implicit_decl, NODE)
358 #define SET_IDENTIFIER_IMPLICIT_DECL(NODE,VALUE) \
359 SET_LANG_ID(NODE, VALUE, implicit_decl)
361 #define IDENTIFIER_ERROR_LOCUS(NODE) LANG_ID_FIELD(error_locus, NODE)
362 #define SET_IDENTIFIER_ERROR_LOCUS(NODE,VALUE) \
363 SET_LANG_ID(NODE, VALUE, error_locus)
366 #define IDENTIFIER_VIRTUAL_P(NODE) TREE_LANG_FLAG_1(NODE)
368 /* Nonzero if this identifier is the prefix for a mangled C++ operator
369 name. */
370 #define IDENTIFIER_OPNAME_P(NODE) TREE_LANG_FLAG_2(NODE)
372 /* Nonzero if this identifier is the name of a type-conversion
373 operator. */
374 #define IDENTIFIER_TYPENAME_P(NODE) \
375 (! strncmp (IDENTIFIER_POINTER (NODE), \
376 OPERATOR_TYPENAME_FORMAT, \
377 strlen (OPERATOR_TYPENAME_FORMAT)))
379 /* Nonzero means reject anything that ANSI standard C forbids. */
380 extern int pedantic;
382 /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only. */
383 #define C_TYPE_FIELDS_READONLY(type) TYPE_LANG_FLAG_0 (type)
385 /* Record in each node resulting from a binary operator
386 what operator was specified for it. */
387 #define C_EXP_ORIGINAL_CODE(exp) ((enum tree_code) TREE_COMPLEXITY (exp))
389 /* Store a value in that field. */
390 #define C_SET_EXP_ORIGINAL_CODE(exp, code) \
391 (TREE_COMPLEXITY (exp) = (int)(code))
393 /* If non-zero, a VAR_DECL whose cleanup will cause a throw to the
394 next exception handler. */
395 extern tree exception_throw_decl;
397 enum cp_tree_index
399 CPTI_JAVA_BYTE_TYPE,
400 CPTI_JAVA_SHORT_TYPE,
401 CPTI_JAVA_INT_TYPE,
402 CPTI_JAVA_LONG_TYPE,
403 CPTI_JAVA_FLOAT_TYPE,
404 CPTI_JAVA_DOUBLE_TYPE,
405 CPTI_JAVA_CHAR_TYPE,
406 CPTI_JAVA_BOOLEAN_TYPE,
408 CPTI_VOID_ZERO,
409 CPTI_WCHAR_DECL,
410 CPTI_VTABLE_ENTRY_TYPE,
411 CPTI_DELTA_TYPE,
412 CPTI_CLEANUP_TYPE,
414 CPTI_TP_DESC_TYPE,
415 CPTI_ACCESS_MODE_TYPE,
416 CPTI_BLTN_DESC_TYPE,
417 CPTI_USER_DESC_TYPE,
418 CPTI_CLASS_DESC_TYPE,
419 CPTI_PTR_DESC_TYPE,
420 CPTI_ATTR_DESC_TYPE,
421 CPTI_FUNC_DESC_TYPE,
422 CPTI_PTMF_DESC_TYPE,
423 CPTI_PTMD_DESC_TYPE,
425 CPTI_CLASS_STAR_TYPE,
426 CPTI_CLASS_TYPE,
427 CPTI_RECORD_TYPE,
428 CPTI_UNION_TYPE,
429 CPTI_ENUM_TYPE,
430 CPTI_UNKNOWN_TYPE,
431 CPTI_VTBL_TYPE,
432 CPTI_VTBL_PTR_TYPE,
433 CPTI_STD,
434 CPTI_TYPE_INFO_TYPE,
435 CPTI_TINFO_FN_ID,
436 CPTI_TINFO_FN_TYPE,
437 CPTI_ABORT_FNDECL,
438 CPTI_GLOBAL_DELETE_FNDECL,
440 CPTI_ACCESS_DEFAULT,
441 CPTI_ACCESS_PUBLIC,
442 CPTI_ACCESS_PROTECTED,
443 CPTI_ACCESS_PRIVATE,
444 CPTI_ACCESS_DEFAULT_VIRTUAL,
445 CPTI_ACCESS_PUBLIC_VIRTUAL,
446 CPTI_ACCESS_PROTECTED_VIRTUAL,
447 CPTI_ACCESS_PRIVATE_VIRTUAL,
449 CPTI_CTOR_IDENTIFIER,
450 CPTI_DELTA2_IDENTIFIER,
451 CPTI_DELTA_IDENTIFIER,
452 CPTI_DTOR_IDENTIFIER,
453 CPTI_IN_CHARGE_IDENTIFIER,
454 CPTI_INDEX_IDENTIFIER,
455 CPTI_NELTS_IDENTIFIER,
456 CPTI_THIS_IDENTIFIER,
457 CPTI_PFN_IDENTIFIER,
458 CPTI_PFN_OR_DELTA2_IDENTIFIER,
459 CPTI_VPTR_IDENTIFIER,
461 CPTI_LANG_NAME_C,
462 CPTI_LANG_NAME_CPLUSPLUS,
463 CPTI_LANG_NAME_JAVA,
465 CPTI_EMPTY_EXCEPT_SPEC,
466 CPTI_NULL,
467 CPTI_JCLASS,
468 CPTI_MINUS_ONE,
469 CPTI_TERMINATE,
470 CPTI_ATEXIT,
472 CPTI_MAX
475 extern tree cp_global_trees[CPTI_MAX];
477 #define java_byte_type_node cp_global_trees[CPTI_JAVA_BYTE_TYPE]
478 #define java_short_type_node cp_global_trees[CPTI_JAVA_SHORT_TYPE]
479 #define java_int_type_node cp_global_trees[CPTI_JAVA_INT_TYPE]
480 #define java_long_type_node cp_global_trees[CPTI_JAVA_LONG_TYPE]
481 #define java_float_type_node cp_global_trees[CPTI_JAVA_FLOAT_TYPE]
482 #define java_double_type_node cp_global_trees[CPTI_JAVA_DOUBLE_TYPE]
483 #define java_char_type_node cp_global_trees[CPTI_JAVA_CHAR_TYPE]
484 #define java_boolean_type_node cp_global_trees[CPTI_JAVA_BOOLEAN_TYPE]
486 #define void_zero_node cp_global_trees[CPTI_VOID_ZERO]
487 #define wchar_decl_node cp_global_trees[CPTI_WCHAR_DECL]
488 #define vtable_entry_type cp_global_trees[CPTI_VTABLE_ENTRY_TYPE]
489 #define delta_type_node cp_global_trees[CPTI_DELTA_TYPE]
490 #define __tp_desc_type_node cp_global_trees[CPTI_TP_DESC_TYPE]
491 #define __access_mode_type_node cp_global_trees[CPTI_ACCESS_MODE_TYPE]
492 #define __bltn_desc_type_node cp_global_trees[CPTI_BLTN_DESC_TYPE]
493 #define __user_desc_type_node cp_global_trees[CPTI_USER_DESC_TYPE]
494 #define __class_desc_type_node cp_global_trees[CPTI_CLASS_DESC_TYPE]
495 #define __ptr_desc_type_node cp_global_trees[CPTI_PTR_DESC_TYPE]
496 #define __attr_desc_type_node cp_global_trees[CPTI_ATTR_DESC_TYPE]
497 #define __func_desc_type_node cp_global_trees[CPTI_FUNC_DESC_TYPE]
498 #define __ptmf_desc_type_node cp_global_trees[CPTI_PTMF_DESC_TYPE]
499 #define __ptmd_desc_type_node cp_global_trees[CPTI_PTMD_DESC_TYPE]
500 #define class_star_type_node cp_global_trees[CPTI_CLASS_STAR_TYPE]
501 #define class_type_node cp_global_trees[CPTI_CLASS_TYPE]
502 #define record_type_node cp_global_trees[CPTI_RECORD_TYPE]
503 #define union_type_node cp_global_trees[CPTI_UNION_TYPE]
504 #define enum_type_node cp_global_trees[CPTI_ENUM_TYPE]
505 #define unknown_type_node cp_global_trees[CPTI_UNKNOWN_TYPE]
506 #define vtbl_type_node cp_global_trees[CPTI_VTBL_TYPE]
507 #define vtbl_ptr_type_node cp_global_trees[CPTI_VTBL_PTR_TYPE]
508 #define std_node cp_global_trees[CPTI_STD]
509 #define type_info_type_node cp_global_trees[CPTI_TYPE_INFO_TYPE]
510 #define tinfo_fn_id cp_global_trees[CPTI_TINFO_FN_ID]
511 #define tinfo_fn_type cp_global_trees[CPTI_TINFO_FN_TYPE]
512 #define abort_fndecl cp_global_trees[CPTI_ABORT_FNDECL]
513 #define global_delete_fndecl cp_global_trees[CPTI_GLOBAL_DELETE_FNDECL]
515 /* Define the sets of attributes that member functions and baseclasses
516 can have. These are sensible combinations of {public,private,protected}
517 cross {virtual,non-virtual}. */
519 #define access_default_node cp_global_trees[CPTI_ACCESS_DEFAULT]
520 #define access_public_node cp_global_trees[CPTI_ACCESS_PUBLIC]
521 #define access_protected_node cp_global_trees[CPTI_ACCESS_PROTECTED]
522 #define access_private_node cp_global_trees[CPTI_ACCESS_PRIVATE]
523 #define access_default_virtual_node cp_global_trees[CPTI_ACCESS_DEFAULT_VIRTUAL]
524 #define access_public_virtual_node cp_global_trees[CPTI_ACCESS_PUBLIC_VIRTUAL]
525 #define access_protected_virtual_node cp_global_trees[CPTI_ACCESS_PROTECTED_VIRTUAL]
526 #define access_private_virtual_node cp_global_trees[CPTI_ACCESS_PRIVATE_VIRTUAL]
528 /* We cache these tree nodes so as to call get_identifier less
529 frequently. */
531 #define ctor_identifier cp_global_trees[CPTI_CTOR_IDENTIFIER]
532 #define delta2_identifier cp_global_trees[CPTI_DELTA2_IDENTIFIER]
533 #define delta_identifier cp_global_trees[CPTI_DELTA_IDENTIFIER]
534 #define dtor_identifier cp_global_trees[CPTI_DTOR_IDENTIFIER]
535 #define in_charge_identifier cp_global_trees[CPTI_IN_CHARGE_IDENTIFIER]
536 #define index_identifier cp_global_trees[CPTI_INDEX_IDENTIFIER]
537 #define nelts_identifier cp_global_trees[CPTI_NELTS_IDENTIFIER]
538 #define this_identifier cp_global_trees[CPTI_THIS_IDENTIFIER]
539 #define pfn_identifier cp_global_trees[CPTI_PFN_IDENTIFIER]
540 #define pfn_or_delta2_identifier cp_global_trees[CPTI_PFN_OR_DELTA2_IDENTIFIER]
541 #define vptr_identifier cp_global_trees[CPTI_VPTR_IDENTIFIER]
543 #define lang_name_c cp_global_trees[CPTI_LANG_NAME_C]
544 #define lang_name_cplusplus cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS]
545 #define lang_name_java cp_global_trees[CPTI_LANG_NAME_JAVA]
547 /* Exception specifier used for throw(). */
548 #define empty_except_spec cp_global_trees[CPTI_EMPTY_EXCEPT_SPEC]
550 /* The node for `__null'. */
551 #define null_node cp_global_trees[CPTI_NULL]
553 /* If non-NULL, a POINTER_TYPE equivalent to (java::lang::Class*). */
554 #define jclass_node cp_global_trees[CPTI_JCLASS]
556 /* A node for `(int) -1'. */
557 #define minus_one_node cp_global_trees[CPTI_MINUS_ONE]
559 /* The declaration for `std::terminate'. */
560 #define terminate_node cp_global_trees[CPTI_TERMINATE]
562 /* The declaration for `std::atexit'. */
563 #define atexit_node cp_global_trees[CPTI_ATEXIT]
565 /* The type of a destructor. */
566 #define cleanup_type cp_global_trees[CPTI_CLEANUP_TYPE]
568 /* Global state. */
570 struct stmt_tree {
571 tree x_last_stmt;
572 tree x_last_expr_type;
573 int stmts_are_full_exprs_p;
576 struct saved_scope {
577 tree old_bindings;
578 tree old_namespace;
579 tree class_name;
580 tree class_type;
581 tree access_specifier;
582 tree function_decl;
583 varray_type lang_base;
584 tree *lang_stack;
585 tree lang_name;
586 tree x_function_parms;
587 tree template_parms;
588 tree x_previous_class_type;
589 tree x_previous_class_values;
590 tree x_saved_tree;
592 HOST_WIDE_INT x_processing_template_decl;
593 int x_processing_specialization;
594 int x_processing_explicit_instantiation;
595 int need_pop_function_context;
597 struct stmt_tree x_stmt_tree;
599 struct binding_level *class_bindings;
600 struct binding_level *bindings;
602 struct saved_scope *prev;
605 /* The current open namespace. */
607 #define current_namespace scope_chain->old_namespace
609 /* IDENTIFIER_NODE: name of current class */
611 #define current_class_name scope_chain->class_name
613 /* _TYPE: the type of the current class */
615 #define current_class_type scope_chain->class_type
617 /* When parsing a class definition, the access specifier most recently
618 given by the user, or, if no access specifier was given, the
619 default value appropriate for the kind of class (i.e., struct,
620 class, or union). */
622 #define current_access_specifier scope_chain->access_specifier
624 /* Pointer to the top of the language name stack. */
626 #define current_lang_stack scope_chain->lang_stack
627 #define current_lang_base scope_chain->lang_base
628 #define current_lang_name scope_chain->lang_name
630 /* Parsing a function declarator leaves a list of parameter names
631 or a chain or parameter decls here. */
633 #define current_function_parms scope_chain->x_function_parms
634 #define current_template_parms scope_chain->template_parms
636 #define processing_template_decl scope_chain->x_processing_template_decl
637 #define processing_specialization scope_chain->x_processing_specialization
638 #define processing_explicit_instantiation scope_chain->x_processing_explicit_instantiation
640 /* _TYPE: the previous type that was a class */
642 #define previous_class_type scope_chain->x_previous_class_type
644 /* This is a copy of the class_shadowed list of the previous class
645 binding contour when at global scope. It's used to reset
646 IDENTIFIER_CLASS_VALUEs when entering another class scope (i.e. a
647 cache miss). */
649 #define previous_class_values scope_chain->x_previous_class_values
651 extern struct saved_scope *scope_chain;
653 /* Global state pertinent to the current function. */
655 struct language_function
657 tree x_named_labels;
658 tree x_ctor_label;
659 tree x_dtor_label;
660 tree x_base_init_list;
661 tree x_member_init_list;
662 tree x_current_class_ptr;
663 tree x_current_class_ref;
664 tree x_eh_spec_try_block;
665 tree x_scope_stmt_stack;
666 tree x_in_charge_parm;
668 tree *x_vcalls_possible_p;
670 struct rtx_def *x_last_dtor_insn;
671 struct rtx_def *x_last_parm_cleanup_insn;
672 struct rtx_def *x_result_rtx;
674 int returns_value;
675 int returns_null;
676 int parms_stored;
677 int temp_name_counter;
678 int in_function_try_handler;
679 int x_expanding_p;
680 int name_declared;
681 int vtbls_set_up_p;
683 struct stmt_tree x_stmt_tree;
685 struct named_label_list *x_named_label_uses;
686 struct binding_level *bindings;
688 const char *cannot_inline;
691 /* The current C++-specific per-function global variables. */
693 #define cp_function_chain (current_function->language)
695 /* In a destructor, the point at which all derived class destroying
696 has been done, just before any base class destroying will be done. */
698 #define dtor_label cp_function_chain->x_dtor_label
700 /* In a constructor, the point at which we are ready to return
701 the pointer to the initialized object. */
703 #define ctor_label cp_function_chain->x_ctor_label
705 /* In C++, structures with well-defined constructors are initialized by
706 those constructors, unasked. CURRENT_BASE_INIT_LIST
707 holds a list of stmts for a BASE_INIT term in the grammar.
708 This list has one element for each base class which must be
709 initialized. The list elements are [basename, init], with
710 type basetype. This allows the possibly anachronistic form
711 (assuming d : a, b, c) "d (int a) : c(a+5), b (a-4), a (a+3)"
712 where each successive term can be handed down the constructor
713 line. Perhaps this was not intended. */
715 #define current_base_init_list cp_function_chain->x_base_init_list
716 #define current_member_init_list cp_function_chain->x_member_init_list
718 /* When we're processing a member function, current_class_ptr is the
719 PARM_DECL for the `this' pointer. The current_class_ref is an
720 expression for `*this'. */
722 #define current_class_ptr \
723 (current_function ? cp_function_chain->x_current_class_ptr : NULL_TREE)
724 #define current_class_ref \
725 (current_function ? cp_function_chain->x_current_class_ref : NULL_TREE)
727 /* Information about the current statement tree. */
729 #define current_stmt_tree \
730 (current_function \
731 ? &cp_function_chain->x_stmt_tree \
732 : &scope_chain->x_stmt_tree)
734 /* When building a statement-tree, this is the last statement added to
735 the tree. */
737 #define last_tree current_stmt_tree->x_last_stmt
739 /* The type of the last expression-statement we have seen. This is
740 required because the type of a statement-expression is the type of
741 the last expression statement. */
743 #define last_expr_type current_stmt_tree->x_last_expr_type
745 /* The TRY_BLOCK for the exception-specifiers for the current
746 function, if any. */
748 #define current_eh_spec_try_block cp_function_chain->x_eh_spec_try_block
750 /* The stack of SCOPE_STMTs for the current function. */
752 #define current_scope_stmt_stack cp_function_chain->x_scope_stmt_stack
754 /* The `__in_chrg' parameter for the current function. Only used for
755 destructors. */
757 #define current_in_charge_parm cp_function_chain->x_in_charge_parm
759 /* In destructors, this is a pointer to a condition in an
760 if-statement. If the pointed-to value is boolean_true_node, then
761 there may be virtual function calls in this destructor. */
763 #define current_vcalls_possible_p cp_function_chain->x_vcalls_possible_p
765 /* Set to 0 at beginning of a function definition, set to 1 if
766 a return statement that specifies a return value is seen. */
768 #define current_function_returns_value cp_function_chain->returns_value
770 /* Set to 0 at beginning of a function definition, set to 1 if
771 a return statement with no argument is seen. */
773 #define current_function_returns_null cp_function_chain->returns_null
775 #define current_function_just_assigned_this \
776 cp_function_chain->just_assigned_this
778 #define current_function_parms_stored \
779 cp_function_chain->parms_stored
781 /* Non-zero if we have already declared __FUNCTION__ (and related
782 variables) in the current function. */
784 #define current_function_name_declared \
785 cp_function_chain->name_declared
787 /* Nonzero if we have already generated code to initialize virtual
788 function tables in this function. */
790 #define vtbls_set_up_p cp_function_chain->vtbls_set_up_p
792 /* Used to help generate temporary names which are unique within
793 a function. Reset to 0 by start_function. */
795 #define temp_name_counter cp_function_chain->temp_name_counter
797 /* Non-zero if we should generate RTL for functions that we process.
798 When this is zero, we just accumulate tree structure, without
799 interacting with the back end. */
801 #define expanding_p cp_function_chain->x_expanding_p
803 /* Non-zero if we are in the semantic analysis phase for the current
804 function. */
806 #define doing_semantic_analysis_p() (!expanding_p)
808 /* Non-zero if we should treat statements as full expressions. In
809 particular, this variable is no-zero if at the end of a statement
810 we should destroy any temporaries created during that statement.
811 Similarly, if, at the end of a block, we should destroy any local
812 variables in this block. Normally, this variable is non-zero,
813 since those are the normal semantics of C++.
815 However, in order to represent aggregate initialization code as
816 tree structure, we use statement-expressions. The statements
817 within the statement expression should not result in cleanups being
818 run until the entire enclosing statement is complete. */
820 #define stmts_are_full_exprs_p \
821 current_stmt_tree->stmts_are_full_exprs_p
823 #define in_function_try_handler cp_function_chain->in_function_try_handler
825 extern tree current_function_return_value;
826 extern tree global_namespace;
828 extern tree ridpointers[];
829 extern tree ansi_opname[];
830 extern tree ansi_assopname[];
832 /* Nonzero means `$' can be in an identifier. */
834 extern int dollars_in_ident;
836 /* Nonzero means allow type mismatches in conditional expressions;
837 just make their values `void'. */
839 extern int flag_cond_mismatch;
841 /* Nonzero means don't recognize the keyword `asm'. */
843 extern int flag_no_asm;
845 /* For cross referencing. */
847 extern int flag_gnu_xref;
849 /* For environments where you can use GNU binutils (as, ld in particular). */
851 extern int flag_gnu_binutils;
853 /* Nonzero means warn about implicit declarations. */
855 extern int warn_implicit;
857 /* Nonzero means warn about usage of long long when `-pedantic'. */
859 extern int warn_long_long;
861 /* Nonzero means warn when all ctors or dtors are private, and the class
862 has no friends. */
864 extern int warn_ctor_dtor_privacy;
866 /* Nonzero means warn about function definitions that default the return type
867 or that use a null return and have a return-type other than void. */
869 extern int warn_return_type;
871 /* Nonzero means give string constants the type `const char *', as mandated
872 by the standard. */
874 extern int flag_const_strings;
876 /* Nonzero means warn about deprecated conversion from string constant to
877 `char *'. */
879 extern int warn_write_strings;
881 /* Nonzero means warn about sizeof(function) or addition/subtraction
882 of function pointers. */
884 extern int warn_pointer_arith;
886 /* Nonzero means warn about suggesting putting in ()'s. */
888 extern int warn_parentheses;
890 /* Nonzero means warn about multiple (redundant) decls for the same single
891 variable or function. */
893 extern int warn_redundant_decls;
895 /* Warn if initializer is not completely bracketed. */
897 extern int warn_missing_braces;
899 /* Warn about comparison of signed and unsigned values. */
901 extern int warn_sign_compare;
903 /* Warn about testing equality of floating point numbers. */
905 extern int warn_float_equal;
907 /* Warn about a subscript that has type char. */
909 extern int warn_char_subscripts;
911 /* Nonzero means warn about pointer casts that can drop a type qualifier
912 from the pointer target type. */
914 extern int warn_cast_qual;
916 /* Warn about *printf or *scanf format/argument anomalies. */
918 extern int warn_format;
920 /* Nonzero means warn about non virtual destructors in classes that have
921 virtual functions. */
923 extern int warn_nonvdtor;
925 /* Non-zero means warn when we convert a pointer to member function
926 into a pointer to (void or function). */
928 extern int warn_pmf2ptr;
930 /* Nonzero means warn about violation of some Effective C++ style rules. */
932 extern int warn_ecpp;
934 /* Nonzero means warn where overload resolution chooses a promotion from
935 unsigned to signed over a conversion to an unsigned of the same size. */
937 extern int warn_sign_promo;
939 /* Non-zero means warn when a function is declared extern and later inline. */
941 extern int warn_extern_inline;
943 /* Non-zero means warn when an old-style cast is used. */
945 extern int warn_old_style_cast;
947 /* Nonzero means to treat bitfields as unsigned unless they say `signed'. */
949 extern int flag_signed_bitfields;
951 /* True for more efficient but incompatible (not fully tested)
952 vtable implementation (using thunks).
953 0 is old behavior; 1 is new behavior. */
954 extern int flag_vtable_thunks;
956 /* INTERFACE_ONLY nonzero means that we are in an "interface"
957 section of the compiler. INTERFACE_UNKNOWN nonzero means
958 we cannot trust the value of INTERFACE_ONLY. If INTERFACE_UNKNOWN
959 is zero and INTERFACE_ONLY is zero, it means that we are responsible
960 for exporting definitions that others might need. */
961 extern int interface_only, interface_unknown;
963 /* Nonzero means we should attempt to elide constructors when possible. */
965 extern int flag_elide_constructors;
967 /* Nonzero means enable obscure ANSI features and disable GNU extensions
968 that might cause ANSI-compliant code to be miscompiled. */
970 extern int flag_ansi;
972 /* Nonzero means that member functions defined in class scope are
973 inline by default. */
975 extern int flag_default_inline;
977 /* The name-mangling scheme to use. Versions of gcc before 2.8 use
978 version 0. */
979 extern int name_mangling_version;
981 /* Nonzero means that guiding declarations are allowed. */
982 extern int flag_guiding_decls;
984 /* Nonzero if wchar_t should be `unsigned short' instead of whatever it
985 would normally be, for use with WINE. */
986 extern int flag_short_wchar;
988 /* Nonzero if squashed mangling is to be performed.
989 This uses the B and K codes to reference previously seen class types
990 and class qualifiers. */
991 extern int flag_do_squangling;
993 /* Nonzero means generate separate instantiation control files and juggle
994 them at link time. */
995 extern int flag_use_repository;
997 /* Nonzero if we want to issue diagnostics that the standard says are not
998 required. */
999 extern int flag_optional_diags;
1001 /* Nonzero means do not consider empty argument prototype to mean function
1002 takes no arguments. */
1003 extern int flag_strict_prototype;
1005 /* Nonzero means output .vtable_{entry,inherit} for use in doing vtable gc. */
1006 extern int flag_vtable_gc;
1008 /* Nonzero means make the default pedwarns warnings instead of errors.
1009 The value of this flag is ignored if -pedantic is specified. */
1010 extern int flag_permissive;
1012 /* Nonzero if we want to obey access control semantics. */
1014 extern int flag_access_control;
1016 /* If this variable is defined to a non-NULL value, it will be called
1017 after the file has been completely parsed. The argument will be
1018 the GLOBAL_NAMESPACE. */
1020 extern void (*back_end_hook) PROTO((tree));
1023 /* C++ language-specific tree codes. */
1024 #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
1025 enum cplus_tree_code {
1026 __DUMMY = LAST_AND_UNUSED_TREE_CODE,
1027 #include "cp-tree.def"
1028 LAST_CPLUS_TREE_CODE
1030 #undef DEFTREECODE
1032 enum languages { lang_c, lang_cplusplus, lang_java };
1034 /* Macros to make error reporting functions' lives easier. */
1035 #define TYPE_IDENTIFIER(NODE) (DECL_NAME (TYPE_NAME (NODE)))
1036 #define TYPE_NAME_STRING(NODE) (IDENTIFIER_POINTER (TYPE_IDENTIFIER (NODE)))
1037 #define TYPE_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (TYPE_IDENTIFIER (NODE)))
1039 #define TYPE_ASSEMBLER_NAME_STRING(NODE) (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE))))
1040 #define TYPE_ASSEMBLER_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE))))
1042 /* The _DECL for this _TYPE. */
1043 #define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE)))
1045 /* Nonzero if T is a class (or struct or union) type. Also nonzero
1046 for template type parameters, typename types, and instantiated
1047 template template parameters. Despite its name,
1048 this macro has nothing to do with the definition of aggregate given
1049 in the standard. Think of this macro as MAYBE_CLASS_TYPE_P. */
1050 #define IS_AGGR_TYPE(t) \
1051 (TREE_CODE (t) == TEMPLATE_TYPE_PARM \
1052 || TREE_CODE (t) == TYPENAME_TYPE \
1053 || TREE_CODE (t) == TYPEOF_TYPE \
1054 || (TREE_CODE (t) == TEMPLATE_TEMPLATE_PARM \
1055 && TYPE_TEMPLATE_INFO (t)) \
1056 || TYPE_LANG_FLAG_5 (t))
1058 /* Set IS_AGGR_TYPE for T to VAL. T must be a class, struct, or
1059 union type. */
1060 #define SET_IS_AGGR_TYPE(T, VAL) \
1061 (TYPE_LANG_FLAG_5 (T) = (VAL))
1063 /* Nonzero if T is a class type. Zero for template type parameters,
1064 typename types, and so forth. */
1065 #define CLASS_TYPE_P(t) \
1066 (IS_AGGR_TYPE_CODE (TREE_CODE (t)) && IS_AGGR_TYPE (t))
1068 #define IS_AGGR_TYPE_CODE(t) (t == RECORD_TYPE || t == UNION_TYPE)
1069 #define IS_AGGR_TYPE_2(TYPE1,TYPE2) \
1070 (TREE_CODE (TYPE1) == TREE_CODE (TYPE2) \
1071 && IS_AGGR_TYPE (TYPE1) && IS_AGGR_TYPE (TYPE2))
1072 #define IS_OVERLOAD_TYPE(t) \
1073 (IS_AGGR_TYPE (t) || TREE_CODE (t) == ENUMERAL_TYPE)
1075 /* In a *_TYPE, nonzero means a built-in type. */
1076 #define TYPE_BUILT_IN(NODE) TYPE_LANG_FLAG_6(NODE)
1078 /* True if this a "Java" type, defined in 'extern "Java"'. */
1079 #define TYPE_FOR_JAVA(NODE) TYPE_LANG_FLAG_3(NODE)
1081 /* The type qualifiers for this type, including the qualifiers on the
1082 elements for an array type. */
1083 #define CP_TYPE_QUALS(NODE) \
1084 ((TREE_CODE (NODE) != ARRAY_TYPE) \
1085 ? TYPE_QUALS (NODE) : cp_type_quals (NODE))
1087 /* Nonzero if this type is const-qualified. */
1088 #define CP_TYPE_CONST_P(NODE) \
1089 ((CP_TYPE_QUALS (NODE) & TYPE_QUAL_CONST) != 0)
1091 /* Nonzero if this type is volatile-qualified. */
1092 #define CP_TYPE_VOLATILE_P(NODE) \
1093 ((CP_TYPE_QUALS (NODE) & TYPE_QUAL_VOLATILE) != 0)
1095 /* Nonzero if this type is restrict-qualified. */
1096 #define CP_TYPE_RESTRICT_P(NODE) \
1097 ((CP_TYPE_QUALS (NODE) & TYPE_QUAL_RESTRICT) != 0)
1099 /* Nonzero if this type is const-qualified, but not
1100 volatile-qualified. Other qualifiers are ignored. This macro is
1101 used to test whether or not it is OK to bind an rvalue to a
1102 reference. */
1103 #define CP_TYPE_CONST_NON_VOLATILE_P(NODE) \
1104 ((CP_TYPE_QUALS (NODE) & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE)) \
1105 == TYPE_QUAL_CONST)
1107 #define DELTA_FROM_VTABLE_ENTRY(ENTRY) \
1108 (!flag_vtable_thunks ? \
1109 TREE_VALUE (CONSTRUCTOR_ELTS (ENTRY)) \
1110 : TREE_CODE (TREE_OPERAND ((ENTRY), 0)) != THUNK_DECL ? integer_zero_node \
1111 : build_int_2 (THUNK_DELTA (TREE_OPERAND ((ENTRY), 0)), 0))
1113 /* Virtual function addresses can be gotten from a virtual function
1114 table entry using this macro. */
1115 #define FNADDR_FROM_VTABLE_ENTRY(ENTRY) \
1116 (!flag_vtable_thunks ? \
1117 TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY)))) \
1118 : TREE_CODE (TREE_OPERAND ((ENTRY), 0)) != THUNK_DECL ? (ENTRY) \
1119 : DECL_INITIAL (TREE_OPERAND ((ENTRY), 0)))
1120 #define SET_FNADDR_FROM_VTABLE_ENTRY(ENTRY,VALUE) \
1121 (TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY)))) = (VALUE))
1122 #define FUNCTION_ARG_CHAIN(NODE) (TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (NODE))))
1123 #define PROMOTES_TO_AGGR_TYPE(NODE,CODE) \
1124 (((CODE) == TREE_CODE (NODE) \
1125 && IS_AGGR_TYPE (TREE_TYPE (NODE))) \
1126 || IS_AGGR_TYPE (NODE))
1128 /* Nonzero iff TYPE is uniquely derived from PARENT. Under MI, PARENT can
1129 be an ambiguous base class of TYPE, and this macro will be false. */
1130 #define UNIQUELY_DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 0, (tree *)0) >= 0)
1131 #define ACCESSIBLY_DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, -1, (tree *)0) >= 0)
1132 #define ACCESSIBLY_UNIQUELY_DERIVED_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 1, (tree *)0) >= 0)
1133 #define DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 0, (tree *)0) != -1)
1135 /* This structure provides additional information above and beyond
1136 what is provide in the ordinary tree_type. In the past, we used it
1137 for the types of class types, template parameters types, typename
1138 types, and so forth. However, there can be many (tens to hundreds
1139 of thousands) of template parameter types in a compilation, and
1140 there's no need for this additional information in that case.
1141 Therefore, we now use this data structure only for class types.
1143 In the past, it was thought that there would be relatively few
1144 class types. However, in the presence of heavy use of templates,
1145 many (i.e., thousands) of classes can easily be generated.
1146 Therefore, we should endeavor to keep the size of this structure to
1147 a minimum. */
1148 struct lang_type
1150 unsigned char align;
1152 unsigned has_type_conversion : 1;
1153 unsigned has_init_ref : 1;
1154 unsigned has_default_ctor : 1;
1155 unsigned uses_multiple_inheritance : 1;
1156 unsigned const_needs_init : 1;
1157 unsigned ref_needs_init : 1;
1158 unsigned has_const_assign_ref : 1;
1159 unsigned anon_aggr : 1;
1161 unsigned has_nonpublic_ctor : 2;
1162 unsigned has_nonpublic_assign_ref : 2;
1163 unsigned vtable_needs_writing : 1;
1164 unsigned has_assign_ref : 1;
1165 unsigned gets_new : 2;
1167 unsigned gets_delete : 2;
1168 unsigned has_call_overloaded : 1;
1169 unsigned has_array_ref_overloaded : 1;
1170 unsigned has_arrow_overloaded : 1;
1171 unsigned interface_only : 1;
1172 unsigned interface_unknown : 1;
1173 unsigned needs_virtual_reinit : 1;
1175 unsigned marks: 6;
1176 unsigned vec_delete_takes_size : 1;
1177 unsigned declared_class : 1;
1179 unsigned being_defined : 1;
1180 unsigned redefined : 1;
1181 unsigned debug_requested : 1;
1182 unsigned use_template : 2;
1183 unsigned got_semicolon : 1;
1184 unsigned ptrmemfunc_flag : 1;
1185 unsigned was_anonymous : 1;
1187 unsigned has_real_assign_ref : 1;
1188 unsigned has_const_init_ref : 1;
1189 unsigned has_complex_init_ref : 1;
1190 unsigned has_complex_assign_ref : 1;
1191 unsigned has_abstract_assign_ref : 1;
1192 unsigned non_aggregate : 1;
1193 unsigned is_partial_instantiation : 1;
1194 unsigned has_mutable : 1;
1196 unsigned com_interface : 1;
1197 unsigned non_pod_class : 1;
1199 /* When adding a flag here, consider whether or not it ought to
1200 apply to a template instance if it applies to the template. If
1201 so, make sure to copy it in instantiate_class_template! */
1203 /* There are six bits left to fill out a 32-bit word. Keep track of
1204 this by updating the size of this bitfield whenever you add or
1205 remove a flag. */
1206 unsigned dummy : 6;
1208 int vsize;
1209 int vfield_parent;
1211 union tree_node *vfields;
1212 union tree_node *vbases;
1214 union tree_node *tags;
1216 union tree_node *search_slot;
1218 union tree_node *size;
1220 union tree_node *abstract_virtuals;
1221 union tree_node *friend_classes;
1223 union tree_node *rtti;
1225 union tree_node *methods;
1227 union tree_node *template_info;
1228 tree befriending_classes;
1231 /* Indicates whether or not (and how) a template was expanded for this class.
1232 0=no information yet/non-template class
1233 1=implicit template instantiation
1234 2=explicit template specialization
1235 3=explicit template instantiation */
1236 #define CLASSTYPE_USE_TEMPLATE(NODE) (TYPE_LANG_SPECIFIC(NODE)->use_template)
1238 /* Fields used for storing information before the class is defined.
1239 After the class is defined, these fields hold other information. */
1241 /* List of friends which were defined inline in this class definition. */
1242 #define CLASSTYPE_INLINE_FRIENDS(NODE) (TYPE_NONCOPIED_PARTS (NODE))
1244 /* Nonzero for _CLASSTYPE means that operator new and delete are defined,
1245 respectively. */
1246 #define TYPE_GETS_NEW(NODE) (TYPE_LANG_SPECIFIC(NODE)->gets_new)
1247 #define TYPE_GETS_DELETE(NODE) (TYPE_LANG_SPECIFIC(NODE)->gets_delete)
1248 #define TYPE_GETS_REG_DELETE(NODE) (TYPE_GETS_DELETE (NODE) & 1)
1250 /* Nonzero for _CLASSTYPE means that operator vec delete is defined and
1251 takes the optional size_t argument. */
1252 #define TYPE_VEC_DELETE_TAKES_SIZE(NODE) \
1253 (TYPE_LANG_SPECIFIC(NODE)->vec_delete_takes_size)
1254 #define TYPE_VEC_NEW_USES_COOKIE(NODE) \
1255 (TYPE_NEEDS_DESTRUCTOR (NODE) \
1256 || (TYPE_LANG_SPECIFIC (NODE) && TYPE_VEC_DELETE_TAKES_SIZE (NODE)))
1258 /* Nonzero means that this _CLASSTYPE node defines ways of converting
1259 itself to other types. */
1260 #define TYPE_HAS_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_type_conversion)
1262 /* Nonzero means that this _CLASSTYPE node overloads operator=(X&). */
1263 #define TYPE_HAS_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_assign_ref)
1264 #define TYPE_HAS_CONST_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_const_assign_ref)
1266 /* Nonzero means that this _CLASSTYPE node has an X(X&) constructor. */
1267 #define TYPE_HAS_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_init_ref)
1268 #define TYPE_HAS_CONST_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_const_init_ref)
1270 /* Nonzero means that this type is being defined. I.e., the left brace
1271 starting the definition of this type has been seen. */
1272 #define TYPE_BEING_DEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->being_defined)
1273 /* Nonzero means that this type has been redefined. In this case, if
1274 convenient, don't reprocess any methods that appear in its redefinition. */
1275 #define TYPE_REDEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->redefined)
1277 /* The is the basetype that contains NODE's rtti. */
1278 #define CLASSTYPE_RTTI(NODE) (TYPE_LANG_SPECIFIC(NODE)->rtti)
1280 /* Nonzero means that this _CLASSTYPE node overloads operator(). */
1281 #define TYPE_OVERLOADS_CALL_EXPR(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_call_overloaded)
1283 /* Nonzero means that this _CLASSTYPE node overloads operator[]. */
1284 #define TYPE_OVERLOADS_ARRAY_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_array_ref_overloaded)
1286 /* Nonzero means that this _CLASSTYPE node overloads operator->. */
1287 #define TYPE_OVERLOADS_ARROW(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_arrow_overloaded)
1289 /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
1290 multiple inheritance. If this is 0 for the root of a type
1291 hierarchy, then we can use more efficient search techniques. */
1292 #define TYPE_USES_MULTIPLE_INHERITANCE(NODE) (TYPE_LANG_SPECIFIC(NODE)->uses_multiple_inheritance)
1294 /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
1295 virtual base classes. If this is 0 for the root of a type
1296 hierarchy, then we can use more efficient search techniques. */
1297 #define TYPE_USES_VIRTUAL_BASECLASSES(NODE) (TREE_LANG_FLAG_3(NODE))
1299 /* Vector member functions defined in this class. Each element is
1300 either a FUNCTION_DECL, a TEMPLATE_DECL, or an OVERLOAD. All
1301 functions with the same name end up in the same slot. The first
1302 two elements are for constructors, and destructors, respectively.
1303 These are followed by ordinary member functions. There may be
1304 empty entries at the end of the vector. */
1305 #define CLASSTYPE_METHOD_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->methods)
1307 /* The first type conversion operator in the class (the others can be
1308 searched with TREE_CHAIN), or the first non-constructor function if
1309 there are no type conversion operators. */
1310 #define CLASSTYPE_FIRST_CONVERSION(NODE) \
1311 TREE_VEC_LENGTH (CLASSTYPE_METHOD_VEC (NODE)) > 2 \
1312 ? TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), 2) \
1313 : NULL_TREE;
1315 /* Mark bits for depth-first and breath-first searches. */
1317 /* Get the value of the Nth mark bit. */
1318 #define CLASSTYPE_MARKED_N(NODE, N) \
1319 (((CLASS_TYPE_P (NODE) ? TYPE_LANG_SPECIFIC (NODE)->marks \
1320 : TYPE_ALIAS_SET (NODE)) & (1 << N)) != 0)
1322 /* Set the Nth mark bit. */
1323 #define SET_CLASSTYPE_MARKED_N(NODE, N) \
1324 (CLASS_TYPE_P (NODE) \
1325 ? (TYPE_LANG_SPECIFIC (NODE)->marks |= (1 << (N))) \
1326 : (TYPE_ALIAS_SET (NODE) |= (1 << (N))))
1328 /* Clear the Nth mark bit. */
1329 #define CLEAR_CLASSTYPE_MARKED_N(NODE, N) \
1330 (CLASS_TYPE_P (NODE) \
1331 ? (TYPE_LANG_SPECIFIC (NODE)->marks &= ~(1 << (N))) \
1332 : (TYPE_ALIAS_SET (NODE) &= ~(1 << (N))))
1334 /* Get the value of the mark bits. */
1335 #define CLASSTYPE_MARKED(NODE) CLASSTYPE_MARKED_N(NODE, 0)
1336 #define CLASSTYPE_MARKED2(NODE) CLASSTYPE_MARKED_N(NODE, 1)
1337 #define CLASSTYPE_MARKED3(NODE) CLASSTYPE_MARKED_N(NODE, 2)
1338 #define CLASSTYPE_MARKED4(NODE) CLASSTYPE_MARKED_N(NODE, 3)
1339 #define CLASSTYPE_MARKED5(NODE) CLASSTYPE_MARKED_N(NODE, 4)
1340 #define CLASSTYPE_MARKED6(NODE) CLASSTYPE_MARKED_N(NODE, 5)
1342 /* Macros to modify the above flags */
1343 #define SET_CLASSTYPE_MARKED(NODE) SET_CLASSTYPE_MARKED_N(NODE, 0)
1344 #define CLEAR_CLASSTYPE_MARKED(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 0)
1345 #define SET_CLASSTYPE_MARKED2(NODE) SET_CLASSTYPE_MARKED_N(NODE, 1)
1346 #define CLEAR_CLASSTYPE_MARKED2(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 1)
1347 #define SET_CLASSTYPE_MARKED3(NODE) SET_CLASSTYPE_MARKED_N(NODE, 2)
1348 #define CLEAR_CLASSTYPE_MARKED3(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 2)
1349 #define SET_CLASSTYPE_MARKED4(NODE) SET_CLASSTYPE_MARKED_N(NODE, 3)
1350 #define CLEAR_CLASSTYPE_MARKED4(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 3)
1351 #define SET_CLASSTYPE_MARKED5(NODE) SET_CLASSTYPE_MARKED_N(NODE, 4)
1352 #define CLEAR_CLASSTYPE_MARKED5(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 4)
1353 #define SET_CLASSTYPE_MARKED6(NODE) SET_CLASSTYPE_MARKED_N(NODE, 5)
1354 #define CLEAR_CLASSTYPE_MARKED6(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 5)
1356 /* A list of the nested tag-types (class, struct, union, or enum)
1357 found within this class. The TREE_PURPOSE of each node is the name
1358 of the type; the TREE_VALUE is the type itself. This list includes
1359 nested member class templates. */
1360 #define CLASSTYPE_TAGS(NODE) (TYPE_LANG_SPECIFIC(NODE)->tags)
1362 /* If this class has any bases, this is the number of the base class from
1363 which our VFIELD is based, -1 otherwise. If this class has no base
1364 classes, this is not used.
1365 In D : B1, B2, PARENT would be 0, if D's vtable came from B1,
1366 1, if D's vtable came from B2. */
1367 #define CLASSTYPE_VFIELD_PARENT(NODE) (TYPE_LANG_SPECIFIC(NODE)->vfield_parent)
1369 /* The number of virtual functions defined for this
1370 _CLASSTYPE node. */
1371 #define CLASSTYPE_VSIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->vsize)
1372 /* The virtual base classes that this type uses. */
1373 #define CLASSTYPE_VBASECLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->vbases)
1374 /* The virtual function pointer fields that this type contains. */
1375 #define CLASSTYPE_VFIELDS(NODE) (TYPE_LANG_SPECIFIC(NODE)->vfields)
1377 /* Number of baseclasses defined for this type.
1378 0 means no base classes. */
1379 #define CLASSTYPE_N_BASECLASSES(NODE) \
1380 (TYPE_BINFO_BASETYPES (NODE) ? TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES(NODE)) : 0)
1382 /* Used for keeping search-specific information. Any search routine
1383 which uses this must define what exactly this slot is used for. */
1384 #define CLASSTYPE_SEARCH_SLOT(NODE) (TYPE_LANG_SPECIFIC(NODE)->search_slot)
1386 /* These are the size, mode and alignment of the type without its
1387 virtual base classes, for when we use this type as a base itself. */
1388 #define CLASSTYPE_SIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->size)
1389 #define CLASSTYPE_ALIGN(NODE) (TYPE_LANG_SPECIFIC(NODE)->align)
1391 /* A cons list of virtual functions which cannot be inherited by
1392 derived classes. When deriving from this type, the derived
1393 class must provide its own definition for each of these functions. */
1394 #define CLASSTYPE_ABSTRACT_VIRTUALS(NODE) (TYPE_LANG_SPECIFIC(NODE)->abstract_virtuals)
1396 /* Nonzero means that this aggr type has been `closed' by a semicolon. */
1397 #define CLASSTYPE_GOT_SEMICOLON(NODE) (TYPE_LANG_SPECIFIC (NODE)->got_semicolon)
1399 /* Nonzero means that the main virtual function table pointer needs to be
1400 set because base constructors have placed the wrong value there.
1401 If this is zero, it means that they placed the right value there,
1402 and there is no need to change it. */
1403 #define CLASSTYPE_NEEDS_VIRTUAL_REINIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->needs_virtual_reinit)
1405 /* Nonzero means that if this type has virtual functions, that
1406 the virtual function table will be written out. */
1407 #define CLASSTYPE_VTABLE_NEEDS_WRITING(NODE) (TYPE_LANG_SPECIFIC(NODE)->vtable_needs_writing)
1409 /* Nonzero means that this type has an X() constructor. */
1410 #define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_default_ctor)
1412 /* Nonzero means the type declared a ctor as private or protected. We
1413 use this to make sure we don't try to generate a copy ctor for a
1414 class that has a member of type NODE. */
1415 #define TYPE_HAS_NONPUBLIC_CTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_nonpublic_ctor)
1417 /* Ditto, for operator=. */
1418 #define TYPE_HAS_NONPUBLIC_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_nonpublic_assign_ref)
1420 /* Nonzero means that this type contains a mutable member */
1421 #define CLASSTYPE_HAS_MUTABLE(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_mutable)
1422 #define TYPE_HAS_MUTABLE_P(NODE) (cp_has_mutable_p (NODE))
1424 /* Nonzero means that this class type is a non-POD class. */
1425 #define CLASSTYPE_NON_POD_P(NODE) (TYPE_LANG_SPECIFIC (NODE)->non_pod_class)
1427 /* Nonzero means that this type is meant for communication via COM. */
1428 #define CLASSTYPE_COM_INTERFACE(NODE) \
1429 (TYPE_LANG_SPECIFIC(NODE)->com_interface)
1431 /* A list of class types of which this type is a friend. The
1432 TREE_VALUE is normally a TYPE, but will be a TEMPLATE_DECL in the
1433 case of a template friend. */
1434 #define CLASSTYPE_FRIEND_CLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->friend_classes)
1436 /* A list of the classes which grant friendship to this class. */
1437 #define CLASSTYPE_BEFRIENDING_CLASSES(NODE) \
1438 (TYPE_LANG_SPECIFIC (NODE)->befriending_classes)
1440 /* Say whether this node was declared as a "class" or a "struct". */
1441 #define CLASSTYPE_DECLARED_CLASS(NODE) (TYPE_LANG_SPECIFIC(NODE)->declared_class)
1443 /* Nonzero if this class has const members which have no specified initialization. */
1444 #define CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->const_needs_init)
1446 /* Nonzero if this class has ref members which have no specified initialization. */
1447 #define CLASSTYPE_REF_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->ref_needs_init)
1449 /* Nonzero if this class is included from a header file which employs
1450 `#pragma interface', and it is not included in its implementation file. */
1451 #define CLASSTYPE_INTERFACE_ONLY(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_only)
1453 /* Same as above, but for classes whose purpose we do not know. */
1454 #define CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown)
1455 #define CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown == 0)
1456 #define SET_CLASSTYPE_INTERFACE_UNKNOWN_X(NODE,X) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = !!(X))
1457 #define SET_CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = 1)
1458 #define SET_CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = 0)
1460 /* Nonzero if a _DECL node requires us to output debug info for this class. */
1461 #define CLASSTYPE_DEBUG_REQUESTED(NODE) (TYPE_LANG_SPECIFIC(NODE)->debug_requested)
1463 /* Additional macros for inheritance information. */
1465 /* The BINFO_INHERITANCE_CHAIN is used opposite to the description in
1466 gcc/tree.h. In particular if D is derived from B then the BINFO
1467 for B (in D) will have a BINFO_INHERITANCE_CHAIN pointing to
1468 D. In tree.h, this pointer is described as pointing in other
1469 direction. There is a different BINFO for each path to a virtual
1470 base; BINFOs for virtual bases are not shared. In addition, shared
1471 versions of each of the virtual class BINFOs are stored in
1472 CLASSTYPE_VBASECLASSES.
1474 We use TREE_VIA_PROTECTED and TREE_VIA_PUBLIC, but private
1475 inheritance is indicated by the absence of the other two flags, not
1476 by TREE_VIA_PRIVATE, which is unused.
1478 The TREE_CHAIN is for scratch space in search.c. */
1480 /* Nonzero means marked by DFS or BFS search, including searches
1481 by `get_binfo' and `get_base_distance'. */
1482 #define BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED(BINFO_TYPE(NODE)):TREE_LANG_FLAG_0(NODE))
1483 /* Macros needed because of C compilers that don't allow conditional
1484 expressions to be lvalues. Grr! */
1485 #define SET_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_0(NODE)=1))
1486 #define CLEAR_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_0(NODE)=0))
1488 /* Nonzero means marked in search through virtual inheritance hierarchy. */
1489 #define BINFO_VBASE_MARKED(NODE) CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
1490 /* Modifier macros */
1491 #define SET_BINFO_VBASE_MARKED(NODE) SET_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
1492 #define CLEAR_BINFO_VBASE_MARKED(NODE) CLEAR_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
1494 /* Nonzero means marked in search for members or member functions. */
1495 #define BINFO_FIELDS_MARKED(NODE) \
1496 (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED2 (BINFO_TYPE (NODE)):TREE_LANG_FLAG_2(NODE))
1497 #define SET_BINFO_FIELDS_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED2(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_2(NODE)=1))
1498 #define CLEAR_BINFO_FIELDS_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED2(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_2(NODE)=0))
1500 /* Nonzero means that this class is on a path leading to a new vtable. */
1501 #define BINFO_VTABLE_PATH_MARKED(NODE) \
1502 (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):TREE_LANG_FLAG_3(NODE))
1503 #define SET_BINFO_VTABLE_PATH_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_3(NODE)=1))
1504 #define CLEAR_BINFO_VTABLE_PATH_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_3(NODE)=0))
1506 /* Nonzero means that this class has a new vtable. */
1507 #define BINFO_NEW_VTABLE_MARKED(NODE) \
1508 (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):TREE_LANG_FLAG_4(NODE))
1509 #define SET_BINFO_NEW_VTABLE_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_4(NODE)=1))
1510 #define CLEAR_BINFO_NEW_VTABLE_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_4(NODE)=0))
1512 /* Nonzero means this class has done dfs_pushdecls. */
1513 #define BINFO_PUSHDECLS_MARKED(NODE) BINFO_VTABLE_PATH_MARKED (NODE)
1514 #define SET_BINFO_PUSHDECLS_MARKED(NODE) SET_BINFO_VTABLE_PATH_MARKED (NODE)
1515 #define CLEAR_BINFO_PUSHDECLS_MARKED(NODE) CLEAR_BINFO_VTABLE_PATH_MARKED (NODE)
1517 /* Used by various search routines. */
1518 #define IDENTIFIER_MARKED(NODE) TREE_LANG_FLAG_0 (NODE)
1520 /* Accessor macros for the vfield slots in structures. */
1522 /* Get the assoc info that caused this vfield to exist. */
1523 #define VF_BINFO_VALUE(NODE) TREE_PURPOSE (NODE)
1525 /* Get that same information as a _TYPE. */
1526 #define VF_BASETYPE_VALUE(NODE) TREE_VALUE (NODE)
1528 /* Get the value of the top-most type dominating the non-`normal' vfields. */
1529 #define VF_DERIVED_VALUE(NODE) (VF_BINFO_VALUE (NODE) ? BINFO_TYPE (VF_BINFO_VALUE (NODE)) : NULL_TREE)
1531 /* Get the value of the top-most type that's `normal' for the vfield. */
1532 #define VF_NORMAL_VALUE(NODE) TREE_TYPE (NODE)
1534 /* Nonzero for TREE_LIST node means that this list of things
1535 is a list of parameters, as opposed to a list of expressions. */
1536 #define TREE_PARMLIST(NODE) ((NODE)->common.unsigned_flag) /* overloaded! */
1538 /* For FUNCTION_TYPE or METHOD_TYPE, a list of the exceptions that
1539 this type can raise. Each TREE_VALUE is a _TYPE. The TREE_VALUE
1540 will be NULL_TREE to indicate a throw specification of `()', or
1541 no exceptions allowed. */
1542 #define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_NONCOPIED_PARTS (NODE)
1544 /* For FUNCTION_TYPE or METHOD_TYPE, return 1 iff it is declared `throw()'. */
1545 #define TYPE_NOTHROW_P(NODE) \
1546 (TYPE_RAISES_EXCEPTIONS (NODE) \
1547 && TREE_VALUE (TYPE_RAISES_EXCEPTIONS (NODE)) == NULL_TREE)
1549 /* The binding level associated with the namespace. */
1550 #define NAMESPACE_LEVEL(NODE) \
1551 (DECL_LANG_SPECIFIC(NODE)->decl_flags.u.level)
1554 /* If a DECL has DECL_LANG_SPECIFIC, it is either a lang_decl_flags or
1555 a lang_decl (which has lang_decl_flags as its initial prefix).
1556 This macro is nonzero for tree nodes whose DECL_LANG_SPECIFIC is
1557 the full lang_decl, and not just lang_decl_flags. */
1558 #define CAN_HAVE_FULL_LANG_DECL_P(NODE) \
1559 (!(TREE_CODE ((NODE)) == VAR_DECL \
1560 || TREE_CODE ((NODE)) == CONST_DECL \
1561 || TREE_CODE ((NODE)) == FIELD_DECL \
1562 || TREE_CODE ((NODE)) == USING_DECL))
1564 struct lang_decl_flags
1566 #ifdef ONLY_INT_FIELDS
1567 int language : 8;
1568 #else
1569 enum languages language : 8;
1570 #endif
1572 unsigned operator_attr : 1;
1573 unsigned constructor_attr : 1;
1574 unsigned friend_attr : 1;
1575 unsigned static_function : 1;
1576 unsigned const_memfunc : 1;
1577 unsigned volatile_memfunc : 1;
1578 unsigned abstract_virtual : 1;
1579 unsigned constructor_for_vbase_attr : 1;
1581 unsigned mutable_flag : 1;
1582 unsigned saved_inline : 1;
1583 unsigned use_template : 2;
1584 unsigned nonconverting : 1;
1585 unsigned declared_inline : 1;
1586 unsigned not_really_extern : 1;
1587 unsigned needs_final_overrider : 1;
1589 unsigned bitfield : 1;
1590 unsigned defined_in_class : 1;
1591 unsigned pending_inline_p : 1;
1592 unsigned global_ctor_p : 1;
1593 unsigned global_dtor_p : 1;
1594 unsigned dummy : 3;
1596 tree context;
1598 union {
1599 /* In a FUNCTION_DECL or a VAR_DECL, this is DECL_TEMPLATE_INFO. */
1600 tree template_info;
1602 /* In a NAMESPACE_DECL, this is NAMESPACE_LEVEL. */
1603 struct binding_level *level;
1604 } u;
1606 union {
1607 /* This is DECL_ACCESS. */
1608 tree access;
1610 /* In a namespace-scope FUNCTION_DECL, this is
1611 GLOBAL_INIT_PRIORITY. */
1612 int init_priority;
1613 } u2;
1616 struct lang_decl
1618 struct lang_decl_flags decl_flags;
1620 tree main_decl_variant;
1621 tree befriending_classes;
1623 /* In a FUNCTION_DECL, this is DECL_SAVED_TREE. */
1624 tree saved_tree;
1626 union
1628 tree sorted_fields;
1629 struct pending_inline *pending_inline_info;
1630 struct language_function *saved_language_function;
1631 } u;
1634 /* Non-zero if NODE is a _DECL with TREE_READONLY set. */
1635 #define TREE_READONLY_DECL_P(NODE) \
1636 (TREE_READONLY (NODE) && TREE_CODE_CLASS (TREE_CODE (NODE)) == 'd')
1638 /* Non-zero iff DECL is memory-based. The DECL_RTL of
1639 certain const variables might be a CONST_INT, or a REG
1640 in some cases. We cannot use `memory_operand' as a test
1641 here because on most RISC machines, a variable's address
1642 is not, by itself, a legitimate address. */
1643 #define DECL_IN_MEMORY_P(NODE) \
1644 (DECL_RTL (NODE) != NULL_RTX && GET_CODE (DECL_RTL (NODE)) == MEM)
1646 /* For FUNCTION_DECLs: return the language in which this decl
1647 was declared. */
1648 #define DECL_LANGUAGE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.language)
1650 /* For FUNCTION_DECLs: nonzero means that this function is a constructor. */
1651 #define DECL_CONSTRUCTOR_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_attr)
1653 /* There ought to be a better way to find out whether or not something is
1654 a destructor. */
1655 #define DECL_DESTRUCTOR_P(NODE) \
1656 (DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (NODE)) \
1657 && DECL_LANGUAGE (NODE) == lang_cplusplus)
1659 /* Non-zero if NODE is a user-defined conversion operator. */
1660 #define DECL_CONV_FN_P(NODE) \
1661 (IDENTIFIER_TYPENAME_P (DECL_NAME (NODE)) && TREE_TYPE (DECL_NAME (NODE)))
1663 /* Non-zero if NODE is an overloaded operator. */
1664 #define DECL_OVERLOADED_OPERATOR_P(NODE) \
1665 (IDENTIFIER_OPNAME_P (DECL_NAME ((NODE))))
1667 /* For FUNCTION_DECLs: nonzero means that this function is a constructor
1668 for an object with virtual baseclasses. */
1669 #define DECL_CONSTRUCTOR_FOR_VBASE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_for_vbase_attr)
1671 /* Non-zero for a FUNCTION_DECL that declares a type-info function. */
1672 #define DECL_TINFO_FN_P(NODE) \
1673 (TREE_CODE (NODE) == FUNCTION_DECL \
1674 && DECL_ARTIFICIAL (NODE) \
1675 && DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag)
1677 /* Mark NODE as a type-info function. */
1678 #define SET_DECL_TINFO_FN_P(NODE) \
1679 (DECL_LANG_SPECIFIC((NODE))->decl_flags.mutable_flag = 1)
1681 /* Nonzero for _DECL means that this decl appears in (or will appear
1682 in) as a member in a RECORD_TYPE or UNION_TYPE node. It is also for
1683 detecting circularity in case members are multiply defined. In the
1684 case of a VAR_DECL, it is also used to determine how program storage
1685 should be allocated. */
1686 #define DECL_IN_AGGR_P(NODE) (DECL_LANG_FLAG_3(NODE))
1688 /* Nonzero if the DECL was defined in the class definition itself,
1689 rather than outside the class. */
1690 #define DECL_DEFINED_IN_CLASS_P(DECL) \
1691 (DECL_LANG_SPECIFIC (DECL)->decl_flags.defined_in_class)
1693 /* Nonzero for FUNCTION_DECL means that this decl is just a
1694 friend declaration, and should not be added to the list of
1695 member functions for this class. */
1696 #define DECL_FRIEND_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.friend_attr)
1698 /* A TREE_LIST of the types which have befriended this FUNCTION_DECL. */
1699 #define DECL_BEFRIENDING_CLASSES(NODE) \
1700 (DECL_LANG_SPECIFIC(NODE)->befriending_classes)
1702 /* Nonzero for FUNCTION_DECL means that this decl is a static
1703 member function. */
1704 #define DECL_STATIC_FUNCTION_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.static_function)
1706 /* Nonzero for a class member means that it is shared between all objects
1707 of that class. */
1708 #define SHARED_MEMBER_P(NODE) \
1709 (TREE_CODE (NODE) == VAR_DECL || TREE_CODE (NODE) == TYPE_DECL \
1710 || TREE_CODE (NODE) == CONST_DECL)
1712 /* Nonzero for FUNCTION_DECL means that this decl is a non-static
1713 member function. */
1714 #define DECL_NONSTATIC_MEMBER_FUNCTION_P(NODE) \
1715 (TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE)
1717 /* Nonzero for FUNCTION_DECL means that this decl is a member function
1718 (static or non-static). */
1719 #define DECL_FUNCTION_MEMBER_P(NODE) \
1720 (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE) || DECL_STATIC_FUNCTION_P (NODE))
1722 /* Nonzero for FUNCTION_DECL means that this member function
1723 has `this' as const X *const. */
1724 #define DECL_CONST_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.const_memfunc)
1726 /* Nonzero for FUNCTION_DECL means that this member function
1727 has `this' as volatile X *const. */
1728 #define DECL_VOLATILE_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.volatile_memfunc)
1730 /* Nonzero for a DECL means that this member is a non-static member. */
1731 #define DECL_NONSTATIC_MEMBER_P(NODE) \
1732 ((TREE_CODE (NODE) == FUNCTION_DECL \
1733 && DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE)) \
1734 || TREE_CODE (NODE) == FIELD_DECL)
1736 /* Nonzero for _DECL means that this member object type
1737 is mutable. */
1738 #define DECL_MUTABLE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag)
1740 /* Nonzero for _DECL means that this constructor is a non-converting
1741 constructor. */
1742 #define DECL_NONCONVERTING_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.nonconverting)
1744 /* Nonzero for FUNCTION_DECL means that this member function
1745 exists as part of an abstract class's interface. */
1746 #define DECL_ABSTRACT_VIRTUAL_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.abstract_virtual)
1748 /* Nonzero for FUNCTION_DECL means that this member function
1749 must be overridden by derived classes. */
1750 #define DECL_NEEDS_FINAL_OVERRIDER_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.needs_final_overrider)
1752 /* The _TYPE context in which this _DECL appears. This field holds the
1753 class where a virtual function instance is actually defined, and the
1754 lexical scope of a friend function defined in a class body. */
1755 #define DECL_CLASS_CONTEXT(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.context)
1756 #define DECL_REAL_CONTEXT(NODE) \
1757 ((TREE_CODE (NODE) == FUNCTION_DECL && DECL_FUNCTION_MEMBER_P (NODE)) \
1758 ? DECL_CLASS_CONTEXT (NODE) : CP_DECL_CONTEXT (NODE))
1760 /* NULL_TREE in DECL_CONTEXT represents the global namespace. */
1761 #define CP_DECL_CONTEXT(NODE) \
1762 (DECL_CONTEXT (NODE) ? DECL_CONTEXT (NODE) : global_namespace)
1763 #define FROB_CONTEXT(NODE) ((NODE) == global_namespace ? NULL_TREE : (NODE))
1765 /* For a virtual function, the base where we find its vtable entry.
1766 For a non-virtual function, the base where it is defined. */
1767 #define DECL_VIRTUAL_CONTEXT(NODE) DECL_CONTEXT (NODE)
1769 /* 1 iff NODE has namespace scope, including the global namespace. */
1770 #define DECL_NAMESPACE_SCOPE_P(NODE) \
1771 (!DECL_TEMPLATE_PARM_P (NODE) \
1772 && TREE_CODE (CP_DECL_CONTEXT (NODE)) == NAMESPACE_DECL)
1774 /* 1 iff NODE is a class member. */
1775 #define DECL_CLASS_SCOPE_P(NODE) \
1776 (DECL_CONTEXT (NODE) \
1777 && TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (NODE))) == 't')
1779 /* 1 iff NODE is function-local. */
1780 #define DECL_FUNCTION_SCOPE_P(NODE) \
1781 (DECL_CONTEXT (NODE) \
1782 && TREE_CODE (DECL_CONTEXT (NODE)) == FUNCTION_DECL)
1784 /* For a NAMESPACE_DECL: the list of using namespace directives
1785 The PURPOSE is the used namespace, the value is the namespace
1786 that is the common ancestor. */
1787 #define DECL_NAMESPACE_USING(NODE) DECL_VINDEX (NAMESPACE_DECL_CHECK (NODE))
1789 /* In a NAMESPACE_DECL, the DECL_INITIAL is used to record all users
1790 of a namespace, to record the transitive closure of using namespace. */
1791 #define DECL_NAMESPACE_USERS(NODE) DECL_INITIAL (NAMESPACE_DECL_CHECK (NODE))
1793 /* In a NAMESPACE_DECL, points to the original namespace if this is
1794 a namespace alias. */
1795 #define DECL_NAMESPACE_ALIAS(NODE) \
1796 DECL_ABSTRACT_ORIGIN (NAMESPACE_DECL_CHECK (NODE))
1797 #define ORIGINAL_NAMESPACE(NODE) \
1798 (DECL_NAMESPACE_ALIAS (NODE) ? DECL_NAMESPACE_ALIAS (NODE) : (NODE))
1800 /* In a non-local VAR_DECL with static storage duration, this is the
1801 initialization priority. If this value is zero, the NODE will be
1802 initialized at the DEFAULT_INIT_PRIORITY. */
1803 #define DECL_INIT_PRIORITY(NODE) (DECL_FIELD_SIZE (VAR_DECL_CHECK (NODE)))
1805 /* In a TREE_LIST concatenating using directives, indicate indirekt
1806 directives */
1807 #define TREE_INDIRECT_USING(NODE) (TREE_LIST_CHECK (NODE)->common.lang_flag_0)
1809 /* In a VAR_DECL for a variable declared in a for statement,
1810 this is the shadowed (local) variable. */
1811 #define DECL_SHADOWED_FOR_VAR(NODE) DECL_RESULT(VAR_DECL_CHECK (NODE))
1813 /* Points back to the decl which caused this lang_decl to be allocated. */
1814 #define DECL_MAIN_VARIANT(NODE) (DECL_LANG_SPECIFIC(NODE)->main_decl_variant)
1816 /* In a FUNCTION_DECL, this is nonzero if this function was defined in
1817 the class definition. We have saved away the text of the function,
1818 but have not yet processed it. */
1819 #define DECL_PENDING_INLINE_P(NODE) \
1820 (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE))->decl_flags.pending_inline_p)
1822 /* If DECL_PENDING_INLINE_P holds, this is the saved text of the
1823 function. */
1824 #define DECL_PENDING_INLINE_INFO(NODE) \
1825 (DECL_LANG_SPECIFIC(NODE)->u.pending_inline_info)
1827 /* For a TYPE_DECL: if this function has many fields, we'll sort them
1828 and put them into a TREE_VEC. */
1829 #define DECL_SORTED_FIELDS(NODE) \
1830 (DECL_LANG_SPECIFIC (TYPE_DECL_CHECK (NODE))->u.sorted_fields)
1832 /* True if on the saved_inlines (see decl2.c) list. */
1833 #define DECL_SAVED_INLINE(DECL) \
1834 (DECL_LANG_SPECIFIC(DECL)->decl_flags.saved_inline)
1836 /* For a VAR_DECL or FUNCTION_DECL: template-specific information. */
1837 #define DECL_TEMPLATE_INFO(NODE) \
1838 (DECL_LANG_SPECIFIC(VAR_OR_FUNCTION_DECL_CHECK (NODE))->decl_flags.u.template_info)
1840 /* Template information for a RECORD_TYPE or UNION_TYPE. */
1841 #define CLASSTYPE_TEMPLATE_INFO(NODE) \
1842 (TYPE_LANG_SPECIFIC(RECORD_OR_UNION_TYPE_CHECK (NODE))->template_info)
1844 /* Template information for an ENUMERAL_TYPE. Although an enumeration may
1845 not be a primary template, it may be declared within the scope of a
1846 primary template and the enumeration constants may depend on
1847 non-type template parameters. */
1848 #define ENUM_TEMPLATE_INFO(NODE) (TYPE_BINFO (ENUMERAL_TYPE_CHECK (NODE)))
1850 /* Template information for a template template parameter. */
1851 #define TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO(NODE) (TYPE_BINFO (NODE))
1853 /* Template information for an ENUMERAL_, RECORD_, or UNION_TYPE. */
1854 #define TYPE_TEMPLATE_INFO(NODE) \
1855 (TREE_CODE (NODE) == ENUMERAL_TYPE \
1856 ? ENUM_TEMPLATE_INFO (NODE) : \
1857 (TREE_CODE (NODE) == TEMPLATE_TEMPLATE_PARM \
1858 ? TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (NODE) \
1859 : CLASSTYPE_TEMPLATE_INFO (NODE)))
1861 /* Set the template information for an ENUMERAL_, RECORD_, or
1862 UNION_TYPE to VAL. */
1863 #define SET_TYPE_TEMPLATE_INFO(NODE, VAL) \
1864 (TREE_CODE (NODE) == ENUMERAL_TYPE \
1865 ? (ENUM_TEMPLATE_INFO (NODE) = VAL) \
1866 : (CLASSTYPE_TEMPLATE_INFO (NODE) = VAL))
1868 #define TI_TEMPLATE(NODE) (TREE_PURPOSE (NODE))
1869 #define TI_ARGS(NODE) (TREE_VALUE (NODE))
1870 #define TI_SPEC_INFO(NODE) (TREE_CHAIN (NODE))
1871 #define TI_PENDING_TEMPLATE_FLAG(NODE) TREE_LANG_FLAG_1 (NODE)
1873 /* We use TREE_VECs to hold template arguments. If there is only one
1874 level of template arguments, then the TREE_VEC contains the
1875 arguments directly. If there is more than one level of template
1876 arguments, then each entry in the TREE_VEC is itself a TREE_VEC,
1877 containing the template arguments for a single level. The first
1878 entry in the outer TREE_VEC is the outermost level of template
1879 parameters; the last is the innermost.
1881 It is incorrect to ever form a template argument vector containing
1882 only one level of arguments, but which is a TREE_VEC containing as
1883 its only entry the TREE_VEC for that level. */
1885 /* Non-zero if the template arguments is actually a vector of vectors,
1886 rather than just a vector. */
1887 #define TMPL_ARGS_HAVE_MULTIPLE_LEVELS(NODE) \
1888 (NODE != NULL_TREE \
1889 && TREE_CODE (NODE) == TREE_VEC \
1890 && TREE_VEC_LENGTH (NODE) > 0 \
1891 && TREE_VEC_ELT (NODE, 0) != NULL_TREE \
1892 && TREE_CODE (TREE_VEC_ELT (NODE, 0)) == TREE_VEC)
1894 /* The depth of a template argument vector. When called directly by
1895 the parser, we use a TREE_LIST rather than a TREE_VEC to represent
1896 template arguments. In fact, we may even see NULL_TREE if there
1897 are no template arguments. In both of those cases, there is only
1898 one level of template arguments. */
1899 #define TMPL_ARGS_DEPTH(NODE) \
1900 (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (NODE) ? TREE_VEC_LENGTH (NODE) : 1)
1902 /* The LEVELth level of the template ARGS. Note that template
1903 parameter levels are indexed from 1, not from 0. */
1904 #define TMPL_ARGS_LEVEL(ARGS, LEVEL) \
1905 (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (ARGS) \
1906 ? TREE_VEC_ELT ((ARGS), (LEVEL) - 1) : ARGS)
1908 /* Set the LEVELth level of the template ARGS to VAL. This macro does
1909 not work with single-level argument vectors. */
1910 #define SET_TMPL_ARGS_LEVEL(ARGS, LEVEL, VAL) \
1911 (TREE_VEC_ELT ((ARGS), (LEVEL) - 1) = (VAL))
1913 /* Accesses the IDXth parameter in the LEVELth level of the ARGS. */
1914 #define TMPL_ARG(ARGS, LEVEL, IDX) \
1915 (TREE_VEC_ELT (TMPL_ARGS_LEVEL (ARGS, LEVEL), IDX))
1917 /* Set the IDXth element in the LEVELth level of ARGS to VAL. This
1918 macro does not work with single-level argument vectors. */
1919 #define SET_TMPL_ARG(ARGS, LEVEL, IDX, VAL) \
1920 (TREE_VEC_ELT (TREE_VEC_ELT ((ARGS), (LEVEL) - 1), (IDX)) = (VAL))
1922 /* Given a single level of template arguments in NODE, return the
1923 number of arguments. */
1924 #define NUM_TMPL_ARGS(NODE) \
1925 ((NODE) == NULL_TREE ? 0 \
1926 : (TREE_CODE (NODE) == TREE_VEC \
1927 ? TREE_VEC_LENGTH (NODE) : list_length (NODE)))
1929 /* The number of levels of template parameters given by NODE. */
1930 #define TMPL_PARMS_DEPTH(NODE) \
1931 (TREE_INT_CST_HIGH (TREE_PURPOSE (NODE)))
1933 /* The TEMPLATE_DECL instantiated or specialized by NODE. This
1934 TEMPLATE_DECL will be the immediate parent, not the most general
1935 template. For example, in:
1937 template <class T> struct S { template <class U> void f(U); }
1939 the FUNCTION_DECL for S<int>::f<double> will have, as its
1940 DECL_TI_TEMPLATE, `template <class U> S<int>::f<U>'.
1942 As a special case, for a member friend template of a template
1943 class, this value will not be a TEMPLATE_DECL, but rather a
1944 LOOKUP_EXPR or IDENTIFIER_NODE indicating the name of the template
1945 and any explicit template arguments provided. For example, in:
1947 template <class T> struct S { friend void f<int>(int, double); }
1949 the DECL_TI_TEMPLATE will be a LOOKUP_EXPR for `f' and the
1950 DECL_TI_ARGS will be {int}. */
1951 #define DECL_TI_TEMPLATE(NODE) TI_TEMPLATE (DECL_TEMPLATE_INFO (NODE))
1953 /* The template arguments used to obtain this decl from the most
1954 general form of DECL_TI_TEMPLATE. For the example given for
1955 DECL_TI_TEMPLATE, the DECL_TI_ARGS will be {int, double}. These
1956 are always the full set of arguments required to instantiate this
1957 declaration from the most general template specialized here. */
1958 #define DECL_TI_ARGS(NODE) TI_ARGS (DECL_TEMPLATE_INFO (NODE))
1959 #define CLASSTYPE_TI_TEMPLATE(NODE) TI_TEMPLATE (CLASSTYPE_TEMPLATE_INFO (NODE))
1960 #define CLASSTYPE_TI_ARGS(NODE) TI_ARGS (CLASSTYPE_TEMPLATE_INFO (NODE))
1961 #define CLASSTYPE_TI_SPEC_INFO(NODE) TI_SPEC_INFO (CLASSTYPE_TEMPLATE_INFO (NODE))
1962 #define ENUM_TI_TEMPLATE(NODE) \
1963 TI_TEMPLATE (ENUM_TEMPLATE_INFO (NODE))
1964 #define ENUM_TI_ARGS(NODE) \
1965 TI_ARGS (ENUM_TEMPLATE_INFO (NODE))
1967 /* Like DECL_TI_TEMPLATE, but for an ENUMERAL_, RECORD_, or UNION_TYPE. */
1968 #define TYPE_TI_TEMPLATE(NODE) \
1969 (TI_TEMPLATE (TYPE_TEMPLATE_INFO (NODE)))
1971 /* Like DECL_TI_ARGS, but for an ENUMERAL_, RECORD_, or UNION_TYPE. */
1972 #define TYPE_TI_ARGS(NODE) \
1973 (TI_ARGS (TYPE_TEMPLATE_INFO (NODE)))
1975 #define INNERMOST_TEMPLATE_PARMS(NODE) TREE_VALUE(NODE)
1977 /* Nonzero if the NODE corresponds to the template parameters for a
1978 member template, whose inline definition is being processed after
1979 the class definition is complete. */
1980 #define TEMPLATE_PARMS_FOR_INLINE(NODE) TREE_LANG_FLAG_1 (NODE)
1982 /* In a FUNCTION_DECL, the saved representation of the body of the
1983 entire function. Usually a COMPOUND_STMT, but this may also be a
1984 RETURN_INIT, CTOR_INITIALIZER, or TRY_BLOCK. */
1985 #define DECL_SAVED_TREE(NODE) \
1986 (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE))->saved_tree)
1988 /* In a FUNCTION_DECL, the saved language-specific per-function data. */
1989 #define DECL_SAVED_FUNCTION_DATA(NODE) \
1990 (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE))->u.saved_language_function)
1992 #define COMPOUND_STMT_NO_SCOPE(NODE) TREE_LANG_FLAG_0 (NODE)
1993 #define NEW_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
1994 #define DELETE_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
1995 #define DELETE_EXPR_USE_VEC(NODE) TREE_LANG_FLAG_1 (NODE)
1996 #define LOOKUP_EXPR_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
1998 /* Nonzero if this AGGR_INIT_EXPR provides for initialization via a
1999 constructor call, rather than an ordinary function call. */
2000 #define AGGR_INIT_VIA_CTOR_P(NODE) \
2001 TREE_LANG_FLAG_0 (AGGR_INIT_EXPR_CHECK (NODE))
2003 /* Nonzero if this statement should be considered a full-expression. */
2004 #define STMT_IS_FULL_EXPR_P(NODE) TREE_LANG_FLAG_1 ((NODE))
2006 /* The TYPE_MAIN_DECL for a class template type is a TYPE_DECL, not a
2007 TEMPLATE_DECL. This macro determines whether or not a given class
2008 type is really a template type, as opposed to an instantiation or
2009 specialization of one. */
2010 #define CLASSTYPE_IS_TEMPLATE(NODE) \
2011 (CLASSTYPE_TEMPLATE_INFO (NODE) \
2012 && !CLASSTYPE_USE_TEMPLATE (NODE) \
2013 && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (NODE)))
2015 /* The name used by the user to name the typename type. Typically,
2016 this is an IDENTIFIER_NODE, and the same as the DECL_NAME on the
2017 corresponding TYPE_DECL. However, this may also be a
2018 TEMPLATE_ID_EXPR if we had something like `typename X::Y<T>'. */
2019 #define TYPENAME_TYPE_FULLNAME(NODE) TYPE_BINFO (NODE)
2021 /* Nonzero if NODE is an implicit typename. */
2022 #define IMPLICIT_TYPENAME_P(NODE) \
2023 (TREE_CODE (NODE) == TYPENAME_TYPE && TREE_TYPE (NODE))
2025 /* Nonzero if NODE is a TYPE_DECL that should not be visible because
2026 it is from a dependent base class. */
2027 #define IMPLICIT_TYPENAME_TYPE_DECL_P(NODE) \
2028 (TREE_CODE (NODE) == TYPE_DECL \
2029 && DECL_ARTIFICIAL (NODE) \
2030 && IMPLICIT_TYPENAME_P (TREE_TYPE (NODE)))
2032 /* Nonzero in INTEGER_CST means that this int is negative by dint of
2033 using a twos-complement negated operand. */
2034 #define TREE_NEGATED_INT(NODE) TREE_LANG_FLAG_0 (INTEGER_CST_CHECK (NODE))
2036 #if 0 /* UNUSED */
2037 /* Nonzero in any kind of _EXPR or _REF node means that it is a call
2038 to a storage allocation routine. If, later, alternate storage
2039 is found to hold the object, this call can be ignored. */
2040 #define TREE_CALLS_NEW(NODE) (TREE_LANG_FLAG_1 (NODE))
2041 #endif
2043 /* Nonzero in any kind of _TYPE that uses multiple inheritance
2044 or virtual baseclasses. */
2045 #define TYPE_USES_COMPLEX_INHERITANCE(NODE) (TREE_LANG_FLAG_1 (NODE))
2047 #if 0 /* UNUSED */
2048 /* Nonzero in IDENTIFIER_NODE means that this name is not the name the user
2049 gave; it's a DECL_NESTED_TYPENAME. Someone may want to set this on
2050 mangled function names, too, but it isn't currently. */
2051 #define TREE_MANGLED(NODE) (FOO)
2052 #endif
2054 #if 0 /* UNUSED */
2055 /* Nonzero in IDENTIFIER_NODE means that this name is overloaded, and
2056 should be looked up in a non-standard way. */
2057 #define DECL_OVERLOADED(NODE) (FOO)
2058 #endif
2060 /* Nonzero if this (non-TYPE)_DECL has its virtual attribute set.
2061 For a FUNCTION_DECL, this is when the function is a virtual function.
2062 For a VAR_DECL, this is when the variable is a virtual function table.
2063 For a FIELD_DECL, when the field is the field for the virtual function table.
2064 For an IDENTIFIER_NODE, nonzero if any function with this name
2065 has been declared virtual.
2067 For a _TYPE if it uses virtual functions (or is derived from
2068 one that does). */
2069 #define TYPE_VIRTUAL_P(NODE) (TREE_LANG_FLAG_2 (NODE))
2071 extern int flag_new_for_scope;
2073 /* This flag is true of a local VAR_DECL if it was declared in a for
2074 statement, but we are no longer in the scope of the for. */
2075 #define DECL_DEAD_FOR_LOCAL(NODE) DECL_LANG_FLAG_7 (VAR_DECL_CHECK (NODE))
2077 /* This flag is set on a VAR_DECL that is a DECL_DEAD_FOR_LOCAL
2078 if we already emitted a warning about using it. */
2079 #define DECL_ERROR_REPORTED(NODE) DECL_LANG_FLAG_0 (VAR_DECL_CHECK (NODE))
2081 /* This _DECL represents a compiler-generated entity. */
2082 #define SET_DECL_ARTIFICIAL(NODE) (DECL_ARTIFICIAL (NODE) = 1)
2084 /* Record whether a typedef for type `int' was actually `signed int'. */
2085 #define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp))
2087 /* In a FIELD_DECL, nonzero if the decl was originally a bitfield. */
2088 #define DECL_C_BIT_FIELD(NODE) \
2089 (DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE))\
2090 && DECL_LANG_SPECIFIC (NODE)->decl_flags.bitfield)
2091 #define SET_DECL_C_BIT_FIELD(NODE) \
2092 (DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE))->decl_flags.bitfield = 1)
2094 #define INTEGRAL_CODE_P(CODE) \
2095 (CODE == INTEGER_TYPE || CODE == ENUMERAL_TYPE || CODE == BOOLEAN_TYPE)
2097 /* [basic.fundamental]
2099 Types bool, char, wchar_t, and the signed and unsigned integer types
2100 are collectively called integral types.
2102 Note that INTEGRAL_TYPE_P, as defined in tree.h, allows enumeration
2103 types as well, which is incorrect in C++. */
2104 #define CP_INTEGRAL_TYPE_P(TYPE) \
2105 (TREE_CODE ((TYPE)) == BOOLEAN_TYPE \
2106 || TREE_CODE ((TYPE)) == INTEGER_TYPE)
2108 /* [basic.fundamental]
2110 Integral and floating types are collectively called arithmetic
2111 types. */
2112 #define ARITHMETIC_TYPE_P(TYPE) \
2113 (CP_INTEGRAL_TYPE_P (TYPE) || TREE_CODE (TYPE) == REAL_TYPE)
2115 /* Mark which labels are explicitly declared.
2116 These may be shadowed, and may be referenced from nested functions. */
2117 #define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label)
2119 /* Nonzero for _TYPE means that the _TYPE defines
2120 at least one constructor. */
2121 #define TYPE_HAS_CONSTRUCTOR(NODE) (TYPE_LANG_FLAG_1(NODE))
2123 /* When appearing in an INDIRECT_REF, it means that the tree structure
2124 underneath is actually a call to a constructor. This is needed
2125 when the constructor must initialize local storage (which can
2126 be automatically destroyed), rather than allowing it to allocate
2127 space from the heap.
2129 When appearing in a SAVE_EXPR, it means that underneath
2130 is a call to a constructor.
2132 When appearing in a CONSTRUCTOR, it means that it was
2133 a GNU C constructor expression.
2135 When appearing in a FIELD_DECL, it means that this field
2136 has been duly initialized in its constructor. */
2137 #define TREE_HAS_CONSTRUCTOR(NODE) (TREE_LANG_FLAG_4(NODE))
2139 #define EMPTY_CONSTRUCTOR_P(NODE) (TREE_CODE (NODE) == CONSTRUCTOR \
2140 && CONSTRUCTOR_ELTS (NODE) == NULL_TREE \
2141 && ! TREE_HAS_CONSTRUCTOR (NODE))
2143 #if 0
2144 /* Indicates that a NON_LVALUE_EXPR came from a C++ reference.
2145 Used to generate more helpful error message in case somebody
2146 tries to take its address. */
2147 #define TREE_REFERENCE_EXPR(NODE) (TREE_LANG_FLAG_3(NODE))
2148 #endif
2150 /* Nonzero for _TYPE means that the _TYPE defines a destructor. */
2151 #define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2(NODE))
2153 /* Nonzero means that an object of this type can not be initialized using
2154 an initializer list. */
2155 #define CLASSTYPE_NON_AGGREGATE(NODE) \
2156 (TYPE_LANG_SPECIFIC (NODE)->non_aggregate)
2157 #define TYPE_NON_AGGREGATE_CLASS(NODE) \
2158 (IS_AGGR_TYPE (NODE) && CLASSTYPE_NON_AGGREGATE (NODE))
2160 /* Nonzero if there is a user-defined X::op=(x&) for this class. */
2161 #define TYPE_HAS_REAL_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_real_assign_ref)
2162 #define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_complex_assign_ref)
2163 #define TYPE_HAS_ABSTRACT_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_abstract_assign_ref)
2164 #define TYPE_HAS_COMPLEX_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_complex_init_ref)
2166 /* Nonzero for _TYPE node means that destroying an object of this type
2167 will involve a call to a destructor. This can apply to objects
2168 of ARRAY_TYPE is the type of the elements needs a destructor. */
2169 #define TYPE_NEEDS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_4(NODE))
2171 /* Nonzero for class type means that initialization of this type can use
2172 a bitwise copy. */
2173 #define TYPE_HAS_TRIVIAL_INIT_REF(NODE) \
2174 (TYPE_HAS_INIT_REF (NODE) && ! TYPE_HAS_COMPLEX_INIT_REF (NODE))
2176 /* Nonzero for class type means that assignment of this type can use
2177 a bitwise copy. */
2178 #define TYPE_HAS_TRIVIAL_ASSIGN_REF(NODE) \
2179 (TYPE_HAS_ASSIGN_REF (NODE) && ! TYPE_HAS_COMPLEX_ASSIGN_REF (NODE))
2181 #define TYPE_PTRMEM_P(NODE) \
2182 (TREE_CODE (NODE) == POINTER_TYPE \
2183 && TREE_CODE (TREE_TYPE (NODE)) == OFFSET_TYPE)
2184 #define TYPE_PTR_P(NODE) \
2185 (TREE_CODE (NODE) == POINTER_TYPE \
2186 && TREE_CODE (TREE_TYPE (NODE)) != OFFSET_TYPE)
2187 #define TYPE_PTROB_P(NODE) \
2188 (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE \
2189 && TREE_CODE (TREE_TYPE (NODE)) != VOID_TYPE)
2190 #define TYPE_PTROBV_P(NODE) \
2191 (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE)
2192 #define TYPE_PTRFN_P(NODE) \
2193 (TREE_CODE (NODE) == POINTER_TYPE \
2194 && TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE)
2196 /* Nonzero for _TYPE node means that this type is a pointer to member
2197 function type. */
2198 #define TYPE_PTRMEMFUNC_P(NODE) \
2199 (TREE_CODE(NODE) == RECORD_TYPE \
2200 && TYPE_LANG_SPECIFIC(NODE) \
2201 && TYPE_PTRMEMFUNC_FLAG (NODE))
2203 #define TYPE_PTRMEMFUNC_FLAG(NODE) \
2204 (TYPE_LANG_SPECIFIC(NODE)->ptrmemfunc_flag)
2206 /* A pointer-to-function member type looks like:
2208 struct {
2209 short __delta;
2210 short __index;
2211 union {
2212 P __pfn;
2213 short __delta2;
2214 } __pfn_or_delta2;
2217 where P is a POINTER_TYPE to a METHOD_TYPE appropriate for the
2218 pointer to member. The fields are used as follows:
2220 If __INDEX is -1, then the function to call is non-virtual, and
2221 is located at the address given by __PFN.
2223 If __INDEX is zero, then this a NULL pointer-to-member.
2225 Otherwise, the function to call is virtual. Then, __DELTA2 gives
2226 the offset from an instance of the object to the virtual function
2227 table, and __INDEX - 1 is the index into the vtable to use to
2228 find the function.
2230 The value to use for the THIS parameter is the address of the
2231 object plus __DELTA.
2233 For example, given:
2235 struct B1 {
2236 int i;
2239 struct B2 {
2240 double d;
2241 void f();
2244 struct S : public B1, B2 {};
2246 the pointer-to-member for `&S::f' looks like:
2248 { 4, -1, { &f__2B2 } };
2250 The `4' means that given an `S*' you have to add 4 bytes to get to
2251 the address of the `B2*'. Then, the -1 indicates that this is a
2252 non-virtual function. Of course, `&f__2B2' is the name of that
2253 function.
2255 (Of course, the exact values may differ depending on the mangling
2256 scheme, sizes of types, and such.). */
2258 /* Get the POINTER_TYPE to the METHOD_TYPE associated with this
2259 pointer to member function. TYPE_PTRMEMFUNC_P _must_ be true,
2260 before using this macro. */
2261 #define TYPE_PTRMEMFUNC_FN_TYPE(NODE) (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (NODE)))))))
2263 /* Returns `A' for a type like `int (A::*)(double)' */
2264 #define TYPE_PTRMEMFUNC_OBJECT_TYPE(NODE) \
2265 TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (NODE)))
2267 /* These are use to manipulate the canonical RECORD_TYPE from the
2268 hashed POINTER_TYPE, and can only be used on the POINTER_TYPE. */
2269 #define TYPE_GET_PTRMEMFUNC_TYPE(NODE) ((tree)TYPE_LANG_SPECIFIC(NODE))
2270 #define TYPE_SET_PTRMEMFUNC_TYPE(NODE, VALUE) (TYPE_LANG_SPECIFIC(NODE) = ((struct lang_type *)(void*)(VALUE)))
2271 /* These are to get the delta2 and pfn fields from a TYPE_PTRMEMFUNC_P. */
2272 #define DELTA2_FROM_PTRMEMFUNC(NODE) delta2_from_ptrmemfunc ((NODE))
2273 #define PFN_FROM_PTRMEMFUNC(NODE) pfn_from_ptrmemfunc ((NODE))
2275 /* For a pointer-to-member type of the form `T X::*', this is `X'. */
2276 #define TYPE_PTRMEM_CLASS_TYPE(NODE) \
2277 (TYPE_PTRMEM_P ((NODE)) \
2278 ? TYPE_OFFSET_BASETYPE (TREE_TYPE ((NODE))) \
2279 : TYPE_PTRMEMFUNC_OBJECT_TYPE ((NODE)))
2281 /* For a pointer-to-member type of the form `T X::*', this is `T'. */
2282 #define TYPE_PTRMEM_POINTED_TO_TYPE(NODE) \
2283 (TYPE_PTRMEM_P ((NODE)) \
2284 ? TREE_TYPE (TREE_TYPE (NODE)) \
2285 : TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE ((NODE))))
2287 /* For a pointer-to-member constant `X::Y' this is the RECORD_TYPE for
2288 `X'. */
2289 #define PTRMEM_CST_CLASS(NODE) \
2290 TYPE_PTRMEM_CLASS_TYPE (TREE_TYPE (PTRMEM_CST_CHECK (NODE)))
2292 /* For a pointer-to-member constant `X::Y' this is the _DECL for
2293 `Y'. */
2294 #define PTRMEM_CST_MEMBER(NODE) (((ptrmem_cst_t)PTRMEM_CST_CHECK (NODE))->member)
2296 /* Nonzero for VAR_DECL and FUNCTION_DECL node means that `extern' was
2297 specified in its declaration. */
2298 #define DECL_THIS_EXTERN(NODE) \
2299 DECL_LANG_FLAG_2 (VAR_OR_FUNCTION_DECL_CHECK (NODE))
2301 /* Nonzero for VAR_DECL and FUNCTION_DECL node means that `static' was
2302 specified in its declaration. */
2303 #define DECL_THIS_STATIC(NODE) \
2304 DECL_LANG_FLAG_6 (VAR_OR_FUNCTION_DECL_CHECK (NODE))
2306 /* Nonzero in FUNCTION_DECL means it is really an operator.
2307 Just used to communicate formatting information to dbxout.c. */
2308 #define DECL_OPERATOR(NODE) \
2309 (DECL_LANG_SPECIFIC(FUNCTION_DECL_CHECK (NODE))->decl_flags.operator_attr)
2311 /* Nonzero if TYPE is an anonymous union or struct type. We have to use a
2312 flag for this because "A union for which objects or pointers are
2313 declared is not an anonymous union" [class.union]. */
2314 #define ANON_AGGR_TYPE_P(NODE) \
2315 (CLASS_TYPE_P (NODE) && TYPE_LANG_SPECIFIC (NODE)->anon_aggr)
2316 #define SET_ANON_AGGR_TYPE_P(NODE) \
2317 (TYPE_LANG_SPECIFIC (NODE)->anon_aggr = 1)
2319 /* For a VAR_DECL that is an anonymous union, these are the various
2320 sub-variables that make up the anonymous union. */
2321 #define DECL_ANON_UNION_ELEMS(NODE) DECL_ARGUMENTS ((NODE))
2323 #define UNKNOWN_TYPE LANG_TYPE
2325 /* Define fields and accessors for nodes representing declared names. */
2327 #if 0
2328 /* C++: A derived class may be able to directly use the virtual
2329 function table of a base class. When it does so, it may
2330 still have a decl node used to access the virtual function
2331 table (so that variables of this type can initialize their
2332 virtual function table pointers by name). When such thievery
2333 is committed, know exactly which base class's virtual function
2334 table is the one being stolen. This effectively computes the
2335 transitive closure. */
2336 #define DECL_VPARENT(NODE) ((NODE)->decl.arguments)
2337 #endif
2339 #define TYPE_WAS_ANONYMOUS(NODE) (TYPE_LANG_SPECIFIC (NODE)->was_anonymous)
2341 /* C++: all of these are overloaded! These apply only to TYPE_DECLs. */
2343 /* The format of each node in the DECL_FRIENDLIST is as follows:
2345 The TREE_PURPOSE will be the name of a function, i.e., an
2346 IDENTIFIER_NODE. The TREE_VALUE will be itself a TREE_LIST, the
2347 list of functions with that name which are friends. The
2348 TREE_PURPOSE of each node in this sublist will be error_mark_node,
2349 if the function was declared a friend individually, in which case
2350 the TREE_VALUE will be the function_decl. If, however, all
2351 functions with a given name in a class were declared to be friends,
2352 the TREE_PUROSE will be the class type, and the TREE_VALUE will be
2353 NULL_TREE. */
2354 #define DECL_FRIENDLIST(NODE) (DECL_INITIAL (NODE))
2355 #define FRIEND_NAME(LIST) (TREE_PURPOSE (LIST))
2356 #define FRIEND_DECLS(LIST) (TREE_VALUE (LIST))
2358 /* The DECL_ACCESS, if non-NULL, is a TREE_LIST. The TREE_PURPOSE of
2359 each node is a type; the TREE_VALUE is the access granted for this
2360 DECL in that type. The DECL_ACCESS is set by access declarations.
2361 For example, if a member that would normally be public in a
2362 derived class is made protected, then the derived class and the
2363 protected_access_node will appear in the DECL_ACCESS for the node. */
2364 #define DECL_ACCESS(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.u2.access)
2366 /* Nonzero if the FUNCTION_DECL is a global constructor. */
2367 #define DECL_GLOBAL_CTOR_P(NODE) \
2368 (DECL_LANG_SPECIFIC ((NODE))->decl_flags.global_ctor_p)
2370 /* Nonzero if the FUNCTION_DECL is a global destructor. */
2371 #define DECL_GLOBAL_DTOR_P(NODE) \
2372 (DECL_LANG_SPECIFIC ((NODE))->decl_flags.global_dtor_p)
2374 /* If DECL_GLOBAL_CTOR_P or DECL_GLOBAL_DTOR_P holds, this macro
2375 returns the initialization priority for the function. Constructors
2376 with lower numbers should be run first. Destructors should be run
2377 in the reverse order of constructors. */
2378 #define GLOBAL_INIT_PRIORITY(NODE) \
2379 (DECL_LANG_SPECIFIC ((NODE))->decl_flags.u2.init_priority)
2381 /* Accessor macros for C++ template decl nodes. */
2383 /* The DECL_TEMPLATE_PARMS are a list. The TREE_PURPOSE of each node
2384 is a INT_CST whose TREE_INT_CST_HIGH indicates the level of the
2385 template parameters, with 1 being the outermost set of template
2386 parameters. The TREE_VALUE is a vector, whose elements are the
2387 template parameters at each level. Each element in the vector is a
2388 TREE_LIST, whose TREE_VALUE is a PARM_DECL (if the parameter is a
2389 non-type parameter), or a TYPE_DECL (if the parameter is a type
2390 parameter). The TREE_PURPOSE is the default value, if any. The
2391 TEMPLATE_PARM_INDEX for the parameter is avilable as the
2392 DECL_INITIAL (for a PARM_DECL) or as the TREE_TYPE (for a
2393 TYPE_DECL). */
2394 #define DECL_TEMPLATE_PARMS(NODE) DECL_ARGUMENTS(NODE)
2395 #define DECL_INNERMOST_TEMPLATE_PARMS(NODE) \
2396 INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (NODE))
2397 #define DECL_NTPARMS(NODE) \
2398 TREE_VEC_LENGTH (DECL_INNERMOST_TEMPLATE_PARMS (NODE))
2399 /* For function, method, class-data templates. */
2400 #define DECL_TEMPLATE_RESULT(NODE) DECL_RESULT(NODE)
2401 /* For a static member variable template, the
2402 DECL_TEMPLATE_INSTANTIATIONS list contains the explicitly and
2403 implicitly generated instantiations of the variable. There are no
2404 partial instantiations of static member variables, so all of these
2405 will be full instantiations.
2407 For a class template the DECL_TEMPLATE_INSTANTIATIONS lists holds
2408 all instantiations and specializations of the class type, including
2409 partial instantiations and partial specializations.
2411 In both cases, the TREE_PURPOSE of each node contains the arguments
2412 used; the TREE_VALUE contains the generated variable. The template
2413 arguments are always complete. For example, given:
2415 template <class T> struct S1 {
2416 template <class U> struct S2 {};
2417 template <class U> struct S2<U*> {};
2420 the record for the partial specialization will contain, as its
2421 argument list, { {T}, {U*} }, and will be on the
2422 DECL_TEMPLATE_INSTANTIATIONS list for `template <class T> template
2423 <class U> struct S1<T>::S2'.
2425 This list is not used for function templates. */
2426 #define DECL_TEMPLATE_INSTANTIATIONS(NODE) DECL_VINDEX(NODE)
2427 /* For a function template, the DECL_TEMPLATE_SPECIALIZATIONS lists
2428 contains all instantiations and specializations of the function,
2429 including partial instantiations. For a partial instantiation
2430 which is a specialization, this list holds only full
2431 specializations of the template that are instantiations of the
2432 partial instantiation. For example, given:
2434 template <class T> struct S {
2435 template <class U> void f(U);
2436 template <> void f(T);
2439 the `S<int>::f<int>(int)' function will appear on the
2440 DECL_TEMPLATE_SPECIALIZATIONS list for both `template <class T>
2441 template <class U> void S<T>::f(U)' and `template <class T> void
2442 S<int>::f(T)'. In the latter case, however, it will have only the
2443 innermost set of arguments (T, in this case). The DECL_TI_TEMPLATE
2444 for the function declaration will point at the specialization, not
2445 the fully general template.
2447 For a class template, this list contains the partial
2448 specializations of this template. (Full specializations are not
2449 recorded on this list.) The TREE_PURPOSE holds the innermost
2450 arguments used in the partial specialization (e.g., for `template
2451 <class T> struct S<T*, int>' this will be `T*'.) The TREE_VALUE
2452 holds the innermost template parameters for the specialization
2453 (e.g., `T' in the example above.) The TREE_TYPE is the _TYPE node
2454 for the partial specialization.
2456 This list is not used for static variable templates. */
2457 #define DECL_TEMPLATE_SPECIALIZATIONS(NODE) DECL_SIZE(NODE)
2459 /* Nonzero for a DECL which is actually a template parameter. */
2460 #define DECL_TEMPLATE_PARM_P(NODE) \
2461 DECL_LANG_FLAG_0 (NODE)
2463 #define DECL_TEMPLATE_TEMPLATE_PARM_P(NODE) \
2464 (TREE_CODE (NODE) == TEMPLATE_DECL && DECL_TEMPLATE_PARM_P (NODE))
2466 #define DECL_FUNCTION_TEMPLATE_P(NODE) \
2467 (TREE_CODE (NODE) == TEMPLATE_DECL \
2468 && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == FUNCTION_DECL)
2470 /* Nonzero for a DECL that represents a template class. */
2471 #define DECL_CLASS_TEMPLATE_P(NODE) \
2472 (TREE_CODE (NODE) == TEMPLATE_DECL \
2473 && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == TYPE_DECL \
2474 && !DECL_TEMPLATE_TEMPLATE_PARM_P (NODE))
2476 /* Nonzero if NODE which declares a type. */
2477 #define DECL_DECLARES_TYPE_P(NODE) \
2478 (TREE_CODE (NODE) == TYPE_DECL || DECL_CLASS_TEMPLATE_P (NODE))
2480 /* Nonzero if NODE is the typedef implicitly generated for a type when
2481 the type is declared. (In C++, `struct S {};' is roughly equivalent
2482 to `struct S {}; typedef struct S S;' in C. This macro will hold
2483 for the typedef indicated in this example. Note that in C++, there
2484 is a second implicit typedef for each class, in the scope of `S'
2485 itself, so that you can `S::S'. This macro does *not* hold for
2486 those typedefs. */
2487 #define DECL_IMPLICIT_TYPEDEF_P(NODE) \
2488 (TREE_CODE ((NODE)) == TYPE_DECL && DECL_LANG_FLAG_2 ((NODE)))
2489 #define SET_DECL_IMPLICIT_TYPEDEF_P(NODE) \
2490 (DECL_LANG_FLAG_2 ((NODE)) = 1)
2492 /* A `primary' template is one that has its own template header. A
2493 member function of a class template is a template, but not primary.
2494 A member template is primary. Friend templates are primary, too. */
2496 /* Returns the primary template corresponding to these parameters. */
2497 #define DECL_PRIMARY_TEMPLATE(NODE) \
2498 (TREE_TYPE (DECL_INNERMOST_TEMPLATE_PARMS (NODE)))
2500 /* Returns non-zero if NODE is a primary template. */
2501 #define PRIMARY_TEMPLATE_P(NODE) (DECL_PRIMARY_TEMPLATE (NODE) == NODE)
2503 #define CLASSTYPE_TEMPLATE_LEVEL(NODE) \
2504 (TREE_INT_CST_HIGH (TREE_PURPOSE (CLASSTYPE_TI_TEMPLATE (NODE))))
2506 /* Indicates whether or not (and how) a template was expanded for this
2507 FUNCTION_DECL or VAR_DECL.
2508 0=normal declaration, e.g. int min (int, int);
2509 1=implicit template instantiation
2510 2=explicit template specialization, e.g. int min<int> (int, int);
2511 3=explicit template instantiation, e.g. template int min<int> (int, int); */
2512 #define DECL_USE_TEMPLATE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.use_template)
2514 #define DECL_TEMPLATE_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) & 1)
2515 #define CLASSTYPE_TEMPLATE_INSTANTIATION(NODE) \
2516 (CLASSTYPE_USE_TEMPLATE (NODE) & 1)
2518 #define DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) == 2)
2519 #define SET_DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) = 2)
2520 #define CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \
2521 (CLASSTYPE_USE_TEMPLATE (NODE) == 2)
2522 #define SET_CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \
2523 (CLASSTYPE_USE_TEMPLATE (NODE) = 2)
2525 #define DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 1)
2526 #define SET_DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) = 1)
2527 #define CLASSTYPE_IMPLICIT_INSTANTIATION(NODE) \
2528 (CLASSTYPE_USE_TEMPLATE(NODE) == 1)
2529 #define SET_CLASSTYPE_IMPLICIT_INSTANTIATION(NODE) \
2530 (CLASSTYPE_USE_TEMPLATE(NODE) = 1)
2532 #define DECL_EXPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 3)
2533 #define SET_DECL_EXPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) = 3)
2534 #define CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \
2535 (CLASSTYPE_USE_TEMPLATE(NODE) == 3)
2536 #define SET_CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \
2537 (CLASSTYPE_USE_TEMPLATE(NODE) = 3)
2539 /* Non-zero if DECL is a friend function which is an instantiation
2540 from the point of view of the compiler, but not from the point of
2541 view of the language. For example given:
2542 template <class T> struct S { friend void f(T) {}; };
2543 the declaration of `void f(int)' generated when S<int> is
2544 instantiated will not be a DECL_TEMPLATE_INSTANTIATION, but will be
2545 a DECL_FRIEND_PSUEDO_TEMPLATE_INSTANTIATION. */
2546 #define DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION(DECL) \
2547 (DECL_TEMPLATE_INFO (DECL) && !DECL_USE_TEMPLATE (DECL))
2549 /* Non-zero if TYPE is a partial instantiation of a template class,
2550 i.e., an instantiation whose instantiation arguments involve
2551 template types. */
2552 #define PARTIAL_INSTANTIATION_P(TYPE) \
2553 (TYPE_LANG_SPECIFIC (TYPE)->is_partial_instantiation)
2555 /* Non-zero iff we are currently processing a declaration for an
2556 entity with its own template parameter list, and which is not a
2557 full specialization. */
2558 #define PROCESSING_REAL_TEMPLATE_DECL_P() \
2559 (processing_template_decl > template_class_depth (current_class_type))
2561 /* This function may be a guiding decl for a template. */
2562 #define DECL_MAYBE_TEMPLATE(NODE) DECL_LANG_FLAG_4 (NODE)
2564 /* Nonzero if this VAR_DECL or FUNCTION_DECL has already been
2565 instantiated, i.e. its definition has been generated from the
2566 pattern given in the the template. */
2567 #define DECL_TEMPLATE_INSTANTIATED(NODE) \
2568 DECL_LANG_FLAG_1 (VAR_OR_FUNCTION_DECL_CHECK (NODE))
2570 /* We know what we're doing with this decl now. */
2571 #define DECL_INTERFACE_KNOWN(NODE) DECL_LANG_FLAG_5 (NODE)
2573 /* This function was declared inline. This flag controls the linkage
2574 semantics of 'inline'; whether or not the function is inlined is
2575 controlled by DECL_INLINE. */
2576 #define DECL_THIS_INLINE(NODE) \
2577 (DECL_LANG_SPECIFIC (NODE)->decl_flags.declared_inline)
2579 /* DECL_EXTERNAL must be set on a decl until the decl is actually emitted,
2580 so that assemble_external will work properly. So we have this flag to
2581 tell us whether the decl is really not external. */
2582 #define DECL_NOT_REALLY_EXTERN(NODE) \
2583 (DECL_LANG_SPECIFIC (NODE)->decl_flags.not_really_extern)
2585 #define DECL_REALLY_EXTERN(NODE) \
2586 (DECL_EXTERNAL (NODE) && ! DECL_NOT_REALLY_EXTERN (NODE))
2588 #define THUNK_DELTA(DECL) ((DECL)->decl.frame_size.i)
2590 /* DECL_NEEDED_P holds of a declaration when we need to emit its
2591 definition. This is true when the back-end tells us that
2592 the symbol has been referenced in the generated code. If, however,
2593 we are not generating code, then it is also true when a symbol has
2594 just been used somewhere, even if it's not really needed. */
2595 #define DECL_NEEDED_P(DECL) \
2596 (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME ((DECL)))) \
2598 /* An un-parsed default argument looks like an identifier. */
2599 #define DEFARG_LENGTH(NODE) (DEFAULT_ARG_CHECK(NODE)->identifier.length)
2600 #define DEFARG_POINTER(NODE) (DEFAULT_ARG_CHECK(NODE)->identifier.pointer)
2602 /* These macros provide convenient access to the various _STMT nodes
2603 created when parsing template declarations. */
2604 #define IF_COND(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 0)
2605 #define THEN_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 1)
2606 #define ELSE_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 2)
2607 #define WHILE_COND(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 0)
2608 #define WHILE_BODY(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 1)
2609 #define DO_COND(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 0)
2610 #define DO_BODY(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 1)
2611 #define RETURN_EXPR(NODE) TREE_OPERAND (RETURN_STMT_CHECK (NODE), 0)
2612 #define EXPR_STMT_EXPR(NODE) TREE_OPERAND (EXPR_STMT_CHECK (NODE), 0)
2613 #define FOR_INIT_STMT(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 0)
2614 #define FOR_COND(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 1)
2615 #define FOR_EXPR(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 2)
2616 #define FOR_BODY(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 3)
2617 #define SWITCH_COND(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 0)
2618 #define SWITCH_BODY(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 1)
2619 #define CASE_LOW(NODE) TREE_OPERAND (CASE_LABEL_CHECK (NODE), 0)
2620 #define CASE_HIGH(NODE) TREE_OPERAND (CASE_LABEL_CHECK (NODE), 1)
2621 #define GOTO_DESTINATION(NODE) TREE_OPERAND (GOTO_STMT_CHECK (NODE), 0)
2622 #define TRY_STMTS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 0)
2623 #define TRY_HANDLERS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 1)
2624 #define CLEANUP_P(NODE) TREE_LANG_FLAG_0 (TRY_BLOCK_CHECK (NODE))
2625 /* Nonzero if this try block is a function try block. */
2626 #define FN_TRY_BLOCK_P(NODE) TREE_LANG_FLAG_3 (TRY_BLOCK_CHECK (NODE))
2627 #define HANDLER_PARMS(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 0)
2628 #define HANDLER_BODY(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 1)
2629 #define COMPOUND_BODY(NODE) TREE_OPERAND (COMPOUND_STMT_CHECK (NODE), 0)
2630 #define ASM_CV_QUAL(NODE) TREE_OPERAND (ASM_STMT_CHECK (NODE), 0)
2631 #define ASM_STRING(NODE) TREE_OPERAND (ASM_STMT_CHECK (NODE), 1)
2632 #define ASM_OUTPUTS(NODE) TREE_OPERAND (ASM_STMT_CHECK (NODE), 2)
2633 #define ASM_INPUTS(NODE) TREE_OPERAND (ASM_STMT_CHECK (NODE), 3)
2634 #define ASM_CLOBBERS(NODE) TREE_OPERAND (ASM_STMT_CHECK (NODE), 4)
2635 #define DECL_STMT_DECL(NODE) TREE_OPERAND (DECL_STMT_CHECK (NODE), 0)
2636 #define STMT_EXPR_STMT(NODE) TREE_OPERAND (STMT_EXPR_CHECK (NODE), 0)
2637 #define SUBOBJECT_CLEANUP(NODE) TREE_OPERAND (SUBOBJECT_CHECK (NODE), 0)
2638 #define CLEANUP_DECL(NODE) TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 0)
2639 #define CLEANUP_EXPR(NODE) TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 1)
2640 #define START_CATCH_TYPE(NODE) TREE_TYPE (START_CATCH_STMT_CHECK (NODE))
2641 #define LABEL_STMT_LABEL(NODE) TREE_OPERAND (LABEL_STMT_CHECK (NODE), 0)
2643 /* Nonzero if this SCOPE_STMT is for the beginning of a scope. */
2644 #define SCOPE_BEGIN_P(NODE) \
2645 (TREE_LANG_FLAG_0 (SCOPE_STMT_CHECK (NODE)))
2647 /* Nonzero if this SCOPE_STMT is for the end of a scope. */
2648 #define SCOPE_END_P(NODE) \
2649 (!SCOPE_BEGIN_P (SCOPE_STMT_CHECK (NODE)))
2651 /* Nonzero for a SCOPE_STMT if there were no variables in this scope. */
2652 #define SCOPE_NULLIFIED_P(NODE) \
2653 (TREE_LANG_FLAG_3 (SCOPE_STMT_CHECK (NODE)))
2655 /* Nonzero for a SCOPE_STMT if this statement is for a partial scope.
2656 For example, in:
2658 S s;
2660 S s2;
2661 goto l;
2663 there is (implicitly) a new scope after `l', even though there are
2664 no curly braces. In particular, when we hit the goto, we must
2665 destroy s2 and then re-construct it. For the implicit scope,
2666 SCOPE_PARTIAL_P will be set. */
2667 #define SCOPE_PARTIAL_P(NODE) \
2668 (TREE_LANG_FLAG_4 (SCOPE_STMT_CHECK (NODE)))
2670 /* Nonzero for an ASM_STMT if the assembly statement is volatile. */
2671 #define ASM_VOLATILE_P(NODE) \
2672 (ASM_CV_QUAL (ASM_STMT_CHECK (NODE)) != NULL_TREE)
2674 /* The line-number at which a statement began. But if
2675 STMT_LINENO_FOR_FN_P does holds, then this macro gives the
2676 line number for the end of the current function instead. */
2677 #define STMT_LINENO(NODE) \
2678 (TREE_COMPLEXITY ((NODE)))
2680 /* If non-zero, the STMT_LINENO for NODE is the line at which the
2681 function ended. */
2682 #define STMT_LINENO_FOR_FN_P(NODE) \
2683 (TREE_LANG_FLAG_2 ((NODE)))
2685 /* The parameters for a call-declarator. */
2686 #define CALL_DECLARATOR_PARMS(NODE) \
2687 (TREE_PURPOSE (TREE_OPERAND ((NODE), 1)))
2689 /* The cv-qualifiers for a call-declarator. */
2690 #define CALL_DECLARATOR_QUALS(NODE) \
2691 (TREE_VALUE (TREE_OPERAND ((NODE), 1)))
2693 /* The exception-specification for a call-declarator. */
2694 #define CALL_DECLARATOR_EXCEPTION_SPEC(NODE) \
2695 (TREE_TYPE ((NODE)))
2697 /* An enumeration of the kind of tags that C++ accepts. */
2698 enum tag_types { record_type, class_type, union_type, enum_type };
2700 /* The various kinds of lvalues we distinguish. */
2701 typedef enum cp_lvalue_kind {
2702 clk_none = 0, /* Things that are not an lvalue. */
2703 clk_ordinary = 1, /* An ordinary lvalue. */
2704 clk_class = 2, /* An rvalue of class-type. */
2705 clk_bitfield = 4, /* An lvalue for a bit-field. */
2706 } cp_lvalue_kind;
2708 /* Zero means prototype weakly, as in ANSI C (no args means nothing).
2709 Each language context defines how this variable should be set. */
2710 extern int strict_prototype;
2711 extern int strict_prototypes_lang_c, strict_prototypes_lang_cplusplus;
2713 /* Non-zero means that if a label exists, and no other identifier
2714 applies, use the value of the label. */
2715 extern int flag_labels_ok;
2717 /* Nonzero means allow Microsoft extensions without a pedwarn. */
2718 extern int flag_ms_extensions;
2720 /* Non-zero means to collect statistics which might be expensive
2721 and to print them when we are done. */
2722 extern int flag_detailed_statistics;
2724 /* Non-zero means warn in function declared in derived class has the
2725 same name as a virtual in the base class, but fails to match the
2726 type signature of any virtual function in the base class. */
2727 extern int warn_overloaded_virtual;
2729 /* Nonzero means warn about use of multicharacter literals. */
2730 extern int warn_multichar;
2732 /* Non-zero means warn if a non-templatized friend function is
2733 declared in a templatized class. This behavior is warned about with
2734 flag_guiding_decls in do_friend. */
2735 extern int warn_nontemplate_friend;
2737 /* in c-common.c */
2738 extern void declare_function_name PROTO((void));
2739 extern void decl_attributes PROTO((tree, tree, tree));
2740 extern void init_function_format_info PROTO((void));
2741 extern void record_function_format PROTO((tree, tree, int, int, int));
2742 extern void check_function_format PROTO((tree, tree, tree));
2743 /* Print an error message for invalid operands to arith operation CODE.
2744 NOP_EXPR is used as a special case (see truthvalue_conversion). */
2745 extern void binary_op_error PROTO((enum tree_code));
2746 extern tree canonical_type_variant PROTO((tree));
2747 extern void c_expand_expr_stmt PROTO((tree));
2748 /* Validate the expression after `case' and apply default promotions. */
2749 extern tree check_case_value PROTO((tree));
2750 /* Concatenate a list of STRING_CST nodes into one STRING_CST. */
2751 extern tree combine_strings PROTO((tree));
2752 extern void constant_expression_warning PROTO((tree));
2753 extern tree convert_and_check PROTO((tree, tree));
2754 extern void overflow_warning PROTO((tree));
2755 extern void unsigned_conversion_warning PROTO((tree, tree));
2756 extern void c_apply_type_quals_to_decl PROTO((int, tree));
2758 /* Read the rest of the current #-directive line. */
2759 #if USE_CPPLIB
2760 extern char *get_directive_line PROTO((void));
2761 #define GET_DIRECTIVE_LINE() get_directive_line ()
2762 #else
2763 extern char *get_directive_line PROTO((FILE *));
2764 #define GET_DIRECTIVE_LINE() get_directive_line (finput)
2765 #endif
2766 /* Subroutine of build_binary_op, used for comparison operations.
2767 See if the operands have both been converted from subword integer types
2768 and, if so, perhaps change them both back to their original type. */
2769 extern tree shorten_compare PROTO((tree *, tree *, tree *, enum tree_code *));
2770 /* Prepare expr to be an argument of a TRUTH_NOT_EXPR,
2771 or validate its data type for an `if' or `while' statement or ?..: exp. */
2772 extern tree truthvalue_conversion PROTO((tree));
2773 extern tree type_for_mode PROTO((enum machine_mode, int));
2774 extern tree type_for_size PROTO((unsigned, int));
2775 extern int c_get_alias_set PROTO((tree));
2777 /* in decl{2}.c */
2778 /* A node that is a list (length 1) of error_mark_nodes. */
2779 extern tree error_mark_list;
2781 /* A list of virtual function tables we must make sure to write out. */
2782 extern tree pending_vtables;
2784 /* Node for "pointer to (virtual) function".
2785 This may be distinct from ptr_type_node so gdb can distinguish them. */
2786 #define vfunc_ptr_type_node \
2787 (flag_vtable_thunks ? vtable_entry_type : ptr_type_node)
2790 /* For building calls to `delete'. */
2791 extern tree integer_two_node, integer_three_node;
2793 extern tree anonymous_namespace_name;
2795 /* in pt.c */
2797 /* These values are used for the `STRICT' parameter to type_unfication and
2798 fn_type_unification. Their meanings are described with the
2799 documentation for fn_type_unification. */
2801 typedef enum unification_kind_t {
2802 DEDUCE_CALL,
2803 DEDUCE_CONV,
2804 DEDUCE_EXACT
2805 } unification_kind_t;
2807 /* The template currently being instantiated, and where the instantiation
2808 was triggered. */
2809 struct tinst_level
2811 tree decl;
2812 int line;
2813 char *file;
2814 struct tinst_level *next;
2817 extern void maybe_print_template_context PROTO ((void));
2819 /* in class.c */
2821 extern int current_class_depth;
2823 /* Points to the name of that function. May not be the DECL_NAME
2824 of CURRENT_FUNCTION_DECL due to overloading */
2825 extern tree original_function_name;
2827 /* in init.c */
2828 extern tree global_base_init_list;
2831 /* Here's where we control how name mangling takes place. */
2833 #define OPERATOR_ASSIGN_FORMAT "__a%s"
2834 #define OPERATOR_FORMAT "__%s"
2835 #define OPERATOR_TYPENAME_FORMAT "__op"
2837 /* Cannot use '$' up front, because this confuses gdb
2838 (names beginning with '$' are gdb-local identifiers).
2840 Note that all forms in which the '$' is significant are long enough
2841 for direct indexing (meaning that if we know there is a '$'
2842 at a particular location, we can index into the string at
2843 any other location that provides distinguishing characters). */
2845 /* Define NO_DOLLAR_IN_LABEL in your favorite tm file if your assembler
2846 doesn't allow '$' in symbol names. */
2847 #ifndef NO_DOLLAR_IN_LABEL
2849 #define JOINER '$'
2851 #define VPTR_NAME "$v"
2852 #define THROW_NAME "$eh_throw"
2853 #define DESTRUCTOR_DECL_PREFIX "_$_"
2854 #define AUTO_VTABLE_NAME "__vtbl$me__"
2855 #define AUTO_TEMP_NAME "_$tmp_"
2856 #define AUTO_TEMP_FORMAT "_$tmp_%d"
2857 #define VTABLE_BASE "$vb"
2858 #define VTABLE_NAME_FORMAT (flag_vtable_thunks ? "__vt_%s" : "_vt$%s")
2859 #define VFIELD_BASE "$vf"
2860 #define VFIELD_NAME "_vptr$"
2861 #define VFIELD_NAME_FORMAT "_vptr$%s"
2862 #define VBASE_NAME "_vb$"
2863 #define VBASE_NAME_FORMAT "_vb$%s"
2864 #define STATIC_NAME_FORMAT "_%s$%s"
2865 #define ANON_AGGRNAME_FORMAT "$_%d"
2867 #else /* NO_DOLLAR_IN_LABEL */
2869 #ifndef NO_DOT_IN_LABEL
2871 #define JOINER '.'
2873 #define VPTR_NAME ".v"
2874 #define THROW_NAME ".eh_throw"
2875 #define DESTRUCTOR_DECL_PREFIX "_._"
2876 #define AUTO_VTABLE_NAME "__vtbl.me__"
2877 #define AUTO_TEMP_NAME "_.tmp_"
2878 #define AUTO_TEMP_FORMAT "_.tmp_%d"
2879 #define VTABLE_BASE ".vb"
2880 #define VTABLE_NAME_FORMAT (flag_vtable_thunks ? "__vt_%s" : "_vt.%s")
2881 #define VFIELD_BASE ".vf"
2882 #define VFIELD_NAME "_vptr."
2883 #define VFIELD_NAME_FORMAT "_vptr.%s"
2884 #define VBASE_NAME "_vb."
2885 #define VBASE_NAME_FORMAT "_vb.%s"
2886 #define STATIC_NAME_FORMAT "_%s.%s"
2888 #define ANON_AGGRNAME_FORMAT "._%d"
2890 #else /* NO_DOT_IN_LABEL */
2892 #define VPTR_NAME "__vptr"
2893 #define VPTR_NAME_P(ID_NODE) \
2894 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VPTR_NAME, sizeof (VPTR_NAME) - 1))
2895 #define THROW_NAME "__eh_throw"
2896 #define DESTRUCTOR_DECL_PREFIX "__destr_"
2897 #define DESTRUCTOR_NAME_P(ID_NODE) \
2898 (!strncmp (IDENTIFIER_POINTER (ID_NODE), DESTRUCTOR_DECL_PREFIX, \
2899 sizeof (DESTRUCTOR_DECL_PREFIX) - 1))
2900 #define IN_CHARGE_NAME "__in_chrg"
2901 #define AUTO_VTABLE_NAME "__vtbl_me__"
2902 #define AUTO_TEMP_NAME "__tmp_"
2903 #define TEMP_NAME_P(ID_NODE) \
2904 (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, \
2905 sizeof (AUTO_TEMP_NAME) - 1))
2906 #define AUTO_TEMP_FORMAT "__tmp_%d"
2907 #define VTABLE_BASE "__vtb"
2908 #define VTABLE_NAME "__vt_"
2909 #define VTABLE_NAME_FORMAT (flag_vtable_thunks ? "__vt_%s" : "_vt_%s")
2910 #define VTABLE_NAME_P(ID_NODE) \
2911 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VTABLE_NAME, \
2912 sizeof (VTABLE_NAME) - 1))
2913 #define VFIELD_BASE "__vfb"
2914 #define VFIELD_NAME "__vptr_"
2915 #define VFIELD_NAME_P(ID_NODE) \
2916 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, \
2917 sizeof (VFIELD_NAME) - 1))
2918 #define VFIELD_NAME_FORMAT "_vptr_%s"
2919 #define VBASE_NAME "__vb_"
2920 #define VBASE_NAME_P(ID_NODE) \
2921 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VBASE_NAME, \
2922 sizeof (VBASE_NAME) - 1))
2923 #define VBASE_NAME_FORMAT "__vb_%s"
2924 #define STATIC_NAME_FORMAT "__static_%s_%s"
2926 #define ANON_AGGRNAME_PREFIX "__anon_"
2927 #define ANON_AGGRNAME_P(ID_NODE) \
2928 (!strncmp (IDENTIFIER_POINTER (ID_NODE), ANON_AGGRNAME_PREFIX, \
2929 sizeof (ANON_AGGRNAME_PREFIX) - 1))
2930 #define ANON_AGGRNAME_FORMAT "__anon_%d"
2931 #define ANON_PARMNAME_FORMAT "__%d"
2932 #define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \
2933 && IDENTIFIER_POINTER (ID_NODE)[1] == '_' \
2934 && IDENTIFIER_POINTER (ID_NODE)[2] <= '9')
2936 #endif /* NO_DOT_IN_LABEL */
2937 #endif /* NO_DOLLAR_IN_LABEL */
2939 #define THIS_NAME "this"
2940 #define DESTRUCTOR_NAME_FORMAT "~%s"
2941 #define FILE_FUNCTION_PREFIX_LEN 9
2942 #define CTOR_NAME "__ct"
2943 #define DTOR_NAME "__dt"
2945 #define IN_CHARGE_NAME "__in_chrg"
2947 #define VTBL_PTR_TYPE "__vtbl_ptr_type"
2948 #define VTABLE_DELTA_NAME "__delta"
2949 #define VTABLE_INDEX_NAME "__index"
2950 #define VTABLE_PFN_NAME "__pfn"
2951 #define VTABLE_DELTA2_NAME "__delta2"
2953 #define EXCEPTION_CLEANUP_NAME "exception cleanup"
2955 #define THIS_NAME_P(ID_NODE) (strcmp(IDENTIFIER_POINTER (ID_NODE), "this") == 0)
2957 #if !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL)
2959 #define VPTR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
2960 && IDENTIFIER_POINTER (ID_NODE)[1] == 'v')
2961 #define DESTRUCTOR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == JOINER \
2962 && IDENTIFIER_POINTER (ID_NODE)[2] == '_')
2964 #define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \
2965 && IDENTIFIER_POINTER (ID_NODE)[2] == 't' \
2966 && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER)
2968 #define VBASE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \
2969 && IDENTIFIER_POINTER (ID_NODE)[2] == 'b' \
2970 && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER)
2972 #define TEMP_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, sizeof (AUTO_TEMP_NAME)-1))
2973 #define VFIELD_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, sizeof(VFIELD_NAME)-1))
2975 /* For anonymous aggregate types, we need some sort of name to
2976 hold on to. In practice, this should not appear, but it should
2977 not be harmful if it does. */
2978 #define ANON_AGGRNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
2979 && IDENTIFIER_POINTER (ID_NODE)[1] == '_')
2980 #define ANON_PARMNAME_FORMAT "_%d"
2981 #define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \
2982 && IDENTIFIER_POINTER (ID_NODE)[1] <= '9')
2983 #endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */
2985 /* Store the vbase pointer field name for type TYPE into pointer BUF. */
2986 #define FORMAT_VBASE_NAME(BUF,TYPE) do { \
2987 char *wbuf = (char *) alloca (TYPE_ASSEMBLER_NAME_LENGTH (TYPE) \
2988 + sizeof (VBASE_NAME) + 1); \
2989 sprintf (wbuf, VBASE_NAME_FORMAT, TYPE_ASSEMBLER_NAME_STRING (TYPE)); \
2990 (BUF) = wbuf; \
2991 } while (0)
2993 /* Returns non-zero iff ID_NODE is an IDENTIFIER_NODE whose name is
2994 `main'. */
2995 #define MAIN_NAME_P(ID_NODE) \
2996 (strcmp (IDENTIFIER_POINTER (ID_NODE), "main") == 0)
2998 /* Returns non-zero iff NODE is a declaration for the global function
2999 `main'. */
3000 #define DECL_MAIN_P(NODE) \
3001 (TREE_CODE (NODE) == FUNCTION_DECL \
3002 && DECL_LANGUAGE (NODE) == lang_c \
3003 && DECL_NAME (NODE) != NULL_TREE \
3004 && MAIN_NAME_P (DECL_NAME (NODE)))
3007 /* Things for handling inline functions. */
3009 struct pending_inline
3011 struct pending_inline *next; /* pointer to next in chain */
3012 int lineno; /* line number we got the text from */
3013 char *filename; /* name of file we were processing */
3014 tree fndecl; /* FUNCTION_DECL that brought us here */
3015 int token; /* token we were scanning */
3016 int token_value; /* value of token we were scanning (YYSTYPE) */
3018 char *buf; /* pointer to character stream */
3019 int len; /* length of stream */
3020 unsigned int can_free : 1; /* free this after we're done with it? */
3021 unsigned int deja_vu : 1; /* set iff we don't want to see it again. */
3022 unsigned int interface : 2; /* 0=interface 1=unknown 2=implementation */
3025 /* in method.c */
3026 extern struct pending_inline *pending_inlines;
3028 /* Negative values means we know `this' to be of static type. */
3030 extern int flag_this_is_variable;
3032 /* Nonzero means generate 'rtti' that give run-time type information. */
3034 extern int flag_rtti;
3036 /* Nonzero means do emit exported implementations of functions even if
3037 they can be inlined. */
3039 extern int flag_implement_inlines;
3041 /* Nonzero means templates obey #pragma interface and implementation. */
3043 extern int flag_external_templates;
3045 /* Nonzero means templates are emitted where they are instantiated. */
3047 extern int flag_alt_external_templates;
3049 /* Nonzero means implicit template instantiations are emitted. */
3051 extern int flag_implicit_templates;
3053 /* Nonzero if we want to emit defined symbols with common-like linkage as
3054 weak symbols where possible, in order to conform to C++ semantics.
3055 Otherwise, emit them as local symbols. */
3057 extern int flag_weak;
3059 /* Nonzero to enable experimental ABI changes. */
3061 extern int flag_new_abi;
3063 /* Nonzero to not ignore namespace std. */
3065 extern int flag_honor_std;
3067 /* Nonzero if we're done parsing and into end-of-file activities. */
3069 extern int at_eof;
3071 enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
3073 /* Some macros for char-based bitfields. */
3074 #define B_SET(a,x) (a[x>>3] |= (1 << (x&7)))
3075 #define B_CLR(a,x) (a[x>>3] &= ~(1 << (x&7)))
3076 #define B_TST(a,x) (a[x>>3] & (1 << (x&7)))
3078 /* These are uses as bits in flags passed to build_method_call
3079 to control its error reporting behavior.
3081 LOOKUP_PROTECT means flag access violations.
3082 LOOKUP_COMPLAIN mean complain if no suitable member function
3083 matching the arguments is found.
3084 LOOKUP_NORMAL is just a combination of these two.
3085 LOOKUP_NONVIRTUAL means make a direct call to the member function found
3086 LOOKUP_GLOBAL means search through the space of overloaded functions,
3087 as well as the space of member functions.
3088 LOOKUP_HAS_IN_CHARGE means that the "in charge" variable is already
3089 in the parameter list.
3090 LOOKUP_ONLYCONVERTING means that non-conversion constructors are not tried.
3091 DIRECT_BIND means that if a temporary is created, it should be created so
3092 that it lives as long as the current variable bindings; otherwise it
3093 only lives until the end of the complete-expression.
3094 LOOKUP_SPECULATIVELY means return NULL_TREE if we cannot find what we are
3095 after. Note, LOOKUP_COMPLAIN is checked and error messages printed
3096 before LOOKUP_SPECULATIVELY is checked.
3097 LOOKUP_NO_CONVERSION means that user-defined conversions are not
3098 permitted. Built-in conversions are permitted.
3099 LOOKUP_DESTRUCTOR means explicit call to destructor.
3100 LOOKUP_NO_TEMP_BIND means temporaries will not be bound to references.
3102 These are used in global lookup to support elaborated types and
3103 qualifiers.
3105 LOOKUP_PREFER_TYPES means not to accept objects, and possibly namespaces.
3106 LOOKUP_PREFER_NAMESPACES means not to accept objects, and possibly types.
3107 LOOKUP_PREFER_BOTH means class-or-namespace-name.
3108 LOOKUP_TEMPLATES_EXPECTED means that class templates also count
3109 as types. */
3111 #define LOOKUP_PROTECT (1)
3112 #define LOOKUP_COMPLAIN (2)
3113 #define LOOKUP_NORMAL (3)
3114 /* #define LOOKUP_UNUSED (4) */
3115 #define LOOKUP_NONVIRTUAL (8)
3116 #define LOOKUP_GLOBAL (16)
3117 #define LOOKUP_HAS_IN_CHARGE (32)
3118 #define LOOKUP_SPECULATIVELY (64)
3119 #define LOOKUP_ONLYCONVERTING (128)
3120 #define DIRECT_BIND (256)
3121 #define LOOKUP_NO_CONVERSION (512)
3122 #define LOOKUP_DESTRUCTOR (512)
3123 #define LOOKUP_NO_TEMP_BIND (1024)
3124 #define LOOKUP_PREFER_TYPES (2048)
3125 #define LOOKUP_PREFER_NAMESPACES (4096)
3126 #define LOOKUP_PREFER_BOTH (6144)
3127 #define LOOKUP_TEMPLATES_EXPECTED (8192)
3129 #define LOOKUP_NAMESPACES_ONLY(f) \
3130 (((f) & LOOKUP_PREFER_NAMESPACES) && !((f) & LOOKUP_PREFER_TYPES))
3131 #define LOOKUP_TYPES_ONLY(f) \
3132 (!((f) & LOOKUP_PREFER_NAMESPACES) && ((f) & LOOKUP_PREFER_TYPES))
3133 #define LOOKUP_QUALIFIERS_ONLY(f) ((f) & LOOKUP_PREFER_BOTH)
3136 /* These flags are used by the conversion code.
3137 CONV_IMPLICIT : Perform implicit conversions (standard and user-defined).
3138 CONV_STATIC : Perform the explicit conversions for static_cast.
3139 CONV_CONST : Perform the explicit conversions for const_cast.
3140 CONV_REINTERPRET: Perform the explicit conversions for reinterpret_cast.
3141 CONV_PRIVATE : Perform upcasts to private bases.
3142 CONV_FORCE_TEMP : Require a new temporary when converting to the same
3143 aggregate type. */
3145 #define CONV_IMPLICIT 1
3146 #define CONV_STATIC 2
3147 #define CONV_CONST 4
3148 #define CONV_REINTERPRET 8
3149 #define CONV_PRIVATE 16
3150 /* #define CONV_NONCONVERTING 32 */
3151 #define CONV_FORCE_TEMP 64
3152 #define CONV_STATIC_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_FORCE_TEMP)
3153 #define CONV_OLD_CONVERT (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \
3154 | CONV_REINTERPRET)
3155 #define CONV_C_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \
3156 | CONV_REINTERPRET | CONV_PRIVATE | CONV_FORCE_TEMP)
3158 /* Used by build_expr_type_conversion to indicate which types are
3159 acceptable as arguments to the expression under consideration. */
3161 #define WANT_INT 1 /* integer types, including bool */
3162 #define WANT_FLOAT 2 /* floating point types */
3163 #define WANT_ENUM 4 /* enumerated types */
3164 #define WANT_POINTER 8 /* pointer types */
3165 #define WANT_NULL 16 /* null pointer constant */
3166 #define WANT_ARITH (WANT_INT | WANT_FLOAT)
3168 /* Used with comptypes, and related functions, to guide type
3169 comparison. */
3171 #define COMPARE_STRICT 0 /* Just check if the types are the
3172 same. */
3173 #define COMPARE_BASE 1 /* Check to see if the second type is
3174 derived from the first, or if both
3175 are pointers (or references) and
3176 the types pointed to by the second
3177 type is derived from the pointed to
3178 by the first. */
3179 #define COMPARE_RELAXED 2 /* Like COMPARE_DERIVED, but in
3180 reverse. Also treat enmeration
3181 types as the same as integer types
3182 of the same width. */
3183 #define COMPARE_REDECLARATION 4 /* The comparsion is being done when
3184 another declaration of an existing
3185 entity is seen. */
3186 #define COMPARE_NO_ATTRIBUTES 8 /* The comparison should ignore
3187 extra-linguistic type attributes. */
3189 /* Used with push_overloaded_decl. */
3190 #define PUSH_GLOBAL 0 /* Push the DECL into namespace scope,
3191 regardless of the current scope. */
3192 #define PUSH_LOCAL 1 /* Push the DECL into the current
3193 scope. */
3194 #define PUSH_USING 2 /* We are pushing this DECL as the
3195 result of a using declaration. */
3197 /* Used with start function. */
3198 #define SF_DEFAULT 0 /* No flags. */
3199 #define SF_PRE_PARSED 1 /* The function declaration has
3200 already been parsed. */
3201 #define SF_INCLASS_INLINE 2 /* The function is an inline, defined
3202 in the class body. */
3203 #define SF_EXPAND 4 /* Generate RTL for this function. */
3205 /* Returns nonzero iff TYPE1 and TYPE2 are the same type, in the usual
3206 sense of `same'. */
3207 #define same_type_p(type1, type2) \
3208 comptypes ((type1), (type2), COMPARE_STRICT)
3210 /* Returns nonzero iff TYPE1 and TYPE2 are the same type, or if TYPE2
3211 is derived from TYPE1, or if TYPE2 is a pointer (reference) to a
3212 class derived from the type pointed to (referred to) by TYPE1. */
3213 #define same_or_base_type_p(type1, type2) \
3214 comptypes ((type1), (type2), COMPARE_BASE)
3216 /* These macros are used to access a TEMPLATE_PARM_INDEX. */
3217 #define TEMPLATE_PARM_INDEX_CAST(NODE) \
3218 ((template_parm_index*)TEMPLATE_PARM_INDEX_CHECK (NODE))
3219 #define TEMPLATE_PARM_IDX(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->index)
3220 #define TEMPLATE_PARM_LEVEL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->level)
3221 #define TEMPLATE_PARM_DESCENDANTS(NODE) (TREE_CHAIN (NODE))
3222 #define TEMPLATE_PARM_ORIG_LEVEL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->orig_level)
3223 #define TEMPLATE_PARM_DECL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->decl)
3225 /* These macros are for accessing the fields of TEMPLATE_TYPE_PARM
3226 and TEMPLATE_TEMPLATE_PARM nodes. */
3227 #define TEMPLATE_TYPE_PARM_INDEX(NODE) (TYPE_FIELDS (NODE))
3228 #define TEMPLATE_TYPE_IDX(NODE) \
3229 (TEMPLATE_PARM_IDX (TEMPLATE_TYPE_PARM_INDEX (NODE)))
3230 #define TEMPLATE_TYPE_LEVEL(NODE) \
3231 (TEMPLATE_PARM_LEVEL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
3232 #define TEMPLATE_TYPE_ORIG_LEVEL(NODE) \
3233 (TEMPLATE_PARM_ORIG_LEVEL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
3234 #define TEMPLATE_TYPE_DECL(NODE) \
3235 (TEMPLATE_PARM_DECL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
3237 /* Control stringification of trees (types, decls & exprs).
3238 Bit or them together. */
3239 enum tree_string_flags
3241 TS_PLAIN, /* nothing special */
3242 TS_CHASE_TYPEDEFS = 1 << 0, /* look through typedefs */
3243 TS_DECORATE = 1 << 1, /* decorate things */
3244 TS_FUNC_NORETURN = 1 << 2, /* inhibit function return type */
3245 TS_FUNC_THROW = 1 << 3, /* show throw spec */
3246 TS_PARM_DEFAULTS = 1 << 4, /* show parm defaults */
3247 TS_EXPR_PARENS = 1 << 5, /* enclose in parens */
3248 TS_AGGR_TAGS = 1 << 6, /* show struct tags */
3249 TS_DECL_TYPE = 1 << 7, /* show decl's type */
3250 TS_FUNC_SCOPE = 1 << 8, /* show function scope */
3251 TS_PEDANTIC_NAME = 1 << 9, /* pedantically name things */
3252 TS_TEMPLATE_PREFIX= 1 << 10, /* show template <parms> prefix */
3254 /* Internal use flags */
3255 TS_TEMPLATE_PARM = 1 << 11, /* decl is really a non-type template parm */
3256 TS_TEMPLATE_PLAIN = 1 << 12, /* don't decorate primary template_name */
3258 TS_NEXT_BIT = 13 /* next available bit */
3261 /* in lex.c */
3262 /* Indexed by TREE_CODE, these tables give C-looking names to
3263 operators represented by TREE_CODES. For example,
3264 opname_tab[(int) MINUS_EXPR] == "-". */
3265 extern const char **opname_tab, **assignop_tab;
3267 /* in call.c */
3268 extern int check_dtor_name PROTO((tree, tree));
3269 extern int get_arglist_len_in_bytes PROTO((tree));
3271 extern tree build_vfield_ref PROTO((tree, tree));
3272 extern tree resolve_scope_to_name PROTO((tree, tree));
3273 extern tree build_scoped_method_call PROTO((tree, tree, tree, tree));
3274 extern tree build_addr_func PROTO((tree));
3275 extern tree build_call PROTO((tree, tree, tree));
3276 extern tree build_method_call PROTO((tree, tree, tree, tree, int));
3277 extern int null_ptr_cst_p PROTO((tree));
3278 extern tree type_decays_to PROTO((tree));
3279 extern tree build_user_type_conversion PROTO((tree, tree, int));
3280 extern tree build_new_function_call PROTO((tree, tree));
3281 extern tree build_new_op PROTO((enum tree_code, int, tree, tree, tree));
3282 extern tree build_op_new_call PROTO((enum tree_code, tree, tree, int));
3283 extern tree build_op_delete_call PROTO((enum tree_code, tree, tree, int, tree));
3284 extern int can_convert PROTO((tree, tree));
3285 extern int can_convert_arg PROTO((tree, tree, tree));
3286 extern int enforce_access PROTO((tree, tree));
3287 extern tree convert_default_arg PROTO((tree, tree, tree));
3288 extern tree convert_arg_to_ellipsis PROTO((tree));
3289 extern tree build_x_va_arg PROTO((tree, tree));
3290 extern tree convert_type_from_ellipsis PROTO((tree));
3291 extern int is_properly_derived_from PROTO((tree, tree));
3292 extern tree initialize_reference PROTO((tree, tree));
3293 extern tree strip_top_quals PROTO((tree));
3294 extern tree perform_implicit_conversion PROTO((tree, tree));
3296 /* in class.c */
3297 extern tree build_vbase_path PROTO((enum tree_code, tree, tree, tree, int));
3298 extern tree build_vtbl_ref PROTO((tree, tree));
3299 extern tree build_vfn_ref PROTO((tree *, tree, tree));
3300 extern void add_method PROTO((tree, tree *, tree));
3301 extern int currently_open_class PROTO((tree));
3302 extern tree get_vfield_offset PROTO((tree));
3303 extern void duplicate_tag_error PROTO((tree));
3304 extern tree finish_struct PROTO((tree, tree));
3305 extern void finish_struct_1 PROTO((tree));
3306 extern int resolves_to_fixed_type_p PROTO((tree, int *));
3307 extern void init_class_processing PROTO((void));
3308 extern int is_empty_class PROTO((tree));
3309 extern void pushclass PROTO((tree, int));
3310 extern void popclass PROTO((void));
3311 extern void push_nested_class PROTO((tree, int));
3312 extern void pop_nested_class PROTO((void));
3313 extern void push_lang_context PROTO((tree));
3314 extern void pop_lang_context PROTO((void));
3315 extern tree instantiate_type PROTO((tree, tree, int));
3316 extern void print_class_statistics PROTO((void));
3317 extern unsigned HOST_WIDE_INT skip_rtti_stuff PROTO((tree *, tree));
3318 extern void build_self_reference PROTO((void));
3319 extern void warn_hidden PROTO((tree));
3320 extern tree get_enclosing_class PROTO((tree));
3321 int is_base_of_enclosing_class PROTO((tree, tree));
3322 extern void unreverse_member_declarations PROTO((tree));
3323 extern void invalidate_class_lookup_cache PROTO((void));
3324 extern void maybe_note_name_used_in_class PROTO((tree, tree));
3325 extern void note_name_declared_in_class PROTO((tree, tree));
3327 /* in cvt.c */
3328 extern tree convert_to_reference PROTO((tree, tree, int, int, tree));
3329 extern tree convert_from_reference PROTO((tree));
3330 extern tree convert_pointer_to_real PROTO((tree, tree));
3331 extern tree convert_pointer_to PROTO((tree, tree));
3332 extern tree ocp_convert PROTO((tree, tree, int, int));
3333 extern tree cp_convert PROTO((tree, tree));
3334 extern tree convert_to_void PROTO((tree, const char */*implicit context*/));
3335 extern tree convert PROTO((tree, tree));
3336 extern tree convert_force PROTO((tree, tree, int));
3337 extern tree build_type_conversion PROTO((tree, tree, int));
3338 extern tree build_expr_type_conversion PROTO((int, tree, int));
3339 extern tree type_promotes_to PROTO((tree));
3340 extern tree perform_qualification_conversions PROTO((tree, tree));
3342 /* decl.c */
3343 /* resume_binding_level */
3344 extern void set_identifier_local_value PROTO((tree, tree));
3345 extern int global_bindings_p PROTO((void));
3346 extern int toplevel_bindings_p PROTO((void));
3347 extern int namespace_bindings_p PROTO((void));
3348 extern void keep_next_level PROTO((int));
3349 extern int kept_level_p PROTO((void));
3350 extern void declare_pseudo_global_level PROTO((void));
3351 extern int pseudo_global_level_p PROTO((void));
3352 extern void set_class_shadows PROTO((tree));
3353 extern void pushlevel PROTO((int));
3354 extern void note_level_for_for PROTO((void));
3355 extern void resume_level PROTO((struct binding_level *));
3356 extern void delete_block PROTO((tree));
3357 extern void insert_block PROTO((tree));
3358 extern void add_block_current_level PROTO((tree));
3359 extern void set_block PROTO((tree));
3360 extern void pushlevel_class PROTO((void));
3361 extern void poplevel_class PROTO((void));
3362 extern void print_binding_stack PROTO((void));
3363 extern void print_binding_level PROTO((struct binding_level *));
3364 extern void push_namespace PROTO((tree));
3365 extern void pop_namespace PROTO((void));
3366 extern void push_nested_namespace PROTO((tree));
3367 extern void pop_nested_namespace PROTO((tree));
3368 extern void maybe_push_to_top_level PROTO((int));
3369 extern void push_to_top_level PROTO((void));
3370 extern void pop_from_top_level PROTO((void));
3371 extern tree identifier_type_value PROTO((tree));
3372 extern void set_identifier_type_value PROTO((tree, tree));
3373 extern void pop_everything PROTO((void));
3374 extern void pushtag PROTO((tree, tree, int));
3375 extern tree make_anon_name PROTO((void));
3376 extern void clear_anon_tags PROTO((void));
3377 extern int decls_match PROTO((tree, tree));
3378 extern int duplicate_decls PROTO((tree, tree));
3379 extern tree pushdecl PROTO((tree));
3380 extern tree pushdecl_top_level PROTO((tree));
3381 extern void pushdecl_class_level PROTO((tree));
3382 #if 0
3383 extern void pushdecl_nonclass_level PROTO((tree));
3384 #endif
3385 extern tree pushdecl_namespace_level PROTO((tree));
3386 extern tree push_using_decl PROTO((tree, tree));
3387 extern tree push_using_directive PROTO((tree));
3388 extern void push_class_level_binding PROTO((tree, tree));
3389 extern tree implicitly_declare PROTO((tree));
3390 extern tree lookup_label PROTO((tree));
3391 extern tree declare_local_label PROTO((tree));
3392 extern tree define_label PROTO((char *, int, tree));
3393 extern void push_switch PROTO((void));
3394 extern void pop_switch PROTO((void));
3395 extern void define_case_label PROTO((void));
3396 extern tree getdecls PROTO((void));
3397 extern tree gettags PROTO((void));
3398 #if 0
3399 extern void set_current_level_tags_transparency PROTO((int));
3400 #endif
3401 extern tree binding_for_name PROTO((tree, tree));
3402 extern tree namespace_binding PROTO((tree, tree));
3403 extern void set_namespace_binding PROTO((tree, tree, tree));
3404 extern tree lookup_namespace_name PROTO((tree, tree));
3405 extern tree build_typename_type PROTO((tree, tree, tree, tree));
3406 extern tree make_typename_type PROTO((tree, tree, int));
3407 extern tree lookup_name_nonclass PROTO((tree));
3408 extern tree lookup_function_nonclass PROTO((tree, tree));
3409 extern tree lookup_name PROTO((tree, int));
3410 extern tree lookup_name_current_level PROTO((tree));
3411 extern tree lookup_type_current_level PROTO((tree));
3412 extern tree lookup_name_namespace_only PROTO((tree));
3413 extern void begin_only_namespace_names PROTO((void));
3414 extern void end_only_namespace_names PROTO((void));
3415 extern tree namespace_ancestor PROTO((tree, tree));
3416 extern tree unqualified_namespace_lookup PROTO((tree, int, tree *));
3417 extern int lookup_using_namespace PROTO((tree, tree, tree, tree, int, tree *));
3418 extern int qualified_lookup_using_namespace PROTO((tree, tree, tree, int));
3419 extern tree auto_function PROTO((tree, tree));
3420 extern void init_decl_processing PROTO((void));
3421 extern int init_type_desc PROTO((void));
3422 extern tree define_function PROTO((const char *, tree,
3423 void (*) (tree),
3424 const char *));
3425 extern tree check_tag_decl PROTO((tree));
3426 extern void shadow_tag PROTO((tree));
3427 extern tree groktypename PROTO((tree));
3428 extern tree start_decl PROTO((tree, tree, int, tree, tree));
3429 extern void start_decl_1 PROTO((tree));
3430 extern void cp_finish_decl PROTO((tree, tree, tree, int, int));
3431 extern void finish_decl PROTO((tree, tree, tree));
3432 extern void maybe_inject_for_scope_var PROTO((tree));
3433 extern void initialize_local_var PROTO((tree, tree, int));
3434 extern void expand_static_init PROTO((tree, tree));
3435 extern tree start_handler_parms PROTO((tree, tree));
3436 extern int complete_array_type PROTO((tree, tree, int));
3437 extern tree build_ptrmemfunc_type PROTO((tree));
3438 /* the grokdeclarator prototype is in decl.h */
3439 extern int parmlist_is_exprlist PROTO((tree));
3440 extern int copy_args_p PROTO((tree));
3441 extern int grok_ctor_properties PROTO((tree, tree));
3442 extern void grok_op_properties PROTO((tree, int, int));
3443 extern tree xref_tag PROTO((tree, tree, int));
3444 extern tree xref_tag_from_type PROTO((tree, tree, int));
3445 extern void xref_basetypes PROTO((tree, tree, tree, tree));
3446 extern tree start_enum PROTO((tree));
3447 extern tree finish_enum PROTO((tree));
3448 extern tree build_enumerator PROTO((tree, tree, tree));
3449 extern int start_function PROTO((tree, tree, tree, int));
3450 extern void expand_start_early_try_stmts PROTO((void));
3451 extern void store_parm_decls PROTO((void));
3452 extern void store_return_init PROTO((tree));
3453 extern tree finish_function PROTO((int, int));
3454 extern tree start_method PROTO((tree, tree, tree));
3455 extern tree finish_method PROTO((tree));
3456 extern void hack_incomplete_structures PROTO((tree));
3457 extern tree maybe_build_cleanup_and_delete PROTO((tree));
3458 extern tree maybe_build_cleanup PROTO((tree));
3459 extern void cplus_expand_expr_stmt PROTO((tree));
3460 extern void finish_stmt PROTO((void));
3461 extern int in_function_p PROTO((void));
3462 extern void replace_defarg PROTO((tree, tree));
3463 extern void print_other_binding_stack PROTO((struct binding_level *));
3464 extern void revert_static_member_fn PROTO((tree*, tree*, tree*));
3465 extern void fixup_anonymous_aggr PROTO((tree));
3466 extern int check_static_variable_definition PROTO((tree, tree));
3467 extern void push_local_binding PROTO((tree, tree, int));
3468 extern int push_class_binding PROTO((tree, tree));
3469 extern tree check_default_argument PROTO((tree, tree));
3470 extern tree push_overloaded_decl PROTO((tree, int));
3471 extern void clear_identifier_class_values PROTO((void));
3472 extern void storetags PROTO((tree));
3473 extern int vtable_decl_p PROTO((tree, void *));
3474 extern int vtype_decl_p PROTO((tree, void *));
3475 extern int sigtable_decl_p PROTO((tree, void *));
3476 typedef int (*walk_globals_pred) PROTO((tree, void *));
3477 typedef int (*walk_globals_fn) PROTO((tree *, void *));
3478 extern int walk_globals PROTO((walk_globals_pred,
3479 walk_globals_fn,
3480 void *));
3481 typedef int (*walk_namespaces_fn) PROTO((tree, void *));
3482 extern int walk_namespaces PROTO((walk_namespaces_fn,
3483 void *));
3484 extern int wrapup_globals_for_namespace PROTO((tree, void *));
3485 extern tree cp_namespace_decls PROTO((tree));
3486 extern tree create_implicit_typedef PROTO((tree, tree));
3487 extern tree maybe_push_decl PROTO((tree));
3488 extern void emit_local_var PROTO((tree));
3489 extern tree build_target_expr PROTO((tree, tree));
3490 extern void make_rtl_for_local_static PROTO((tree));
3492 /* in decl2.c */
3493 extern void init_decl2 PROTO((void));
3494 extern int check_java_method PROTO((tree));
3495 extern int lang_decode_option PROTO((int, char **));
3496 extern tree grok_method_quals PROTO((tree, tree, tree));
3497 extern void warn_if_unknown_interface PROTO((tree));
3498 extern void grok_x_components PROTO((tree));
3499 extern void maybe_retrofit_in_chrg PROTO((tree));
3500 extern void maybe_make_one_only PROTO((tree));
3501 extern void grokclassfn PROTO((tree, tree, enum overload_flags, tree));
3502 extern tree grok_alignof PROTO((tree));
3503 extern tree grok_array_decl PROTO((tree, tree));
3504 extern tree delete_sanity PROTO((tree, tree, int, int));
3505 extern tree check_classfn PROTO((tree, tree));
3506 extern void check_member_template PROTO((tree));
3507 extern tree grokfield PROTO((tree, tree, tree, tree, tree));
3508 extern tree grokbitfield PROTO((tree, tree, tree));
3509 extern tree groktypefield PROTO((tree, tree));
3510 extern tree grokoptypename PROTO((tree, tree));
3511 extern int copy_assignment_arg_p PROTO((tree, int));
3512 extern void cplus_decl_attributes PROTO((tree, tree, tree));
3513 extern tree constructor_name_full PROTO((tree));
3514 extern tree constructor_name PROTO((tree));
3515 extern void setup_vtbl_ptr PROTO((void));
3516 extern void mark_inline_for_output PROTO((tree));
3517 extern tree get_temp_name PROTO((tree, int));
3518 extern void finish_anon_union PROTO((tree));
3519 extern tree finish_table PROTO((tree, tree, tree, int));
3520 extern void finish_builtin_type PROTO((tree, const char *,
3521 tree *, int, tree));
3522 extern tree coerce_new_type PROTO((tree));
3523 extern tree coerce_delete_type PROTO((tree));
3524 extern void comdat_linkage PROTO((tree));
3525 extern void import_export_class PROTO((tree));
3526 extern void import_export_vtable PROTO((tree, tree, int));
3527 extern void import_export_decl PROTO((tree));
3528 extern tree build_cleanup PROTO((tree));
3529 extern void finish_file PROTO((void));
3530 extern tree reparse_absdcl_as_expr PROTO((tree, tree));
3531 extern tree reparse_absdcl_as_casts PROTO((tree, tree));
3532 extern tree build_expr_from_tree PROTO((tree));
3533 extern tree reparse_decl_as_expr PROTO((tree, tree));
3534 extern tree finish_decl_parsing PROTO((tree));
3535 extern tree check_cp_case_value PROTO((tree));
3536 extern void set_decl_namespace PROTO((tree, tree, int));
3537 extern tree current_decl_namespace PROTO((void));
3538 extern void push_decl_namespace PROTO((tree));
3539 extern void pop_decl_namespace PROTO((void));
3540 extern void push_scope PROTO((tree));
3541 extern void pop_scope PROTO((tree));
3542 extern void do_namespace_alias PROTO((tree, tree));
3543 extern void do_toplevel_using_decl PROTO((tree));
3544 extern void do_local_using_decl PROTO((tree));
3545 extern tree do_class_using_decl PROTO((tree));
3546 extern void do_using_directive PROTO((tree));
3547 extern void check_default_args PROTO((tree));
3548 extern void mark_used PROTO((tree));
3549 extern tree handle_class_head PROTO((tree, tree, tree));
3550 extern tree lookup_arg_dependent PROTO((tree, tree, tree));
3551 extern void finish_static_data_member_decl PROTO((tree, tree, tree, int, int));
3553 /* in parse.y */
3554 extern void cp_parse_init PROTO((void));
3556 /* in errfn.c */
3557 /* The cp_* functions aren't suitable for ATTRIBUTE_PRINTF. */
3558 extern void cp_error PVPROTO((const char *, ...));
3559 extern void cp_error_at PVPROTO((const char *, ...));
3560 extern void cp_warning PVPROTO((const char *, ...));
3561 extern void cp_warning_at PVPROTO((const char *, ...));
3562 extern void cp_pedwarn PVPROTO((const char *, ...));
3563 extern void cp_pedwarn_at PVPROTO((const char *, ...));
3564 extern void cp_compiler_error PVPROTO((const char *, ...));
3565 extern void cp_sprintf PVPROTO((const char *, ...));
3566 extern void cp_deprecated PROTO((const char*));
3568 /* in error.c */
3569 extern void init_error PROTO((void));
3570 extern const char *type_as_string PROTO((tree, enum tree_string_flags));
3571 extern const char *decl_as_string PROTO((tree, enum tree_string_flags));
3572 extern const char *expr_as_string PROTO((tree, enum tree_string_flags));
3573 extern const char *context_as_string PROTO((tree, enum tree_string_flags));
3574 extern const char *lang_decl_name PROTO((tree, int));
3575 extern const char *cp_file_of PROTO((tree));
3576 extern int cp_line_of PROTO((tree));
3578 /* in except.c */
3579 extern void init_exception_processing PROTO((void));
3580 extern tree expand_start_catch_block PROTO((tree));
3581 extern void expand_end_catch_block PROTO((tree));
3582 extern void expand_builtin_throw PROTO((void));
3583 extern tree expand_start_eh_spec PROTO((void));
3584 extern void expand_end_eh_spec PROTO((tree, tree));
3585 extern void expand_exception_blocks PROTO((void));
3586 extern tree start_anon_func PROTO((void));
3587 extern void end_anon_func PROTO((void));
3588 extern tree build_throw PROTO((tree));
3589 extern void mark_all_runtime_matches PROTO((void));
3591 /* in expr.c */
3592 extern void init_cplus_expand PROTO((void));
3593 extern void fixup_result_decl PROTO((tree, struct rtx_def *));
3594 extern int extract_init PROTO((tree, tree));
3595 extern void do_case PROTO((tree, tree));
3596 extern tree cplus_expand_constant PROTO((tree));
3598 /* friend.c */
3599 extern int is_friend PROTO((tree, tree));
3600 extern void make_friend_class PROTO((tree, tree));
3601 extern void add_friend PROTO((tree, tree));
3602 extern void add_friends PROTO((tree, tree, tree));
3603 extern tree do_friend PROTO((tree, tree, tree, tree, tree, enum overload_flags, tree, int));
3605 /* in init.c */
3606 extern void init_init_processing PROTO((void));
3607 extern void expand_direct_vtbls_init PROTO((tree, tree, int, int, tree));
3608 extern tree emit_base_init PROTO((tree));
3609 extern void check_base_init PROTO((tree));
3610 extern void expand_member_init PROTO((tree, tree, tree));
3611 extern tree build_aggr_init PROTO((tree, tree, int));
3612 extern int is_aggr_typedef PROTO((tree, int));
3613 extern int is_aggr_type PROTO((tree, int));
3614 extern tree get_aggr_from_typedef PROTO((tree, int));
3615 extern tree get_type_value PROTO((tree));
3616 extern tree build_member_call PROTO((tree, tree, tree));
3617 extern tree build_offset_ref PROTO((tree, tree));
3618 extern tree resolve_offset_ref PROTO((tree));
3619 extern tree decl_constant_value PROTO((tree));
3620 extern tree build_new PROTO((tree, tree, tree, int));
3621 extern tree build_new_1 PROTO((tree));
3622 extern tree build_vec_init PROTO((tree, tree, tree, tree, int));
3623 extern tree build_x_delete PROTO((tree, int, tree));
3624 extern tree build_delete PROTO((tree, tree, tree, int, int));
3625 extern tree build_vbase_delete PROTO((tree, tree));
3626 extern tree build_vec_delete PROTO((tree, tree, tree, tree, int));
3627 extern tree create_temporary_var PROTO((tree));
3628 extern void begin_init_stmts PROTO((tree *, tree *));
3629 extern tree finish_init_stmts PROTO((tree, tree));
3631 /* in input.c */
3633 /* in lex.c */
3634 extern char *file_name_nondirectory PROTO((const char *));
3635 extern tree make_pointer_declarator PROTO((tree, tree));
3636 extern tree make_reference_declarator PROTO((tree, tree));
3637 extern tree make_call_declarator PROTO((tree, tree, tree, tree));
3638 extern void set_quals_and_spec PROTO((tree, tree, tree));
3639 extern const char *operator_name_string PROTO((tree));
3640 extern void lang_init PROTO((void));
3641 extern void lang_finish PROTO((void));
3642 #if 0
3643 extern void reinit_lang_specific PROTO((void));
3644 #endif
3645 extern void reinit_parse_for_function PROTO((void));
3646 extern void print_parse_statistics PROTO((void));
3647 extern void extract_interface_info PROTO((void));
3648 extern void do_pending_inlines PROTO((void));
3649 extern void process_next_inline PROTO((struct pending_inline *));
3650 extern struct pending_input *save_pending_input PROTO((void));
3651 extern void restore_pending_input PROTO((struct pending_input *));
3652 extern void yyungetc PROTO((int, int));
3653 extern void reinit_parse_for_method PROTO((int, tree));
3654 extern void reinit_parse_for_block PROTO((int, struct obstack *));
3655 extern tree cons_up_default_function PROTO((tree, tree, int));
3656 extern void check_for_missing_semicolon PROTO((tree));
3657 extern void note_got_semicolon PROTO((tree));
3658 extern void note_list_got_semicolon PROTO((tree));
3659 extern void do_pending_lang_change PROTO((void));
3660 extern int identifier_type PROTO((tree));
3661 extern void see_typename PROTO((void));
3662 extern tree do_identifier PROTO((tree, int, tree));
3663 extern tree do_scoped_id PROTO((tree, int));
3664 extern tree identifier_typedecl_value PROTO((tree));
3665 extern int real_yylex PROTO((void));
3666 extern int is_rid PROTO((tree));
3667 extern tree build_lang_decl PROTO((enum tree_code, tree, tree));
3668 extern void retrofit_lang_decl PROTO((tree));
3669 extern void copy_lang_decl PROTO((tree));
3670 extern tree cp_make_lang_type PROTO((enum tree_code));
3671 extern void dump_time_statistics PROTO((void));
3672 extern void compiler_error PVPROTO((const char *, ...))
3673 ATTRIBUTE_PRINTF_1;
3674 extern void yyerror PROTO((const char *));
3675 extern void clear_inline_text_obstack PROTO((void));
3676 extern void maybe_snarf_defarg PROTO((void));
3677 extern tree snarf_defarg PROTO((void));
3678 extern void add_defarg_fn PROTO((tree));
3679 extern void do_pending_defargs PROTO((void));
3680 extern int identifier_type PROTO((tree));
3681 extern void yyhook PROTO((int));
3682 extern int cp_type_qual_from_rid PROTO((tree));
3684 /* in method.c */
3685 extern void init_method PROTO((void));
3686 extern void do_inline_function_hair PROTO((tree, tree));
3687 extern char *build_overload_name PROTO((tree, int, int));
3688 extern tree build_static_name PROTO((tree, tree));
3689 extern tree build_decl_overload PROTO((tree, tree, int));
3690 extern tree build_decl_overload_real PROTO((tree, tree, tree, tree,
3691 tree, int));
3692 extern void set_mangled_name_for_decl PROTO((tree));
3693 extern tree build_typename_overload PROTO((tree));
3694 extern tree build_overload_with_type PROTO((tree, tree));
3695 extern tree build_destructor_name PROTO((tree));
3696 extern tree build_opfncall PROTO((enum tree_code, int, tree, tree, tree));
3697 extern tree hack_identifier PROTO((tree, tree));
3698 extern tree make_thunk PROTO((tree, int));
3699 extern void emit_thunk PROTO((tree));
3700 extern void synthesize_method PROTO((tree));
3701 extern tree get_id_2 PROTO((const char *, tree));
3703 /* in pt.c */
3704 extern void init_pt PROTO ((void));
3705 extern void check_template_shadow PROTO ((tree));
3706 extern tree innermost_args PROTO ((tree));
3707 extern tree tsubst PROTO ((tree, tree, int, tree));
3708 extern tree tsubst_expr PROTO ((tree, tree, int, tree));
3709 extern tree tsubst_copy PROTO ((tree, tree, int, tree));
3710 extern void maybe_begin_member_template_processing PROTO((tree));
3711 extern void maybe_end_member_template_processing PROTO((void));
3712 extern tree finish_member_template_decl PROTO((tree));
3713 extern void begin_template_parm_list PROTO((void));
3714 extern void begin_specialization PROTO((void));
3715 extern void reset_specialization PROTO((void));
3716 extern void end_specialization PROTO((void));
3717 extern void begin_explicit_instantiation PROTO((void));
3718 extern void end_explicit_instantiation PROTO((void));
3719 extern tree check_explicit_specialization PROTO((tree, tree, int, int));
3720 extern tree process_template_parm PROTO((tree, tree));
3721 extern tree end_template_parm_list PROTO((tree));
3722 extern void end_template_decl PROTO((void));
3723 extern tree current_template_args PROTO((void));
3724 extern tree push_template_decl PROTO((tree));
3725 extern tree push_template_decl_real PROTO((tree, int));
3726 extern void redeclare_class_template PROTO((tree, tree));
3727 extern tree lookup_template_class PROTO((tree, tree, tree, tree, int));
3728 extern tree lookup_template_function PROTO((tree, tree));
3729 extern int uses_template_parms PROTO((tree));
3730 extern tree instantiate_class_template PROTO((tree));
3731 extern tree instantiate_template PROTO((tree, tree));
3732 extern void overload_template_name PROTO((tree));
3733 extern int fn_type_unification PROTO((tree, tree, tree, tree, tree, unification_kind_t));
3734 struct tinst_level *tinst_for_decl PROTO((void));
3735 extern void mark_decl_instantiated PROTO((tree, int));
3736 extern int more_specialized PROTO((tree, tree, tree));
3737 extern void mark_class_instantiated PROTO((tree, int));
3738 extern void do_decl_instantiation PROTO((tree, tree, tree));
3739 extern void do_type_instantiation PROTO((tree, tree));
3740 extern tree instantiate_decl PROTO((tree));
3741 extern tree get_bindings PROTO((tree, tree, tree));
3742 extern void add_tree PROTO((tree));
3743 extern void add_maybe_template PROTO((tree, tree));
3744 extern void pop_tinst_level PROTO((void));
3745 extern int more_specialized_class PROTO((tree, tree));
3746 extern int is_member_template PROTO((tree));
3747 extern int template_parms_equal PROTO((tree, tree));
3748 extern int comp_template_parms PROTO((tree, tree));
3749 extern int template_class_depth PROTO((tree));
3750 extern int is_specialization_of PROTO((tree, tree));
3751 extern int comp_template_args PROTO((tree, tree));
3752 extern void maybe_process_partial_specialization PROTO((tree));
3753 extern void maybe_check_template_type PROTO((tree));
3754 extern tree most_specialized_instantiation PROTO((tree, tree));
3755 extern void print_candidates PROTO((tree));
3756 extern int instantiate_pending_templates PROTO((void));
3757 extern tree tsubst_default_argument PROTO((tree, tree, tree));
3758 extern tree most_general_template PROTO((tree));
3760 extern int processing_template_parmlist;
3762 /* in repo.c */
3763 extern void repo_template_used PROTO((tree));
3764 extern void repo_template_instantiated PROTO((tree, int));
3765 extern void init_repo PROTO((const char *));
3766 extern void finish_repo PROTO((void));
3768 /* in rtti.c */
3769 extern void init_rtti_processing PROTO((void));
3770 extern tree get_tinfo_fn_dynamic PROTO((tree));
3771 extern tree build_typeid PROTO((tree));
3772 extern tree build_x_typeid PROTO((tree));
3773 extern tree get_tinfo_fn PROTO((tree));
3774 extern tree get_typeid PROTO((tree));
3775 extern tree get_typeid_1 PROTO((tree));
3776 extern tree build_dynamic_cast PROTO((tree, tree));
3777 extern void synthesize_tinfo_fn PROTO((tree));
3779 /* in search.c */
3780 extern int types_overlap_p PROTO((tree, tree));
3781 extern tree get_vbase PROTO((tree, tree));
3782 extern tree get_binfo PROTO((tree, tree, int));
3783 extern int get_base_distance PROTO((tree, tree, int, tree *));
3784 extern tree get_dynamic_cast_base_type PROTO((tree, tree));
3785 extern int accessible_p PROTO((tree, tree));
3786 extern tree lookup_field PROTO((tree, tree, int, int));
3787 extern int lookup_fnfields_1 PROTO((tree, tree));
3788 extern tree lookup_fnfields PROTO((tree, tree, int));
3789 extern tree lookup_member PROTO((tree, tree, int, int));
3790 extern tree lookup_nested_tag PROTO((tree, tree));
3791 extern tree get_matching_virtual PROTO((tree, tree, int));
3792 extern tree get_abstract_virtuals PROTO((tree));
3793 extern tree init_vbase_pointers PROTO((tree, tree));
3794 extern void expand_indirect_vtbls_init PROTO((tree, tree, tree));
3795 extern void clear_search_slots PROTO((tree));
3796 extern tree get_vbase_types PROTO((tree));
3797 extern void note_debug_info_needed PROTO((tree));
3798 extern void push_class_decls PROTO((tree));
3799 extern void pop_class_decls PROTO((void));
3800 extern void unuse_fields PROTO((tree));
3801 extern void print_search_statistics PROTO((void));
3802 extern void init_search_processing PROTO((void));
3803 extern void reinit_search_statistics PROTO((void));
3804 extern tree current_scope PROTO((void));
3805 extern int at_function_scope_p PROTO((void));
3806 extern tree lookup_conversions PROTO((tree));
3807 extern tree binfo_for_vtable PROTO((tree));
3808 extern int binfo_from_vbase PROTO((tree));
3809 extern tree dfs_walk PROTO((tree,
3810 tree (*)(tree, void *),
3811 tree (*) (tree, void *),
3812 void *));
3813 extern tree dfs_unmark PROTO((tree, void *));
3814 extern tree markedp PROTO((tree, void *));
3816 /* in semantics.c */
3817 extern void finish_expr_stmt PROTO((tree));
3818 extern tree begin_if_stmt PROTO((void));
3819 extern void finish_if_stmt_cond PROTO((tree, tree));
3820 extern tree finish_then_clause PROTO((tree));
3821 extern void begin_else_clause PROTO((void));
3822 extern void finish_else_clause PROTO((tree));
3823 extern void finish_if_stmt PROTO((void));
3824 extern tree begin_while_stmt PROTO((void));
3825 extern void finish_while_stmt_cond PROTO((tree, tree));
3826 extern void finish_while_stmt PROTO((tree));
3827 extern tree begin_do_stmt PROTO((void));
3828 extern void finish_do_body PROTO((tree));
3829 extern void finish_do_stmt PROTO((tree, tree));
3830 extern void finish_return_stmt PROTO((tree));
3831 extern tree begin_for_stmt PROTO((void));
3832 extern void finish_for_init_stmt PROTO((tree));
3833 extern void finish_for_cond PROTO((tree, tree));
3834 extern void finish_for_expr PROTO((tree, tree));
3835 extern void finish_for_stmt PROTO((tree, tree));
3836 extern void finish_break_stmt PROTO((void));
3837 extern void finish_continue_stmt PROTO((void));
3838 extern tree begin_switch_stmt PROTO((void));
3839 extern void finish_switch_cond PROTO((tree, tree));
3840 extern void finish_switch_stmt PROTO((tree, tree));
3841 extern void finish_case_label PROTO((tree, tree));
3842 extern void finish_goto_stmt PROTO((tree));
3843 extern tree begin_try_block PROTO((void));
3844 extern void finish_try_block PROTO((tree));
3845 extern void finish_handler_sequence PROTO((tree));
3846 extern tree begin_function_try_block PROTO((void));
3847 extern void finish_function_try_block PROTO((tree));
3848 extern void finish_function_handler_sequence PROTO((tree));
3849 extern void finish_cleanup_try_block PROTO((tree));
3850 extern tree begin_handler PROTO((void));
3851 extern tree finish_handler_parms PROTO((tree, tree));
3852 extern void begin_catch_block PROTO((tree));
3853 extern void finish_handler PROTO((tree, tree));
3854 extern void finish_cleanup PROTO((tree, tree));
3855 extern tree begin_compound_stmt PROTO((int));
3856 extern tree finish_compound_stmt PROTO((int, tree));
3857 extern void finish_asm_stmt PROTO((tree, tree, tree, tree, tree));
3858 extern void finish_label_stmt PROTO((tree));
3859 extern void finish_label_decl PROTO((tree));
3860 extern void finish_subobject PROTO((tree));
3861 extern tree finish_parenthesized_expr PROTO((tree));
3862 extern tree begin_stmt_expr PROTO((void));
3863 extern tree finish_stmt_expr PROTO((tree));
3864 extern tree finish_call_expr PROTO((tree, tree, int));
3865 extern tree finish_increment_expr PROTO((tree, enum tree_code));
3866 extern tree finish_this_expr PROTO((void));
3867 extern tree finish_object_call_expr PROTO((tree, tree, tree));
3868 extern tree finish_qualified_object_call_expr PROTO((tree, tree, tree));
3869 extern tree finish_pseudo_destructor_call_expr PROTO((tree, tree, tree));
3870 extern tree finish_qualified_call_expr PROTO ((tree, tree));
3871 extern tree finish_label_address_expr PROTO((tree));
3872 extern tree finish_unary_op_expr PROTO((enum tree_code, tree));
3873 extern tree finish_id_expr PROTO((tree));
3874 extern int begin_new_placement PROTO((void));
3875 extern tree finish_new_placement PROTO((tree, int));
3876 extern int begin_function_definition PROTO((tree, tree));
3877 extern tree begin_constructor_declarator PROTO((tree, tree));
3878 extern tree finish_declarator PROTO((tree, tree, tree, tree, int));
3879 extern void finish_translation_unit PROTO((void));
3880 extern tree finish_template_type_parm PROTO((tree, tree));
3881 extern tree finish_template_template_parm PROTO((tree, tree));
3882 extern tree finish_parmlist PROTO((tree, int));
3883 extern tree begin_class_definition PROTO((tree));
3884 extern tree finish_class_definition PROTO((tree, tree, int, int));
3885 extern void finish_default_args PROTO((void));
3886 extern void begin_inline_definitions PROTO((void));
3887 extern void finish_inline_definitions PROTO((void));
3888 extern tree finish_member_class_template PROTO((tree));
3889 extern void finish_template_decl PROTO((tree));
3890 extern tree finish_template_type PROTO((tree, tree, int));
3891 extern void enter_scope_of PROTO((tree));
3892 extern tree finish_base_specifier PROTO((tree, tree));
3893 extern void finish_member_declaration PROTO((tree));
3894 extern void check_multiple_declarators PROTO((void));
3895 extern tree finish_typeof PROTO((tree));
3896 extern void add_decl_stmt PROTO((tree));
3897 extern void finish_decl_cleanup PROTO((tree, tree));
3898 extern void finish_named_return_value PROTO((tree, tree));
3899 extern tree expand_stmt PROTO((tree));
3900 extern void expand_body PROTO((tree));
3901 extern void begin_stmt_tree PROTO((tree *));
3902 extern void finish_stmt_tree PROTO((tree *));
3903 extern void prep_stmt PROTO((tree));
3904 extern void add_scope_stmt PROTO((int, int));
3905 extern void do_pushlevel PROTO((void));
3906 extern tree do_poplevel PROTO((void));
3907 /* Non-zero if we are presently building a statement tree, rather
3908 than expanding each statement as we encounter it. */
3909 #define building_stmt_tree() (last_tree != NULL_TREE)
3911 /* in spew.c */
3912 extern void init_spew PROTO((void));
3913 extern int peekyylex PROTO((void));
3914 extern int yylex PROTO((void));
3915 extern tree arbitrate_lookup PROTO((tree, tree, tree));
3917 /* in tree.c */
3918 extern void init_tree PROTO((void));
3919 extern void cplus_unsave_expr_now PROTO((tree));
3920 extern int pod_type_p PROTO((tree));
3921 extern void unshare_base_binfos PROTO((tree));
3922 extern int member_p PROTO((tree));
3923 extern cp_lvalue_kind real_lvalue_p PROTO((tree));
3924 extern tree build_min PVPROTO((enum tree_code, tree, ...));
3925 extern tree build_min_nt PVPROTO((enum tree_code, ...));
3926 extern tree min_tree_cons PROTO((tree, tree, tree));
3927 extern int lvalue_p PROTO((tree));
3928 extern int lvalue_or_else PROTO((tree, const char *));
3929 extern tree build_cplus_new PROTO((tree, tree));
3930 extern tree get_target_expr PROTO((tree));
3931 extern tree break_out_cleanups PROTO((tree));
3932 extern tree break_out_calls PROTO((tree));
3933 extern tree build_cplus_method_type PROTO((tree, tree, tree));
3934 extern tree build_cplus_staticfn_type PROTO((tree, tree, tree));
3935 extern tree build_cplus_array_type PROTO((tree, tree));
3936 extern int layout_basetypes PROTO((tree, int));
3937 extern tree build_vbase_pointer_fields PROTO((tree));
3938 extern tree build_base_fields PROTO((tree));
3939 extern tree hash_tree_cons PROTO((tree, tree, tree));
3940 extern tree hash_tree_chain PROTO((tree, tree));
3941 extern tree hash_chainon PROTO((tree, tree));
3942 extern tree make_binfo PROTO((tree, tree, tree, tree));
3943 extern tree binfo_value PROTO((tree, tree));
3944 extern tree reverse_path PROTO((tree));
3945 extern int count_functions PROTO((tree));
3946 extern int is_overloaded_fn PROTO((tree));
3947 extern tree get_first_fn PROTO((tree));
3948 extern int bound_pmf_p PROTO((tree));
3949 extern tree ovl_cons PROTO((tree, tree));
3950 extern tree scratch_ovl_cons PROTO((tree, tree));
3951 extern int ovl_member PROTO((tree, tree));
3952 extern tree build_overload PROTO((tree, tree));
3953 extern tree fnaddr_from_vtable_entry PROTO((tree));
3954 extern tree function_arg_chain PROTO((tree));
3955 extern int promotes_to_aggr_type PROTO((tree, enum tree_code));
3956 extern int is_aggr_type_2 PROTO((tree, tree));
3957 extern const char *lang_printable_name PROTO((tree, int));
3958 extern tree build_exception_variant PROTO((tree, tree));
3959 extern tree copy_template_template_parm PROTO((tree));
3960 extern void print_lang_statistics PROTO((void));
3961 extern void __eprintf
3962 PROTO((const char *, const char *, unsigned, const char *));
3963 extern tree array_type_nelts_total PROTO((tree));
3964 extern tree array_type_nelts_top PROTO((tree));
3965 extern tree break_out_target_exprs PROTO((tree));
3966 extern tree get_type_decl PROTO((tree));
3967 extern tree vec_binfo_member PROTO((tree, tree));
3968 extern tree hack_decl_function_context PROTO((tree));
3969 extern tree decl_namespace_context PROTO((tree));
3970 extern tree lvalue_type PROTO((tree));
3971 extern tree error_type PROTO((tree));
3972 extern tree build_ptr_wrapper PROTO((void *));
3973 extern tree build_expr_ptr_wrapper PROTO((void *));
3974 extern tree build_int_wrapper PROTO((int));
3975 extern tree build_srcloc_here PROTO((void));
3976 extern int varargs_function_p PROTO((tree));
3977 extern int really_overloaded_fn PROTO((tree));
3978 extern int cp_tree_equal PROTO((tree, tree));
3979 extern int can_free PROTO((struct obstack *, tree));
3980 extern tree mapcar PROTO((tree, tree (*) (tree)));
3981 extern tree no_linkage_check PROTO((tree));
3982 extern void debug_binfo PROTO((tree));
3983 extern void push_expression_obstack PROTO((void));
3984 extern void push_permanent_obstack PROTO((void));
3985 extern tree build_dummy_object PROTO((tree));
3986 extern tree maybe_dummy_object PROTO((tree, tree *));
3987 extern int is_dummy_object PROTO((tree));
3988 extern tree search_tree PROTO((tree *, tree (*)(tree *)));
3989 extern int cp_valid_lang_attribute PROTO((tree, tree, tree, tree));
3990 extern tree make_ptrmem_cst PROTO((tree, tree));
3991 extern tree cp_build_qualified_type_real PROTO((tree, int, int));
3992 #define cp_build_qualified_type(TYPE, QUALS) \
3993 cp_build_qualified_type_real ((TYPE), (QUALS), /*complain=*/1)
3995 #define scratchalloc expralloc
3996 #define build_scratch_list build_expr_list
3997 #define push_scratch_obstack push_expression_obstack
3999 /* in typeck.c */
4000 extern int string_conv_p PROTO((tree, tree, int));
4001 extern tree condition_conversion PROTO((tree));
4002 extern tree target_type PROTO((tree));
4003 extern tree require_complete_type PROTO((tree));
4004 extern tree complete_type PROTO((tree));
4005 extern tree complete_type_or_else PROTO((tree, tree));
4006 extern int type_unknown_p PROTO((tree));
4007 extern int fntype_p PROTO((tree));
4008 extern tree commonparms PROTO((tree, tree));
4009 extern tree original_type PROTO((tree));
4010 extern tree common_type PROTO((tree, tree));
4011 extern int comp_except_specs PROTO((tree, tree, int));
4012 extern int comptypes PROTO((tree, tree, int));
4013 extern int comp_target_types PROTO((tree, tree, int));
4014 extern int compparms PROTO((tree, tree));
4015 extern int comp_target_types PROTO((tree, tree, int));
4016 extern int comp_cv_qualification PROTO((tree, tree));
4017 extern int comp_cv_qual_signature PROTO((tree, tree));
4018 extern tree unsigned_type PROTO((tree));
4019 extern tree signed_type PROTO((tree));
4020 extern tree signed_or_unsigned_type PROTO((int, tree));
4021 extern tree expr_sizeof PROTO((tree));
4022 extern tree c_sizeof PROTO((tree));
4023 extern tree c_sizeof_nowarn PROTO((tree));
4024 extern tree c_alignof PROTO((tree));
4025 extern tree inline_conversion PROTO((tree));
4026 extern tree decay_conversion PROTO((tree));
4027 extern tree default_conversion PROTO((tree));
4028 extern tree build_object_ref PROTO((tree, tree, tree));
4029 extern tree build_component_ref_1 PROTO((tree, tree, int));
4030 extern tree build_component_ref PROTO((tree, tree, tree, int));
4031 extern tree build_x_component_ref PROTO((tree, tree, tree, int));
4032 extern tree build_x_indirect_ref PROTO((tree, const char *));
4033 extern tree build_indirect_ref PROTO((tree, const char *));
4034 extern tree build_array_ref PROTO((tree, tree));
4035 extern tree build_x_function_call PROTO((tree, tree, tree));
4036 extern tree get_member_function_from_ptrfunc PROTO((tree *, tree));
4037 extern tree build_function_call_real PROTO((tree, tree, int, int));
4038 extern tree build_function_call PROTO((tree, tree));
4039 extern tree build_function_call_maybe PROTO((tree, tree));
4040 extern tree convert_arguments PROTO((tree, tree, tree, int));
4041 extern tree build_x_binary_op PROTO((enum tree_code, tree, tree));
4042 extern tree build_binary_op PROTO((enum tree_code, tree, tree));
4043 extern tree build_binary_op_nodefault PROTO((enum tree_code, tree, tree, enum tree_code));
4044 extern tree build_x_unary_op PROTO((enum tree_code, tree));
4045 extern tree build_unary_op PROTO((enum tree_code, tree, int));
4046 extern tree unary_complex_lvalue PROTO((enum tree_code, tree));
4047 extern int mark_addressable PROTO((tree));
4048 extern tree build_x_conditional_expr PROTO((tree, tree, tree));
4049 extern tree build_conditional_expr PROTO((tree, tree, tree));
4050 extern tree build_x_compound_expr PROTO((tree));
4051 extern tree build_compound_expr PROTO((tree));
4052 extern tree build_static_cast PROTO((tree, tree));
4053 extern tree build_reinterpret_cast PROTO((tree, tree));
4054 extern tree build_const_cast PROTO((tree, tree));
4055 extern tree build_c_cast PROTO((tree, tree));
4056 extern tree build_x_modify_expr PROTO((tree, enum tree_code, tree));
4057 extern tree build_modify_expr PROTO((tree, enum tree_code, tree));
4058 extern tree convert_for_initialization PROTO((tree, tree, tree, int, const char *, tree, int));
4059 extern void c_expand_asm_operands PROTO((tree, tree, tree, tree, int, char *, int));
4060 extern void c_expand_return PROTO((tree));
4061 extern tree c_expand_start_case PROTO((tree));
4062 extern int comp_ptr_ttypes PROTO((tree, tree));
4063 extern int ptr_reasonably_similar PROTO((tree, tree));
4064 extern tree build_ptrmemfunc PROTO((tree, tree, int));
4065 extern tree strip_array_types PROTO((tree));
4066 extern int cp_type_quals PROTO((tree));
4067 extern int cp_has_mutable_p PROTO((tree));
4068 extern int at_least_as_qualified_p PROTO((tree, tree));
4069 extern int more_qualified_p PROTO((tree, tree));
4070 extern tree build_ptrmemfunc1 PROTO((tree, tree, tree, tree, tree));
4071 extern void expand_ptrmemfunc_cst PROTO((tree, tree *, tree *, tree *, tree *));
4072 extern tree delta2_from_ptrmemfunc PROTO((tree));
4073 extern tree pfn_from_ptrmemfunc PROTO((tree));
4074 extern tree type_after_usual_arithmetic_conversions PROTO((tree, tree));
4075 extern tree composite_pointer_type PROTO((tree, tree, tree, tree,
4076 const char*));
4077 extern tree check_return_expr PROTO((tree));
4079 /* in typeck2.c */
4080 extern tree error_not_base_type PROTO((tree, tree));
4081 extern tree binfo_or_else PROTO((tree, tree));
4082 extern void readonly_error PROTO((tree, const char *, int));
4083 extern int abstract_virtuals_error PROTO((tree, tree));
4084 extern void incomplete_type_error PROTO((tree, tree));
4085 extern void my_friendly_abort PROTO((int))
4086 ATTRIBUTE_NORETURN;
4087 extern void my_friendly_assert PROTO((int, int));
4088 extern tree store_init_value PROTO((tree, tree));
4089 extern tree digest_init PROTO((tree, tree, tree *));
4090 extern tree build_scoped_ref PROTO((tree, tree));
4091 extern tree build_x_arrow PROTO((tree));
4092 extern tree build_m_component_ref PROTO((tree, tree));
4093 extern tree build_functional_cast PROTO((tree, tree));
4094 extern char *enum_name_string PROTO((tree, tree));
4095 extern void report_case_error PROTO((int, tree, tree, tree));
4096 extern void check_for_new_type PROTO((const char *, flagged_type_tree));
4097 extern tree add_exception_specifier PROTO((tree, tree, int));
4099 /* in xref.c */
4100 extern void GNU_xref_begin PROTO((const char *));
4101 extern void GNU_xref_end PROTO((int));
4102 extern void GNU_xref_file PROTO((const char *));
4103 extern void GNU_xref_start_scope PROTO((HOST_WIDE_INT));
4104 extern void GNU_xref_end_scope PROTO((HOST_WIDE_INT, HOST_WIDE_INT, int, int));
4105 extern void GNU_xref_ref PROTO((tree, const char *));
4106 extern void GNU_xref_decl PROTO((tree, tree));
4107 extern void GNU_xref_call PROTO((tree, const char *));
4108 extern void GNU_xref_function PROTO((tree, tree));
4109 extern void GNU_xref_assign PROTO((tree));
4110 extern void GNU_xref_hier PROTO((tree, tree, int, int, int));
4111 extern void GNU_xref_member PROTO((tree, tree));
4113 /* in dump.c */
4114 extern void dump_node_to_file PROTO ((tree, const char *));
4116 /* -- end of C++ */
4118 #endif /* not _CP_TREE_H */