source: trunk/third/gcc/cp/cp-tree.h @ 8834

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