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