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