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