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