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