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