OSDN Git Service

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