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