OSDN Git Service

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