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