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