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