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