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