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