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