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