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