00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef GCC_CP_TREE_H
00028 #define GCC_CP_TREE_H
00029
00030 #include "function.h"
00031 #include "hashtab.h"
00032 #include "splay-tree.h"
00033 #include "varray.h"
00034
00035 #ifndef __GNUC__
00036 #error "You should be using 'make bootstrap' -- see installation instructions"
00037 #endif
00038
00039 #include "c-common.h"
00040
00041 struct diagnostic_context;
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162 #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
00163
00164 #define VAR_OR_FUNCTION_DECL_CHECK(NODE) \
00165 ({ const tree __t = (NODE); \
00166 enum tree_code const __c = TREE_CODE(__t); \
00167 if (__c != VAR_DECL && __c != FUNCTION_DECL) \
00168 tree_check_failed (__t, VAR_DECL, __FILE__, __LINE__, \
00169 __FUNCTION__); \
00170 __t; })
00171
00172 #define VAR_FUNCTION_OR_PARM_DECL_CHECK(NODE) \
00173 ({ const tree __t = (NODE); \
00174 enum tree_code const __c = TREE_CODE(__t); \
00175 if (__c != VAR_DECL \
00176 && __c != FUNCTION_DECL \
00177 && __c != PARM_DECL) \
00178 tree_check_failed (__t, VAR_DECL, __FILE__, __LINE__, \
00179 __FUNCTION__); \
00180 __t; })
00181
00182 #define VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK(NODE) \
00183 ({ const tree __t = (NODE); \
00184 enum tree_code const __c = TREE_CODE(__t); \
00185 if (__c != VAR_DECL \
00186 && __c != FUNCTION_DECL \
00187 && __c != TYPE_DECL \
00188 && __c != TEMPLATE_DECL) \
00189 tree_check_failed (__t, VAR_DECL, __FILE__, __LINE__, \
00190 __FUNCTION__); \
00191 __t; })
00192
00193 #define RECORD_OR_UNION_TYPE_CHECK(NODE) \
00194 ({ const tree __t = (NODE); \
00195 enum tree_code const __c = TREE_CODE(__t); \
00196 if (__c != RECORD_TYPE && __c != UNION_TYPE) \
00197 tree_check_failed (__t, RECORD_TYPE, __FILE__, __LINE__, \
00198 __FUNCTION__); \
00199 __t; })
00200
00201 #define BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK(NODE) \
00202 ({ const tree __t = (NODE); \
00203 enum tree_code const __c = TREE_CODE(__t); \
00204 if (__c != BOUND_TEMPLATE_TEMPLATE_PARM) \
00205 tree_check_failed (__t, BOUND_TEMPLATE_TEMPLATE_PARM, \
00206 __FILE__, __LINE__, __FUNCTION__); \
00207 __t; })
00208
00209 #else
00210
00211 #define VAR_OR_FUNCTION_DECL_CHECK(NODE) (NODE)
00212 #define VAR_FUNCTION_OR_PARM_DECL_CHECK(NODE) (NODE)
00213 #define VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK(NODE) (NODE)
00214 #define RECORD_OR_UNION_TYPE_CHECK(NODE) (NODE)
00215 #define BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK(NODE) (NODE)
00216
00217 #endif
00218
00219
00220
00221
00222 #define abi_version_at_least(N) \
00223 (flag_abi_version == 0 || flag_abi_version >= (N))
00224
00225
00226
00227
00228 typedef struct cxx_saved_binding cxx_saved_binding;
00229
00230
00231
00232 typedef struct cxx_binding cxx_binding;
00233
00234
00235 #define cxx_binding_make() (ggc_alloc (sizeof (cxx_binding)))
00236
00237
00238 #define cxx_binding_clear(B) memset ((B), 0, sizeof (cxx_binding))
00239
00240 struct cxx_binding GTY(())
00241 {
00242
00243 cxx_binding *previous;
00244
00245 tree value;
00246
00247 tree type;
00248 union tree_binding_u {
00249 tree GTY ((tag ("0"))) scope;
00250 struct cp_binding_level * GTY ((tag ("1"))) level;
00251 } GTY ((desc ("%0.has_level"))) scope;
00252 unsigned has_level : 1;
00253 unsigned value_is_inherited : 1;
00254 unsigned is_local : 1;
00255 };
00256
00257
00258
00259 typedef struct binding_table_s *binding_table;
00260 typedef struct binding_entry_s *binding_entry;
00261
00262
00263 typedef void (*bt_foreach_proc) (binding_entry, void *);
00264
00265 struct binding_entry_s GTY(())
00266 {
00267 binding_entry chain;
00268 tree name;
00269 tree type;
00270 };
00271
00272 extern void binding_table_foreach (binding_table, bt_foreach_proc, void *);
00273 extern binding_entry binding_table_find (binding_table, tree);
00274 extern void cxx_remember_type_decls (binding_table);
00275
00276
00277
00278 struct lang_identifier GTY(())
00279 {
00280 struct c_common_identifier c_common;
00281 cxx_binding *namespace_bindings;
00282 cxx_binding *bindings;
00283 tree class_value;
00284 tree class_template_info;
00285 struct lang_id2 *x;
00286 };
00287
00288
00289
00290
00291
00292 #define C_IS_RESERVED_WORD(ID) TREE_LANG_FLAG_5 (ID)
00293
00294 extern const short rid_to_yy[RID_MAX];
00295 #define C_RID_YYCODE(ID) rid_to_yy[C_RID_CODE (ID)]
00296
00297 #define LANG_IDENTIFIER_CAST(NODE) \
00298 ((struct lang_identifier*)IDENTIFIER_NODE_CHECK (NODE))
00299
00300 struct lang_id2 GTY(())
00301 {
00302 tree label_value;
00303 tree implicit_decl;
00304 tree error_locus;
00305 };
00306
00307 typedef struct flagged_type_tree_s GTY(())
00308 {
00309 tree t;
00310 int new_type_flag;
00311 tree lookups;
00312 } flagged_type_tree;
00313
00314 typedef struct template_parm_index_s GTY(())
00315 {
00316 struct tree_common common;
00317 HOST_WIDE_INT index;
00318 HOST_WIDE_INT level;
00319 HOST_WIDE_INT orig_level;
00320 tree decl;
00321 } template_parm_index;
00322
00323 struct ptrmem_cst GTY(())
00324 {
00325 struct tree_common common;
00326
00327
00328 rtx rtl;
00329 tree member;
00330 };
00331 typedef struct ptrmem_cst * ptrmem_cst_t;
00332
00333
00334
00335 #define LOCAL_BINDING_P(NODE) ((NODE)->is_local)
00336
00337
00338
00339 #define INHERITED_VALUE_BINDING_P(NODE) ((NODE)->value_is_inherited)
00340
00341
00342
00343
00344
00345
00346 #define BINDING_SCOPE(NODE) ((NODE)->scope.scope)
00347
00348
00349 #define BINDING_HAS_LEVEL_P(NODE) ((NODE)->has_level)
00350
00351
00352
00353 #define BINDING_VALUE(NODE) ((NODE)->value)
00354
00355
00356 #define BINDING_TYPE(NODE) ((NODE)->type)
00357
00358 #define IDENTIFIER_GLOBAL_VALUE(NODE) \
00359 namespace_binding ((NODE), global_namespace)
00360 #define SET_IDENTIFIER_GLOBAL_VALUE(NODE, VAL) \
00361 set_namespace_binding ((NODE), global_namespace, (VAL))
00362 #define IDENTIFIER_NAMESPACE_VALUE(NODE) \
00363 namespace_binding ((NODE), current_namespace)
00364 #define SET_IDENTIFIER_NAMESPACE_VALUE(NODE, VAL) \
00365 set_namespace_binding ((NODE), current_namespace, (VAL))
00366
00367 #define CLEANUP_P(NODE) TREE_LANG_FLAG_0 (TRY_BLOCK_CHECK (NODE))
00368
00369
00370
00371 #define same_type_p(TYPE1, TYPE2) \
00372 comptypes ((TYPE1), (TYPE2), COMPARE_STRICT)
00373
00374
00375
00376 #define same_type_ignoring_top_level_qualifiers_p(TYPE1, TYPE2) \
00377 same_type_p (TYPE_MAIN_VARIANT (TYPE1), TYPE_MAIN_VARIANT (TYPE2))
00378
00379
00380
00381 #define building_stmt_tree() (last_tree != NULL_TREE)
00382
00383
00384
00385 #define DECL_MAIN_P(NODE) \
00386 (DECL_EXTERN_C_FUNCTION_P (NODE) \
00387 && DECL_NAME (NODE) != NULL_TREE \
00388 && MAIN_NAME_P (DECL_NAME (NODE)))
00389
00390
00391 #define OVL_FUNCTION(NODE) \
00392 (((struct tree_overload*)OVERLOAD_CHECK (NODE))->function)
00393 #define OVL_CHAIN(NODE) TREE_CHAIN (NODE)
00394
00395 #define OVL_CURRENT(NODE) \
00396 ((TREE_CODE (NODE) == OVERLOAD) ? OVL_FUNCTION (NODE) : (NODE))
00397 #define OVL_NEXT(NODE) \
00398 ((TREE_CODE (NODE) == OVERLOAD) ? TREE_CHAIN (NODE) : NULL_TREE)
00399
00400
00401
00402 #define OVL_USED(NODE) TREE_USED (NODE)
00403
00404 struct tree_overload GTY(())
00405 {
00406 struct tree_common common;
00407 tree function;
00408 };
00409
00410
00411 #define BASELINK_P(NODE) \
00412 (TREE_CODE (NODE) == BASELINK)
00413
00414 #define BASELINK_BINFO(NODE) \
00415 (TREE_OPERAND (BASELINK_CHECK (NODE), 0))
00416
00417
00418 #define BASELINK_FUNCTIONS(NODE) \
00419 (TREE_OPERAND (BASELINK_CHECK (NODE), 1))
00420
00421
00422
00423 #define BASELINK_ACCESS_BINFO(NODE) \
00424 (TREE_OPERAND (BASELINK_CHECK (NODE), 2))
00425
00426
00427
00428
00429
00430 #define BASELINK_OPTYPE(NODE) \
00431 (TREE_CHAIN (BASELINK_CHECK (NODE)))
00432
00433 #define WRAPPER_ZC(NODE) (((struct tree_wrapper*)WRAPPER_CHECK (NODE))->z_c)
00434
00435 struct tree_wrapper GTY(())
00436 {
00437 struct tree_common common;
00438 struct z_candidate *z_c;
00439 };
00440
00441 #define SRCLOC_FILE(NODE) (((struct tree_srcloc*)SRCLOC_CHECK (NODE))->filename)
00442 #define SRCLOC_LINE(NODE) (((struct tree_srcloc*)SRCLOC_CHECK (NODE))->linenum)
00443 struct tree_srcloc GTY(())
00444 {
00445 struct tree_common common;
00446 const char *filename;
00447 int linenum;
00448 };
00449
00450
00451
00452 #define IDENTIFIER_NAMESPACE_BINDINGS(NODE) \
00453 (LANG_IDENTIFIER_CAST (NODE)->namespace_bindings)
00454 #define IDENTIFIER_TEMPLATE(NODE) \
00455 (LANG_IDENTIFIER_CAST (NODE)->class_template_info)
00456
00457
00458
00459
00460
00461
00462
00463
00464 #define IDENTIFIER_BINDING(NODE) \
00465 (LANG_IDENTIFIER_CAST (NODE)->bindings)
00466
00467
00468
00469 #define IDENTIFIER_VALUE(NODE) \
00470 (IDENTIFIER_BINDING (NODE) ? BINDING_VALUE (IDENTIFIER_BINDING (NODE)) : 0)
00471
00472
00473
00474
00475
00476
00477 #define IDENTIFIER_CLASS_VALUE(NODE) \
00478 (LANG_IDENTIFIER_CAST (NODE)->class_value)
00479
00480
00481
00482
00483
00484 #define IDENTIFIER_TYPE_VALUE(NODE) identifier_type_value (NODE)
00485 #define REAL_IDENTIFIER_TYPE_VALUE(NODE) TREE_TYPE (NODE)
00486 #define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (TREE_TYPE (NODE) = (TYPE))
00487 #define IDENTIFIER_HAS_TYPE_VALUE(NODE) (IDENTIFIER_TYPE_VALUE (NODE) ? 1 : 0)
00488
00489 #define LANG_ID_FIELD(NAME, NODE) \
00490 (LANG_IDENTIFIER_CAST (NODE)->x \
00491 ? LANG_IDENTIFIER_CAST (NODE)->x->NAME : 0)
00492
00493 #define SET_LANG_ID(NODE, VALUE, NAME) \
00494 (LANG_IDENTIFIER_CAST (NODE)->x == 0 \
00495 ? LANG_IDENTIFIER_CAST (NODE)->x \
00496 = (struct lang_id2 *)ggc_alloc_cleared (sizeof (struct lang_id2)) : 0, \
00497 LANG_IDENTIFIER_CAST (NODE)->x->NAME = (VALUE))
00498
00499 #define IDENTIFIER_LABEL_VALUE(NODE) \
00500 LANG_ID_FIELD (label_value, NODE)
00501 #define SET_IDENTIFIER_LABEL_VALUE(NODE, VALUE) \
00502 SET_LANG_ID (NODE, VALUE, label_value)
00503
00504 #define IDENTIFIER_IMPLICIT_DECL(NODE) \
00505 LANG_ID_FIELD (implicit_decl, NODE)
00506 #define SET_IDENTIFIER_IMPLICIT_DECL(NODE, VALUE) \
00507 SET_LANG_ID (NODE, VALUE, implicit_decl)
00508
00509 #define IDENTIFIER_ERROR_LOCUS(NODE) \
00510 LANG_ID_FIELD (error_locus, NODE)
00511 #define SET_IDENTIFIER_ERROR_LOCUS(NODE, VALUE) \
00512 SET_LANG_ID (NODE, VALUE, error_locus)
00513
00514
00515
00516 #define IDENTIFIER_VIRTUAL_P(NODE) TREE_LANG_FLAG_1 (NODE)
00517
00518
00519
00520 #define IDENTIFIER_OPNAME_P(NODE) TREE_LANG_FLAG_2 (NODE)
00521
00522
00523
00524 #define IDENTIFIER_TYPENAME_P(NODE) \
00525 TREE_LANG_FLAG_4 (NODE)
00526
00527
00528
00529 #define IDENTIFIER_CTOR_OR_DTOR_P(NODE) \
00530 TREE_LANG_FLAG_3 (NODE)
00531
00532
00533 #define C_TYPE_FIELDS_READONLY(TYPE) TYPE_LANG_FLAG_0 (TYPE)
00534
00535
00536 #define C_SET_EXP_ORIGINAL_CODE(EXP, CODE) \
00537 (TREE_COMPLEXITY (EXP) = (int)(CODE))
00538
00539 enum cp_tree_node_structure_enum {
00540 TS_CP_COMMON,
00541 TS_CP_GENERIC,
00542 TS_CP_IDENTIFIER,
00543 TS_CP_TPI,
00544 TS_CP_PTRMEM,
00545 TS_CP_OVERLOAD,
00546 TS_CP_WRAPPER,
00547 TS_CP_SRCLOC,
00548 LAST_TS_CP_ENUM
00549 };
00550
00551
00552 union lang_tree_node GTY((desc ("cp_tree_node_structure (&%h)"),
00553 chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
00554 {
00555 struct tree_common GTY ((tag ("TS_CP_COMMON"))) common;
00556 union tree_node GTY ((tag ("TS_CP_GENERIC"),
00557 desc ("tree_node_structure (&%h)"))) generic;
00558 struct template_parm_index_s GTY ((tag ("TS_CP_TPI"))) tpi;
00559 struct ptrmem_cst GTY ((tag ("TS_CP_PTRMEM"))) ptrmem;
00560 struct tree_overload GTY ((tag ("TS_CP_OVERLOAD"))) overload;
00561 struct tree_wrapper GTY ((tag ("TS_CP_WRAPPER"))) wrapper;
00562 struct tree_srcloc GTY ((tag ("TS_CP_SRCLOC"))) srcloc;
00563 struct lang_identifier GTY ((tag ("TS_CP_IDENTIFIER"))) identifier;
00564 };
00565
00566
00567 enum cp_tree_index
00568 {
00569 CPTI_JAVA_BYTE_TYPE,
00570 CPTI_JAVA_SHORT_TYPE,
00571 CPTI_JAVA_INT_TYPE,
00572 CPTI_JAVA_LONG_TYPE,
00573 CPTI_JAVA_FLOAT_TYPE,
00574 CPTI_JAVA_DOUBLE_TYPE,
00575 CPTI_JAVA_CHAR_TYPE,
00576 CPTI_JAVA_BOOLEAN_TYPE,
00577
00578 CPTI_WCHAR_DECL,
00579 CPTI_VTABLE_ENTRY_TYPE,
00580 CPTI_DELTA_TYPE,
00581 CPTI_VTABLE_INDEX_TYPE,
00582 CPTI_CLEANUP_TYPE,
00583 CPTI_VTT_PARM_TYPE,
00584
00585 CPTI_TI_DESC_TYPE,
00586 CPTI_BLTN_DESC_TYPE,
00587 CPTI_PTR_DESC_TYPE,
00588 CPTI_ARY_DESC_TYPE,
00589 CPTI_FUNC_DESC_TYPE,
00590 CPTI_ENUM_DESC_TYPE,
00591 CPTI_CLASS_DESC_TYPE,
00592 CPTI_SI_CLASS_DESC_TYPE,
00593 CPTI_VMI_CLASS_DESC_TYPE,
00594 CPTI_PTM_DESC_TYPE,
00595 CPTI_BASE_DESC_TYPE,
00596
00597 CPTI_CLASS_TYPE,
00598 CPTI_RECORD_TYPE,
00599 CPTI_UNION_TYPE,
00600 CPTI_ENUM_TYPE,
00601 CPTI_UNKNOWN_TYPE,
00602 CPTI_VTBL_TYPE,
00603 CPTI_VTBL_PTR_TYPE,
00604 CPTI_STD,
00605 CPTI_ABI,
00606 CPTI_TYPE_INFO_TYPE,
00607 CPTI_TYPE_INFO_PTR_TYPE,
00608 CPTI_ABORT_FNDECL,
00609 CPTI_GLOBAL_DELETE_FNDECL,
00610 CPTI_AGGR_TAG,
00611
00612 CPTI_ACCESS_DEFAULT,
00613 CPTI_ACCESS_PUBLIC,
00614 CPTI_ACCESS_PROTECTED,
00615 CPTI_ACCESS_PRIVATE,
00616 CPTI_ACCESS_DEFAULT_VIRTUAL,
00617 CPTI_ACCESS_PUBLIC_VIRTUAL,
00618 CPTI_ACCESS_PROTECTED_VIRTUAL,
00619 CPTI_ACCESS_PRIVATE_VIRTUAL,
00620
00621 CPTI_CTOR_IDENTIFIER,
00622 CPTI_COMPLETE_CTOR_IDENTIFIER,
00623 CPTI_BASE_CTOR_IDENTIFIER,
00624 CPTI_DTOR_IDENTIFIER,
00625 CPTI_COMPLETE_DTOR_IDENTIFIER,
00626 CPTI_BASE_DTOR_IDENTIFIER,
00627 CPTI_DELETING_DTOR_IDENTIFIER,
00628 CPTI_DELTA_IDENTIFIER,
00629 CPTI_IN_CHARGE_IDENTIFIER,
00630 CPTI_VTT_PARM_IDENTIFIER,
00631 CPTI_NELTS_IDENTIFIER,
00632 CPTI_THIS_IDENTIFIER,
00633 CPTI_PFN_IDENTIFIER,
00634 CPTI_VPTR_IDENTIFIER,
00635 CPTI_STD_IDENTIFIER,
00636
00637 CPTI_LANG_NAME_C,
00638 CPTI_LANG_NAME_CPLUSPLUS,
00639 CPTI_LANG_NAME_JAVA,
00640
00641 CPTI_EMPTY_EXCEPT_SPEC,
00642 CPTI_NULL,
00643 CPTI_JCLASS,
00644 CPTI_TERMINATE,
00645 CPTI_CALL_UNEXPECTED,
00646 CPTI_ATEXIT,
00647 CPTI_DSO_HANDLE,
00648 CPTI_DCAST,
00649
00650 CPTI_KEYED_CLASSES,
00651
00652 CPTI_MAX
00653 };
00654
00655 extern GTY(()) tree cp_global_trees[CPTI_MAX];
00656
00657 #define java_byte_type_node cp_global_trees[CPTI_JAVA_BYTE_TYPE]
00658 #define java_short_type_node cp_global_trees[CPTI_JAVA_SHORT_TYPE]
00659 #define java_int_type_node cp_global_trees[CPTI_JAVA_INT_TYPE]
00660 #define java_long_type_node cp_global_trees[CPTI_JAVA_LONG_TYPE]
00661 #define java_float_type_node cp_global_trees[CPTI_JAVA_FLOAT_TYPE]
00662 #define java_double_type_node cp_global_trees[CPTI_JAVA_DOUBLE_TYPE]
00663 #define java_char_type_node cp_global_trees[CPTI_JAVA_CHAR_TYPE]
00664 #define java_boolean_type_node cp_global_trees[CPTI_JAVA_BOOLEAN_TYPE]
00665
00666 #define wchar_decl_node cp_global_trees[CPTI_WCHAR_DECL]
00667 #define vtable_entry_type cp_global_trees[CPTI_VTABLE_ENTRY_TYPE]
00668 /* The type used to represent an offset by which to adjust the `this'
00669 pointer in pointer-to-member types. */
00670 #define delta_type_node cp_global_trees[CPTI_DELTA_TYPE]
00671 /* The type used to represent an index into the vtable. */
00672 #define vtable_index_type cp_global_trees[CPTI_VTABLE_INDEX_TYPE]
00673
00674 #define ti_desc_type_node cp_global_trees[CPTI_TI_DESC_TYPE]
00675 #define bltn_desc_type_node cp_global_trees[CPTI_BLTN_DESC_TYPE]
00676 #define ptr_desc_type_node cp_global_trees[CPTI_PTR_DESC_TYPE]
00677 #define ary_desc_type_node cp_global_trees[CPTI_ARY_DESC_TYPE]
00678 #define func_desc_type_node cp_global_trees[CPTI_FUNC_DESC_TYPE]
00679 #define enum_desc_type_node cp_global_trees[CPTI_ENUM_DESC_TYPE]
00680 #define class_desc_type_node cp_global_trees[CPTI_CLASS_DESC_TYPE]
00681 #define si_class_desc_type_node cp_global_trees[CPTI_SI_CLASS_DESC_TYPE]
00682 #define vmi_class_desc_type_node cp_global_trees[CPTI_VMI_CLASS_DESC_TYPE]
00683 #define ptm_desc_type_node cp_global_trees[CPTI_PTM_DESC_TYPE]
00684 #define base_desc_type_node cp_global_trees[CPTI_BASE_DESC_TYPE]
00685
00686 #define class_type_node cp_global_trees[CPTI_CLASS_TYPE]
00687 #define record_type_node cp_global_trees[CPTI_RECORD_TYPE]
00688 #define union_type_node cp_global_trees[CPTI_UNION_TYPE]
00689 #define enum_type_node cp_global_trees[CPTI_ENUM_TYPE]
00690 #define unknown_type_node cp_global_trees[CPTI_UNKNOWN_TYPE]
00691 #define vtbl_type_node cp_global_trees[CPTI_VTBL_TYPE]
00692 #define vtbl_ptr_type_node cp_global_trees[CPTI_VTBL_PTR_TYPE]
00693 #define std_node cp_global_trees[CPTI_STD]
00694 #define abi_node cp_global_trees[CPTI_ABI]
00695 #define type_info_type_node cp_global_trees[CPTI_TYPE_INFO_TYPE]
00696 #define type_info_ptr_type cp_global_trees[CPTI_TYPE_INFO_PTR_TYPE]
00697 #define abort_fndecl cp_global_trees[CPTI_ABORT_FNDECL]
00698 #define global_delete_fndecl cp_global_trees[CPTI_GLOBAL_DELETE_FNDECL]
00699 #define current_aggr cp_global_trees[CPTI_AGGR_TAG]
00700
00701 /* Define the sets of attributes that member functions and baseclasses
00702 can have. These are sensible combinations of {public,private,protected}
00703 cross {virtual,non-virtual}. */
00704
00705 #define access_default_node cp_global_trees[CPTI_ACCESS_DEFAULT]
00706 #define access_public_node cp_global_trees[CPTI_ACCESS_PUBLIC]
00707 #define access_protected_node cp_global_trees[CPTI_ACCESS_PROTECTED]
00708 #define access_private_node cp_global_trees[CPTI_ACCESS_PRIVATE]
00709 #define access_default_virtual_node cp_global_trees[CPTI_ACCESS_DEFAULT_VIRTUAL]
00710 #define access_public_virtual_node cp_global_trees[CPTI_ACCESS_PUBLIC_VIRTUAL]
00711 #define access_protected_virtual_node cp_global_trees[CPTI_ACCESS_PROTECTED_VIRTUAL]
00712 #define access_private_virtual_node cp_global_trees[CPTI_ACCESS_PRIVATE_VIRTUAL]
00713
00714 /* We cache these tree nodes so as to call get_identifier less
00715 frequently. */
00716
00717 /* The name of a constructor that takes an in-charge parameter to
00718 decide whether or not to construct virtual base classes. */
00719 #define ctor_identifier cp_global_trees[CPTI_CTOR_IDENTIFIER]
00720 /* The name of a constructor that constructs virtual base classes. */
00721 #define complete_ctor_identifier cp_global_trees[CPTI_COMPLETE_CTOR_IDENTIFIER]
00722 /* The name of a constructor that does not construct virtual base classes. */
00723 #define base_ctor_identifier cp_global_trees[CPTI_BASE_CTOR_IDENTIFIER]
00724 /* The name of a destructor that takes an in-charge parameter to
00725 decide whether or not to destroy virtual base classes and whether
00726 or not to delete the object. */
00727 #define dtor_identifier cp_global_trees[CPTI_DTOR_IDENTIFIER]
00728 /* The name of a destructor that destroys virtual base classes. */
00729 #define complete_dtor_identifier cp_global_trees[CPTI_COMPLETE_DTOR_IDENTIFIER]
00730 /* The name of a destructor that does not destroy virtual base
00731 classes. */
00732 #define base_dtor_identifier cp_global_trees[CPTI_BASE_DTOR_IDENTIFIER]
00733 /* The name of a destructor that destroys virtual base classes, and
00734 then deletes the entire object. */
00735 #define deleting_dtor_identifier cp_global_trees[CPTI_DELETING_DTOR_IDENTIFIER]
00736 #define delta_identifier cp_global_trees[CPTI_DELTA_IDENTIFIER]
00737 #define in_charge_identifier cp_global_trees[CPTI_IN_CHARGE_IDENTIFIER]
00738 /* The name of the parameter that contains a pointer to the VTT to use
00739 for this subobject constructor or destructor. */
00740 #define vtt_parm_identifier cp_global_trees[CPTI_VTT_PARM_IDENTIFIER]
00741 #define nelts_identifier cp_global_trees[CPTI_NELTS_IDENTIFIER]
00742 #define this_identifier cp_global_trees[CPTI_THIS_IDENTIFIER]
00743 #define pfn_identifier cp_global_trees[CPTI_PFN_IDENTIFIER]
00744 #define vptr_identifier cp_global_trees[CPTI_VPTR_IDENTIFIER]
00745 /* The name of the std namespace. */
00746 #define std_identifier cp_global_trees[CPTI_STD_IDENTIFIER]
00747 #define lang_name_c cp_global_trees[CPTI_LANG_NAME_C]
00748 #define lang_name_cplusplus cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS]
00749 #define lang_name_java cp_global_trees[CPTI_LANG_NAME_JAVA]
00750
00751 /* Exception specifier used for throw(). */
00752 #define empty_except_spec cp_global_trees[CPTI_EMPTY_EXCEPT_SPEC]
00753
00754 /* The node for `__null'. */
00755 #define null_node cp_global_trees[CPTI_NULL]
00756
00757 /* If non-NULL, a POINTER_TYPE equivalent to (java::lang::Class*). */
00758 #define jclass_node cp_global_trees[CPTI_JCLASS]
00759
00760 /* The declaration for `std::terminate'. */
00761 #define terminate_node cp_global_trees[CPTI_TERMINATE]
00762
00763 /* The declaration for "__cxa_call_unexpected". */
00764 #define call_unexpected_node cp_global_trees[CPTI_CALL_UNEXPECTED]
00765
00766 /* A pointer to `std::atexit'. */
00767 #define atexit_node cp_global_trees[CPTI_ATEXIT]
00768
00769 /* A pointer to `__dso_handle'. */
00770 #define dso_handle_node cp_global_trees[CPTI_DSO_HANDLE]
00771
00772 /* The declaration of the dynamic_cast runtime. */
00773 #define dynamic_cast_node cp_global_trees[CPTI_DCAST]
00774
00775 /* The type of a destructor. */
00776 #define cleanup_type cp_global_trees[CPTI_CLEANUP_TYPE]
00777
00778 /* The type of the vtt parameter passed to subobject constructors and
00779 destructors. */
00780 #define vtt_parm_type cp_global_trees[CPTI_VTT_PARM_TYPE]
00781
00782 /* A TREE_LIST of the dynamic classes whose vtables may have to be
00783 emitted in this translation unit. */
00784
00785 #define keyed_classes cp_global_trees[CPTI_KEYED_CLASSES]
00786
00787 /* Global state. */
00788
00789 struct saved_scope GTY(())
00790 {
00791 cxx_saved_binding *old_bindings;
00792 tree old_namespace;
00793 tree decl_ns_list;
00794 tree class_name;
00795 tree class_type;
00796 tree access_specifier;
00797 tree function_decl;
00798 varray_type lang_base;
00799 tree lang_name;
00800 tree template_parms;
00801 tree x_previous_class_type;
00802 tree x_previous_class_values;
00803 tree x_saved_tree;
00804 tree lookups;
00805 tree last_parms;
00806
00807 HOST_WIDE_INT x_processing_template_decl;
00808 int x_processing_specialization;
00809 int x_processing_explicit_instantiation;
00810 int need_pop_function_context;
00811
00812 struct stmt_tree_s x_stmt_tree;
00813
00814 struct cp_binding_level *class_bindings;
00815 struct cp_binding_level *bindings;
00816
00817 struct saved_scope *prev;
00818 };
00819
00820 /* The current open namespace. */
00821
00822 #define current_namespace scope_chain->old_namespace
00823
00824 /* The stack for namespaces of current declarations. */
00825
00826 #define decl_namespace_list scope_chain->decl_ns_list
00827
00828 /* IDENTIFIER_NODE: name of current class */
00829
00830 #define current_class_name scope_chain->class_name
00831
00832 /* _TYPE: the type of the current class */
00833
00834 #define current_class_type scope_chain->class_type
00835
00836 /* When parsing a class definition, the access specifier most recently
00837 given by the user, or, if no access specifier was given, the
00838 default value appropriate for the kind of class (i.e., struct,
00839 class, or union). */
00840
00841 #define current_access_specifier scope_chain->access_specifier
00842
00843 /* Pointer to the top of the language name stack. */
00844
00845 #define current_lang_base scope_chain->lang_base
00846 #define current_lang_name scope_chain->lang_name
00847
00848 /* Parsing a function declarator leaves a list of parameter names
00849 or a chain or parameter decls here. */
00850
00851 #define current_template_parms scope_chain->template_parms
00852
00853 #define processing_template_decl scope_chain->x_processing_template_decl
00854 #define processing_specialization scope_chain->x_processing_specialization
00855 #define processing_explicit_instantiation scope_chain->x_processing_explicit_instantiation
00856
00857 /* _TYPE: the previous type that was a class */
00858
00859 #define previous_class_type scope_chain->x_previous_class_type
00860
00861 /* This is a copy of the class_shadowed list of the previous class
00862 binding contour when at global scope. It's used to reset
00863 IDENTIFIER_CLASS_VALUEs when entering another class scope (i.e. a
00864 cache miss). */
00865
00866 #define previous_class_values scope_chain->x_previous_class_values
00867
00868 /* A list of private types mentioned, for deferred access checking. */
00869
00870 #define type_lookups scope_chain->lookups
00871
00872 extern GTY(()) struct saved_scope *scope_chain;
00873
00874 struct unparsed_text;
00875
00876 /* Global state pertinent to the current function. */
00877
00878 struct language_function GTY(())
00879 {
00880 struct c_language_function base;
00881
00882 tree x_dtor_label;
00883 tree x_current_class_ptr;
00884 tree x_current_class_ref;
00885 tree x_eh_spec_block;
00886 tree x_in_charge_parm;
00887 tree x_vtt_parm;
00888 tree x_return_value;
00889
00890 int returns_value;
00891 int returns_null;
00892 int returns_abnormally;
00893 int in_function_try_handler;
00894 int in_base_initializer;
00895 int x_expanding_p;
00896
00897 /* True if this function can throw an exception. */
00898 bool can_throw : 1;
00899
00900 struct named_label_use_list *x_named_label_uses;
00901 struct named_label_list *x_named_labels;
00902 struct cp_binding_level *bindings;
00903 varray_type x_local_names;
00904
00905 const char *cannot_inline;
00906 struct unparsed_text *unparsed_inlines;
00907 };
00908
00909 /* The current C++-specific per-function global variables. */
00910
00911 #define cp_function_chain (cfun->language)
00912
00913 /* In a destructor, the point at which all derived class destroying
00914 has been done, just before any base class destroying will be done. */
00915
00916 #define dtor_label cp_function_chain->x_dtor_label
00917
00918 /* When we're processing a member function, current_class_ptr is the
00919 PARM_DECL for the `this' pointer. The current_class_ref is an
00920 expression for `*this'. */
00921
00922 #define current_class_ptr \
00923 (cfun ? cp_function_chain->x_current_class_ptr : NULL_TREE)
00924 #define current_class_ref \
00925 (cfun ? cp_function_chain->x_current_class_ref : NULL_TREE)
00926
00927 /* The EH_SPEC_BLOCK for the exception-specifiers for the current
00928 function, if any. */
00929
00930 #define current_eh_spec_block cp_function_chain->x_eh_spec_block
00931
00932 /* The `__in_chrg' parameter for the current function. Only used for
00933 constructors and destructors. */
00934
00935 #define current_in_charge_parm cp_function_chain->x_in_charge_parm
00936
00937 /* The `__vtt_parm' parameter for the current function. Only used for
00938 constructors and destructors. */
00939
00940 #define current_vtt_parm cp_function_chain->x_vtt_parm
00941
00942 /* Set to 0 at beginning of a function definition, set to 1 if
00943 a return statement that specifies a return value is seen. */
00944
00945 #define current_function_returns_value cp_function_chain->returns_value
00946
00947 /* Set to 0 at beginning of a function definition, set to 1 if
00948 a return statement with no argument is seen. */
00949
00950 #define current_function_returns_null cp_function_chain->returns_null
00951
00952 /* Set to 0 at beginning of a function definition, set to 1 if
00953 a call to a noreturn function is seen. */
00954
00955 #define current_function_returns_abnormally \
00956 cp_function_chain->returns_abnormally
00957
00958 /* Nonzero if we should generate RTL for functions that we process.
00959 When this is zero, we just accumulate tree structure, without
00960 interacting with the back end. */
00961
00962 #define expanding_p cp_function_chain->x_expanding_p
00963
00964 /* Nonzero if we are in the semantic analysis phase for the current
00965 function. */
00966
00967 #define doing_semantic_analysis_p() (!expanding_p)
00968
00969 /* Non-zero if we are processing a base initializer. Zero elsewhere. */
00970 #define in_base_initializer cp_function_chain->in_base_initializer
00971
00972 #define in_function_try_handler cp_function_chain->in_function_try_handler
00973
00974 /* Expression always returned from function, or error_mark_node
00975 otherwise, for use by the automatic named return value optimization. */
00976
00977 #define current_function_return_value \
00978 (cp_function_chain->x_return_value)
00979
00980 extern GTY(()) tree global_namespace;
00981
00982 #define ansi_opname(CODE) \
00983 (operator_name_info[(int) (CODE)].identifier)
00984 #define ansi_assopname(CODE) \
00985 (assignment_operator_name_info[(int) (CODE)].identifier)
00986
00987 /* True if NODE is an erroneous expression. */
00988
00989 #define error_operand_p(NODE) \
00990 ((NODE) == error_mark_node \
00991 || ((NODE) && TREE_TYPE ((NODE)) == error_mark_node))
00992
00993 /* INTERFACE_ONLY nonzero means that we are in an "interface"
00994 section of the compiler. INTERFACE_UNKNOWN nonzero means
00995 we cannot trust the value of INTERFACE_ONLY. If INTERFACE_UNKNOWN
00996 is zero and INTERFACE_ONLY is zero, it means that we are responsible
00997 for exporting definitions that others might need. */
00998 extern int interface_only, interface_unknown;
00999
01000 /* C++ language-specific tree codes. */
01001 #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
01002 enum cplus_tree_code {
01003 CP_DUMMY_TREE_CODE = LAST_C_TREE_CODE,
01004 #include "cp-tree.def"
01005 LAST_CPLUS_TREE_CODE
01006 };
01007 #undef DEFTREECODE
01008
01009 enum languages { lang_c, lang_cplusplus, lang_java };
01010
01011 /* Macros to make error reporting functions' lives easier. */
01012 #define TYPE_IDENTIFIER(NODE) (DECL_NAME (TYPE_NAME (NODE)))
01013 #define TYPE_LINKAGE_IDENTIFIER(NODE) \
01014 (TYPE_IDENTIFIER (TYPE_MAIN_VARIANT (NODE)))
01015 #define TYPE_NAME_STRING(NODE) (IDENTIFIER_POINTER (TYPE_IDENTIFIER (NODE)))
01016 #define TYPE_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (TYPE_IDENTIFIER (NODE)))
01017
01018 #define TYPE_ASSEMBLER_NAME_STRING(NODE) \
01019 (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE))))
01020 #define TYPE_ASSEMBLER_NAME_LENGTH(NODE) \
01021 (IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE))))
01022
01023 /* Nonzero if NODE has no name for linkage purposes. */
01024 #define TYPE_ANONYMOUS_P(NODE) \
01025 (TAGGED_TYPE_P (NODE) && ANON_AGGRNAME_P (TYPE_LINKAGE_IDENTIFIER (NODE)))
01026
01027 /* The _DECL for this _TYPE. */
01028 #define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE)))
01029
01030 /* Nonzero if T is a class (or struct or union) type. Also nonzero
01031 for template type parameters, typename types, and instantiated
01032 template template parameters. Despite its name,
01033 this macro has nothing to do with the definition of aggregate given
01034 in the standard. Think of this macro as MAYBE_CLASS_TYPE_P. */
01035 #define IS_AGGR_TYPE(T) \
01036 (TREE_CODE (T) == TEMPLATE_TYPE_PARM \
01037 || TREE_CODE (T) == TYPENAME_TYPE \
01038 || TREE_CODE (T) == TYPEOF_TYPE \
01039 || TREE_CODE (T) == BOUND_TEMPLATE_TEMPLATE_PARM \
01040 || TYPE_LANG_FLAG_5 (T))
01041
01042 /* Set IS_AGGR_TYPE for T to VAL. T must be a class, struct, or
01043 union type. */
01044 #define SET_IS_AGGR_TYPE(T, VAL) \
01045 (TYPE_LANG_FLAG_5 (T) = (VAL))
01046
01047 /* Nonzero if T is a class type. Zero for template type parameters,
01048 typename types, and so forth. */
01049 #define CLASS_TYPE_P(T) \
01050 (IS_AGGR_TYPE_CODE (TREE_CODE (T)) && IS_AGGR_TYPE (T))
01051
01052 #define IS_AGGR_TYPE_CODE(T) ((T) == RECORD_TYPE || (T) == UNION_TYPE)
01053 #define IS_AGGR_TYPE_2(TYPE1, TYPE2) \
01054 (TREE_CODE (TYPE1) == TREE_CODE (TYPE2) \
01055 && IS_AGGR_TYPE (TYPE1) && IS_AGGR_TYPE (TYPE2))
01056 #define TAGGED_TYPE_P(T) \
01057 (CLASS_TYPE_P (T) || TREE_CODE (T) == ENUMERAL_TYPE)
01058 #define IS_OVERLOAD_TYPE(T) TAGGED_TYPE_P (T)
01059
01060 /* In a *_TYPE, nonzero means a built-in type. */
01061 #define TYPE_BUILT_IN(NODE) TYPE_LANG_FLAG_6 (NODE)
01062
01063 /* True if this a "Java" type, defined in 'extern "Java"'. */
01064 #define TYPE_FOR_JAVA(NODE) TYPE_LANG_FLAG_3 (NODE)
01065
01066 /* Nonzero if this type is const-qualified. */
01067 #define CP_TYPE_CONST_P(NODE) \
01068 ((cp_type_quals (NODE) & TYPE_QUAL_CONST) != 0)
01069
01070 /* Nonzero if this type is volatile-qualified. */
01071 #define CP_TYPE_VOLATILE_P(NODE) \
01072 ((cp_type_quals (NODE) & TYPE_QUAL_VOLATILE) != 0)
01073
01074 /* Nonzero if this type is restrict-qualified. */
01075 #define CP_TYPE_RESTRICT_P(NODE) \
01076 ((cp_type_quals (NODE) & TYPE_QUAL_RESTRICT) != 0)
01077
01078 /* Nonzero if this type is const-qualified, but not
01079 volatile-qualified. Other qualifiers are ignored. This macro is
01080 used to test whether or not it is OK to bind an rvalue to a
01081 reference. */
01082 #define CP_TYPE_CONST_NON_VOLATILE_P(NODE) \
01083 ((cp_type_quals (NODE) & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE)) \
01084 == TYPE_QUAL_CONST)
01085
01086 #define FUNCTION_ARG_CHAIN(NODE) \
01087 TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (NODE)))
01088
01089 /* Given a FUNCTION_DECL, returns the first TREE_LIST out of TYPE_ARG_TYPES
01090 which refers to a user-written parameter. */
01091 #define FUNCTION_FIRST_USER_PARMTYPE(NODE) \
01092 skip_artificial_parms_for ((NODE), TYPE_ARG_TYPES (TREE_TYPE (NODE)))
01093
01094 /* Similarly, but for DECL_ARGUMENTS. */
01095 #define FUNCTION_FIRST_USER_PARM(NODE) \
01096 skip_artificial_parms_for ((NODE), DECL_ARGUMENTS (NODE))
01097
01098 #define PROMOTES_TO_AGGR_TYPE(NODE, CODE) \
01099 (((CODE) == TREE_CODE (NODE) \
01100 && IS_AGGR_TYPE (TREE_TYPE (NODE))) \
01101 || IS_AGGR_TYPE (NODE))
01102
01103 /* Nonzero iff TYPE is derived from PARENT. Ignores accessibility and
01104 ambiguity issues. */
01105 #define DERIVED_FROM_P(PARENT, TYPE) \
01106 (lookup_base ((TYPE), PARENT, ba_any, NULL) != NULL_TREE)
01107 /* Nonzero iff TYPE is uniquely derived from PARENT. Ignores
01108 accessibility. */
01109 #define UNIQUELY_DERIVED_FROM_P(PARENT, TYPE) \
01110 (lookup_base ((TYPE), (PARENT), ba_ignore | ba_quiet, NULL) != NULL_TREE)
01111 /* Nonzero iff TYPE is accessible in the current scope and uniquely
01112 derived from PARENT. */
01113 #define ACCESSIBLY_UNIQUELY_DERIVED_P(PARENT, TYPE) \
01114 (lookup_base ((TYPE), (PARENT), ba_check | ba_quiet, NULL) != NULL_TREE)
01115 /* Nonzero iff TYPE is publicly & uniquely derived from PARENT. */
01116 #define PUBLICLY_UNIQUELY_DERIVED_P(PARENT, TYPE) \
01117 (lookup_base ((TYPE), (PARENT), ba_not_special | ba_quiet, NULL) \
01118 != NULL_TREE)
01119
01120 /* This is a few header flags for 'struct lang_type'. Actually,
01121 all but the first are used only for lang_type_class; they
01122 are put in this structure to save space. */
01123 struct lang_type_header GTY(())
01124 {
01125 unsigned is_lang_type_class : 1;
01126
01127 unsigned has_type_conversion : 1;
01128 unsigned has_init_ref : 1;
01129 unsigned has_default_ctor : 1;
01130 unsigned uses_multiple_inheritance : 1;
01131 unsigned const_needs_init : 1;
01132 unsigned ref_needs_init : 1;
01133 unsigned has_const_assign_ref : 1;
01134 };
01135
01136 /* This structure provides additional information above and beyond
01137 what is provide in the ordinary tree_type. In the past, we used it
01138 for the types of class types, template parameters types, typename
01139 types, and so forth. However, there can be many (tens to hundreds
01140 of thousands) of template parameter types in a compilation, and
01141 there's no need for this additional information in that case.
01142 Therefore, we now use this data structure only for class types.
01143
01144 In the past, it was thought that there would be relatively few
01145 class types. However, in the presence of heavy use of templates,
01146 many (i.e., thousands) of classes can easily be generated.
01147 Therefore, we should endeavor to keep the size of this structure to
01148 a minimum. */
01149 struct lang_type_class GTY(())
01150 {
01151 struct lang_type_header h;
01152
01153 unsigned char align;
01154
01155 unsigned has_mutable : 1;
01156 unsigned com_interface : 1;
01157 unsigned non_pod_class : 1;
01158 unsigned nearly_empty_p : 1;
01159 unsigned user_align : 1;
01160 unsigned has_assign_ref : 1;
01161 unsigned has_new : 1;
01162 unsigned has_array_new : 1;
01163
01164 unsigned gets_delete : 2;
01165 unsigned has_call_overloaded : 1;
01166 unsigned has_array_ref_overloaded : 1;
01167 unsigned has_arrow_overloaded : 1;
01168 unsigned interface_only : 1;
01169 unsigned interface_unknown : 1;
01170
01171 unsigned marks: 6;
01172 unsigned vec_new_uses_cookie : 1;
01173 unsigned declared_class : 1;
01174
01175 unsigned being_defined : 1;
01176 unsigned redefined : 1;
01177 unsigned debug_requested : 1;
01178 unsigned use_template : 2;
01179 unsigned got_semicolon : 1;
01180 unsigned ptrmemfunc_flag : 1;
01181 unsigned was_anonymous : 1;
01182
01183 unsigned has_real_assign_ref : 1;
01184 unsigned has_const_init_ref : 1;
01185 unsigned has_complex_init_ref : 1;
01186 unsigned has_complex_assign_ref : 1;
01187 unsigned has_abstract_assign_ref : 1;
01188 unsigned non_aggregate : 1;
01189 unsigned is_partial_instantiation : 1;
01190 unsigned java_interface : 1;
01191
01192 unsigned anon_aggr : 1;
01193 unsigned non_zero_init : 1;
01194 unsigned empty_p : 1;
01195 unsigned contains_empty_class_p : 1;
01196
01197 /* When adding a flag here, consider whether or not it ought to
01198 apply to a template instance if it applies to the template. If
01199 so, make sure to copy it in instantiate_class_template! */
01200
01201 /* There are some bits left to fill out a 32-bit word. Keep track
01202 of this by updating the size of this bitfield whenever you add or
01203 remove a flag. */
01204 #ifdef KEY
01205 /* 1 if the copy constructor is implicitly defined instead of user defined.
01206 */
01207 unsigned has_implicit_copy_constructor : 1;
01208 unsigned dummy : 4;
01209 #else
01210 unsigned dummy : 5;
01211 #endif
01212
01213 tree primary_base;
01214 tree vfields;
01215 tree vcall_indices;
01216 tree vtables;
01217 tree typeinfo_var;
01218 tree vbases;
01219 binding_table nested_udts;
01220 tree as_base;
01221 tree pure_virtuals;
01222 tree friend_classes;
01223 tree methods;
01224 tree key_method;
01225 tree decl_list;
01226 tree template_info;
01227 tree befriending_classes;
01228 #ifdef KEY
01229 /* The copy constructor to use if the WHIRL translator needs to copy objects.
01230 */
01231 tree copy_constructor;
01232 #endif
01233 };
01234
01235 struct lang_type_ptrmem GTY(())
01236 {
01237 struct lang_type_header h;
01238 tree record;
01239 };
01240
01241 struct lang_type GTY(())
01242 {
01243 union lang_type_u
01244 {
01245 struct lang_type_header GTY((tag ("2"))) h;
01246 struct lang_type_class GTY((tag ("1"))) c;
01247 struct lang_type_ptrmem GTY((tag ("0"))) ptrmem;
01248 } GTY((desc ("%h.h.is_lang_type_class"))) u;
01249 };
01250
01251 #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
01252
01253 #define LANG_TYPE_CLASS_CHECK(NODE) \
01254 ({ struct lang_type *lt = TYPE_LANG_SPECIFIC (NODE); \
01255 if (! lt->u.h.is_lang_type_class) \
01256 lang_check_failed (__FILE__, __LINE__, __FUNCTION__); \
01257 <->u.c; })
01258
01259 #define LANG_TYPE_PTRMEM_CHECK(NODE) \
01260 ({ struct lang_type *lt = TYPE_LANG_SPECIFIC (NODE); \
01261 if (lt->u.h.is_lang_type_class) \
01262 lang_check_failed (__FILE__, __LINE__, __FUNCTION__); \
01263 <->u.ptrmem; })
01264
01265 #else
01266
01267 #define LANG_TYPE_CLASS_CHECK(NODE) (&TYPE_LANG_SPECIFIC (NODE)->u.c)
01268 #define LANG_TYPE_PTRMEM_CHECK(NODE) (&TYPE_LANG_SPECIFIC (NODE)->u.ptrmem)
01269
01270 #endif /* ENABLE_TREE_CHECKING */
01271
01272 /* Indicates whether or not (and how) a template was expanded for this class.
01273 0=no information yet/non-template class
01274 1=implicit template instantiation
01275 2=explicit template specialization
01276 3=explicit template instantiation */
01277 #define CLASSTYPE_USE_TEMPLATE(NODE) \
01278 (LANG_TYPE_CLASS_CHECK (NODE)->use_template)
01279
01280 /* Fields used for storing information before the class is defined.
01281 After the class is defined, these fields hold other information. */
01282
01283 /* List of friends which were defined inline in this class definition. */
01284 #define CLASSTYPE_INLINE_FRIENDS(NODE) CLASSTYPE_PURE_VIRTUALS (NODE)
01285
01286 /* Nonzero for _CLASSTYPE means that operator delete is defined. */
01287 #define TYPE_GETS_DELETE(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->gets_delete)
01288 #define TYPE_GETS_REG_DELETE(NODE) (TYPE_GETS_DELETE (NODE) & 1)
01289
01290 /* Nonzero if `new NODE[x]' should cause the allocation of extra
01291 storage to indicate how many array elements are in use. */
01292 #define TYPE_VEC_NEW_USES_COOKIE(NODE) \
01293 (CLASS_TYPE_P (NODE) \
01294 && LANG_TYPE_CLASS_CHECK (NODE)->vec_new_uses_cookie)
01295
01296 /* Nonzero means that this _CLASSTYPE node defines ways of converting
01297 itself to other types. */
01298 #define TYPE_HAS_CONVERSION(NODE) \
01299 (LANG_TYPE_CLASS_CHECK (NODE)->h.has_type_conversion)
01300
01301 /* Nonzero means that this _CLASSTYPE node overloads operator=(X&). */
01302 #define TYPE_HAS_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_assign_ref)
01303 #define TYPE_HAS_CONST_ASSIGN_REF(NODE) \
01304 (LANG_TYPE_CLASS_CHECK (NODE)->h.has_const_assign_ref)
01305
01306 /* Nonzero means that this _CLASSTYPE node has an X(X&) constructor. */
01307 #define TYPE_HAS_INIT_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->h.has_init_ref)
01308 #define TYPE_HAS_CONST_INIT_REF(NODE) \
01309 (LANG_TYPE_CLASS_CHECK (NODE)->has_const_init_ref)
01310
01311 /* Nonzero if this class defines an overloaded operator new. (An
01312 operator new [] doesn't count.) */
01313 #define TYPE_HAS_NEW_OPERATOR(NODE) \
01314 (LANG_TYPE_CLASS_CHECK (NODE)->has_new)
01315
01316 /* Nonzero if this class defines an overloaded operator new[]. */
01317 #define TYPE_HAS_ARRAY_NEW_OPERATOR(NODE) \
01318 (LANG_TYPE_CLASS_CHECK (NODE)->has_array_new)
01319
01320 /* Nonzero means that this type is being defined. I.e., the left brace
01321 starting the definition of this type has been seen. */
01322 #define TYPE_BEING_DEFINED(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->being_defined)
01323 /* Nonzero means that this type has been redefined. In this case, if
01324 convenient, don't reprocess any methods that appear in its redefinition. */
01325 #define TYPE_REDEFINED(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->redefined)
01326
01327 #ifdef KEY
01328 /* Nonzero means this type's copy constructor is implicitly defined instead of
01329 user defined. */
01330 #define TYPE_HAS_IMPLICIT_COPY_CONSTRUCTOR(NODE) \
01331 (LANG_TYPE_CLASS_CHECK (NODE)->has_implicit_copy_constructor)
01332
01333 /* The copy constructor to use if the WHIRL translator needs to copy objects. */
01334 #define CLASSTYPE_COPY_CONSTRUCTOR(NODE) \
01335 (LANG_TYPE_CLASS_CHECK (NODE)->copy_constructor)
01336 #endif
01337
01338 /* Nonzero means that this _CLASSTYPE node overloads operator(). */
01339 #define TYPE_OVERLOADS_CALL_EXPR(NODE) \
01340 (LANG_TYPE_CLASS_CHECK (NODE)->has_call_overloaded)
01341
01342 /* Nonzero means that this _CLASSTYPE node overloads operator[]. */
01343 #define TYPE_OVERLOADS_ARRAY_REF(NODE) \
01344 (LANG_TYPE_CLASS_CHECK (NODE)->has_array_ref_overloaded)
01345
01346 /* Nonzero means that this _CLASSTYPE node overloads operator->. */
01347 #define TYPE_OVERLOADS_ARROW(NODE) \
01348 (LANG_TYPE_CLASS_CHECK (NODE)->has_arrow_overloaded)
01349
01350 /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
01351 multiple inheritance. If this is 0 for the root of a type
01352 hierarchy, then we can use more efficient search techniques. */
01353 #define TYPE_USES_MULTIPLE_INHERITANCE(NODE) \
01354 (LANG_TYPE_CLASS_CHECK (NODE)->h.uses_multiple_inheritance)
01355
01356 /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
01357 virtual base classes. If this is 0 for the root of a type
01358 hierarchy, then we can use more efficient search techniques. */
01359 #define TYPE_USES_VIRTUAL_BASECLASSES(NODE) (TREE_LANG_FLAG_3 (NODE))
01360
01361 /* The member function with which the vtable will be emitted:
01362 the first noninline non-pure-virtual member function. NULL_TREE
01363 if there is no key function or if this is a class template */
01364 #define CLASSTYPE_KEY_METHOD(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->key_method)
01365
01366 /* Vector member functions defined in this class. Each element is
01367 either a FUNCTION_DECL, a TEMPLATE_DECL, or an OVERLOAD. All
01368 functions with the same name end up in the same slot. The first
01369 two elements are for constructors, and destructors, respectively.
01370 All template conversion operators to innermost template dependent
01371 types are overloaded on the next slot, if they exist. Note, the
01372 names for these functions will not all be the same. The
01373 non-template conversion operators & templated conversions to
01374 non-innermost template types are next, followed by ordinary member
01375 functions. There may be empty entries at the end of the vector.
01376 The conversion operators are unsorted. The ordinary member
01377 functions are sorted, once the class is complete. */
01378 #define CLASSTYPE_METHOD_VEC(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->methods)
01379
01380 /* For class templates, this is a TREE_LIST of all member data,
01381 functions, types, and friends in the order of declaration.
01382 The TREE_PURPOSE of each TREE_LIST is NULL_TREE for a friend,
01383 and the RECORD_TYPE for the class template otherwise. */
01384 #define CLASSTYPE_DECL_LIST(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->decl_list)
01385
01386 /* The slot in the CLASSTYPE_METHOD_VEC where constructors go. */
01387 #define CLASSTYPE_CONSTRUCTOR_SLOT 0
01388
01389 /* The slot in the CLASSTYPE_METHOD_VEC where destructors go. */
01390 #define CLASSTYPE_DESTRUCTOR_SLOT 1
01391
01392 /* The first slot in the CLASSTYPE_METHOD_VEC where conversion
01393 operators can appear. */
01394 #define CLASSTYPE_FIRST_CONVERSION_SLOT 2
01395
01396 /* A FUNCTION_DECL or OVERLOAD for the constructors for NODE. These
01397 are the constructors that take an in-charge parameter. */
01398 #define CLASSTYPE_CONSTRUCTORS(NODE) \
01399 (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_CONSTRUCTOR_SLOT))
01400
01401 /* A FUNCTION_DECL for the destructor for NODE. These are the
01402 destructors that take an in-charge parameter. */
01403 #define CLASSTYPE_DESTRUCTORS(NODE) \
01404 (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_DESTRUCTOR_SLOT))
01405
01406 /* Mark bits for depth-first and breath-first searches. */
01407
01408 /* Get the value of the Nth mark bit. */
01409 #define CLASSTYPE_MARKED_N(NODE, N) \
01410 (((CLASS_TYPE_P (NODE) ? LANG_TYPE_CLASS_CHECK (NODE)->marks \
01411 : ((unsigned) TYPE_ALIAS_SET (NODE))) & (1 << (N))) != 0)
01412
01413 /* Set the Nth mark bit. */
01414 #define SET_CLASSTYPE_MARKED_N(NODE, N) \
01415 (CLASS_TYPE_P (NODE) \
01416 ? (void) (LANG_TYPE_CLASS_CHECK (NODE)->marks |= (1 << (N))) \
01417 : (void) (TYPE_ALIAS_SET (NODE) |= (1 << (N))))
01418
01419 /* Clear the Nth mark bit. */
01420 #define CLEAR_CLASSTYPE_MARKED_N(NODE, N) \
01421 (CLASS_TYPE_P (NODE) \
01422 ? (void) (LANG_TYPE_CLASS_CHECK (NODE)->marks &= ~(1 << (N))) \
01423 : (void) (TYPE_ALIAS_SET (NODE) &= ~(1 << (N))))
01424
01425 /* Get the value of the mark bits. */
01426 #define CLASSTYPE_MARKED(NODE) CLASSTYPE_MARKED_N (NODE, 0)
01427 #define CLASSTYPE_MARKED2(NODE) CLASSTYPE_MARKED_N (NODE, 1)
01428 #define CLASSTYPE_MARKED3(NODE) CLASSTYPE_MARKED_N (NODE, 2)
01429 #define CLASSTYPE_MARKED4(NODE) CLASSTYPE_MARKED_N (NODE, 3)
01430 #define CLASSTYPE_MARKED5(NODE) CLASSTYPE_MARKED_N (NODE, 4)
01431 #define CLASSTYPE_MARKED6(NODE) CLASSTYPE_MARKED_N (NODE, 5)
01432
01433 /* Macros to modify the above flags */
01434 #define SET_CLASSTYPE_MARKED(NODE) SET_CLASSTYPE_MARKED_N (NODE, 0)
01435 #define CLEAR_CLASSTYPE_MARKED(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 0)
01436 #define SET_CLASSTYPE_MARKED2(NODE) SET_CLASSTYPE_MARKED_N (NODE, 1)
01437 #define CLEAR_CLASSTYPE_MARKED2(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 1)
01438 #define SET_CLASSTYPE_MARKED3(NODE) SET_CLASSTYPE_MARKED_N (NODE, 2)
01439 #define CLEAR_CLASSTYPE_MARKED3(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 2)
01440 #define SET_CLASSTYPE_MARKED4(NODE) SET_CLASSTYPE_MARKED_N (NODE, 3)
01441 #define CLEAR_CLASSTYPE_MARKED4(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 3)
01442 #define SET_CLASSTYPE_MARKED5(NODE) SET_CLASSTYPE_MARKED_N (NODE, 4)
01443 #define CLEAR_CLASSTYPE_MARKED5(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 4)
01444 #define SET_CLASSTYPE_MARKED6(NODE) SET_CLASSTYPE_MARKED_N (NODE, 5)
01445 #define CLEAR_CLASSTYPE_MARKED6(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 5)
01446
01447 /* A binding_table of the nested tag-types (class, struct, union, or enum)
01448 found within this class. The ENTRY->name of each node is the name
01449 of the type; the ENTRY->type is the type itself. This table includes
01450 nested member class templates. */
01451 #define CLASSTYPE_NESTED_UDTS(NODE) \
01452 (LANG_TYPE_CLASS_CHECK (NODE)->nested_udts)
01453
01454 /* Nonzero if NODE has a primary base class, i.e., a base class with
01455 which it shares the virtual function table pointer. */
01456 #define CLASSTYPE_HAS_PRIMARY_BASE_P(NODE) \
01457 (CLASSTYPE_PRIMARY_BINFO (NODE) != NULL_TREE)
01458
01459 /* If non-NULL, this is the binfo for the primary base class, i.e.,
01460 the base class which contains the virtual function table pointer
01461 for this class. */
01462 #define CLASSTYPE_PRIMARY_BINFO(NODE) \
01463 (LANG_TYPE_CLASS_CHECK (NODE)->primary_base)
01464
01465 /* A chain of BINFOs for the direct and indirect virtual base classes
01466 that this type uses in a post-order depth-first left-to-right
01467 order. (In other words, these bases appear in the order that they
01468 should be initialized.) If a virtual base is primary, then the
01469 primary copy will appear on this list. Thus, the BINFOs on this
01470 list are all "real"; they are the same BINFOs that will be
01471 encountered when using dfs_unmarked_real_bases_queue_p and related
01472 functions. */
01473 #define CLASSTYPE_VBASECLASSES(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->vbases)
01474
01475 /* For a non-virtual BINFO, the BINFO itself; for a virtual BINFO, the
01476 binfo_for_vbase. C is the most derived class for the hierarchy
01477 containing BINFO. */
01478 #define CANONICAL_BINFO(BINFO, C) \
01479 (TREE_VIA_VIRTUAL (BINFO) \
01480 ? binfo_for_vbase (BINFO_TYPE (BINFO), C) \
01481 : (BINFO))
01482
01483 /* Number of direct baseclasses of NODE. */
01484 #define CLASSTYPE_N_BASECLASSES(NODE) \
01485 (BINFO_N_BASETYPES (TYPE_BINFO (NODE)))
01486
01487 /* The type corresponding to NODE when NODE is used as a base class,
01488 i.e., NODE without virtual base classes. */
01489
01490 #define CLASSTYPE_AS_BASE(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->as_base)
01491
01492 /* These are the size and alignment of the type without its virtual
01493 base classes, for when we use this type as a base itself. */
01494 #define CLASSTYPE_SIZE(NODE) TYPE_SIZE (CLASSTYPE_AS_BASE (NODE))
01495 #define CLASSTYPE_SIZE_UNIT(NODE) TYPE_SIZE_UNIT (CLASSTYPE_AS_BASE (NODE))
01496 #define CLASSTYPE_ALIGN(NODE) TYPE_ALIGN (CLASSTYPE_AS_BASE (NODE))
01497 #define CLASSTYPE_USER_ALIGN(NODE) TYPE_USER_ALIGN (CLASSTYPE_AS_BASE (NODE))
01498
01499 /* The alignment of NODE, without its virtual bases, in bytes. */
01500 #define CLASSTYPE_ALIGN_UNIT(NODE) \
01501 (CLASSTYPE_ALIGN (NODE) / BITS_PER_UNIT)
01502
01503 /* True if this a Java interface type, declared with
01504 '__attribute__ ((java_interface))'. */
01505 #define TYPE_JAVA_INTERFACE(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->java_interface)
01506
01507 /* A cons list of virtual functions which cannot be inherited by
01508 derived classes. When deriving from this type, the derived
01509 class must provide its own definition for each of these functions. */
01510 #define CLASSTYPE_PURE_VIRTUALS(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->pure_virtuals)
01511
01512 /* Nonzero means that this aggr type has been `closed' by a semicolon. */
01513 #define CLASSTYPE_GOT_SEMICOLON(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->got_semicolon)
01514
01515 /* Nonzero means that this type has an X() constructor. */
01516 #define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) \
01517 (LANG_TYPE_CLASS_CHECK (NODE)->h.has_default_ctor)
01518
01519 /* Nonzero means that this type contains a mutable member */
01520 #define CLASSTYPE_HAS_MUTABLE(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_mutable)
01521 #define TYPE_HAS_MUTABLE_P(NODE) (cp_has_mutable_p (NODE))
01522
01523 /* Nonzero means that this class type is a non-POD class. */
01524 #define CLASSTYPE_NON_POD_P(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->non_pod_class)
01525
01526 /* Nonzero means that this class contains pod types whose default
01527 initialization is not a zero initialization (namely, pointers to
01528 data members). */
01529 #define CLASSTYPE_NON_ZERO_INIT_P(NODE) \
01530 (LANG_TYPE_CLASS_CHECK (NODE)->non_zero_init)
01531
01532 /* Nonzero if this class is "empty" in the sense of the C++ ABI. */
01533 #define CLASSTYPE_EMPTY_P(NODE) \
01534 (LANG_TYPE_CLASS_CHECK (NODE)->empty_p)
01535
01536 /* Nonzero if this class is "nearly empty", i.e., contains only a
01537 virtual function table pointer. */
01538 #define CLASSTYPE_NEARLY_EMPTY_P(NODE) \
01539 (LANG_TYPE_CLASS_CHECK (NODE)->nearly_empty_p)
01540
01541 /* Nonzero if this class contains an empty subobject. */
01542 #define CLASSTYPE_CONTAINS_EMPTY_CLASS_P(NODE) \
01543 (LANG_TYPE_CLASS_CHECK (NODE)->contains_empty_class_p)
01544
01545 /* A list of class types of which this type is a friend. The
01546 TREE_VALUE is normally a TYPE, but will be a TEMPLATE_DECL in the
01547 case of a template friend. */
01548 #define CLASSTYPE_FRIEND_CLASSES(NODE) \
01549 (LANG_TYPE_CLASS_CHECK (NODE)->friend_classes)
01550
01551 /* A list of the classes which grant friendship to this class. */
01552 #define CLASSTYPE_BEFRIENDING_CLASSES(NODE) \
01553 (LANG_TYPE_CLASS_CHECK (NODE)->befriending_classes)
01554
01555 /* Say whether this node was declared as a "class" or a "struct". */
01556 #define CLASSTYPE_DECLARED_CLASS(NODE) \
01557 (LANG_TYPE_CLASS_CHECK (NODE)->declared_class)
01558
01559 /* Nonzero if this class has const members
01560 which have no specified initialization. */
01561 #define CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE) \
01562 (TYPE_LANG_SPECIFIC (NODE) \
01563 ? LANG_TYPE_CLASS_CHECK (NODE)->h.const_needs_init : 0)
01564 #define SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE, VALUE) \
01565 (LANG_TYPE_CLASS_CHECK (NODE)->h.const_needs_init = (VALUE))
01566
01567 /* Nonzero if this class has ref members
01568 which have no specified initialization. */
01569 #define CLASSTYPE_REF_FIELDS_NEED_INIT(NODE) \
01570 (TYPE_LANG_SPECIFIC (NODE) \
01571 ? LANG_TYPE_CLASS_CHECK (NODE)->h.ref_needs_init : 0)
01572 #define SET_CLASSTYPE_REF_FIELDS_NEED_INIT(NODE, VALUE) \
01573 (LANG_TYPE_CLASS_CHECK (NODE)->h.ref_needs_init = (VALUE))
01574
01575 /* Nonzero if this class is included from a header file which employs
01576 `#pragma interface', and it is not included in its implementation file. */
01577 #define CLASSTYPE_INTERFACE_ONLY(NODE) \
01578 (LANG_TYPE_CLASS_CHECK (NODE)->interface_only)
01579
01580 /* True if we have already determined whether or not vtables, VTTs,
01581 typeinfo, and other similar per-class data should be emitted in
01582 this translation unit. This flag does not indicate whether or not
01583 these items should be emitted; it only indicates that we know one
01584 way or the other. */
01585 #define CLASSTYPE_INTERFACE_KNOWN(NODE) \
01586 (LANG_TYPE_CLASS_CHECK (NODE)->interface_unknown == 0)
01587 /* The opposite of CLASSTYPE_INTERFANCE_KNOWN. */
01588 #define CLASSTYPE_INTERFACE_UNKNOWN(NODE) \
01589 (LANG_TYPE_CLASS_CHECK (NODE)->interface_unknown)
01590
01591 #define SET_CLASSTYPE_INTERFACE_UNKNOWN_X(NODE,X) \
01592 (LANG_TYPE_CLASS_CHECK (NODE)->interface_unknown = !!(X))
01593 #define SET_CLASSTYPE_INTERFACE_UNKNOWN(NODE) \
01594 (LANG_TYPE_CLASS_CHECK (NODE)->interface_unknown = 1)
01595 #define SET_CLASSTYPE_INTERFACE_KNOWN(NODE) \
01596 (LANG_TYPE_CLASS_CHECK (NODE)->interface_unknown = 0)
01597
01598 /* Nonzero if a _DECL node requires us to output debug info for this class. */
01599 #define CLASSTYPE_DEBUG_REQUESTED(NODE) \
01600 (LANG_TYPE_CLASS_CHECK (NODE)->debug_requested)
01601
01602 /* Additional macros for inheritance information. */
01603
01604 /* The BINFO_INHERITANCE_CHAIN is used opposite to the description in
01605 gcc/tree.h. In particular if D is derived from B then the BINFO
01606 for B (in D) will have a BINFO_INHERITANCE_CHAIN pointing to
01607 D. In tree.h, this pointer is described as pointing in other
01608 direction. There is a different BINFO for each path to a virtual
01609 base; BINFOs for virtual bases are not shared.
01610
01611 We use TREE_VIA_PROTECTED and TREE_VIA_PUBLIC, but private
01612 inheritance is indicated by the absence of the other two flags, not
01613 by TREE_VIA_PRIVATE, which is unused. */
01614
01615 /* Mark the binfo, whether shared or not. Each instance of a virtual
01616 base can be separately marked. */
01617 #define BINFO_UNSHARED_MARKED(NODE) TREE_LANG_FLAG_0 (NODE)
01618
01619 /* Nonzero means marked by DFS or BFS search. */
01620 #define BINFO_MARKED(NODE) \
01621 (TREE_VIA_VIRTUAL (NODE) \
01622 ? CLASSTYPE_MARKED (BINFO_TYPE (NODE)) \
01623 : TREE_LANG_FLAG_0 (NODE))
01624 /* Macros needed because of C compilers that don't allow conditional
01625 expressions to be lvalues. Grr! */
01626 #define SET_BINFO_MARKED(NODE) \
01627 (TREE_VIA_VIRTUAL(NODE) \
01628 ? SET_CLASSTYPE_MARKED (BINFO_TYPE (NODE)) \
01629 : (void)(TREE_LANG_FLAG_0 (NODE) = 1))
01630 #define CLEAR_BINFO_MARKED(NODE) \
01631 (TREE_VIA_VIRTUAL (NODE) \
01632 ? CLEAR_CLASSTYPE_MARKED (BINFO_TYPE (NODE)) \
01633 : (void)(TREE_LANG_FLAG_0 (NODE) = 0))
01634
01635 /* Nonzero means that this class is on a path leading to a new vtable. */
01636 #define BINFO_VTABLE_PATH_MARKED(NODE) \
01637 (TREE_VIA_VIRTUAL (NODE) \
01638 ? CLASSTYPE_MARKED3 (BINFO_TYPE (NODE)) \
01639 : TREE_LANG_FLAG_3 (NODE))
01640 #define SET_BINFO_VTABLE_PATH_MARKED(NODE) \
01641 (TREE_VIA_VIRTUAL(NODE) \
01642 ? SET_CLASSTYPE_MARKED3 (BINFO_TYPE (NODE)) \
01643 : (TREE_LANG_FLAG_3 (NODE) = 1))
01644 #define CLEAR_BINFO_VTABLE_PATH_MARKED(NODE) \
01645 (TREE_VIA_VIRTUAL (NODE) \
01646 ? CLEAR_CLASSTYPE_MARKED3 (BINFO_TYPE (NODE))\
01647 : (TREE_LANG_FLAG_3 (NODE) = 0))
01648
01649 /* Nonzero means B (a BINFO) has its own vtable. Under the old ABI,
01650 secondary vtables are sometimes shared. Any copies will not have
01651 this flag set.
01652
01653 B is part of the hierarchy dominated by C. */
01654 #define BINFO_NEW_VTABLE_MARKED(B, C) \
01655 (TREE_LANG_FLAG_4 (CANONICAL_BINFO (B, C)))
01656
01657 /* Any subobject that needs a new vtable must have a vptr and must not
01658 be a non-virtual primary base (since it would then use the vtable from a
01659 derived class and never become non-primary.) */
01660 #define SET_BINFO_NEW_VTABLE_MARKED(B, C) \
01661 (BINFO_NEW_VTABLE_MARKED (B, C) = 1, \
01662 my_friendly_assert (!BINFO_PRIMARY_P (B) \
01663 || TREE_VIA_VIRTUAL (B), 20000517), \
01664 my_friendly_assert (CLASSTYPE_VFIELDS (BINFO_TYPE (B)) != NULL_TREE, \
01665 20000517))
01666
01667 /* Nonzero means this class has done dfs_pushdecls. */
01668 #define BINFO_PUSHDECLS_MARKED(NODE) BINFO_VTABLE_PATH_MARKED (NODE)
01669 #define SET_BINFO_PUSHDECLS_MARKED(NODE) SET_BINFO_VTABLE_PATH_MARKED (NODE)
01670 #define CLEAR_BINFO_PUSHDECLS_MARKED(NODE) CLEAR_BINFO_VTABLE_PATH_MARKED (NODE)
01671
01672 /* Nonzero if this BINFO is a primary base class. Note, this can be
01673 set for non-canononical virtual bases. For a virtual primary base
01674 you might also need to check whether it is canonical. */
01675
01676 #define BINFO_PRIMARY_P(NODE) \
01677 (BINFO_PRIMARY_BASE_OF (NODE) != NULL_TREE)
01678
01679 /* The index in the VTT where this subobject's sub-VTT can be found.
01680 NULL_TREE if there is no sub-VTT. */
01681 #define BINFO_SUBVTT_INDEX(NODE) TREE_VEC_ELT (NODE, 8)
01682
01683 /* The index in the VTT where the vptr for this subobject can be
01684 found. NULL_TREE if there is no secondary vptr in the VTT. */
01685 #define BINFO_VPTR_INDEX(NODE) TREE_VEC_ELT (NODE, 9)
01686
01687 /* The binfo of which NODE is a primary base. (This is different from
01688 BINFO_INHERITANCE_CHAIN for virtual base because a virtual base is
01689 sometimes a primary base for a class for which it is not an
01690 immediate base.) */
01691 #define BINFO_PRIMARY_BASE_OF(NODE) TREE_VEC_ELT (NODE, 10)
01692
01693 /* Nonzero if this binfo has lost its primary base binfo (because that
01694 is a nearly-empty virtual base that has been taken by some other
01695 base in the complete hierarchy. */
01696 #define BINFO_LOST_PRIMARY_P(NODE) TREE_LANG_FLAG_2 (NODE)
01697
01698 /* Nonzero if this binfo is an indirect primary base, i.e. a virtual
01699 base that is a primary base of some of other class in the
01700 hierarchy. */
01701 #define BINFO_INDIRECT_PRIMARY_P(NODE) TREE_USED (NODE)
01702
01703 /* Used by various search routines. */
01704 #define IDENTIFIER_MARKED(NODE) TREE_LANG_FLAG_0 (NODE)
01705
01706 /* A TREE_LIST of the vcall indices associated with the class NODE.
01707 The TREE_PURPOSE of each node is a FUNCTION_DECL for a virtual
01708 function. The TREE_VALUE is the index into the virtual table where
01709 the vcall offset for that function is stored, when NODE is a
01710 virtual base. */
01711 #define CLASSTYPE_VCALL_INDICES(NODE) \
01712 (LANG_TYPE_CLASS_CHECK (NODE)->vcall_indices)
01713
01714 /* The various vtables for the class NODE. The primary vtable will be
01715 first, followed by the construction vtables and VTT, if any. */
01716 #define CLASSTYPE_VTABLES(NODE) \
01717 (LANG_TYPE_CLASS_CHECK (NODE)->vtables)
01718
01719 /* The std::type_info variable representing this class, or NULL if no
01720 such variable has been created. This field is only set for the
01721 TYPE_MAIN_VARIANT of the class. */
01722 #define CLASSTYPE_TYPEINFO_VAR(NODE) \
01723 (LANG_TYPE_CLASS_CHECK (NODE)->typeinfo_var)
01724
01725 /* Accessor macros for the vfield slots in structures. */
01726
01727 /* List of virtual table fields that this type contains (both the primary
01728 and secondaries). The TREE_VALUE is the class type where the vtable
01729 field was introduced. For a vtable field inherited from the primary
01730 base, or introduced by this class, the TREE_PURPOSE is NULL. For
01731 other vtable fields (those from non-primary bases), the
01732 TREE_PURPOSE is the BINFO of the base through which the vtable was
01733 inherited. */
01734 #define CLASSTYPE_VFIELDS(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->vfields)
01735
01736 /* Get the BINFO that introduced this vtable into the hierarchy (will
01737 be NULL for those created at this level, or from a primary
01738 hierarchy). */
01739 #define VF_BINFO_VALUE(NODE) TREE_PURPOSE (NODE)
01740
01741 /* Get the TYPE that introduced this vtable into the hierarchy (always
01742 non-NULL). */
01743 #define VF_BASETYPE_VALUE(NODE) TREE_VALUE (NODE)
01744
01745 /* Accessor macros for the BINFO_VIRTUALS list. */
01746
01747 /* The number of bytes by which to adjust the `this' pointer when
01748 calling this virtual function. Subtract this value from the this
01749 pointer. Always non-NULL, might be constant zero though. */
01750 #define BV_DELTA(NODE) (TREE_PURPOSE (NODE))
01751
01752 /* If non-NULL, the vtable index at which to find the vcall offset
01753 when calling this virtual function. Add the value at that vtable
01754 index to the this pointer. */
01755 #define BV_VCALL_INDEX(NODE) (TREE_TYPE (NODE))
01756
01757 /* The function to call. */
01758 #define BV_FN(NODE) (TREE_VALUE (NODE))
01759
01760
01761 /* Nonzero for TREE_LIST node means that this list of things
01762 is a list of parameters, as opposed to a list of expressions. */
01763 #define TREE_PARMLIST(NODE) (TREE_LANG_FLAG_2 (NODE))
01764
01765 /* Nonzero for a parmlist means that this parmlist ended in ... */
01766 #define PARMLIST_ELLIPSIS_P(NODE) TREE_LANG_FLAG_0 (NODE)
01767
01768 /* For FUNCTION_TYPE or METHOD_TYPE, a list of the exceptions that
01769 this type can raise. Each TREE_VALUE is a _TYPE. The TREE_VALUE
01770 will be NULL_TREE to indicate a throw specification of `()', or
01771 no exceptions allowed. */
01772 #define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_BINFO (NODE)
01773
01774 /* For FUNCTION_TYPE or METHOD_TYPE, return 1 iff it is declared `throw()'. */
01775 #define TYPE_NOTHROW_P(NODE) \
01776 (TYPE_RAISES_EXCEPTIONS (NODE) \
01777 && TREE_VALUE (TYPE_RAISES_EXCEPTIONS (NODE)) == NULL_TREE)
01778
01779 /* The binding level associated with the namespace. */
01780 #define NAMESPACE_LEVEL(NODE) \
01781 (DECL_LANG_SPECIFIC (NODE)->decl_flags.u.level)
01782
01783
01784 /* If a DECL has DECL_LANG_SPECIFIC, it is either a lang_decl_flags or
01785 a lang_decl (which has lang_decl_flags as its initial prefix).
01786 This macro is nonzero for tree nodes whose DECL_LANG_SPECIFIC is
01787 the full lang_decl, and not just lang_decl_flags. */
01788 #define CAN_HAVE_FULL_LANG_DECL_P(NODE) \
01789 (!(TREE_CODE (NODE) == VAR_DECL \
01790 || TREE_CODE (NODE) == CONST_DECL \
01791 || TREE_CODE (NODE) == FIELD_DECL \
01792 || TREE_CODE (NODE) == USING_DECL))
01793
01794 struct lang_decl_flags GTY(())
01795 {
01796 struct c_lang_decl base;
01797
01798 ENUM_BITFIELD(languages) language : 8;
01799
01800 unsigned operator_attr : 1;
01801 unsigned constructor_attr : 1;
01802 unsigned destructor_attr : 1;
01803 unsigned friend_attr : 1;
01804 unsigned static_function : 1;
01805 unsigned pure_virtual : 1;
01806 unsigned has_in_charge_parm_p : 1;
01807 unsigned has_vtt_parm_p : 1;
01808
01809 unsigned deferred : 1;
01810 unsigned use_template : 2;
01811 unsigned nonconverting : 1;
01812 unsigned not_really_extern : 1;
01813 unsigned needs_final_overrider : 1;
01814 unsigned initialized_in_class : 1;
01815 unsigned assignment_operator_p : 1;
01816
01817 unsigned global_ctor_p : 1;
01818 unsigned global_dtor_p : 1;
01819 unsigned anticipated_p : 1;
01820 unsigned template_conv_p : 1;
01821 unsigned u1sel : 1;
01822 unsigned u2sel : 1;
01823 unsigned can_be_full : 1;
01824 unsigned unused : 1; /* One unused bit. */
01825
01826 union lang_decl_u {
01827 /* In a FUNCTION_DECL, VAR_DECL, TYPE_DECL, or TEMPLATE_DECL, this
01828 is DECL_TEMPLATE_INFO. */
01829 tree GTY ((tag ("0"))) template_info;
01830
01831 /* In a NAMESPACE_DECL, this is NAMESPACE_LEVEL. */
01832 struct cp_binding_level * GTY ((tag ("1"))) level;
01833 } GTY ((desc ("%1.u1sel"))) u;
01834
01835 union lang_decl_u2 {
01836 /* This is DECL_ACCESS. */
01837 tree GTY ((tag ("0"))) access;
01838
01839 /* For VAR_DECL in function, this is DECL_DISCRIMINATOR. */
01840 int discriminator;
01841
01842 /* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is
01843 THUNK_VCALL_OFFSET. */
01844 tree GTY((tag ("2"))) vcall_offset;
01845 } GTY ((desc ("%1.u2sel"))) u2;
01846 };
01847
01848 struct lang_decl GTY(())
01849 {
01850 struct lang_decl_flags decl_flags;
01851
01852 union lang_decl_u4
01853 {
01854 struct full_lang_decl
01855 {
01856 tree befriending_classes;
01857
01858 /* For a non-virtual FUNCTION_DECL, this is
01859 DECL_FRIEND_CONTEXT. For a virtual FUNCTION_DECL for which
01860 DECL_THUNK_P does not hold, this is DECL_THUNKS. */
01861 tree context;
01862
01863 /* In a FUNCTION_DECL, this is DECL_CLONED_FUNCTION. */
01864 tree cloned_function;
01865
01866 /* In a FUNCTION_DECL for which THUNK_P holds, this is
01867 THUNK_DELTA. */
01868 HOST_WIDE_INT delta;
01869
01870 #ifdef KEY
01871 /* If the named return value optimization is applied to the function,
01872 this is the VAR_DECL of the named return object. */
01873 tree named_return_object;
01874 #endif
01875
01876 /* In an overloaded operator, this is the value of
01877 DECL_OVERLOADED_OPERATOR_P. */
01878 enum tree_code operator_code;
01879
01880 unsigned u3sel : 1;
01881 unsigned pending_inline_p : 1;
01882
01883 union lang_decl_u3
01884 {
01885 tree GTY ((tag ("0"))) sorted_fields;
01886 struct unparsed_text * GTY ((tag ("2"))) pending_inline_info;
01887 struct language_function * GTY ((tag ("1")))
01888 saved_language_function;
01889 } GTY ((desc ("%1.u3sel + %1.pending_inline_p"))) u;
01890 } GTY ((tag ("1"))) f;
01891 } GTY ((desc ("%1.decl_flags.can_be_full"))) u;
01892 };
01893
01894 #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
01895
01896 #define LANG_DECL_U2_CHECK(NODE, TF) \
01897 ({ struct lang_decl *lt = DECL_LANG_SPECIFIC (NODE); \
01898 if (lt->decl_flags.u2sel != TF) \
01899 lang_check_failed (__FILE__, __LINE__, __FUNCTION__); \
01900 <->decl_flags.u2; })
01901
01902 #else
01903
01904 #define LANG_DECL_U2_CHECK(NODE, TF) \
01905 (&DECL_LANG_SPECIFIC (NODE)->decl_flags.u2)
01906
01907 #endif /* ENABLE_TREE_CHECKING */
01908
01909 #define DEFARG_POINTER(NODE) (DEFAULT_ARG_CHECK (NODE)->identifier.id.str)
01910
01911 /* DECL_NEEDED_P holds of a declaration when we need to emit its
01912 definition. This is true when the back-end tells us that
01913 the symbol has been referenced in the generated code. If, however,
01914 we are not generating code, then it is also true when a symbol has
01915 just been used somewhere, even if it's not really needed. We need
01916 anything that isn't comdat, but we don't know for sure whether or
01917 not something is comdat until end-of-file. */
01918 #define DECL_NEEDED_P(DECL) \
01919 ((at_eof && TREE_PUBLIC (DECL) && !DECL_COMDAT (DECL)) \
01920 || (DECL_ASSEMBLER_NAME_SET_P (DECL) \
01921 && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (DECL))) \
01922 || (flag_syntax_only && TREE_USED (DECL)))
01923
01924 /* Nonzero iff DECL is memory-based. The DECL_RTL of
01925 certain const variables might be a CONST_INT, or a REG
01926 in some cases. We cannot use `memory_operand' as a test
01927 here because on most RISC machines, a variable's address
01928 is not, by itself, a legitimate address. */
01929 #define DECL_IN_MEMORY_P(NODE) \
01930 (DECL_RTL_SET_P (NODE) && GET_CODE (DECL_RTL (NODE)) == MEM)
01931
01932 /* For a FUNCTION_DECL or a VAR_DECL, the language linkage for the
01933 declaration. Some entities (like a member function in a local
01934 class, or a local variable) do not have linkage at all, and this
01935 macro should not be used in those cases.
01936
01937 Implementation note: A FUNCTION_DECL without DECL_LANG_SPECIFIC was
01938 created by language-independent code, and has C linkage. Most
01939 VAR_DECLs have C++ linkage, and do not have DECL_LANG_SPECIFIC, but
01940 we do create DECL_LANG_SPECIFIC for variables with non-C++ linkage. */
01941 #define DECL_LANGUAGE(NODE) \
01942 (DECL_LANG_SPECIFIC (NODE) \
01943 ? DECL_LANG_SPECIFIC (NODE)->decl_flags.language \
01944 : (TREE_CODE (NODE) == FUNCTION_DECL \
01945 ? lang_c : lang_cplusplus))
01946
01947 /* Set the language linkage for NODE to LANGUAGE. */
01948 #define SET_DECL_LANGUAGE(NODE, LANGUAGE) \
01949 (DECL_LANG_SPECIFIC (NODE)->decl_flags.language = (LANGUAGE))
01950
01951 /* For FUNCTION_DECLs: nonzero means that this function is a constructor. */
01952 #define DECL_CONSTRUCTOR_P(NODE) \
01953 (DECL_LANG_SPECIFIC (NODE)->decl_flags.constructor_attr)
01954
01955 /* Nonzero if NODE (a FUNCTION_DECL) is a constructor for a complete
01956 object. */
01957 #define DECL_COMPLETE_CONSTRUCTOR_P(NODE) \
01958 (DECL_CONSTRUCTOR_P (NODE) \
01959 && DECL_NAME (NODE) == complete_ctor_identifier)
01960
01961 /* Nonzero if NODE (a FUNCTION_DECL) is a constructor for a base
01962 object. */
01963 #define DECL_BASE_CONSTRUCTOR_P(NODE) \
01964 (DECL_CONSTRUCTOR_P (NODE) \
01965 && DECL_NAME (NODE) == base_ctor_identifier)
01966
01967 /* Nonzero if NODE (a FUNCTION_DECL) is a constructor, but not either the
01968 specialized in-charge constructor or the specialized not-in-charge
01969 constructor. */
01970 #define DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P(NODE) \
01971 (DECL_CONSTRUCTOR_P (NODE) && !DECL_CLONED_FUNCTION_P (NODE))
01972
01973 /* Nonzero if NODE (a FUNCTION_DECL) is a copy constructor. */
01974 #define DECL_COPY_CONSTRUCTOR_P(NODE) \
01975 (DECL_CONSTRUCTOR_P (NODE) && copy_fn_p (NODE) > 0)
01976
01977 /* Nonzero if NODE is a destructor. */
01978 #define DECL_DESTRUCTOR_P(NODE) \
01979 (DECL_LANG_SPECIFIC (NODE)->decl_flags.destructor_attr)
01980
01981 /* Nonzero if NODE (a FUNCTION_DECL) is a destructor, but not the
01982 specialized in-charge constructor, in-charge deleting constructor,
01983 or the the base destructor. */
01984 #define DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P(NODE) \
01985 (DECL_DESTRUCTOR_P (NODE) && !DECL_CLONED_FUNCTION_P (NODE))
01986
01987 /* Nonzero if NODE (a FUNCTION_DECL) is a destructor for a complete
01988 object. */
01989 #define DECL_COMPLETE_DESTRUCTOR_P(NODE) \
01990 (DECL_DESTRUCTOR_P (NODE) \
01991 && DECL_NAME (NODE) == complete_dtor_identifier)
01992
01993 /* Nonzero if NODE (a FUNCTION_DECL) is a destructor for a base
01994 object. */
01995 #define DECL_BASE_DESTRUCTOR_P(NODE) \
01996 (DECL_DESTRUCTOR_P (NODE) \
01997 && DECL_NAME (NODE) == base_dtor_identifier)
01998
01999 /* Nonzero if NODE (a FUNCTION_DECL) is a destructor for a complete
02000 object that deletes the object after it has been destroyed. */
02001 #define DECL_DELETING_DESTRUCTOR_P(NODE) \
02002 (DECL_DESTRUCTOR_P (NODE) \
02003 && DECL_NAME (NODE) == deleting_dtor_identifier)
02004
02005 /* Nonzero if NODE (a FUNCTION_DECL) is a cloned constructor or
02006 destructor. */
02007 #define DECL_CLONED_FUNCTION_P(NODE) \
02008 ((TREE_CODE (NODE) == FUNCTION_DECL \
02009 || TREE_CODE (NODE) == TEMPLATE_DECL) \
02010 && DECL_LANG_SPECIFIC (NODE) \
02011 && DECL_CLONED_FUNCTION (NODE) != NULL_TREE)
02012
02013 /* If DECL_CLONED_FUNCTION_P holds, this is the function that was
02014 cloned. */
02015 #define DECL_CLONED_FUNCTION(NODE) \
02016 (DECL_LANG_SPECIFIC (NODE)->u.f.cloned_function)
02017
02018 #ifdef KEY
02019 /* If the named return value optimization is applied to the function, this is
02020 the VAR_DECL of the named return object. */
02021 #define DECL_NAMED_RETURN_OBJECT(NODE) \
02022 (DECL_LANG_SPECIFIC (NODE)->u.f.named_return_object)
02023 #endif
02024
02025 /* Nonzero if NODE has DECL_DISCRIMINATOR and not DECL_ACCESS. */
02026 #define DECL_DISCRIMINATOR_P(NODE) \
02027 (TREE_CODE (NODE) == VAR_DECL \
02028 && DECL_FUNCTION_SCOPE_P (NODE))
02029
02030 /* Discriminator for name mangling. */
02031 #define DECL_DISCRIMINATOR(NODE) (LANG_DECL_U2_CHECK (NODE, 1)->discriminator)
02032
02033 /* Nonzero if the VTT parm has been added to NODE. */
02034 #define DECL_HAS_VTT_PARM_P(NODE) \
02035 (DECL_LANG_SPECIFIC (NODE)->decl_flags.has_vtt_parm_p)
02036
02037 /* Nonzero if NODE is a FUNCTION_DECL for which a VTT parameter is
02038 required. */
02039 #define DECL_NEEDS_VTT_PARM_P(NODE) \
02040 (TYPE_USES_VIRTUAL_BASECLASSES (DECL_CONTEXT (NODE)) \
02041 && (DECL_BASE_CONSTRUCTOR_P (NODE) \
02042 || DECL_BASE_DESTRUCTOR_P (NODE)))
02043
02044 /* Nonzero if NODE is a user-defined conversion operator. */
02045 #define DECL_CONV_FN_P(NODE) \
02046 (IDENTIFIER_TYPENAME_P (DECL_NAME (NODE)))
02047
02048 /* If FN is a conversion operator, the type to which it converts.
02049 Otherwise, NULL_TREE. */
02050 #define DECL_CONV_FN_TYPE(FN) \
02051 (DECL_CONV_FN_P (FN) ? TREE_TYPE (DECL_NAME (FN)) : NULL_TREE)
02052
02053 /* Nonzero if NODE, which is a TEMPLATE_DECL, is a template
02054 conversion operator to a type dependent on the innermost template
02055 args. */
02056 #define DECL_TEMPLATE_CONV_FN_P(NODE) \
02057 (DECL_LANG_SPECIFIC (NODE)->decl_flags.template_conv_p)
02058
02059 /* Set the overloaded operator code for NODE to CODE. */
02060 #define SET_OVERLOADED_OPERATOR_CODE(NODE, CODE) \
02061 (DECL_LANG_SPECIFIC (NODE)->u.f.operator_code = (CODE))
02062
02063 /* If NODE is an overloaded operator, then this returns the TREE_CODE
02064 associcated with the overloaded operator.
02065 DECL_ASSIGNMENT_OPERATOR_P must also be checked to determine
02066 whether or not NODE is an assignment operator. If NODE is not an
02067 overloaded operator, ERROR_MARK is returned. Since the numerical
02068 value of ERROR_MARK is zero, this macro can be used as a predicate
02069 to test whether or not NODE is an overloaded operator. */
02070 #define DECL_OVERLOADED_OPERATOR_P(NODE) \
02071 (IDENTIFIER_OPNAME_P (DECL_NAME (NODE)) \
02072 ? DECL_LANG_SPECIFIC (NODE)->u.f.operator_code : ERROR_MARK)
02073
02074 /* Nonzero if NODE is an assignment operator. */
02075 #define DECL_ASSIGNMENT_OPERATOR_P(NODE) \
02076 (DECL_LANG_SPECIFIC (NODE)->decl_flags.assignment_operator_p)
02077
02078 /* For FUNCTION_DECLs: nonzero means that this function is a
02079 constructor or a destructor with an extra in-charge parameter to
02080 control whether or not virtual bases are constructed. */
02081 #define DECL_HAS_IN_CHARGE_PARM_P(NODE) \
02082 (DECL_LANG_SPECIFIC (NODE)->decl_flags.has_in_charge_parm_p)
02083
02084 /* Nonzero if NODE is an overloaded `operator delete[]' function. */
02085 #define DECL_ARRAY_DELETE_OPERATOR_P(NODE) \
02086 (DECL_OVERLOADED_OPERATOR_P (NODE) == VEC_DELETE_EXPR)
02087
02088 /* Nonzero for _DECL means that this decl appears in (or will appear
02089 in) as a member in a RECORD_TYPE or UNION_TYPE node. It is also for
02090 detecting circularity in case members are multiply defined. In the
02091 case of a VAR_DECL, it is also used to determine how program storage
02092 should be allocated. */
02093 #define DECL_IN_AGGR_P(NODE) (DECL_LANG_FLAG_3 (NODE))
02094
02095 /* Nonzero for a VAR_DECL means that the variable's initialization has
02096 been processed. */
02097 #define DECL_INITIALIZED_P(NODE) \
02098 (TREE_LANG_FLAG_1 (VAR_DECL_CHECK (NODE)))
02099
02100 /* Nonzero if the DECL was initialized in the class definition itself,
02101 rather than outside the class. This is used for both static member
02102 VAR_DECLS, and FUNTION_DECLS that are defined in the class. */
02103 #define DECL_INITIALIZED_IN_CLASS_P(DECL) \
02104 (DECL_LANG_SPECIFIC (DECL)->decl_flags.initialized_in_class)
02105
02106 /* Nonzero for FUNCTION_DECL means that this decl is just a
02107 friend declaration, and should not be added to the list of
02108 member functions for this class. */
02109 #define DECL_FRIEND_P(NODE) (DECL_LANG_SPECIFIC (NODE)->decl_flags.friend_attr)
02110
02111 /* A TREE_LIST of the types which have befriended this FUNCTION_DECL. */
02112 #define DECL_BEFRIENDING_CLASSES(NODE) \
02113 (DECL_LANG_SPECIFIC (NODE)->u.f.befriending_classes)
02114
02115 /* Nonzero for FUNCTION_DECL means that this decl is a static
02116 member function. */
02117 #define DECL_STATIC_FUNCTION_P(NODE) \
02118 (DECL_LANG_SPECIFIC (NODE)->decl_flags.static_function)
02119
02120 /* Nonzero for FUNCTION_DECL means that this decl is a non-static
02121 member function. */
02122 #define DECL_NONSTATIC_MEMBER_FUNCTION_P(NODE) \
02123 (TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE)
02124
02125 /* Nonzero for FUNCTION_DECL means that this decl is a member function
02126 (static or non-static). */
02127 #define DECL_FUNCTION_MEMBER_P(NODE) \
02128 (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE) || DECL_STATIC_FUNCTION_P (NODE))
02129
02130 /* Nonzero for FUNCTION_DECL means that this member function
02131 has `this' as const X *const. */
02132 #define DECL_CONST_MEMFUNC_P(NODE) \
02133 (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE) \
02134 && CP_TYPE_CONST_P (TREE_TYPE (TREE_VALUE \
02135 (TYPE_ARG_TYPES (TREE_TYPE (NODE))))))
02136
02137 /* Nonzero for FUNCTION_DECL means that this member function
02138 has `this' as volatile X *const. */
02139 #define DECL_VOLATILE_MEMFUNC_P(NODE) \
02140 (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE) \
02141 && CP_TYPE_VOLATILE_P (TREE_TYPE (TREE_VALUE \
02142 (TYPE_ARG_TYPES (TREE_TYPE (NODE))))))
02143
02144 /* Nonzero for a DECL means that this member is a non-static member. */
02145 #define DECL_NONSTATIC_MEMBER_P(NODE) \
02146 ((TREE_CODE (NODE) == FUNCTION_DECL \
02147 && DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE)) \
02148 || TREE_CODE (NODE) == FIELD_DECL)
02149
02150 /* Nonzero for _DECL means that this member object type
02151 is mutable. */
02152 #define DECL_MUTABLE_P(NODE) (DECL_LANG_FLAG_0 (NODE))
02153
02154 /* Nonzero for _DECL means that this constructor is a non-converting
02155 constructor. */
02156 #define DECL_NONCONVERTING_P(NODE) \
02157 (DECL_LANG_SPECIFIC (NODE)->decl_flags.nonconverting)
02158
02159 /* Nonzero for FUNCTION_DECL means that this member function is a pure
02160 virtual function. */
02161 #define DECL_PURE_VIRTUAL_P(NODE) \
02162 (DECL_LANG_SPECIFIC (NODE)->decl_flags.pure_virtual)
02163
02164 /* Nonzero for FUNCTION_DECL means that this member function
02165 must be overridden by derived classes. */
02166 #define DECL_NEEDS_FINAL_OVERRIDER_P(NODE) \
02167 (DECL_LANG_SPECIFIC (NODE)->decl_flags.needs_final_overrider)
02168
02169 /* The thunks associated with NODE, a FUNCTION_DECL that is not itself
02170 a thunk. */
02171 #define DECL_THUNKS(NODE) \
02172 (DECL_LANG_SPECIFIC (NODE)->u.f.context)
02173
02174 /* Nonzero if NODE is a thunk, rather than an ordinary function. */
02175 #define DECL_THUNK_P(NODE) \
02176 (TREE_CODE (NODE) == FUNCTION_DECL \
02177 && DECL_LANG_FLAG_7 (NODE))
02178
02179 /* Nonzero if NODE is a FUNCTION_DECL, but not a thunk. */
02180 #define DECL_NON_THUNK_FUNCTION_P(NODE) \
02181 (TREE_CODE (NODE) == FUNCTION_DECL && !DECL_THUNK_P (NODE))
02182
02183 /* Nonzero if NODE is `extern "C"'. */
02184 #define DECL_EXTERN_C_P(NODE) \
02185 (DECL_LANGUAGE (NODE) == lang_c)
02186
02187 /* Nonzero if NODE is an `extern "C"' function. */
02188 #define DECL_EXTERN_C_FUNCTION_P(NODE) \
02189 (DECL_NON_THUNK_FUNCTION_P (NODE) && DECL_EXTERN_C_P (NODE))
02190
02191 /* Set DECL_THUNK_P for node. */
02192 #define SET_DECL_THUNK_P(NODE) \
02193 (DECL_LANG_FLAG_7 (NODE) = 1, \
02194 DECL_LANG_SPECIFIC (NODE)->u.f.u3sel = 1)
02195
02196 /* Nonzero if this DECL is the __PRETTY_FUNCTION__ variable in a
02197 template function. */
02198 #define DECL_PRETTY_FUNCTION_P(NODE) \
02199 (TREE_LANG_FLAG_0 (NODE))
02200
02201 /* The _TYPE context in which this _DECL appears. This field holds the
02202 class where a virtual function instance is actually defined. */
02203 #define DECL_CLASS_CONTEXT(NODE) \
02204 (DECL_CLASS_SCOPE_P (NODE) ? DECL_CONTEXT (NODE) : NULL_TREE)
02205
02206 /* For a non-member friend function, the class (if any) in which this
02207 friend was defined. For example, given:
02208
02209 struct S { friend void f (); };
02210
02211 the DECL_FRIEND_CONTEXT for `f' will be `S'. */
02212 #define DECL_FRIEND_CONTEXT(NODE) \
02213 ((DECL_FRIEND_P (NODE) && !DECL_FUNCTION_MEMBER_P (NODE)) \
02214 ? DECL_LANG_SPECIFIC (NODE)->u.f.context \
02215 : NULL_TREE)
02216
02217 /* Set the DECL_FRIEND_CONTEXT for NODE to CONTEXT. */
02218 #define SET_DECL_FRIEND_CONTEXT(NODE, CONTEXT) \
02219 (DECL_LANG_SPECIFIC (NODE)->u.f.context = (CONTEXT))
02220
02221 /* NULL_TREE in DECL_CONTEXT represents the global namespace. */
02222 #define CP_DECL_CONTEXT(NODE) \
02223 (DECL_CONTEXT (NODE) ? DECL_CONTEXT (NODE) : global_namespace)
02224 #define FROB_CONTEXT(NODE) ((NODE) == global_namespace ? NULL_TREE : (NODE))
02225
02226 /* 1 iff NODE has namespace scope, including the global namespace. */
02227 #define DECL_NAMESPACE_SCOPE_P(NODE) \
02228 (!DECL_TEMPLATE_PARM_P (NODE) \
02229 && TREE_CODE (CP_DECL_CONTEXT (NODE)) == NAMESPACE_DECL)
02230
02231 /* 1 iff NODE is a class member. */
02232 #define DECL_CLASS_SCOPE_P(NODE) \
02233 (DECL_CONTEXT (NODE) && TYPE_P (DECL_CONTEXT (NODE)))
02234
02235 /* 1 iff NODE is function-local. */
02236 #define DECL_FUNCTION_SCOPE_P(NODE) \
02237 (DECL_CONTEXT (NODE) \
02238 && TREE_CODE (DECL_CONTEXT (NODE)) == FUNCTION_DECL)
02239
02240 /* 1 iff NODE is function-local, but for types. */
02241 #define LOCAL_CLASS_P(NODE) \
02242 (decl_function_context (TYPE_MAIN_DECL (NODE)) != NULL_TREE)
02243
02244 /* For a NAMESPACE_DECL: the list of using namespace directives
02245 The PURPOSE is the used namespace, the value is the namespace
02246 that is the common ancestor. */
02247 #define DECL_NAMESPACE_USING(NODE) DECL_VINDEX (NAMESPACE_DECL_CHECK (NODE))
02248
02249 /* In a NAMESPACE_DECL, the DECL_INITIAL is used to record all users
02250 of a namespace, to record the transitive closure of using namespace. */
02251 #define DECL_NAMESPACE_USERS(NODE) DECL_INITIAL (NAMESPACE_DECL_CHECK (NODE))
02252
02253 /* In a NAMESPACE_DECL, points to the original namespace if this is
02254 a namespace alias. */
02255 #define DECL_NAMESPACE_ALIAS(NODE) \
02256 DECL_ABSTRACT_ORIGIN (NAMESPACE_DECL_CHECK (NODE))
02257 #define ORIGINAL_NAMESPACE(NODE) \
02258 (DECL_NAMESPACE_ALIAS (NODE) ? DECL_NAMESPACE_ALIAS (NODE) : (NODE))
02259
02260 /* Nonzero if NODE is the std namespace. */
02261 #define DECL_NAMESPACE_STD_P(NODE) \
02262 (TREE_CODE (NODE) == NAMESPACE_DECL \
02263 && CP_DECL_CONTEXT (NODE) == global_namespace \
02264 && DECL_NAME (NODE) == std_identifier)
02265
02266 /* In a non-local VAR_DECL with static storage duration, this is the
02267 initialization priority. If this value is zero, the NODE will be
02268 initialized at the DEFAULT_INIT_PRIORITY. */
02269 #define DECL_INIT_PRIORITY(NODE) (VAR_DECL_CHECK (NODE)->decl.u2.i)
02270
02271 /* In a TREE_LIST concatenating using directives, indicate indirect
02272 directives */
02273 #define TREE_INDIRECT_USING(NODE) (TREE_LIST_CHECK (NODE)->common.lang_flag_0)
02274
02275 /* In a VAR_DECL for a variable declared in a for statement,
02276 this is the shadowed (local) variable. */
02277 #define DECL_SHADOWED_FOR_VAR(NODE) DECL_RESULT_FLD(VAR_DECL_CHECK (NODE))
02278
02279 /* In a FUNCTION_DECL, this is nonzero if this function was defined in
02280 the class definition. We have saved away the text of the function,
02281 but have not yet processed it. */
02282 #define DECL_PENDING_INLINE_P(NODE) \
02283 (DECL_LANG_SPECIFIC (NODE)->u.f.pending_inline_p)
02284
02285 /* If DECL_PENDING_INLINE_P holds, this is the saved text of the
02286 function. */
02287 #define DECL_PENDING_INLINE_INFO(NODE) \
02288 (DECL_LANG_SPECIFIC (NODE)->u.f.u.pending_inline_info)
02289
02290 /* For a TYPE_DECL: if this structure has many fields, we'll sort them
02291 and put them into a TREE_VEC. */
02292 #define DECL_SORTED_FIELDS(NODE) \
02293 (DECL_LANG_SPECIFIC (TYPE_DECL_CHECK (NODE))->u.f.u.sorted_fields)
02294
02295 /* True if on the deferred_fns (see decl2.c) list. */
02296 #define DECL_DEFERRED_FN(DECL) \
02297 (DECL_LANG_SPECIFIC (DECL)->decl_flags.deferred)
02298
02299 /* For a VAR_DECL, FUNCTION_DECL, TYPE_DECL or TEMPLATE_DECL:
02300 template-specific information. */
02301 #define DECL_TEMPLATE_INFO(NODE) \
02302 (DECL_LANG_SPECIFIC (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK (NODE)) \
02303 ->decl_flags.u.template_info)
02304
02305 /* For a VAR_DECL, indicates that the variable has been processed.
02306 This flag is set and unset throughout the code; it is always
02307 used for a temporary purpose. */
02308 #define DECL_VAR_MARKED_P(NODE) \
02309 (DECL_LANG_FLAG_4 (VAR_DECL_CHECK (NODE)))
02310
02311 /* Template information for a RECORD_TYPE or UNION_TYPE. */
02312 #define CLASSTYPE_TEMPLATE_INFO(NODE) \
02313 (LANG_TYPE_CLASS_CHECK (RECORD_OR_UNION_TYPE_CHECK (NODE))->template_info)
02314
02315 /* Template information for an ENUMERAL_TYPE. Although an enumeration may
02316 not be a primary template, it may be declared within the scope of a
02317 primary template and the enumeration constants may depend on
02318 non-type template parameters. */
02319 #define ENUM_TEMPLATE_INFO(NODE) (TYPE_BINFO (ENUMERAL_TYPE_CHECK (NODE)))
02320
02321 /* Template information for a template template parameter. */
02322 #define TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO(NODE) \
02323 (LANG_TYPE_CLASS_CHECK (BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK (NODE)) \
02324 ->template_info)
02325
02326 /* Template information for an ENUMERAL_, RECORD_, or UNION_TYPE. */
02327 #define TYPE_TEMPLATE_INFO(NODE) \
02328 (TREE_CODE (NODE) == ENUMERAL_TYPE \
02329 ? ENUM_TEMPLATE_INFO (NODE) : \
02330 (TREE_CODE (NODE) == BOUND_TEMPLATE_TEMPLATE_PARM \
02331 ? TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (NODE) : \
02332 (TYPE_LANG_SPECIFIC (NODE) \
02333 ? CLASSTYPE_TEMPLATE_INFO (NODE) \
02334 : NULL_TREE)))
02335
02336 /* Set the template information for an ENUMERAL_, RECORD_, or
02337 UNION_TYPE to VAL. */
02338 #define SET_TYPE_TEMPLATE_INFO(NODE, VAL) \
02339 (TREE_CODE (NODE) == ENUMERAL_TYPE \
02340 ? (ENUM_TEMPLATE_INFO (NODE) = (VAL)) \
02341 : (CLASSTYPE_TEMPLATE_INFO (NODE) = (VAL)))
02342
02343 #define TI_TEMPLATE(NODE) (TREE_PURPOSE (NODE))
02344 #define TI_ARGS(NODE) (TREE_VALUE (NODE))
02345 #define TI_PENDING_TEMPLATE_FLAG(NODE) TREE_LANG_FLAG_1 (NODE)
02346
02347 /* We use TREE_VECs to hold template arguments. If there is only one
02348 level of template arguments, then the TREE_VEC contains the
02349 arguments directly. If there is more than one level of template
02350 arguments, then each entry in the TREE_VEC is itself a TREE_VEC,
02351 containing the template arguments for a single level. The first
02352 entry in the outer TREE_VEC is the outermost level of template
02353 parameters; the last is the innermost.
02354
02355 It is incorrect to ever form a template argument vector containing
02356 only one level of arguments, but which is a TREE_VEC containing as
02357 its only entry the TREE_VEC for that level. */
02358
02359 /* Nonzero if the template arguments is actually a vector of vectors,
02360 rather than just a vector. */
02361 #define TMPL_ARGS_HAVE_MULTIPLE_LEVELS(NODE) \
02362 ((NODE) != NULL_TREE \
02363 && TREE_CODE (NODE) == TREE_VEC \
02364 && TREE_VEC_LENGTH (NODE) > 0 \
02365 && TREE_VEC_ELT (NODE, 0) != NULL_TREE \
02366 && TREE_CODE (TREE_VEC_ELT (NODE, 0)) == TREE_VEC)
02367
02368 /* The depth of a template argument vector. When called directly by
02369 the parser, we use a TREE_LIST rather than a TREE_VEC to represent
02370 template arguments. In fact, we may even see NULL_TREE if there
02371 are no template arguments. In both of those cases, there is only
02372 one level of template arguments. */
02373 #define TMPL_ARGS_DEPTH(NODE) \
02374 (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (NODE) ? TREE_VEC_LENGTH (NODE) : 1)
02375
02376 /* The LEVELth level of the template ARGS. The outermost level of
02377 args is level 1, not level 0. */
02378 #define TMPL_ARGS_LEVEL(ARGS, LEVEL) \
02379 (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (ARGS) \
02380 ? TREE_VEC_ELT (ARGS, (LEVEL) - 1) : (ARGS))
02381
02382 /* Set the LEVELth level of the template ARGS to VAL. This macro does
02383 not work with single-level argument vectors. */
02384 #define SET_TMPL_ARGS_LEVEL(ARGS, LEVEL, VAL) \
02385 (TREE_VEC_ELT (ARGS, (LEVEL) - 1) = (VAL))
02386
02387 /* Accesses the IDXth parameter in the LEVELth level of the ARGS. */
02388 #define TMPL_ARG(ARGS, LEVEL, IDX) \
02389 (TREE_VEC_ELT (TMPL_ARGS_LEVEL (ARGS, LEVEL), IDX))
02390
02391 /* Set the IDXth element in the LEVELth level of ARGS to VAL. This
02392 macro does not work with single-level argument vectors. */
02393 #define SET_TMPL_ARG(ARGS, LEVEL, IDX, VAL) \
02394 (TREE_VEC_ELT (TREE_VEC_ELT ((ARGS), (LEVEL) - 1), (IDX)) = (VAL))
02395
02396 /* Given a single level of template arguments in NODE, return the
02397 number of arguments. */
02398 #define NUM_TMPL_ARGS(NODE) \
02399 ((NODE) == NULL_TREE ? 0 \
02400 : (TREE_CODE (NODE) == TREE_VEC \
02401 ? TREE_VEC_LENGTH (NODE) : list_length (NODE)))
02402
02403 /* Returns the innermost level of template arguments in ARGS. */
02404 #define INNERMOST_TEMPLATE_ARGS(NODE) \
02405 (get_innermost_template_args ((NODE), 1))
02406
02407 /* The number of levels of template parameters given by NODE. */
02408 #define TMPL_PARMS_DEPTH(NODE) \
02409 ((HOST_WIDE_INT) TREE_INT_CST_LOW (TREE_PURPOSE (NODE)))
02410
02411 /* The TEMPLATE_DECL instantiated or specialized by NODE. This
02412 TEMPLATE_DECL will be the immediate parent, not the most general
02413 template. For example, in:
02414
02415 template <class T> struct S { template <class U> void f(U); }
02416
02417 the FUNCTION_DECL for S<int>::f<double> will have, as its
02418 DECL_TI_TEMPLATE, `template <class U> S<int>::f<U>'.
02419
02420 As a special case, for a member friend template of a template
02421 class, this value will not be a TEMPLATE_DECL, but rather a
02422 LOOKUP_EXPR, IDENTIFIER_NODE or OVERLOAD indicating the name of
02423 the template and any explicit template arguments provided. For
02424 example, in:
02425
02426 template <class T> struct S { friend void f<int>(int, double); }
02427
02428 the DECL_TI_TEMPLATE will be a LOOKUP_EXPR for `f' and the
02429 DECL_TI_ARGS will be {int}. */
02430 #define DECL_TI_TEMPLATE(NODE) TI_TEMPLATE (DECL_TEMPLATE_INFO (NODE))
02431
02432 /* The template arguments used to obtain this decl from the most
02433 general form of DECL_TI_TEMPLATE. For the example given for
02434 DECL_TI_TEMPLATE, the DECL_TI_ARGS will be {int, double}. These
02435 are always the full set of arguments required to instantiate this
02436 declaration from the most general template specialized here. */
02437 #define DECL_TI_ARGS(NODE) TI_ARGS (DECL_TEMPLATE_INFO (NODE))
02438 #define CLASSTYPE_TI_TEMPLATE(NODE) TI_TEMPLATE (CLASSTYPE_TEMPLATE_INFO (NODE))
02439 #define CLASSTYPE_TI_ARGS(NODE) TI_ARGS (CLASSTYPE_TEMPLATE_INFO (NODE))
02440 #define ENUM_TI_TEMPLATE(NODE) \
02441 TI_TEMPLATE (ENUM_TEMPLATE_INFO (NODE))
02442 #define ENUM_TI_ARGS(NODE) \
02443 TI_ARGS (ENUM_TEMPLATE_INFO (NODE))
02444
02445 /* Like DECL_TI_TEMPLATE, but for an ENUMERAL_, RECORD_, or UNION_TYPE. */
02446 #define TYPE_TI_TEMPLATE(NODE) \
02447 (TI_TEMPLATE (TYPE_TEMPLATE_INFO (NODE)))
02448
02449 /* Like DECL_TI_ARGS, but for an ENUMERAL_, RECORD_, or UNION_TYPE. */
02450 #define TYPE_TI_ARGS(NODE) \
02451 (TI_ARGS (TYPE_TEMPLATE_INFO (NODE)))
02452
02453 #define INNERMOST_TEMPLATE_PARMS(NODE) TREE_VALUE (NODE)
02454
02455 /* Nonzero if the NODE corresponds to the template parameters for a
02456 member template, whose inline definition is being processed after
02457 the class definition is complete. */
02458 #define TEMPLATE_PARMS_FOR_INLINE(NODE) TREE_LANG_FLAG_1 (NODE)
02459
02460 /* In a FUNCTION_DECL, the saved language-specific per-function data. */
02461 #define DECL_SAVED_FUNCTION_DATA(NODE) \
02462 (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE)) \
02463 ->u.f.u.saved_language_function)
02464
02465 #define NEW_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
02466 #define DELETE_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
02467 #define DELETE_EXPR_USE_VEC(NODE) TREE_LANG_FLAG_1 (NODE)
02468 #define LOOKUP_EXPR_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
02469
02470 /* Nonzero if this AGGR_INIT_EXPR provides for initialization via a
02471 constructor call, rather than an ordinary function call. */
02472 #define AGGR_INIT_VIA_CTOR_P(NODE) \
02473 TREE_LANG_FLAG_0 (AGGR_INIT_EXPR_CHECK (NODE))
02474
02475 /* The TYPE_MAIN_DECL for a class template type is a TYPE_DECL, not a
02476 TEMPLATE_DECL. This macro determines whether or not a given class
02477 type is really a template type, as opposed to an instantiation or
02478 specialization of one. */
02479 #define CLASSTYPE_IS_TEMPLATE(NODE) \
02480 (CLASSTYPE_TEMPLATE_INFO (NODE) \
02481 && !CLASSTYPE_USE_TEMPLATE (NODE) \
02482 && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (NODE)))
02483
02484 /* The name used by the user to name the typename type. Typically,
02485 this is an IDENTIFIER_NODE, and the same as the DECL_NAME on the
02486 corresponding TYPE_DECL. However, this may also be a
02487 TEMPLATE_ID_EXPR if we had something like `typename X::Y<T>'. */
02488 #define TYPENAME_TYPE_FULLNAME(NODE) (TYPE_FIELDS (NODE))
02489
02490 /* Nonzero if NODE is an implicit typename. */
02491 #define IMPLICIT_TYPENAME_P(NODE) \
02492 (TREE_CODE (NODE) == TYPENAME_TYPE && TREE_TYPE (NODE))
02493
02494 /* Nonzero if NODE is a TYPE_DECL that should not be visible because
02495 it is from a dependent base class. */
02496 #define IMPLICIT_TYPENAME_TYPE_DECL_P(NODE) \
02497 (TREE_CODE (NODE) == TYPE_DECL \
02498 && DECL_ARTIFICIAL (NODE) \
02499 && IMPLICIT_TYPENAME_P (TREE_TYPE (NODE)))
02500
02501 /* Nonzero in INTEGER_CST means that this int is negative by dint of
02502 using a twos-complement negated operand. */
02503 #define TREE_NEGATED_INT(NODE) TREE_LANG_FLAG_0 (INTEGER_CST_CHECK (NODE))
02504
02505 /* Nonzero in any kind of _TYPE where conversions to base-classes may
02506 involve pointer arithmetic. If this is zero, then converting to
02507 a base-class never requires changing the value of the pointer. */
02508 #define TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P(NODE) (TREE_LANG_FLAG_1 (NODE))
02509
02510 /* [class.virtual]
02511
02512 A class that declares or inherits a virtual function is called a
02513 polymorphic class. */
02514 #define TYPE_POLYMORPHIC_P(NODE) (TREE_LANG_FLAG_2 (NODE))
02515
02516 /* Nonzero if this class has a virtual function table pointer. */
02517 #define TYPE_CONTAINS_VPTR_P(NODE) \
02518 (TYPE_POLYMORPHIC_P (NODE) \
02519 || TYPE_USES_VIRTUAL_BASECLASSES (NODE))
02520
02521 /* This flag is true of a local VAR_DECL if it was declared in a for
02522 statement, but we are no longer in the scope of the for. */
02523 #define DECL_DEAD_FOR_LOCAL(NODE) DECL_LANG_FLAG_7 (VAR_DECL_CHECK (NODE))
02524
02525 /* This flag is set on a VAR_DECL that is a DECL_DEAD_FOR_LOCAL
02526 if we already emitted a warning about using it. */
02527 #define DECL_ERROR_REPORTED(NODE) DECL_LANG_FLAG_0 (VAR_DECL_CHECK (NODE))
02528
02529 /* Nonzero if NODE is a FUNCTION_DECL (for a function with global
02530 scope) declared in a local scope. */
02531 #define DECL_LOCAL_FUNCTION_P(NODE) \
02532 DECL_LANG_FLAG_0 (FUNCTION_DECL_CHECK (NODE))
02533
02534 /* Nonzero if NODE is a FUNCTION_DECL for a built-in function, and we have
02535 not yet seen a prototype for that function. */
02536 #define DECL_ANTICIPATED(NODE) \
02537 (DECL_LANG_SPECIFIC (DECL_CHECK (NODE))->decl_flags.anticipated_p)
02538
02539 /* Record whether a typedef for type `int' was actually `signed int'. */
02540 #define C_TYPEDEF_EXPLICITLY_SIGNED(EXP) DECL_LANG_FLAG_1 (EXP)
02541
02542 /* Returns nonzero if DECL has external linkage, as specified by the
02543 language standard. (This predicate may hold even when the
02544 corresponding entity is not actually given external linkage in the
02545 object file; see decl_linkage for details.) */
02546 #define DECL_EXTERNAL_LINKAGE_P(DECL) \
02547 (decl_linkage (DECL) == lk_external)
02548
02549 #define INTEGRAL_CODE_P(CODE) \
02550 ((CODE) == INTEGER_TYPE || (CODE) == ENUMERAL_TYPE || (CODE) == BOOLEAN_TYPE)
02551
02552 /* [basic.fundamental]
02553
02554 Types bool, char, wchar_t, and the signed and unsigned integer types
02555 are collectively called integral types.
02556
02557 Note that INTEGRAL_TYPE_P, as defined in tree.h, allows enumeration
02558 types as well, which is incorrect in C++. */
02559 #define CP_INTEGRAL_TYPE_P(TYPE) \
02560 (TREE_CODE (TYPE) == BOOLEAN_TYPE \
02561 || TREE_CODE (TYPE) == INTEGER_TYPE)
02562
02563 /* Returns true if TYPE is an integral or enumeration name. */
02564 #define INTEGRAL_OR_ENUMERATION_TYPE_P(TYPE) \
02565 (CP_INTEGRAL_TYPE_P (TYPE) || TREE_CODE (TYPE) == ENUMERAL_TYPE)
02566
02567 /* [basic.fundamental]
02568
02569 Integral and floating types are collectively called arithmetic
02570 types. */
02571 #define ARITHMETIC_TYPE_P(TYPE) \
02572 (CP_INTEGRAL_TYPE_P (TYPE) || TREE_CODE (TYPE) == REAL_TYPE)
02573
02574 /* [basic.types]
02575
02576 Arithmetic types, enumeration types, pointer types, and
02577 pointer-to-member types, are collectively called scalar types. */
02578 #define SCALAR_TYPE_P(TYPE) \
02579 (ARITHMETIC_TYPE_P (TYPE) \
02580 || TREE_CODE (TYPE) == ENUMERAL_TYPE \
02581 || TYPE_PTR_P (TYPE) \
02582 || TYPE_PTRMEM_P (TYPE) \
02583 || TYPE_PTRMEMFUNC_P (TYPE))
02584
02585 /* [dcl.init.aggr]
02586
02587 An aggregate is an array or a class with no user-declared
02588 constructors, no private or protected non-static data members, no
02589 base classes, and no virtual functions. */
02590 #define CP_AGGREGATE_TYPE_P(TYPE) \
02591 (TREE_CODE (TYPE) == ARRAY_TYPE \
02592 || (CLASS_TYPE_P (TYPE) \
02593 && !CLASSTYPE_NON_AGGREGATE (TYPE)))
02594
02595 /* Nonzero for a class type means that the class type has a
02596 user-declared constructor. */
02597 #define TYPE_HAS_CONSTRUCTOR(NODE) (TYPE_LANG_FLAG_1 (NODE))
02598
02599 /* When appearing in an INDIRECT_REF, it means that the tree structure
02600 underneath is actually a call to a constructor. This is needed
02601 when the constructor must initialize local storage (which can
02602 be automatically destroyed), rather than allowing it to allocate
02603 space from the heap.
02604
02605 When appearing in a SAVE_EXPR, it means that underneath
02606 is a call to a constructor.
02607
02608 When appearing in a CONSTRUCTOR, it means that it was
02609 a GNU C constructor expression.
02610
02611 When appearing in a FIELD_DECL, it means that this field
02612 has been duly initialized in its constructor. */
02613 #define TREE_HAS_CONSTRUCTOR(NODE) (TREE_LANG_FLAG_4 (NODE))
02614
02615 #define EMPTY_CONSTRUCTOR_P(NODE) (TREE_CODE (NODE) == CONSTRUCTOR \
02616 && CONSTRUCTOR_ELTS (NODE) == NULL_TREE \
02617 && ! TREE_HAS_CONSTRUCTOR (NODE))
02618
02619 /* Nonzero for _TYPE means that the _TYPE defines a destructor. */
02620 #define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2 (NODE))
02621
02622 /* Nonzero means that an object of this type can not be initialized using
02623 an initializer list. */
02624 #define CLASSTYPE_NON_AGGREGATE(NODE) \
02625 (LANG_TYPE_CLASS_CHECK (NODE)->non_aggregate)
02626 #define TYPE_NON_AGGREGATE_CLASS(NODE) \
02627 (IS_AGGR_TYPE (NODE) && CLASSTYPE_NON_AGGREGATE (NODE))
02628
02629 /* Nonzero if there is a user-defined X::op=(x&) for this class. */
02630 #define TYPE_HAS_REAL_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_real_assign_ref)
02631 #define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_complex_assign_ref)
02632 #define TYPE_HAS_ABSTRACT_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_abstract_assign_ref)
02633 #define TYPE_HAS_COMPLEX_INIT_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_complex_init_ref)
02634
02635 /* Nonzero if TYPE has a trivial destructor. From [class.dtor]:
02636
02637 A destructor is trivial if it is an implicitly declared
02638 destructor and if:
02639
02640 - all of the direct base classes of its class have trivial
02641 destructors,
02642
02643 - for all of the non-static data members of its class that are
02644 of class type (or array thereof), each such class has a
02645 trivial destructor. */
02646 #define TYPE_HAS_TRIVIAL_DESTRUCTOR(NODE) \
02647 (!TYPE_HAS_NONTRIVIAL_DESTRUCTOR (NODE))
02648
02649 /* Nonzero for _TYPE node means that this type does not have a trivial
02650 destructor. Therefore, destroying an object of this type will
02651 involve a call to a destructor. This can apply to objects of
02652 ARRAY_TYPE is the type of the elements needs a destructor. */
02653 #define TYPE_HAS_NONTRIVIAL_DESTRUCTOR(NODE) \
02654 (TYPE_LANG_FLAG_4 (NODE))
02655
02656 /* Nonzero for class type means that copy initialization of this type can use
02657 a bitwise copy. */
02658 #define TYPE_HAS_TRIVIAL_INIT_REF(NODE) \
02659 (TYPE_HAS_INIT_REF (NODE) && ! TYPE_HAS_COMPLEX_INIT_REF (NODE))
02660
02661 /* Nonzero for class type means that assignment of this type can use
02662 a bitwise copy. */
02663 #define TYPE_HAS_TRIVIAL_ASSIGN_REF(NODE) \
02664 (TYPE_HAS_ASSIGN_REF (NODE) && ! TYPE_HAS_COMPLEX_ASSIGN_REF (NODE))
02665
02666 #define TYPE_PTRMEM_P(NODE) \
02667 (TREE_CODE (NODE) == POINTER_TYPE \
02668 && TREE_CODE (TREE_TYPE (NODE)) == OFFSET_TYPE)
02669 #define TYPE_PTR_P(NODE) \
02670 (TREE_CODE (NODE) == POINTER_TYPE \
02671 && TREE_CODE (TREE_TYPE (NODE)) != OFFSET_TYPE)
02672 #define TYPE_PTROB_P(NODE) \
02673 (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE \
02674 && TREE_CODE (TREE_TYPE (NODE)) != VOID_TYPE)
02675 #define TYPE_PTROBV_P(NODE) \
02676 (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE)
02677 #define TYPE_PTRFN_P(NODE) \
02678 (TREE_CODE (NODE) == POINTER_TYPE \
02679 && TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE)
02680 #define TYPE_REFFN_P(NODE) \
02681 (TREE_CODE (NODE) == REFERENCE_TYPE \
02682 && TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE)
02683
02684 /* Nonzero for _TYPE node means that this type is a pointer to member
02685 function type. */
02686 #define TYPE_PTRMEMFUNC_P(NODE) \
02687 (TREE_CODE (NODE) == RECORD_TYPE \
02688 && TYPE_LANG_SPECIFIC (NODE) \
02689 && TYPE_PTRMEMFUNC_FLAG (NODE))
02690
02691 #define TYPE_PTRMEMFUNC_FLAG(NODE) \
02692 (LANG_TYPE_CLASS_CHECK (NODE)->ptrmemfunc_flag)
02693
02694 /* Indicates when overload resolution may resolve to a pointer to
02695 member function. [expr.unary.op]/3 */
02696 #define PTRMEM_OK_P(NODE) TREE_LANG_FLAG_0 (NODE)
02697
02698 /* Get the POINTER_TYPE to the METHOD_TYPE associated with this
02699 pointer to member function. TYPE_PTRMEMFUNC_P _must_ be true,
02700 before using this macro. */
02701 #define TYPE_PTRMEMFUNC_FN_TYPE(NODE) \
02702 (TREE_TYPE (TYPE_FIELDS (NODE)))
02703
02704 /* Returns `A' for a type like `int (A::*)(double)' */
02705 #define TYPE_PTRMEMFUNC_OBJECT_TYPE(NODE) \
02706 TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (NODE)))
02707
02708 /* These are use to manipulate the canonical RECORD_TYPE from the
02709 hashed POINTER_TYPE, and can only be used on the POINTER_TYPE. */
02710 #define TYPE_GET_PTRMEMFUNC_TYPE(NODE) \
02711 (TYPE_LANG_SPECIFIC (NODE) ? LANG_TYPE_PTRMEM_CHECK (NODE)->record : NULL)
02712 #define TYPE_SET_PTRMEMFUNC_TYPE(NODE, VALUE) \
02713 do { \
02714 if (TYPE_LANG_SPECIFIC (NODE) == NULL) \
02715 { \
02716 TYPE_LANG_SPECIFIC (NODE) = \
02717 ggc_alloc_cleared (sizeof (struct lang_type_ptrmem)); \
02718 TYPE_LANG_SPECIFIC (NODE)->u.ptrmem.h.is_lang_type_class = 0; \
02719 } \
02720 TYPE_LANG_SPECIFIC (NODE)->u.ptrmem.record = (VALUE); \
02721 } while (0)
02722 /* Returns the pfn field from a TYPE_PTRMEMFUNC_P. */
02723 #define PFN_FROM_PTRMEMFUNC(NODE) pfn_from_ptrmemfunc ((NODE))
02724
02725 /* For a pointer-to-member type of the form `T X::*', this is `X'.
02726 For a type like `void (X::*)() const', this type is `X', not `const
02727 X'. To get at the `const X' you have to look at the
02728 TYPE_PTRMEM_POINTED_TO_TYPE; there, the first parameter will have
02729 type `const X*'. */
02730 #define TYPE_PTRMEM_CLASS_TYPE(NODE) \
02731 (TYPE_PTRMEM_P (NODE) \
02732 ? TYPE_OFFSET_BASETYPE (TREE_TYPE (NODE)) \
02733 : TYPE_PTRMEMFUNC_OBJECT_TYPE (NODE))
02734
02735 /* For a pointer-to-member type of the form `T X::*', this is `T'. */
02736 #define TYPE_PTRMEM_POINTED_TO_TYPE(NODE) \
02737 (TYPE_PTRMEM_P (NODE) \
02738 ? TREE_TYPE (TREE_TYPE (NODE)) \
02739 : TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (NODE)))
02740
02741 /* For a pointer-to-member constant `X::Y' this is the RECORD_TYPE for
02742 `X'. */
02743 #define PTRMEM_CST_CLASS(NODE) \
02744 TYPE_PTRMEM_CLASS_TYPE (TREE_TYPE (PTRMEM_CST_CHECK (NODE)))
02745
02746 /* For a pointer-to-member constant `X::Y' this is the _DECL for
02747 `Y'. */
02748 #define PTRMEM_CST_MEMBER(NODE) (((ptrmem_cst_t)PTRMEM_CST_CHECK (NODE))->member)
02749
02750 /* Nonzero for VAR_DECL and FUNCTION_DECL node means that `extern' was
02751 specified in its declaration. This can also be set for an
02752 erroneously declared PARM_DECL. */
02753 #define DECL_THIS_EXTERN(NODE) \
02754 DECL_LANG_FLAG_2 (VAR_FUNCTION_OR_PARM_DECL_CHECK (NODE))
02755
02756 /* Nonzero for VAR_DECL and FUNCTION_DECL node means that `static' was
02757 specified in its declaration. This can also be set for an
02758 erroneously declared PARM_DECL. */
02759 #define DECL_THIS_STATIC(NODE) \
02760 DECL_LANG_FLAG_6 (VAR_FUNCTION_OR_PARM_DECL_CHECK (NODE))
02761
02762 /* Nonzero if TYPE is an anonymous union or struct type. We have to use a
02763 flag for this because "A union for which objects or pointers are
02764 declared is not an anonymous union" [class.union]. */
02765 #define ANON_AGGR_TYPE_P(NODE) \
02766 (CLASS_TYPE_P (NODE) && LANG_TYPE_CLASS_CHECK (NODE)->anon_aggr)
02767 #define SET_ANON_AGGR_TYPE_P(NODE) \
02768 (LANG_TYPE_CLASS_CHECK (NODE)->anon_aggr = 1)
02769
02770 /* Nonzero if TYPE is an anonymous union type. */
02771 #define ANON_UNION_TYPE_P(NODE) \
02772 (TREE_CODE (NODE) == UNION_TYPE && ANON_AGGR_TYPE_P (NODE))
02773
02774 #define UNKNOWN_TYPE LANG_TYPE
02775
02776 /* Define fields and accessors for nodes representing declared names. */
02777
02778 #define TYPE_WAS_ANONYMOUS(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->was_anonymous)
02779
02780 /* C++: all of these are overloaded! These apply only to TYPE_DECLs. */
02781
02782 /* The format of each node in the DECL_FRIENDLIST is as follows:
02783
02784 The TREE_PURPOSE will be the name of a function, i.e., an
02785 IDENTIFIER_NODE. The TREE_VALUE will be itself a TREE_LIST, the
02786 list of functions with that name which are friends. The
02787 TREE_PURPOSE of each node in this sublist will be error_mark_node,
02788 if the function was declared a friend individually, in which case
02789 the TREE_VALUE will be the function_decl. If, however, all
02790 functions with a given name in a class were declared to be friends,
02791 the TREE_PUROSE will be the class type, and the TREE_VALUE will be
02792 NULL_TREE. */
02793 #define DECL_FRIENDLIST(NODE) (DECL_INITIAL (NODE))
02794 #define FRIEND_NAME(LIST) (TREE_PURPOSE (LIST))
02795 #define FRIEND_DECLS(LIST) (TREE_VALUE (LIST))
02796
02797 /* The DECL_ACCESS, if non-NULL, is a TREE_LIST. The TREE_PURPOSE of
02798 each node is a type; the TREE_VALUE is the access granted for this
02799 DECL in that type. The DECL_ACCESS is set by access declarations.
02800 For example, if a member that would normally be public in a
02801 derived class is made protected, then the derived class and the
02802 protected_access_node will appear in the DECL_ACCESS for the node. */
02803 #define DECL_ACCESS(NODE) (LANG_DECL_U2_CHECK (NODE, 0)->access)
02804
02805 /* Nonzero if the FUNCTION_DECL is a global constructor. */
02806 #define DECL_GLOBAL_CTOR_P(NODE) \
02807 (DECL_LANG_SPECIFIC (NODE)->decl_flags.global_ctor_p)
02808
02809 /* Nonzero if the FUNCTION_DECL is a global destructor. */
02810 #define DECL_GLOBAL_DTOR_P(NODE) \
02811 (DECL_LANG_SPECIFIC (NODE)->decl_flags.global_dtor_p)
02812
02813 /* Accessor macros for C++ template decl nodes. */
02814
02815 /* The DECL_TEMPLATE_PARMS are a list. The TREE_PURPOSE of each node
02816 is a INT_CST whose TREE_INT_CST_LOW indicates the level of the
02817 template parameters, with 1 being the outermost set of template
02818 parameters. The TREE_VALUE is a vector, whose elements are the
02819 template parameters at each level. Each element in the vector is a
02820 TREE_LIST, whose TREE_VALUE is a PARM_DECL (if the parameter is a
02821 non-type parameter), or a TYPE_DECL (if the parameter is a type
02822 parameter). The TREE_PURPOSE is the default value, if any. The
02823 TEMPLATE_PARM_INDEX for the parameter is avilable as the
02824 DECL_INITIAL (for a PARM_DECL) or as the TREE_TYPE (for a
02825 TYPE_DECL). */
02826 #define DECL_TEMPLATE_PARMS(NODE) DECL_ARGUMENTS (NODE)
02827 #define DECL_INNERMOST_TEMPLATE_PARMS(NODE) \
02828 INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (NODE))
02829 #define DECL_NTPARMS(NODE) \
02830 TREE_VEC_LENGTH (DECL_INNERMOST_TEMPLATE_PARMS (NODE))
02831 /* For function, method, class-data templates. */
02832 #define DECL_TEMPLATE_RESULT(NODE) DECL_RESULT_FLD (NODE)
02833 /* For a static member variable template, the
02834 DECL_TEMPLATE_INSTANTIATIONS list contains the explicitly and
02835 implicitly generated instantiations of the variable. There are no
02836 partial instantiations of static member variables, so all of these
02837 will be full instantiations.
02838
02839 For a class template the DECL_TEMPLATE_INSTANTIATIONS lists holds
02840 all instantiations and specializations of the class type, including
02841 partial instantiations and partial specializations.
02842
02843 In both cases, the TREE_PURPOSE of each node contains the arguments
02844 used; the TREE_VALUE contains the generated variable. The template
02845 arguments are always complete. For example, given:
02846
02847 template <class T> struct S1 {
02848 template <class U> struct S2 {};
02849 template <class U> struct S2<U*> {};
02850 };
02851
02852 the record for the partial specialization will contain, as its
02853 argument list, { {T}, {U*} }, and will be on the
02854 DECL_TEMPLATE_INSTANTIATIONS list for `template <class T> template
02855 <class U> struct S1<T>::S2'.
02856
02857 This list is not used for function templates. */
02858 #define DECL_TEMPLATE_INSTANTIATIONS(NODE) DECL_VINDEX (NODE)
02859 /* For a function template, the DECL_TEMPLATE_SPECIALIZATIONS lists
02860 contains all instantiations and specializations of the function,
02861 including partial instantiations. For a partial instantiation
02862 which is a specialization, this list holds only full
02863 specializations of the template that are instantiations of the
02864 partial instantiation. For example, given:
02865
02866 template <class T> struct S {
02867 template <class U> void f(U);
02868 template <> void f(T);
02869 };
02870
02871 the `S<int>::f<int>(int)' function will appear on the
02872 DECL_TEMPLATE_SPECIALIZATIONS list for both `template <class T>
02873 template <class U> void S<T>::f(U)' and `template <class T> void
02874 S<int>::f(T)'. In the latter case, however, it will have only the
02875 innermost set of arguments (T, in this case). The DECL_TI_TEMPLATE
02876 for the function declaration will point at the specialization, not
02877 the fully general template.
02878
02879 For a class template, this list contains the partial
02880 specializations of this template. (Full specializations are not
02881 recorded on this list.) The TREE_PURPOSE holds the innermost
02882 arguments used in the partial specialization (e.g., for `template
02883 <class T> struct S<T*, int>' this will be `T*'.) The TREE_VALUE
02884 holds the innermost template parameters for the specialization
02885 (e.g., `T' in the example above.) The TREE_TYPE is the _TYPE node
02886 for the partial specialization.
02887
02888 This list is not used for static variable templates. */
02889 #define DECL_TEMPLATE_SPECIALIZATIONS(NODE) DECL_SIZE (NODE)
02890
02891 /* Nonzero for a DECL which is actually a template parameter. */
02892 #define DECL_TEMPLATE_PARM_P(NODE) \
02893 (DECL_LANG_FLAG_0 (NODE) \
02894 && (TREE_CODE (NODE) == CONST_DECL \
02895 || TREE_CODE (NODE) == PARM_DECL \
02896 || TREE_CODE (NODE) == TYPE_DECL \
02897 || TREE_CODE (NODE) == TEMPLATE_DECL))
02898
02899 /* Mark NODE as a template parameter. */
02900 #define SET_DECL_TEMPLATE_PARM_P(NODE) \
02901 (DECL_LANG_FLAG_0 (NODE) = 1)
02902
02903 /* Nonzero if NODE is a template template parameter. */
02904 #define DECL_TEMPLATE_TEMPLATE_PARM_P(NODE) \
02905 (TREE_CODE (NODE) == TEMPLATE_DECL && DECL_TEMPLATE_PARM_P (NODE))
02906
02907 #define DECL_FUNCTION_TEMPLATE_P(NODE) \
02908 (TREE_CODE (NODE) == TEMPLATE_DECL \
02909 && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == FUNCTION_DECL)
02910
02911 /* Nonzero for a DECL that represents a template class. */
02912 #define DECL_CLASS_TEMPLATE_P(NODE) \
02913 (TREE_CODE (NODE) == TEMPLATE_DECL \
02914 && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == TYPE_DECL \
02915 && !DECL_TEMPLATE_TEMPLATE_PARM_P (NODE))
02916
02917 /* Nonzero if NODE which declares a type. */
02918 #define DECL_DECLARES_TYPE_P(NODE) \
02919 (TREE_CODE (NODE) == TYPE_DECL || DECL_CLASS_TEMPLATE_P (NODE))
02920
02921 /* Nonzero if NODE is the typedef implicitly generated for a type when
02922 the type is declared. In C++, `struct S {};' is roughly
02923 equivalent to `struct S {}; typedef struct S S;' in C.
02924 DECL_IMPLICIT_TYPEDEF_P will hold for the typedef indicated in this
02925 example. In C++, there is a second implicit typedef for each
02926 class, in the scope of `S' itself, so that you can say `S::S'.
02927 DECL_SELF_REFERENCE_P will hold for that second typedef. */
02928 #define DECL_IMPLICIT_TYPEDEF_P(NODE) \
02929 (TREE_CODE (NODE) == TYPE_DECL && DECL_LANG_FLAG_2 (NODE))
02930 #define SET_DECL_IMPLICIT_TYPEDEF_P(NODE) \
02931 (DECL_LANG_FLAG_2 (NODE) = 1)
02932 #define DECL_SELF_REFERENCE_P(NODE) \
02933 (TREE_CODE (NODE) == TYPE_DECL && DECL_LANG_FLAG_4 (NODE))
02934 #define SET_DECL_SELF_REFERENCE_P(NODE) \
02935 (DECL_LANG_FLAG_4 (NODE) = 1)
02936
02937 /* A `primary' template is one that has its own template header. A
02938 member function of a class template is a template, but not primary.
02939 A member template is primary. Friend templates are primary, too. */
02940
02941 /* Returns the primary template corresponding to these parameters. */
02942 #define DECL_PRIMARY_TEMPLATE(NODE) \
02943 (TREE_TYPE (DECL_INNERMOST_TEMPLATE_PARMS (NODE)))
02944
02945 /* Returns nonzero if NODE is a primary template. */
02946 #define PRIMARY_TEMPLATE_P(NODE) (DECL_PRIMARY_TEMPLATE (NODE) == (NODE))
02947
02948 #define CLASSTYPE_TEMPLATE_LEVEL(NODE) \
02949 (TREE_INT_CST_LOW (TREE_PURPOSE (CLASSTYPE_TI_TEMPLATE (NODE))))
02950
02951 /* Indicates whether or not (and how) a template was expanded for this
02952 FUNCTION_DECL or VAR_DECL.
02953 0=normal declaration, e.g. int min (int, int);
02954 1=implicit template instantiation
02955 2=explicit template specialization, e.g. int min<int> (int, int);
02956 3=explicit template instantiation, e.g. template int min<int> (int, int); */
02957 #define DECL_USE_TEMPLATE(NODE) (DECL_LANG_SPECIFIC (NODE)->decl_flags.use_template)
02958
02959 #define DECL_TEMPLATE_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) & 1)
02960 #define CLASSTYPE_TEMPLATE_INSTANTIATION(NODE) \
02961 (CLASSTYPE_USE_TEMPLATE (NODE) & 1)
02962
02963 #define DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) == 2)
02964 #define SET_DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) = 2)
02965 #define CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \
02966 (CLASSTYPE_USE_TEMPLATE (NODE) == 2)
02967 #define SET_CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \
02968 (CLASSTYPE_USE_TEMPLATE (NODE) = 2)
02969
02970 #define DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 1)
02971 #define SET_DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) = 1)
02972 #define CLASSTYPE_IMPLICIT_INSTANTIATION(NODE) \
02973 (CLASSTYPE_USE_TEMPLATE (NODE) == 1)
02974 #define SET_CLASSTYPE_IMPLICIT_INSTANTIATION(NODE) \
02975 (CLASSTYPE_USE_TEMPLATE (NODE) = 1)
02976
02977 #define DECL_EXPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 3)
02978 #define SET_DECL_EXPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) = 3)
02979 #define CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \
02980 (CLASSTYPE_USE_TEMPLATE (NODE) == 3)
02981 #define SET_CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \
02982 (CLASSTYPE_USE_TEMPLATE (NODE) = 3)
02983
02984 /* Nonzero if DECL is a friend function which is an instantiation
02985 from the point of view of the compiler, but not from the point of
02986 view of the language. For example given:
02987 template <class T> struct S { friend void f(T) {}; };
02988 the declaration of `void f(int)' generated when S<int> is
02989 instantiated will not be a DECL_TEMPLATE_INSTANTIATION, but will be
02990 a DECL_FRIEND_PSUEDO_TEMPLATE_INSTANTIATION. */
02991 #define DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION(DECL) \
02992 (DECL_TEMPLATE_INFO (DECL) && !DECL_USE_TEMPLATE (DECL))
02993
02994 /* Nonzero if TYPE is a partial instantiation of a template class,
02995 i.e., an instantiation whose instantiation arguments involve
02996 template types. */
02997 #define PARTIAL_INSTANTIATION_P(TYPE) \
02998 (LANG_TYPE_CLASS_CHECK (TYPE)->is_partial_instantiation)
02999
03000 /* Nonzero iff we are currently processing a declaration for an
03001 entity with its own template parameter list, and which is not a
03002 full specialization. */
03003 #define PROCESSING_REAL_TEMPLATE_DECL_P() \
03004 (processing_template_decl > template_class_depth (current_scope ()))
03005
03006 /* Nonzero if this VAR_DECL or FUNCTION_DECL has already been
03007 instantiated, i.e. its definition has been generated from the
03008 pattern given in the the template. */
03009 #define DECL_TEMPLATE_INSTANTIATED(NODE) \
03010 DECL_LANG_FLAG_1 (VAR_OR_FUNCTION_DECL_CHECK (NODE))
03011
03012 /* We know what we're doing with this decl now. */
03013 #define DECL_INTERFACE_KNOWN(NODE) DECL_LANG_FLAG_5 (NODE)
03014
03015 /* This function was declared inline. This flag controls the linkage
03016 semantics of 'inline'; whether or not the function is inlined is
03017 controlled by DECL_INLINE. */
03018 #define DECL_DECLARED_INLINE_P(NODE) \
03019 (DECL_LANG_SPECIFIC (NODE)->decl_flags.base.declared_inline)
03020
03021 /* DECL_EXTERNAL must be set on a decl until the decl is actually emitted,
03022 so that assemble_external will work properly. So we have this flag to
03023 tell us whether the decl is really not external. */
03024 #define DECL_NOT_REALLY_EXTERN(NODE) \
03025 (DECL_LANG_SPECIFIC (NODE)->decl_flags.not_really_extern)
03026
03027 #define DECL_REALLY_EXTERN(NODE) \
03028 (DECL_EXTERNAL (NODE) && ! DECL_NOT_REALLY_EXTERN (NODE))
03029
03030 /* A thunk is a stub function.
03031
03032 A thunk is an alternate entry point for an ordinary FUNCTION_DECL.
03033 The address of the ordinary FUNCTION_DECL is given by the
03034 DECL_INITIAL, which is always an ADDR_EXPR whose operand is a
03035 FUNCTION_DECL. The job of the thunk is to adjust the `this'
03036 pointer before transferring control to the FUNCTION_DECL.
03037
03038 A thunk may perform either, or both, of the following operations:
03039
03040 o Adjust the `this' pointer by a constant offset.
03041 o Adjust the `this' pointer by looking up a vcall-offset
03042 in the vtable.
03043
03044 If both operations are performed, then the constant adjument to
03045 `this' is performed first.
03046
03047 The constant adjustment is given by THUNK_DELTA. If the
03048 vcall-offset is required, the index into the vtable is given by
03049 THUNK_VCALL_OFFSET. */
03050
03051 /* An integer indicating how many bytes should be subtracted from the
03052 `this' pointer when this function is called. */
03053 #ifdef KEY
03054 #define THUNK_DELTA(DECL) (DECL_CHECK (DECL)->decl.thunk_delta)
03055 #else
03056 #define THUNK_DELTA(DECL) \
03057 (DECL_LANG_SPECIFIC (DECL)->u.f.delta)
03058 #endif /* KEY */
03059
03060 /* A tree indicating how many bytes should be subtracted from the
03061 vtable for the `this' pointer to find the vcall offset. (The vptr
03062 is always located at offset zero from the f `this' pointer.) If
03063 NULL, then there is no vcall offset. */
03064 #define THUNK_VCALL_OFFSET(DECL) \
03065 (LANG_DECL_U2_CHECK (DECL, 0)->vcall_offset)
03066
03067 /* These macros provide convenient access to the various _STMT nodes
03068 created when parsing template declarations. */
03069 #define TRY_STMTS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 0)
03070 #define TRY_HANDLERS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 1)
03071
03072 #define EH_SPEC_STMTS(NODE) TREE_OPERAND (EH_SPEC_BLOCK_CHECK (NODE), 0)
03073 #define EH_SPEC_RAISES(NODE) TREE_OPERAND (EH_SPEC_BLOCK_CHECK (NODE), 1)
03074
03075 #define USING_STMT_NAMESPACE(NODE) TREE_OPERAND (USING_STMT_CHECK (NODE), 0)
03076
03077 /* Nonzero if this try block is a function try block. */
03078 #define FN_TRY_BLOCK_P(NODE) TREE_LANG_FLAG_3 (TRY_BLOCK_CHECK (NODE))
03079 #define HANDLER_PARMS(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 0)
03080 #define HANDLER_BODY(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 1)
03081 #define HANDLER_TYPE(NODE) TREE_TYPE (HANDLER_CHECK (NODE))
03082
03083 /* The parameters for a call-declarator. */
03084 #define CALL_DECLARATOR_PARMS(NODE) \
03085 (TREE_PURPOSE (TREE_OPERAND (NODE, 1)))
03086
03087 /* The cv-qualifiers for a call-declarator. */
03088 #define CALL_DECLARATOR_QUALS(NODE) \
03089 (TREE_VALUE (TREE_OPERAND (NODE, 1)))
03090
03091 /* The exception-specification for a call-declarator. */
03092 #define CALL_DECLARATOR_EXCEPTION_SPEC(NODE) \
03093 (TREE_TYPE (NODE))
03094
03095 /* An enumeration of the kind of tags that C++ accepts. */
03096 enum tag_types { record_type, class_type, union_type, enum_type };
03097
03098 /* The various kinds of lvalues we distinguish. */
03099 typedef enum cp_lvalue_kind {
03100 clk_none = 0, /* Things that are not an lvalue. */
03101 clk_ordinary = 1, /* An ordinary lvalue. */
03102 clk_class = 2, /* An rvalue of class-type. */
03103 clk_bitfield = 4, /* An lvalue for a bit-field. */
03104 } cp_lvalue_kind;
03105
03106 /* The kinds of scopes we recognize. */
03107 typedef enum scope_kind {
03108 sk_template_parms, /* A scope for template parameters. */
03109 sk_template_spec /* A scope corresponding to a template
03110 specialization. There is never anything in
03111 this scope. */
03112 } scope_kind;
03113
03114 /* Various kinds of template specialization, instantiation, etc. */
03115 typedef enum tmpl_spec_kind {
03116 tsk_none, /* Not a template at all. */
03117 tsk_invalid_member_spec, /* An explicit member template
03118 specialization, but the enclosing
03119 classes have not all been explicitly
03120 specialized. */
03121 tsk_invalid_expl_inst, /* An explicit instantiation containing
03122 template parameter lists. */
03123 tsk_excessive_parms, /* A template declaration with too many
03124 template parameter lists. */
03125 tsk_insufficient_parms, /* A template declaration with too few
03126 parameter lists. */
03127 tsk_template, /* A template declaration. */
03128 tsk_expl_spec, /* An explicit specialization. */
03129 tsk_expl_inst /* An explicit instantiation. */
03130 } tmpl_spec_kind;
03131
03132 /* The various kinds of access. BINFO_ACCESS depends on these being
03133 two bit quantities. The numerical values are important; they are
03134 used to initialize RTTI data structures, so changing them changes
03135 the ABI. */
03136 typedef enum access_kind {
03137 ak_none = 0, /* Inaccessible. */
03138 ak_public = 1, /* Accessible, as a `public' thing. */
03139 ak_protected = 2, /* Accessible, as a `protected' thing. */
03140 ak_private = 3 /* Accessible, as a `private' thing. */
03141 } access_kind;
03142
03143 /* The various kinds of special functions. If you add to this list,
03144 you should update special_function_p as well. */
03145 typedef enum special_function_kind {
03146 sfk_none = 0, /* Not a special function. This enumeral
03147 must have value zero; see
03148 special_function_p. */
03149 sfk_constructor, /* A constructor. */
03150 sfk_copy_constructor, /* A copy constructor. */
03151 sfk_assignment_operator, /* An assignment operator. */
03152 sfk_destructor, /* A destructor. */
03153 sfk_complete_destructor, /* A destructor for complete objects. */
03154 sfk_base_destructor, /* A destructor for base subobjects. */
03155 sfk_deleting_destructor, /* A destructor for complete objects that
03156 deletes the object after it has been
03157 destroyed. */
03158 sfk_conversion /* A conversion operator. */
03159 } special_function_kind;
03160
03161 /* The various kinds of linkage. From [basic.link],
03162
03163 A name is said to have linkage when it might denote the same
03164 object, reference, function, type, template, namespace or value
03165 as a name introduced in another scope:
03166
03167 -- When a name has external linkage, the entity it denotes can
03168 be referred to from scopes of other translation units or from
03169 other scopes of the same translation unit.
03170
03171 -- When a name has internal linkage, the entity it denotes can
03172 be referred to by names from other scopes in the same
03173 translation unit.
03174
03175 -- When a name has no linkage, the entity it denotes cannot be
03176 referred to by names from other scopes. */
03177
03178 typedef enum linkage_kind {
03179 lk_none, /* No linkage. */
03180 lk_internal, /* Internal linkage. */
03181 lk_external /* External linkage. */
03182 } linkage_kind;
03183
03184 /* Bitmask flags to control type substitution. */
03185 typedef enum tsubst_flags_t {
03186 tf_none = 0, /* nothing special */
03187 tf_error = 1 << 0, /* give error messages */
03188 tf_warning = 1 << 1, /* give warnings too */
03189 tf_no_attributes = 1 << 2, /* ignore attributes on comparisons
03190 (instantiate_type use) */
03191 tf_ignore_bad_quals = 1 << 3, /* ignore bad cvr qualifiers */
03192 tf_keep_type_decl = 1 << 4, /* retain typedef type decls
03193 (make_typename_type use) */
03194 tf_ptrmem_ok = 1 << 5, /* pointers to member ok (internal
03195 instantiate_type use) */
03196 tf_parsing = 1 << 6 /* called from parser
03197 (make_typename_type use) */
03198 } tsubst_flags_t;
03199
03200 /* The kind of checking we can do looking in a class hierarchy. */
03201 typedef enum base_access {
03202 ba_any = 0, /* Do not check access, allow an ambiguous base,
03203 prefer a non-virtual base */
03204 ba_ignore = 1, /* Do not check access */
03205 ba_check = 2, /* Check access */
03206 ba_not_special = 3, /* Do not consider special privilege
03207 current_class_type might give. */
03208 ba_quiet = 4, /* Do not issue error messages (bit mask). */
03209 } base_access;
03210
03211 /* The kind of base we can find, looking in a class hierarchy.
03212 Values <0 indicate we failed. */
03213 typedef enum base_kind {
03214 bk_inaccessible = -3, /* The base is inaccessible */
03215 bk_ambig = -2, /* The base is ambiguous */
03216 bk_not_base = -1, /* It is not a base */
03217 bk_same_type = 0, /* It is the same type */
03218 bk_proper_base = 1, /* It is a proper base */
03219 bk_via_virtual = 2 /* It is a proper base, but via a virtual
03220 path. This might not be the canonical
03221 binfo. */
03222 } base_kind;
03223
03224 /* Set by add_implicitly_declared_members() to keep those members from
03225 being flagged as deprecated or reported as using deprecated
03226 types. */
03227 extern int adding_implicit_members;
03228
03229 /* in decl{2}.c */
03230 /* A node that is a list (length 1) of error_mark_nodes. */
03231 extern GTY(()) tree error_mark_list;
03232
03233 /* Node for "pointer to (virtual) function".
03234 This may be distinct from ptr_type_node so gdb can distinguish them. */
03235 #define vfunc_ptr_type_node vtable_entry_type
03236
03237
03238 /* For building calls to `delete'. */
03239 extern GTY(()) tree integer_two_node;
03240 extern GTY(()) tree integer_three_node;
03241
03242 extern GTY(()) tree anonymous_namespace_name;
03243
03244 /* The number of function bodies which we are currently processing.
03245 (Zero if we are at namespace scope, one inside the body of a
03246 function, two inside the body of a function in a local class, etc.) */
03247 extern int function_depth;
03248
03249 /* in pt.c */
03250
03251 /* These values are used for the `STRICT' parameter to type_unification and
03252 fn_type_unification. Their meanings are described with the
03253 documentation for fn_type_unification. */
03254
03255 typedef enum unification_kind_t {
03256 DEDUCE_CALL,
03257 DEDUCE_CONV,
03258 DEDUCE_EXACT,
03259 DEDUCE_ORDER
03260 } unification_kind_t;
03261
03262 /* Macros for operating on a template instantiation level node, represented
03263 by an EXPR_WITH_FILE_LOCATION. */
03264
03265 #define TINST_DECL(NODE) EXPR_WFL_NODE (NODE)
03266 #define TINST_LINE(NODE) EXPR_WFL_LINENO (NODE)
03267 #define TINST_FILE(NODE) EXPR_WFL_FILENAME (NODE)
03268
03269 /* in class.c */
03270
03271 extern int current_class_depth;
03272
03273 /* An array of all local classes present in this translation unit, in
03274 declaration order. */
03275 extern GTY(()) varray_type local_classes;
03276
03277 /* Here's where we control how name mangling takes place. */
03278
03279 /* Cannot use '$' up front, because this confuses gdb
03280 (names beginning with '$' are gdb-local identifiers).
03281
03282 Note that all forms in which the '$' is significant are long enough
03283 for direct indexing (meaning that if we know there is a '$'
03284 at a particular location, we can index into the string at
03285 any other location that provides distinguishing characters). */
03286
03287 /* Define NO_DOLLAR_IN_LABEL in your favorite tm file if your assembler
03288 doesn't allow '$' in symbol names. */
03289 #ifndef NO_DOLLAR_IN_LABEL
03290
03291 #define JOINER '$'
03292
03293 #define VPTR_NAME "$v"
03294 #define THROW_NAME "$eh_throw"
03295 #define AUTO_VTABLE_NAME "__vtbl$me__"
03296 #define AUTO_TEMP_NAME "_$tmp_"
03297 #define AUTO_TEMP_FORMAT "_$tmp_%d"
03298 #define VTABLE_BASE "$vb"
03299 #define VTABLE_NAME_PREFIX "__vt_"
03300 #define VFIELD_BASE "$vf"
03301 #define VFIELD_NAME "_vptr$"
03302 #define VFIELD_NAME_FORMAT "_vptr$%s"
03303 #define STATIC_NAME_FORMAT "_%s$%s"
03304 #define ANON_AGGRNAME_FORMAT "$_%d"
03305
03306 #else /* NO_DOLLAR_IN_LABEL */
03307
03308 #ifndef NO_DOT_IN_LABEL
03309
03310 #define JOINER '.'
03311
03312 #define VPTR_NAME ".v"
03313 #define THROW_NAME ".eh_throw"
03314 #define AUTO_VTABLE_NAME "__vtbl.me__"
03315 #define AUTO_TEMP_NAME "_.tmp_"
03316 #define AUTO_TEMP_FORMAT "_.tmp_%d"
03317 #define VTABLE_BASE ".vb"
03318 #define VTABLE_NAME_PREFIX "__vt_"
03319 #define VFIELD_BASE ".vf"
03320 #define VFIELD_NAME "_vptr."
03321 #define VFIELD_NAME_FORMAT "_vptr.%s"
03322 #define STATIC_NAME_FORMAT "_%s.%s"
03323
03324 #define ANON_AGGRNAME_FORMAT "._%d"
03325
03326 #else /* NO_DOT_IN_LABEL */
03327
03328 #define VPTR_NAME "__vptr"
03329 #define VPTR_NAME_P(ID_NODE) \
03330 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VPTR_NAME, sizeof (VPTR_NAME) - 1))
03331 #define THROW_NAME "__eh_throw"
03332 #define IN_CHARGE_NAME "__in_chrg"
03333 #define AUTO_VTABLE_NAME "__vtbl_me__"
03334 #define AUTO_TEMP_NAME "__tmp_"
03335 #define TEMP_NAME_P(ID_NODE) \
03336 (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, \
03337 sizeof (AUTO_TEMP_NAME) - 1))
03338 #define AUTO_TEMP_FORMAT "__tmp_%d"
03339 #define VTABLE_BASE "__vtb"
03340 #define VTABLE_NAME "__vt_"
03341 #define VTABLE_NAME_PREFIX "__vt_"
03342 #define VTABLE_NAME_P(ID_NODE) \
03343 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VTABLE_NAME, \
03344 sizeof (VTABLE_NAME) - 1))
03345 #define VFIELD_BASE "__vfb"
03346 #define VFIELD_NAME "__vptr_"
03347 #define VFIELD_NAME_P(ID_NODE) \
03348 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, \
03349 sizeof (VFIELD_NAME) - 1))
03350 #define VFIELD_NAME_FORMAT "__vptr_%s"
03351 #define STATIC_NAME_FORMAT "__static_%s_%s"
03352
03353 #define ANON_AGGRNAME_PREFIX "__anon_"
03354 #define ANON_AGGRNAME_P(ID_NODE) \
03355 (!strncmp (IDENTIFIER_POINTER (ID_NODE), ANON_AGGRNAME_PREFIX, \
03356 sizeof (ANON_AGGRNAME_PREFIX) - 1))
03357 #define ANON_AGGRNAME_FORMAT "__anon_%d"
03358
03359 #endif /* NO_DOT_IN_LABEL */
03360 #endif /* NO_DOLLAR_IN_LABEL */
03361
03362 #define THIS_NAME "this"
03363 #define CTOR_NAME "__ct"
03364 #define DTOR_NAME "__dt"
03365
03366 #define IN_CHARGE_NAME "__in_chrg"
03367
03368 #define VTBL_PTR_TYPE "__vtbl_ptr_type"
03369 #define VTABLE_DELTA_NAME "__delta"
03370 #define VTABLE_PFN_NAME "__pfn"
03371
03372 #define EXCEPTION_CLEANUP_NAME "exception cleanup"
03373
03374 #if !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL)
03375
03376 #define VPTR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
03377 && IDENTIFIER_POINTER (ID_NODE)[1] == 'v')
03378
03379 #define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \
03380 && IDENTIFIER_POINTER (ID_NODE)[2] == 't' \
03381 && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER)
03382
03383 #define TEMP_NAME_P(ID_NODE) \
03384 (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, sizeof (AUTO_TEMP_NAME)-1))
03385 #define VFIELD_NAME_P(ID_NODE) \
03386 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, sizeof(VFIELD_NAME)-1))
03387
03388 /* For anonymous aggregate types, we need some sort of name to
03389 hold on to. In practice, this should not appear, but it should
03390 not be harmful if it does. */
03391 #define ANON_AGGRNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
03392 && IDENTIFIER_POINTER (ID_NODE)[1] == '_')
03393 #endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */
03394
03395 /* Returns nonzero iff NODE is a declaration for the global function
03396 `main'. */
03397 #define DECL_MAIN_P(NODE) \
03398 (DECL_EXTERN_C_FUNCTION_P (NODE) \
03399 && DECL_NAME (NODE) != NULL_TREE \
03400 && MAIN_NAME_P (DECL_NAME (NODE)))
03401
03402
03403 /* Nonzero if we're done parsing and into end-of-file activities. */
03404
03405 extern int at_eof;
03406
03407 /* A list of namespace-scope objects which have constructors or
03408 destructors which reside in the global scope. The decl is stored
03409 in the TREE_VALUE slot and the initializer is stored in the
03410 TREE_PURPOSE slot. */
03411 extern GTY(()) tree static_aggregates;
03412
03413 /* Functions called along with real static constructors and destructors. */
03414
03415 extern GTY(()) tree static_ctors;
03416 extern GTY(()) tree static_dtors;
03417
03418 enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
03419
03420 /* Some macros for char-based bitfields. */
03421 #define B_SET(A,X) ((A)[(X)>>3] |= (1 << ((X)&7)))
03422 #define B_CLR(A,X) ((A)[(X)>>3] &= ~(1 << ((X)&7)))
03423 #define B_TST(A,X) ((A)[(X)>>3] & (1 << ((X)&7)))
03424
03425 /* These are uses as bits in flags passed to build_method_call
03426 to control its error reporting behavior.
03427
03428 LOOKUP_PROTECT means flag access violations.
03429 LOOKUP_COMPLAIN mean complain if no suitable member function
03430 matching the arguments is found.
03431 LOOKUP_NORMAL is just a combination of these two.
03432 LOOKUP_NONVIRTUAL means make a direct call to the member function found
03433 LOOKUP_GLOBAL means search through the space of overloaded functions,
03434 as well as the space of member functions.
03435 LOOKUP_ONLYCONVERTING means that non-conversion constructors are not tried.
03436 DIRECT_BIND means that if a temporary is created, it should be created so
03437 that it lives as long as the current variable bindings; otherwise it
03438 only lives until the end of the complete-expression. It also forces
03439 direct-initialization in cases where other parts of the compiler have
03440 already generated a temporary, such as reference initialization and the
03441 catch parameter.
03442 LOOKUP_SPECULATIVELY means return NULL_TREE if we cannot find what we are
03443 after. Note, LOOKUP_COMPLAIN is checked and error messages printed
03444 before LOOKUP_SPECULATIVELY is checked.
03445 LOOKUP_NO_CONVERSION means that user-defined conversions are not
03446 permitted. Built-in conversions are permitted.
03447 LOOKUP_DESTRUCTOR means explicit call to destructor.
03448 LOOKUP_NO_TEMP_BIND means temporaries will not be bound to references.
03449
03450 These are used in global lookup to support elaborated types and
03451 qualifiers.
03452
03453 LOOKUP_PREFER_TYPES means not to accept objects, and possibly namespaces.
03454 LOOKUP_PREFER_NAMESPACES means not to accept objects, and possibly types.
03455 LOOKUP_PREFER_BOTH means class-or-namespace-name.
03456 LOOKUP_TEMPLATES_EXPECTED means that class templates also count
03457 as types. */
03458
03459 #define LOOKUP_PROTECT (1)
03460 #define LOOKUP_COMPLAIN (2)
03461 #define LOOKUP_NORMAL (3)
03462 #define LOOKUP_NONVIRTUAL (8)
03463 #define LOOKUP_GLOBAL (16)
03464 #define LOOKUP_SPECULATIVELY (64)
03465 #define LOOKUP_ONLYCONVERTING (128)
03466 #define DIRECT_BIND (256)
03467 #define LOOKUP_NO_CONVERSION (512)
03468 #define LOOKUP_DESTRUCTOR (512)
03469 #define LOOKUP_NO_TEMP_BIND (1024)
03470 #define LOOKUP_PREFER_TYPES (2048)
03471 #define LOOKUP_PREFER_NAMESPACES (4096)
03472 #define LOOKUP_PREFER_BOTH (6144)
03473 #define LOOKUP_TEMPLATES_EXPECTED (8192)
03474
03475 #define LOOKUP_NAMESPACES_ONLY(F) \
03476 (((F) & LOOKUP_PREFER_NAMESPACES) && !((F) & LOOKUP_PREFER_TYPES))
03477 #define LOOKUP_TYPES_ONLY(F) \
03478 (!((F) & LOOKUP_PREFER_NAMESPACES) && ((F) & LOOKUP_PREFER_TYPES))
03479 #define LOOKUP_QUALIFIERS_ONLY(F) ((F) & LOOKUP_PREFER_BOTH)
03480
03481
03482 /* These flags are used by the conversion code.
03483 CONV_IMPLICIT : Perform implicit conversions (standard and user-defined).
03484 CONV_STATIC : Perform the explicit conversions for static_cast.
03485 CONV_CONST : Perform the explicit conversions for const_cast.
03486 CONV_REINTERPRET: Perform the explicit conversions for reinterpret_cast.
03487 CONV_PRIVATE : Perform upcasts to private bases.
03488 CONV_FORCE_TEMP : Require a new temporary when converting to the same
03489 aggregate type. */
03490
03491 #define CONV_IMPLICIT 1
03492 #define CONV_STATIC 2
03493 #define CONV_CONST 4
03494 #define CONV_REINTERPRET 8
03495 #define CONV_PRIVATE 16
03496 /* #define CONV_NONCONVERTING 32 */
03497 #define CONV_FORCE_TEMP 64
03498 #define CONV_STATIC_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_FORCE_TEMP)
03499 #define CONV_OLD_CONVERT (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \
03500 | CONV_REINTERPRET)
03501 #define CONV_C_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \
03502 | CONV_REINTERPRET | CONV_PRIVATE | CONV_FORCE_TEMP)
03503
03504 /* Used by build_expr_type_conversion to indicate which types are
03505 acceptable as arguments to the expression under consideration. */
03506
03507 #define WANT_INT 1 /* integer types, including bool */
03508 #define WANT_FLOAT 2 /* floating point types */
03509 #define WANT_ENUM 4 /* enumerated types */
03510 #define WANT_POINTER 8 /* pointer types */
03511 #define WANT_NULL 16 /* null pointer constant */
03512 #define WANT_ARITH (WANT_INT | WANT_FLOAT)
03513
03514 /* Used with comptypes, and related functions, to guide type
03515 comparison. */
03516
03517 #define COMPARE_STRICT 0 /* Just check if the types are the
03518 same. */
03519 #define COMPARE_BASE 1 /* Check to see if the second type is
03520 derived from the first, or if both
03521 are pointers (or references) and
03522 the types pointed to by the second
03523 type is derived from the pointed to
03524 by the first. */
03525 #define COMPARE_RELAXED 2 /* Like COMPARE_DERIVED, but in
03526 reverse. Also treat enumeration
03527 types as the same as integer types
03528 of the same width. */
03529 #define COMPARE_REDECLARATION 4 /* The comparsion is being done when
03530 another declaration of an existing
03531 entity is seen. */
03532 #define COMPARE_NO_ATTRIBUTES 8 /* The comparison should ignore
03533 extra-linguistic type attributes. */
03534
03535 /* Used with push_overloaded_decl. */
03536 #define PUSH_GLOBAL 0 /* Push the DECL into namespace scope,
03537 regardless of the current scope. */
03538 #define PUSH_LOCAL 1 /* Push the DECL into the current
03539 scope. */
03540 #define PUSH_USING 2 /* We are pushing this DECL as the
03541 result of a using declaration. */
03542
03543 /* Used with start function. */
03544 #define SF_DEFAULT 0 /* No flags. */
03545 #define SF_PRE_PARSED 1 /* The function declaration has
03546 already been parsed. */
03547 #define SF_INCLASS_INLINE 2 /* The function is an inline, defined
03548 in the class body. */
03549
03550 /* Returns nonzero iff TYPE1 and TYPE2 are the same type, or if TYPE2
03551 is derived from TYPE1, or if TYPE2 is a pointer (reference) to a
03552 class derived from the type pointed to (referred to) by TYPE1. */
03553 #define same_or_base_type_p(TYPE1, TYPE2) \
03554 comptypes ((TYPE1), (TYPE2), COMPARE_BASE)
03555
03556 /* These macros are used to access a TEMPLATE_PARM_INDEX. */
03557 #define TEMPLATE_PARM_INDEX_CAST(NODE) \
03558 ((template_parm_index*)TEMPLATE_PARM_INDEX_CHECK (NODE))
03559 #define TEMPLATE_PARM_IDX(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->index)
03560 #define TEMPLATE_PARM_LEVEL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->level)
03561 #define TEMPLATE_PARM_DESCENDANTS(NODE) (TREE_CHAIN (NODE))
03562 #define TEMPLATE_PARM_ORIG_LEVEL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->orig_level)
03563 #define TEMPLATE_PARM_DECL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->decl)
03564
03565 /* These macros are for accessing the fields of TEMPLATE_TYPE_PARM,
03566 TEMPLATE_TEMPLATE_PARM and BOUND_TEMPLATE_TEMPLATE_PARM nodes. */
03567 #define TEMPLATE_TYPE_PARM_INDEX(NODE) (TYPE_FIELDS (NODE))
03568 #define TEMPLATE_TYPE_IDX(NODE) \
03569 (TEMPLATE_PARM_IDX (TEMPLATE_TYPE_PARM_INDEX (NODE)))
03570 #define TEMPLATE_TYPE_LEVEL(NODE) \
03571 (TEMPLATE_PARM_LEVEL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
03572 #define TEMPLATE_TYPE_ORIG_LEVEL(NODE) \
03573 (TEMPLATE_PARM_ORIG_LEVEL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
03574 #define TEMPLATE_TYPE_DECL(NODE) \
03575 (TEMPLATE_PARM_DECL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
03576
03577 /* These constants can used as bit flags in the process of tree formatting.
03578
03579 TFF_PLAIN_IDENTIFIER: unqualified part of a name.
03580 TFF_SCOPE: include the class and namespace scope of the name.
03581 TFF_CHASE_TYPEDEF: print the original type-id instead of the typedef-name.
03582 TFF_DECL_SPECIFIERS: print decl-specifiers.
03583 TFF_CLASS_KEY_OR_ENUM: precede a class-type name (resp. enum name) with
03584 a class-key (resp. `enum').
03585 TFF_RETURN_TYPE: include function return type.
03586 TFF_FUNCTION_DEFAULT_ARGUMENTS: include function default parameter values.
03587 TFF_EXCEPTION_SPECIFICATION: show function exception specification.
03588 TFF_TEMPLATE_HEADER: show the template<...> header in a
03589 template-declaration.
03590 TFF_TEMPLATE_NAME: show only template-name.
03591 TFF_EXPR_IN_PARENS: Parenthesize expressions. */
03592
03593 #define TFF_PLAIN_IDENTIFIER (0)
03594 #define TFF_SCOPE (1)
03595 #define TFF_CHASE_TYPEDEF (1 << 1)
03596 #define TFF_DECL_SPECIFIERS (1 << 2)
03597 #define TFF_CLASS_KEY_OR_ENUM (1 << 3)
03598 #define TFF_RETURN_TYPE (1 << 4)
03599 #define TFF_FUNCTION_DEFAULT_ARGUMENTS (1 << 5)
03600 #define TFF_EXCEPTION_SPECIFICATION (1 << 6)
03601 #define TFF_TEMPLATE_HEADER (1 << 7)
03602 #define TFF_TEMPLATE_NAME (1 << 8)
03603 #define TFF_EXPR_IN_PARENS (1 << 9)
03604
03605 /* Returns the TEMPLATE_DECL associated to a TEMPLATE_TEMPLATE_PARM
03606 node. */
03607 #define TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL(NODE) \
03608 ((TREE_CODE (NODE) == BOUND_TEMPLATE_TEMPLATE_PARM) \
03609 ? TYPE_TI_TEMPLATE (NODE) \
03610 : TYPE_NAME (NODE))
03611
03612 /* in lex.c */
03613
03614 extern void init_reswords PARAMS ((void));
03615
03616 /* Indexed by TREE_CODE, these tables give C-looking names to
03617 operators represented by TREE_CODES. For example,
03618 opname_tab[(int) MINUS_EXPR] == "-". */
03619 extern const char **opname_tab, **assignop_tab;
03620
03621 typedef struct operator_name_info_t
03622 {
03623 /* The IDENTIFIER_NODE for the operator. */
03624 tree identifier;
03625 /* The name of the operator. */
03626 const char *name;
03627 /* The mangled name of the operator. */
03628 const char *mangled_name;
03629 /* The arity of the operator. */
03630 int arity;
03631 } operator_name_info_t;
03632
03633 /* A mapping from tree codes to operator name information. */
03634 extern operator_name_info_t operator_name_info[];
03635 /* Similar, but for assignment operators. */
03636 extern operator_name_info_t assignment_operator_name_info[];
03637
03638 /* in call.c */
03639 extern int check_dtor_name PARAMS ((tree, tree));
03640 extern int get_arglist_len_in_bytes PARAMS ((tree));
03641
03642 extern tree build_vfield_ref PARAMS ((tree, tree));
03643 extern tree build_scoped_method_call PARAMS ((tree, tree, tree, tree));
03644 extern tree build_conditional_expr PARAMS ((tree, tree, tree));
03645 extern tree build_addr_func PARAMS ((tree));
03646 extern tree build_call PARAMS ((tree, tree));
03647 extern tree build_method_call PARAMS ((tree, tree, tree, tree, int));
03648 extern int null_ptr_cst_p PARAMS ((tree));
03649 extern int sufficient_parms_p PARAMS ((tree));
03650 extern tree type_decays_to PARAMS ((tree));
03651 extern tree resolve_scoped_fn_name PARAMS ((tree, tree));
03652 extern tree build_user_type_conversion PARAMS ((tree, tree, int));
03653 extern tree build_new_function_call PARAMS ((tree, tree));
03654 extern tree build_new_method_call (tree, tree, tree, tree, int);
03655 extern tree build_special_member_call (tree, tree, tree, tree, int);
03656 extern tree build_new_op PARAMS ((enum tree_code, int, tree, tree, tree));
03657 extern tree build_op_delete_call PARAMS ((enum tree_code, tree, tree, int, tree));
03658 extern int can_convert PARAMS ((tree, tree));
03659 extern int can_convert_arg PARAMS ((tree, tree, tree));
03660 extern int can_convert_arg_bad PARAMS ((tree, tree, tree));
03661 extern int enforce_access PARAMS ((tree, tree));
03662 extern tree convert_default_arg PARAMS ((tree, tree, tree, int));
03663 extern tree convert_arg_to_ellipsis PARAMS ((tree));
03664 extern tree build_x_va_arg PARAMS ((tree, tree));
03665 extern tree cxx_type_promotes_to PARAMS ((tree));
03666 extern tree type_passed_as PARAMS ((tree));
03667 extern tree convert_for_arg_passing PARAMS ((tree, tree));
03668 extern tree cp_convert_parm_for_inlining PARAMS ((tree, tree, tree));
03669 extern int is_properly_derived_from PARAMS ((tree, tree));
03670 extern tree initialize_reference PARAMS ((tree, tree, tree, tree *));
03671 extern tree make_temporary_var_for_ref_to_temp (tree, tree);
03672 extern tree strip_top_quals PARAMS ((tree));
03673 extern tree perform_implicit_conversion PARAMS ((tree, tree));
03674 extern tree perform_direct_initialization_if_possible (tree, tree);
03675
03676 /* in class.c */
03677 extern tree build_base_path PARAMS ((enum tree_code, tree, tree, int));
03678 extern tree convert_to_base (tree, tree, bool);
03679 extern tree convert_to_base_statically (tree, tree);
03680 extern tree build_vtbl_ref PARAMS ((tree, tree));
03681 extern tree build_vfn_ref PARAMS ((tree, tree));
03682 extern tree get_vtable_decl PARAMS ((tree, int));
03683 extern void add_method PARAMS ((tree, tree, int));
03684 extern int currently_open_class PARAMS ((tree));
03685 extern tree currently_open_derived_class PARAMS ((tree));
03686 extern void duplicate_tag_error PARAMS ((tree));
03687 extern tree finish_struct PARAMS ((tree, tree));
03688 extern void finish_struct_1 PARAMS ((tree));
03689 extern int resolves_to_fixed_type_p PARAMS ((tree, int *));
03690 extern void init_class_processing PARAMS ((void));
03691 extern int is_empty_class PARAMS ((tree));
03692 extern void pushclass PARAMS ((tree, int));
03693 extern void popclass PARAMS ((void));
03694 extern void push_nested_class PARAMS ((tree, int));
03695 extern void pop_nested_class PARAMS ((void));
03696 extern int current_lang_depth PARAMS ((void));
03697 extern void push_lang_context PARAMS ((tree));
03698 extern void pop_lang_context PARAMS ((void));
03699 extern tree instantiate_type PARAMS ((tree, tree, tsubst_flags_t));
03700 extern void print_class_statistics PARAMS ((void));
03701 extern void cxx_print_statistics PARAMS ((void));
03702 extern void cxx_print_xnode PARAMS ((FILE *, tree, int));
03703 extern void cxx_print_decl PARAMS ((FILE *, tree, int));
03704 extern void cxx_print_type PARAMS ((FILE *, tree, int));
03705 extern void cxx_print_identifier PARAMS ((FILE *, tree, int));
03706 extern void cxx_print_error_function PARAMS ((struct diagnostic_context *,
03707 const char *));
03708 extern void build_self_reference PARAMS ((void));
03709 extern int same_signature_p PARAMS ((tree, tree));
03710 extern void warn_hidden PARAMS ((tree));
03711 extern void maybe_add_class_template_decl_list PARAMS ((tree, tree, int));
03712 extern tree get_enclosing_class PARAMS ((tree));
03713 int is_base_of_enclosing_class PARAMS ((tree, tree));
03714 extern void unreverse_member_declarations PARAMS ((tree));
03715 extern void invalidate_class_lookup_cache PARAMS ((void));
03716 extern void maybe_note_name_used_in_class PARAMS ((tree, tree));
03717 extern void note_name_declared_in_class PARAMS ((tree, tree));
03718 extern tree get_vtbl_decl_for_binfo PARAMS ((tree));
03719 extern tree in_charge_arg_for_name PARAMS ((tree));
03720 extern tree build_cxx_call PARAMS ((tree, tree, tree));
03721 extern tree get_vtt_name PARAMS ((tree));
03722 extern tree get_primary_binfo PARAMS ((tree));
03723
03724 /* in cvt.c */
03725 extern tree convert_to_reference PARAMS ((tree, tree, int, int, tree));
03726 extern tree convert_from_reference PARAMS ((tree));
03727 extern tree convert_lvalue PARAMS ((tree, tree));
03728 extern tree force_rvalue PARAMS ((tree));
03729 extern tree ocp_convert PARAMS ((tree, tree, int, int));
03730 extern tree cp_convert PARAMS ((tree, tree));
03731 extern tree convert_to_void PARAMS ((tree, const char */*implicit context*/));
03732 extern tree convert_force PARAMS ((tree, tree, int));
03733 extern tree build_type_conversion PARAMS ((tree, tree));
03734 extern tree build_expr_type_conversion PARAMS ((int, tree, int));
03735 extern tree type_promotes_to PARAMS ((tree));
03736 extern tree perform_qualification_conversions PARAMS ((tree, tree));
03737 extern void clone_function_decl PARAMS ((tree, int));
03738 extern void adjust_clone_args PARAMS ((tree));
03739
03740 /* decl.c */
03741 extern int global_bindings_p PARAMS ((void));
03742 extern int kept_level_p PARAMS ((void));
03743 extern bool innermost_scope_is_class_p (void);
03744 extern tree getdecls PARAMS ((void));
03745 extern void pushlevel PARAMS ((int));
03746 extern tree poplevel PARAMS ((int,int, int));
03747 extern void insert_block PARAMS ((tree));
03748 extern void set_block PARAMS ((tree));
03749 extern tree pushdecl PARAMS ((tree));
03750 extern void cxx_init_decl_processing PARAMS ((void));
03751 enum cp_tree_node_structure_enum cp_tree_node_structure
03752 PARAMS ((union lang_tree_node *));
03753 extern void cxx_insert_default_attributes PARAMS ((tree));
03754 extern bool cxx_mark_addressable PARAMS ((tree));
03755 extern void cxx_push_function_context PARAMS ((struct function *));
03756 extern void cxx_pop_function_context PARAMS ((struct function *));
03757 extern void cxx_mark_function_context PARAMS ((struct function *));
03758 extern int toplevel_bindings_p PARAMS ((void));
03759 extern int namespace_bindings_p PARAMS ((void));
03760 extern void keep_next_level PARAMS ((int));
03761 extern int template_parm_scope_p PARAMS ((void));
03762 extern void set_class_shadows PARAMS ((tree));
03763 extern void maybe_push_cleanup_level PARAMS ((tree));
03764 extern void begin_scope PARAMS ((scope_kind));
03765 extern void finish_scope PARAMS ((void));
03766 extern void note_level_for_for PARAMS ((void));
03767 extern void note_level_for_try PARAMS ((void));
03768 extern void note_level_for_catch PARAMS ((void));
03769 extern void resume_level PARAMS ((struct cp_binding_level *));
03770 extern void delete_block PARAMS ((tree));
03771 extern void add_block_current_level PARAMS ((tree));
03772 extern void pushlevel_class PARAMS ((void));
03773 extern void poplevel_class PARAMS ((void));
03774 extern void print_binding_stack PARAMS ((void));
03775 extern void print_binding_level PARAMS ((struct cp_binding_level *));
03776 extern void push_namespace PARAMS ((tree));
03777 extern void pop_namespace PARAMS ((void));
03778 extern void push_nested_namespace PARAMS ((tree));
03779 extern void pop_nested_namespace PARAMS ((tree));
03780 extern void maybe_push_to_top_level PARAMS ((int));
03781 extern void push_to_top_level PARAMS ((void));
03782 extern void pop_from_top_level PARAMS ((void));
03783 extern void push_switch PARAMS ((tree));
03784 extern void pop_switch PARAMS ((void));
03785 extern tree identifier_type_value PARAMS ((tree));
03786 extern void set_identifier_type_value PARAMS ((tree, tree));
03787 extern void pop_everything PARAMS ((void));
03788 extern void pushtag PARAMS ((tree, tree, int));
03789 extern tree make_anon_name PARAMS ((void));
03790 extern void clear_anon_tags PARAMS ((void));
03791 extern int decls_match PARAMS ((tree, tree));
03792 extern int duplicate_decls PARAMS ((tree, tree));
03793 extern tree pushdecl_top_level PARAMS ((tree));
03794 extern tree pushdecl_top_level_and_finish (tree, tree);
03795 extern bool pushdecl_class_level (tree);
03796 extern tree pushdecl_namespace_level PARAMS ((tree));
03797 extern tree push_using_decl PARAMS ((tree, tree));
03798 extern tree push_using_directive PARAMS ((tree));
03799 extern bool push_class_level_binding (tree, tree);
03800 extern tree implicitly_declare PARAMS ((tree));
03801 extern tree declare_local_label PARAMS ((tree));
03802 extern tree define_label PARAMS ((const char *, int, tree));
03803 extern void check_goto PARAMS ((tree));
03804 extern void define_case_label PARAMS ((void));
03805 extern cxx_binding *binding_for_name (tree, tree);
03806 extern tree namespace_binding PARAMS ((tree, tree));
03807 extern void set_namespace_binding PARAMS ((tree, tree, tree));
03808 extern tree lookup_namespace_name PARAMS ((tree, tree));
03809 extern tree build_typename_type PARAMS ((tree, tree, tree, tree));
03810 extern tree make_typename_type PARAMS ((tree, tree, tsubst_flags_t));
03811 extern tree make_unbound_class_template PARAMS ((tree, tree, tsubst_flags_t));
03812 extern tree lookup_name_nonclass PARAMS ((tree));
03813 extern tree lookup_function_nonclass PARAMS ((tree, tree));
03814 extern tree lookup_name PARAMS ((tree, int));
03815 extern tree lookup_name_current_level PARAMS ((tree));
03816 extern tree lookup_type_current_level PARAMS ((tree));
03817 extern tree lookup_name_namespace_only PARAMS ((tree));
03818 extern void begin_only_namespace_names PARAMS ((void));
03819 extern void end_only_namespace_names PARAMS ((void));
03820 extern tree namespace_ancestor PARAMS ((tree, tree));
03821 extern bool is_ancestor (tree, tree);
03822 extern tree unqualified_namespace_lookup PARAMS ((tree, int, tree *));
03823 extern tree check_for_out_of_scope_variable (tree);
03824 extern bool lookup_using_namespace (tree, cxx_binding *, tree, tree, int, tree *);
03825 extern bool qualified_lookup_using_namespace (tree, tree, cxx_binding *, int);
03826 extern tree build_library_fn PARAMS ((tree, tree));
03827 extern tree build_library_fn_ptr PARAMS ((const char *, tree));
03828 extern tree build_cp_library_fn_ptr PARAMS ((const char *, tree));
03829 extern tree push_library_fn PARAMS ((tree, tree));
03830 extern tree push_void_library_fn PARAMS ((tree, tree));
03831 extern tree push_throw_library_fn PARAMS ((tree, tree));
03832 extern int init_type_desc PARAMS ((void));
03833 extern tree check_tag_decl PARAMS ((tree));
03834 extern void shadow_tag PARAMS ((tree));
03835 extern tree groktypename PARAMS ((tree));
03836 extern tree start_decl PARAMS ((tree, tree, int, tree, tree));
03837 extern void start_decl_1 PARAMS ((tree));
03838 extern void cp_finish_decl PARAMS ((tree, tree, tree, int));
03839 extern void finish_decl PARAMS ((tree, tree, tree));
03840 extern void maybe_inject_for_scope_var PARAMS ((tree));
03841 extern tree start_handler_parms PARAMS ((tree, tree));
03842 extern int complete_array_type PARAMS ((tree, tree, int));
03843 extern tree build_ptrmemfunc_type PARAMS ((tree));
03844 extern tree build_ptrmem_type (tree, tree);
03845 /* the grokdeclarator prototype is in decl.h */
03846 extern int parmlist_is_exprlist PARAMS ((tree));
03847 extern int copy_fn_p PARAMS ((tree));
03848 extern void grok_special_member_properties PARAMS ((tree));
03849 extern int grok_ctor_properties PARAMS ((tree, tree));
03850 extern void grok_op_properties PARAMS ((tree, int));
03851 extern tree xref_tag (enum tag_types, tree, tree, bool);
03852 extern tree xref_tag_from_type PARAMS ((tree, tree, int));
03853 extern void xref_basetypes PARAMS ((tree, tree));
03854 extern tree start_enum PARAMS ((tree));
03855 extern void finish_enum PARAMS ((tree));
03856 extern void build_enumerator PARAMS ((tree, tree, tree));
03857 extern int start_function PARAMS ((tree, tree, tree, int));
03858 extern tree begin_function_body PARAMS ((void));
03859 extern void finish_function_body PARAMS ((tree));
03860 extern tree finish_function PARAMS ((int));
03861 extern tree start_method PARAMS ((tree, tree, tree));
03862 extern tree finish_method PARAMS ((tree));
03863 extern void maybe_register_incomplete_var PARAMS ((tree));
03864 extern void complete_vars PARAMS ((tree));
03865 extern void finish_stmt PARAMS ((void));
03866 extern void print_other_binding_stack PARAMS ((struct cp_binding_level *));
03867 extern void revert_static_member_fn PARAMS ((tree));
03868 extern void fixup_anonymous_aggr PARAMS ((tree));
03869 extern int check_static_variable_definition PARAMS ((tree, tree));
03870 extern tree compute_array_index_type PARAMS ((tree, tree));
03871 extern void push_local_binding PARAMS ((tree, tree, int));
03872 extern int push_class_binding PARAMS ((tree, tree));
03873 extern tree check_default_argument PARAMS ((tree, tree));
03874 extern tree push_overloaded_decl PARAMS ((tree, int));
03875 extern void clear_identifier_class_values PARAMS ((void));
03876 extern void storetags PARAMS ((tree));
03877 extern int vtable_decl_p PARAMS ((tree, void *));
03878 extern int vtype_decl_p PARAMS ((tree, void *));
03879 extern int sigtable_decl_p PARAMS ((tree, void *));
03880 typedef int (*walk_globals_pred) PARAMS ((tree, void *));
03881 typedef int (*walk_globals_fn) PARAMS ((tree *, void *));
03882 extern int walk_globals PARAMS ((walk_globals_pred,
03883 walk_globals_fn,
03884 void *));
03885 extern int walk_vtables PARAMS ((walk_globals_pred,
03886 walk_globals_fn,
03887 void *));
03888 typedef int (*walk_namespaces_fn) PARAMS ((tree, void *));
03889 extern int walk_namespaces PARAMS ((walk_namespaces_fn,
03890 void *));
03891 extern int wrapup_globals_for_namespace PARAMS ((tree, void *));
03892 extern tree cp_namespace_decls PARAMS ((tree));
03893 extern tree create_implicit_typedef PARAMS ((tree, tree));
03894 extern tree maybe_push_decl PARAMS ((tree));
03895 extern tree build_target_expr_with_type PARAMS ((tree, tree));
03896 extern int local_variable_p PARAMS ((tree));
03897 extern int nonstatic_local_decl_p PARAMS ((tree));
03898 extern tree declare_global_var PARAMS ((tree, tree));
03899 extern void register_dtor_fn PARAMS ((tree));
03900 extern tmpl_spec_kind current_tmpl_spec_kind PARAMS ((int));
03901 extern cxx_binding *cxx_scope_find_binding_for_name (tree, tree);
03902 extern tree cp_fname_init PARAMS ((const char *));
03903 extern bool have_extern_spec;
03904
03905 /* in decl2.c */
03906 extern int check_java_method PARAMS ((tree));
03907 extern int grok_method_quals PARAMS ((tree, tree, tree));
03908 extern void warn_if_unknown_interface PARAMS ((tree));
03909 extern void grok_x_components PARAMS ((tree));
03910 extern void maybe_retrofit_in_chrg PARAMS ((tree));
03911 extern void maybe_make_one_only PARAMS ((tree));
03912 extern void grokclassfn PARAMS ((tree, tree, enum overload_flags, tree));
03913 extern tree grok_array_decl PARAMS ((tree, tree));
03914 extern tree delete_sanity PARAMS ((tree, tree, int, int));
03915 extern tree check_classfn PARAMS ((tree, tree));
03916 extern void check_member_template PARAMS ((tree));
03917 extern tree grokfield PARAMS ((tree, tree, tree, tree, tree));
03918 extern tree grokbitfield PARAMS ((tree, tree, tree));
03919 extern tree groktypefield PARAMS ((tree, tree));
03920 extern tree grokoptypename PARAMS ((tree, tree, tree));
03921 extern void cplus_decl_attributes PARAMS ((tree *, tree, int));
03922 extern tree constructor_name_full PARAMS ((tree));
03923 extern tree constructor_name PARAMS ((tree));
03924 extern bool constructor_name_p (tree, tree);
03925 extern void defer_fn PARAMS ((tree));
03926 extern void finish_anon_union PARAMS ((tree));
03927 extern tree finish_table PARAMS ((tree, tree, tree, int));
03928 extern void finish_builtin_type PARAMS ((tree, const char *,
03929 tree *, int, tree));
03930 extern tree coerce_new_type PARAMS ((tree));
03931 extern tree coerce_delete_type PARAMS ((tree));
03932 extern void comdat_linkage PARAMS ((tree));
03933 extern void import_export_vtable PARAMS ((tree, tree, int));
03934 extern void import_export_decl PARAMS ((tree));
03935 extern void import_export_tinfo PARAMS ((tree, tree, int));
03936 extern tree build_cleanup PARAMS ((tree));
03937 extern void finish_file PARAMS ((void));
03938 extern tree reparse_absdcl_as_expr PARAMS ((tree, tree));
03939 extern tree reparse_absdcl_as_casts PARAMS ((tree, tree));
03940 extern tree build_expr_from_tree PARAMS ((tree));
03941 extern tree build_offset_ref_call_from_tree (tree, tree);
03942 extern tree build_call_from_tree (tree, tree, bool);
03943 extern tree reparse_decl_as_expr PARAMS ((tree, tree));
03944 extern tree finish_decl_parsing PARAMS ((tree));
03945 extern void set_decl_namespace PARAMS ((tree, tree, int));
03946 extern tree current_decl_namespace PARAMS ((void));
03947 extern void push_decl_namespace PARAMS ((tree));
03948 extern void pop_decl_namespace PARAMS ((void));
03949 extern void push_scope PARAMS ((tree));
03950 extern void pop_scope PARAMS ((tree));
03951 extern void do_namespace_alias PARAMS ((tree, tree));
03952 extern void do_toplevel_using_decl PARAMS ((tree));
03953 extern void do_local_using_decl PARAMS ((tree));
03954 extern tree do_class_using_decl PARAMS ((tree));
03955 extern void do_using_directive PARAMS ((tree));
03956 extern void check_default_args PARAMS ((tree));
03957 extern void mark_used PARAMS ((tree));
03958 extern tree handle_class_head (enum tag_types, tree, tree, tree, int, int *);
03959 extern tree handle_class_head_apparent_template (tree, int *);
03960 extern tree lookup_arg_dependent PARAMS ((tree, tree, tree));
03961 extern void finish_static_data_member_decl PARAMS ((tree, tree, tree, int));
03962 extern tree cp_build_parm_decl PARAMS ((tree, tree));
03963 extern tree build_artificial_parm PARAMS ((tree, tree));
03964 extern tree get_guard PARAMS ((tree));
03965 extern tree get_guard_cond PARAMS ((tree));
03966 extern tree set_guard PARAMS ((tree));
03967
03968 extern void cp_error_at PARAMS ((const char *msgid, ...));
03969 extern void cp_warning_at PARAMS ((const char *msgid, ...));
03970 extern void cp_pedwarn_at PARAMS ((const char *msgid, ...));
03971
03972 /* XXX Not i18n clean. */
03973 #define cp_deprecated(STR) \
03974 do { \
03975 if (warn_deprecated) \
03976 warning ("%s is deprecated, please see the documentation for details", \
03977 (STR)); \
03978 } while (0)
03979
03980 /* in error.c */
03981 extern void init_error PARAMS ((void));
03982 extern const char *type_as_string PARAMS ((tree, int));
03983 extern const char *decl_as_string PARAMS ((tree, int));
03984 extern const char *expr_as_string PARAMS ((tree, int));
03985 extern const char *context_as_string PARAMS ((tree, int));
03986 extern const char *lang_decl_name PARAMS ((tree, int));
03987 extern const char *cp_file_of PARAMS ((tree));
03988 extern int cp_line_of PARAMS ((tree));
03989 extern const char *language_to_string PARAMS ((enum languages, int));
03990 extern void print_instantiation_context PARAMS ((void));
03991
03992 /* in except.c */
03993 extern void init_exception_processing PARAMS ((void));
03994 extern tree expand_start_catch_block PARAMS ((tree));
03995 extern void expand_end_catch_block PARAMS ((void));
03996 extern void expand_builtin_throw PARAMS ((void));
03997 extern void expand_eh_spec_block PARAMS ((tree));
03998 extern void expand_exception_blocks PARAMS ((void));
03999 extern tree build_exc_ptr PARAMS ((void));
04000 extern tree build_throw PARAMS ((tree));
04001 extern void mark_all_runtime_matches PARAMS ((void));
04002 extern int nothrow_libfn_p PARAMS ((tree));
04003 extern void check_handlers PARAMS ((tree));
04004 extern void choose_personality_routine PARAMS ((enum languages));
04005
04006 /* in expr.c */
04007 extern rtx cxx_expand_expr PARAMS ((tree, rtx,
04008 enum machine_mode,
04009 int));
04010 extern tree cplus_expand_constant PARAMS ((tree));
04011
04012 /* friend.c */
04013 extern int is_friend PARAMS ((tree, tree));
04014 extern void make_friend_class PARAMS ((tree, tree));
04015 extern void add_friend PARAMS ((tree, tree));
04016 extern tree do_friend PARAMS ((tree, tree, tree, tree, tree, enum overload_flags, tree, int));
04017
04018 /* in init.c */
04019 extern tree expand_member_init (tree);
04020 extern void emit_mem_initializers (tree);
04021 extern tree build_aggr_init PARAMS ((tree, tree, int));
04022 extern tree build_init PARAMS ((tree, tree, int));
04023 extern int is_aggr_type PARAMS ((tree, int));
04024 extern tree get_aggr_from_typedef PARAMS ((tree, int));
04025 extern tree get_type_value PARAMS ((tree));
04026 extern tree build_zero_init (tree, tree, bool);
04027 extern tree build_member_call PARAMS ((tree, tree, tree));
04028 extern tree build_offset_ref PARAMS ((tree, tree));
04029 extern tree resolve_offset_ref PARAMS ((tree));
04030 extern tree build_new PARAMS ((tree, tree, tree, int));
04031 extern tree build_vec_init PARAMS ((tree, tree, tree, int));
04032 extern tree build_x_delete PARAMS ((tree, int, tree));
04033 extern tree build_delete PARAMS ((tree, tree, special_function_kind, int, int));
04034 extern void push_base_cleanups PARAMS ((void));
04035 extern tree build_vbase_delete PARAMS ((tree, tree));
04036 extern tree build_vec_delete PARAMS ((tree, tree, special_function_kind, int));
04037 extern tree create_temporary_var PARAMS ((tree));
04038 extern void begin_init_stmts PARAMS ((tree *, tree *));
04039 extern tree finish_init_stmts PARAMS ((tree, tree));
04040 extern void initialize_vtbl_ptrs PARAMS ((tree));
04041 extern tree build_java_class_ref PARAMS ((tree));
04042
04043 /* in input.c */
04044
04045 /* in lex.c */
04046 extern void cxx_dup_lang_specific_decl PARAMS ((tree));
04047 extern tree make_pointer_declarator PARAMS ((tree, tree));
04048 extern tree make_reference_declarator PARAMS ((tree, tree));
04049 extern tree make_call_declarator PARAMS ((tree, tree, tree, tree));
04050 extern void set_quals_and_spec PARAMS ((tree, tree, tree));
04051 extern void print_parse_statistics PARAMS ((void));
04052 extern void do_pending_inlines PARAMS ((void));
04053 extern void process_next_inline PARAMS ((struct unparsed_text *));
04054
04055 extern void yyungetc PARAMS ((int, int));
04056 extern void snarf_method PARAMS ((tree));
04057
04058 extern void check_for_missing_semicolon PARAMS ((tree));
04059 extern void note_got_semicolon PARAMS ((tree));
04060 extern void note_list_got_semicolon PARAMS ((tree));
04061 extern void do_pending_lang_change PARAMS ((void));
04062 extern void see_typename PARAMS ((void));
04063 extern void unqualified_name_lookup_error PARAMS ((tree));
04064 extern tree do_identifier PARAMS ((tree, int, tree));
04065 extern tree do_scoped_id PARAMS ((tree, tree));
04066 extern tree identifier_typedecl_value PARAMS ((tree));
04067 extern tree build_lang_decl PARAMS ((enum tree_code, tree, tree));
04068 extern void retrofit_lang_decl PARAMS ((tree));
04069 extern tree copy_decl PARAMS ((tree));
04070 extern tree copy_type PARAMS ((tree));
04071 extern tree cxx_make_type PARAMS ((enum tree_code));
04072 extern tree make_aggr_type PARAMS ((enum tree_code));
04073 extern void yyerror PARAMS ((const char *));
04074 extern void yyhook PARAMS ((int));
04075 extern int cp_type_qual_from_rid PARAMS ((tree));
04076 extern const char *cxx_init PARAMS ((const char *));
04077 extern void cxx_finish PARAMS ((void));
04078 extern void cxx_init_options PARAMS ((void));
04079
04080 /* in method.c */
04081 extern void init_method PARAMS ((void));
04082 extern void set_mangled_name_for_decl PARAMS ((tree));
04083 extern tree build_opfncall PARAMS ((enum tree_code, int, tree, tree, tree));
04084 extern tree hack_identifier PARAMS ((tree, tree));
04085 extern tree make_thunk PARAMS ((tree, tree, tree));
04086 extern void use_thunk PARAMS ((tree, int));
04087 extern void synthesize_method PARAMS ((tree));
04088 extern tree implicitly_declare_fn PARAMS ((special_function_kind, tree, int));
04089 extern tree skip_artificial_parms_for PARAMS ((tree, tree));
04090
04091 /* In optimize.c */
04092 extern void optimize_function PARAMS ((tree));
04093 extern int calls_setjmp_p PARAMS ((tree));
04094 extern int maybe_clone_body PARAMS ((tree));
04095
04096 /* in pt.c */
04097 extern void check_template_shadow PARAMS ((tree));
04098 extern tree get_innermost_template_args PARAMS ((tree, int));
04099 extern tree tsubst PARAMS ((tree, tree, tsubst_flags_t, tree));
04100 extern tree tsubst_expr PARAMS ((tree, tree, tsubst_flags_t, tree));
04101 extern tree tsubst_copy PARAMS ((tree, tree, tsubst_flags_t, tree));
04102 extern void maybe_begin_member_template_processing PARAMS ((tree));
04103 extern void maybe_end_member_template_processing PARAMS ((void));
04104 extern tree finish_member_template_decl PARAMS ((tree));
04105 extern void begin_template_parm_list PARAMS ((void));
04106 extern void begin_specialization PARAMS ((void));
04107 extern void reset_specialization PARAMS ((void));
04108 extern void end_specialization PARAMS ((void));
04109 extern void begin_explicit_instantiation PARAMS ((void));
04110 extern void end_explicit_instantiation PARAMS ((void));
04111 extern tree check_explicit_specialization PARAMS ((tree, tree, int, int));
04112 extern tree process_template_parm PARAMS ((tree, tree));
04113 extern tree end_template_parm_list PARAMS ((tree));
04114 extern void end_template_decl PARAMS ((void));
04115 extern tree current_template_args PARAMS ((void));
04116 extern tree push_template_decl PARAMS ((tree));
04117 extern tree push_template_decl_real PARAMS ((tree, int));
04118 extern void redeclare_class_template PARAMS ((tree, tree));
04119 extern tree lookup_template_class PARAMS ((tree, tree, tree, tree, int, tsubst_flags_t));
04120 extern tree lookup_template_function PARAMS ((tree, tree));
04121 extern int uses_template_parms PARAMS ((tree));
04122 extern tree instantiate_class_template PARAMS ((tree));
04123 extern tree instantiate_template PARAMS ((tree, tree));
04124 extern int fn_type_unification PARAMS ((tree, tree, tree, tree, tree, unification_kind_t, int));
04125 extern tree tinst_for_decl PARAMS ((void));
04126 extern void mark_decl_instantiated PARAMS ((tree, int));
04127 extern int more_specialized PARAMS ((tree, tree, int, int));
04128 extern void mark_class_instantiated PARAMS ((tree, int));
04129 extern void do_decl_instantiation (tree, tree);
04130 extern void do_type_instantiation PARAMS ((tree, tree, tsubst_flags_t));
04131 extern tree instantiate_decl PARAMS ((tree, int));
04132 extern tree get_bindings PARAMS ((tree, tree, tree));
04133 extern int push_tinst_level PARAMS ((tree));
04134 extern void pop_tinst_level PARAMS ((void));
04135 extern int more_specialized_class PARAMS ((tree, tree, tree));
04136 extern int is_member_template PARAMS ((tree));
04137 extern int comp_template_parms PARAMS ((tree, tree));
04138 extern int template_class_depth PARAMS ((tree));
04139 extern int is_specialization_of PARAMS ((tree, tree));
04140 extern int comp_template_args PARAMS ((tree, tree));
04141 extern void maybe_process_partial_specialization PARAMS ((tree));
04142 extern void maybe_check_template_type PARAMS ((tree));
04143 extern tree most_specialized_instantiation PARAMS ((tree));
04144 extern void print_candidates PARAMS ((tree));
04145 extern int instantiate_pending_templates PARAMS ((void));
04146 extern tree tsubst_default_argument PARAMS ((tree, tree, tree));
04147 extern tree most_general_template PARAMS ((tree));
04148 extern tree get_mostly_instantiated_function_type PARAMS ((tree));
04149 extern int problematic_instantiation_changed PARAMS ((void));
04150 extern void record_last_problematic_instantiation PARAMS ((void));
04151 extern tree current_instantiation PARAMS ((void));
04152 extern int processing_template_parmlist;
04153
04154 /* in repo.c */
04155 extern void repo_template_used PARAMS ((tree));
04156 extern void repo_template_instantiated PARAMS ((tree, int));
04157 extern void init_repo PARAMS ((const char *));
04158 extern void finish_repo PARAMS ((void));
04159
04160 /* in rtti.c */
04161 extern void init_rtti_processing PARAMS((void));
04162 extern tree build_typeid PARAMS((tree));
04163 extern tree get_tinfo_decl PARAMS((tree));
04164 extern tree get_typeid PARAMS((tree));
04165 extern tree build_dynamic_cast PARAMS((tree, tree));
04166 extern void emit_support_tinfos PARAMS((void));
04167 extern int unemitted_tinfo_decl_p PARAMS((tree, void *));
04168 extern int emit_tinfo_decl PARAMS((tree *, void *));
04169
04170 /* in search.c */
04171 extern bool accessible_base_p (tree, tree);
04172 extern tree lookup_base PARAMS ((tree, tree, base_access, base_kind *));
04173 extern int types_overlap_p PARAMS ((tree, tree));
04174 extern tree get_vbase PARAMS ((tree, tree));
04175 extern tree get_dynamic_cast_base_type PARAMS ((tree, tree));
04176 extern void type_access_control PARAMS ((tree, tree));
04177 extern int accessible_p PARAMS ((tree, tree));
04178 extern tree lookup_field_1 (tree, tree, bool);
04179 extern tree lookup_field PARAMS ((tree, tree, int, int));
04180 extern tree lookup_nested_field PARAMS ((tree, int));
04181 extern int lookup_fnfields_1 PARAMS ((tree, tree));
04182 extern tree lookup_fnfields PARAMS ((tree, tree, int));
04183 extern tree lookup_member PARAMS ((tree, tree, int, int));
04184 extern int look_for_overrides PARAMS ((tree, tree));
04185 extern void get_pure_virtuals PARAMS ((tree));
04186 extern void get_vbase_types PARAMS ((tree));
04187 extern void maybe_suppress_debug_info PARAMS ((tree));
04188 extern void note_debug_info_needed PARAMS ((tree));
04189 extern void push_class_decls PARAMS ((tree));
04190 extern void pop_class_decls PARAMS ((void));
04191 extern void unuse_fields PARAMS ((tree));
04192 extern void print_search_statistics PARAMS ((void));
04193 extern void init_search_processing PARAMS ((void));
04194 extern void reinit_search_statistics PARAMS ((void));
04195 extern tree current_scope PARAMS ((void));
04196 extern int at_function_scope_p PARAMS ((void));
04197 extern bool at_class_scope_p (void);
04198 extern tree context_for_name_lookup PARAMS ((tree));
04199 extern tree lookup_conversions PARAMS ((tree));
04200 extern tree binfo_for_vtable PARAMS ((tree));
04201 extern tree binfo_from_vbase PARAMS ((tree));
04202 extern tree look_for_overrides_here PARAMS ((tree, tree));
04203 extern int check_final_overrider PARAMS ((tree, tree));
04204 extern tree dfs_walk PARAMS ((tree,
04205 tree (*) (tree, void *),
04206 tree (*) (tree, void *),
04207 void *));
04208 extern tree dfs_walk_real PARAMS ((tree,
04209 tree (*) (tree, void *),
04210 tree (*) (tree, void *),
04211 tree (*) (tree, void *),
04212 void *));
04213 extern tree dfs_unmark PARAMS ((tree, void *));
04214 extern tree markedp PARAMS ((tree, void *));
04215 extern tree unmarkedp PARAMS ((tree, void *));
04216 extern tree dfs_unmarked_real_bases_queue_p PARAMS ((tree, void *));
04217 extern tree dfs_marked_real_bases_queue_p PARAMS ((tree, void *));
04218 extern tree dfs_skip_vbases PARAMS ((tree, void *));
04219 extern tree marked_vtable_pathp PARAMS ((tree, void *));
04220 extern tree unmarked_vtable_pathp PARAMS ((tree, void *));
04221 extern tree find_vbase_instance PARAMS ((tree, tree));
04222 extern tree binfo_for_vbase PARAMS ((tree, tree));
04223 extern tree binfo_via_virtual PARAMS ((tree, tree));
04224 extern tree build_baselink (tree, tree, tree, tree);
04225 extern tree adjust_result_of_qualified_name_lookup
04226 (tree, tree, tree);
04227 /* in semantics.c */
04228 extern void init_cp_semantics PARAMS ((void));
04229 extern tree finish_expr_stmt PARAMS ((tree));
04230 extern tree begin_if_stmt PARAMS ((void));
04231 extern void finish_if_stmt_cond PARAMS ((tree, tree));
04232 extern tree finish_then_clause PARAMS ((tree));
04233 extern void begin_else_clause PARAMS ((void));
04234 extern void finish_else_clause PARAMS ((tree));
04235 extern void finish_if_stmt PARAMS ((void));
04236 extern tree begin_while_stmt PARAMS ((void));
04237 extern void finish_while_stmt_cond PARAMS ((tree, tree));
04238 extern void finish_while_stmt PARAMS ((tree));
04239 extern tree begin_do_stmt PARAMS ((void));
04240 extern void finish_do_body PARAMS ((tree));
04241 extern void finish_do_stmt PARAMS ((tree, tree));
04242 extern tree finish_return_stmt PARAMS ((tree));
04243 extern tree begin_for_stmt PARAMS ((void));
04244 extern void finish_for_init_stmt PARAMS ((tree));
04245 extern void finish_for_cond PARAMS ((tree, tree));
04246 extern void finish_for_expr PARAMS ((tree, tree));
04247 extern void finish_for_stmt PARAMS ((tree));
04248 extern tree finish_break_stmt PARAMS ((void));
04249 extern tree finish_continue_stmt PARAMS ((void));
04250 extern tree begin_switch_stmt PARAMS ((void));
04251 extern void finish_switch_cond PARAMS ((tree, tree));
04252 extern void finish_switch_stmt PARAMS ((tree));
04253 extern tree finish_case_label PARAMS ((tree, tree));
04254 extern tree finish_goto_stmt PARAMS ((tree));
04255 extern tree begin_try_block PARAMS ((void));
04256 extern void finish_try_block PARAMS ((tree));
04257 extern tree begin_eh_spec_block PARAMS ((void));
04258 extern void finish_eh_spec_block PARAMS ((tree, tree));
04259 extern void finish_handler_sequence PARAMS ((tree));
04260 extern tree begin_function_try_block PARAMS ((void));
04261 extern void finish_function_try_block PARAMS ((tree));
04262 extern void finish_function_handler_sequence PARAMS ((tree));
04263 extern void finish_cleanup_try_block PARAMS ((tree));
04264 extern tree begin_handler PARAMS ((void));
04265 extern void finish_handler_parms PARAMS ((tree, tree));
04266 extern void begin_catch_block PARAMS ((tree));
04267 extern void finish_handler PARAMS ((tree));
04268 extern void finish_cleanup PARAMS ((tree, tree));
04269 extern tree begin_compound_stmt PARAMS ((int));
04270 extern tree finish_compound_stmt PARAMS ((int, tree));
04271 extern tree finish_asm_stmt PARAMS ((tree, tree, tree, tree, tree));
04272 extern void finish_label_stmt PARAMS ((tree));
04273 extern void finish_label_decl PARAMS ((tree));
04274 extern void finish_subobject PARAMS ((tree));
04275 extern tree finish_parenthesized_expr PARAMS ((tree));
04276 extern tree begin_stmt_expr PARAMS ((void));
04277 extern tree finish_stmt_expr PARAMS ((tree));
04278 extern tree finish_call_expr (tree, tree, bool);
04279 extern tree finish_increment_expr PARAMS ((tree, enum tree_code));
04280 extern tree finish_this_expr PARAMS ((void));
04281 extern tree finish_object_call_expr PARAMS ((tree, tree, tree));
04282 extern tree finish_qualified_object_call_expr PARAMS ((tree, tree, tree));
04283 extern tree finish_pseudo_destructor_call_expr PARAMS ((tree, tree, tree));
04284 extern tree finish_unary_op_expr PARAMS ((enum tree_code, tree));
04285 extern tree finish_id_expr PARAMS ((tree));
04286 extern tree finish_fname (tree);
04287 extern void save_type_access_control PARAMS ((tree));
04288 extern void reset_type_access_control PARAMS ((void));
04289 extern void decl_type_access_control PARAMS ((tree));
04290 extern int begin_function_definition (tree, tree, tree);
04291 extern tree begin_constructor_declarator PARAMS ((tree, tree));
04292 extern tree finish_declarator PARAMS ((tree, tree, tree, tree, int));
04293 extern void finish_translation_unit PARAMS ((void));
04294 extern tree finish_template_type_parm PARAMS ((tree, tree));
04295 extern tree finish_template_template_parm PARAMS ((tree, tree));
04296 extern tree finish_parmlist PARAMS ((tree, int));
04297 extern tree begin_class_definition PARAMS ((tree));
04298 extern tree finish_class_definition PARAMS ((tree, tree, int, int));
04299 extern void finish_default_args PARAMS ((void));
04300 extern void begin_inline_definitions PARAMS ((void));
04301 extern tree finish_member_class_template PARAMS ((tree));
04302 extern void finish_template_decl PARAMS ((tree));
04303 extern tree finish_template_type PARAMS ((tree, tree, int));
04304 extern void enter_scope_of PARAMS ((tree));
04305 extern tree finish_base_specifier PARAMS ((tree, tree));
04306 extern void finish_member_declaration PARAMS ((tree));
04307 extern void check_multiple_declarators PARAMS ((void));
04308 extern tree finish_typeof PARAMS ((tree));
04309 extern tree finish_sizeof PARAMS ((tree));
04310 extern tree finish_alignof PARAMS ((tree));
04311 extern void finish_decl_cleanup PARAMS ((tree, tree));
04312 extern void finish_eh_cleanup PARAMS ((tree));
04313 extern void finish_named_return_value PARAMS ((tree, tree));
04314 extern void expand_body PARAMS ((tree));
04315 extern tree nullify_returns_r PARAMS ((tree *, int *, void *));
04316 extern void do_pushlevel PARAMS ((void));
04317 extern tree do_poplevel PARAMS ((void));
04318 extern void begin_mem_initializers (void);
04319 extern void finish_mem_initializers PARAMS ((tree));
04320 extern void setup_vtbl_ptr PARAMS ((tree, tree));
04321 extern void clear_out_block PARAMS ((void));
04322 extern tree begin_global_stmt_expr PARAMS ((void));
04323 extern tree finish_global_stmt_expr PARAMS ((tree));
04324 extern tree check_template_template_default_arg (tree);
04325
04326 /* in spew.c */
04327 extern void init_spew PARAMS ((void));
04328 extern int peekyylex PARAMS ((void));
04329 extern tree arbitrate_lookup PARAMS ((tree, tree, tree));
04330 extern tree frob_opname PARAMS ((tree));
04331 extern void maybe_snarf_defarg PARAMS ((void));
04332 extern void add_defarg_fn PARAMS ((tree));
04333 extern void do_pending_defargs PARAMS ((void));
04334 extern void done_pending_defargs PARAMS ((void));
04335 extern void unprocessed_defarg_fn PARAMS ((tree));
04336 extern void replace_defarg PARAMS ((tree, tree));
04337 extern void end_input PARAMS ((void));
04338
04339 /* in tree.c */
04340 extern void lang_check_failed PARAMS ((const char *, int,
04341 const char *));
04342 extern tree stabilize_expr PARAMS ((tree, tree *));
04343 extern tree cxx_unsave_expr_now PARAMS ((tree));
04344 extern tree cxx_maybe_build_cleanup PARAMS ((tree));
04345 extern void init_tree PARAMS ((void));
04346 extern int pod_type_p PARAMS ((tree));
04347 extern int zero_init_p PARAMS ((tree));
04348 extern tree canonical_type_variant PARAMS ((tree));
04349 extern void unshare_base_binfos PARAMS ((tree));
04350 extern int member_p PARAMS ((tree));
04351 extern cp_lvalue_kind real_lvalue_p PARAMS ((tree));
04352 extern cp_lvalue_kind real_non_cast_lvalue_p (tree);
04353 extern int non_cast_lvalue_p PARAMS ((tree));
04354 extern int non_cast_lvalue_or_else PARAMS ((tree, const char *));
04355 extern tree build_min PARAMS ((enum tree_code, tree,
04356 ...));
04357 extern tree build_min_nt PARAMS ((enum tree_code, ...));
04358 extern tree build_cplus_new PARAMS ((tree, tree));
04359 extern tree get_target_expr PARAMS ((tree));
04360 extern tree break_out_calls PARAMS ((tree));
04361 extern tree build_cplus_method_type PARAMS ((tree, tree, tree));
04362 extern tree build_cplus_staticfn_type PARAMS ((tree, tree, tree));
04363 extern tree build_cplus_array_type PARAMS ((tree, tree));
04364 extern tree hash_tree_cons PARAMS ((tree, tree, tree));
04365 extern tree hash_tree_chain PARAMS ((tree, tree));
04366 extern tree hash_chainon PARAMS ((tree, tree));
04367 extern tree make_binfo PARAMS ((tree, tree, tree, tree));
04368 extern tree reverse_path PARAMS ((tree));
04369 extern int count_functions PARAMS ((tree));
04370 extern int is_overloaded_fn PARAMS ((tree));
04371 extern tree get_overloaded_fn PARAMS ((tree));
04372 extern tree get_first_fn PARAMS ((tree));
04373 extern int bound_pmf_p PARAMS ((tree));
04374 extern tree ovl_cons PARAMS ((tree, tree));
04375 extern tree build_overload PARAMS ((tree, tree));
04376 extern tree function_arg_chain PARAMS ((tree));
04377 extern int promotes_to_aggr_type PARAMS ((tree, enum tree_code));
04378 extern int is_aggr_type_2 PARAMS ((tree, tree));
04379 extern const char *cxx_printable_name PARAMS ((tree, int));
04380 extern tree build_exception_variant PARAMS ((tree, tree));
04381 extern tree bind_template_template_parm PARAMS ((tree, tree));
04382 extern tree array_type_nelts_total PARAMS ((tree));
04383 extern tree array_type_nelts_top PARAMS ((tree));
04384 extern tree break_out_target_exprs PARAMS ((tree));
04385 extern tree get_type_decl PARAMS ((tree));
04386 extern tree vec_binfo_member PARAMS ((tree, tree));
04387 extern tree decl_namespace_context PARAMS ((tree));
04388 extern tree lvalue_type PARAMS ((tree));
04389 extern tree error_type PARAMS ((tree));
04390 extern tree build_zc_wrapper PARAMS ((struct z_candidate *));
04391 extern tree build_srcloc_here PARAMS ((void));
04392 extern int varargs_function_p PARAMS ((tree));
04393 extern int really_overloaded_fn PARAMS ((tree));
04394 extern int cp_tree_equal PARAMS ((tree, tree));
04395 extern tree no_linkage_check PARAMS ((tree));
04396 extern void debug_binfo PARAMS ((tree));
04397 extern tree build_dummy_object PARAMS ((tree));
04398 extern tree maybe_dummy_object PARAMS ((tree, tree *));
04399 extern int is_dummy_object PARAMS ((tree));
04400 extern const struct attribute_spec cxx_attribute_table[];
04401 extern tree make_ptrmem_cst PARAMS ((tree, tree));
04402 extern tree cp_build_qualified_type_real PARAMS ((tree, int, tsubst_flags_t));
04403 #define cp_build_qualified_type(TYPE, QUALS) \
04404 cp_build_qualified_type_real ((TYPE), (QUALS), tf_error | tf_warning)
04405 extern tree build_shared_int_cst PARAMS ((int));
04406 extern special_function_kind special_function_p PARAMS ((tree));
04407 extern bool name_p (tree);
04408 extern int count_trees PARAMS ((tree));
04409 extern int char_type_p PARAMS ((tree));
04410 extern void verify_stmt_tree PARAMS ((tree));
04411 extern tree find_tree PARAMS ((tree, tree));
04412 extern linkage_kind decl_linkage PARAMS ((tree));
04413 extern tree cp_walk_subtrees PARAMS ((tree*, int*, walk_tree_fn,
04414 void*, void*));
04415 extern int cp_cannot_inline_tree_fn PARAMS ((tree*));
04416 extern tree cp_add_pending_fn_decls PARAMS ((void*,tree));
04417 extern int cp_is_overload_p PARAMS ((tree));
04418 extern int cp_auto_var_in_fn_p PARAMS ((tree,tree));
04419 extern tree cp_copy_res_decl_for_inlining PARAMS ((tree, tree, tree, void*,
04420 int*, void*));
04421 extern int cp_start_inlining PARAMS ((tree));
04422 extern void cp_end_inlining PARAMS ((tree));
04423
04424 /* in typeck.c */
04425 extern int string_conv_p PARAMS ((tree, tree, int));
04426 extern tree cp_truthvalue_conversion PARAMS ((tree));
04427 extern tree condition_conversion PARAMS ((tree));
04428 extern tree target_type PARAMS ((tree));
04429 extern tree require_complete_type PARAMS ((tree));
04430 extern tree complete_type PARAMS ((tree));
04431 extern tree complete_type_or_diagnostic PARAMS ((tree, tree, int));
04432 #define complete_type_or_else(T,V) (complete_type_or_diagnostic ((T), (V), 0))
04433 extern int type_unknown_p PARAMS ((tree));
04434 extern tree commonparms PARAMS ((tree, tree));
04435 extern tree original_type PARAMS ((tree));
04436 extern int comp_except_specs PARAMS ((tree, tree, int));
04437 extern int comptypes PARAMS ((tree, tree, int));
04438 extern int comp_target_types PARAMS ((tree, tree, int));
04439 extern int compparms PARAMS ((tree, tree));
04440 extern int comp_cv_qualification PARAMS ((tree, tree));
04441 extern int comp_cv_qual_signature PARAMS ((tree, tree));
04442 extern tree expr_sizeof PARAMS ((tree));
04443 extern tree cxx_sizeof_or_alignof_type PARAMS ((tree, enum tree_code, int));
04444 #define cxx_sizeof_nowarn(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, false)
04445 extern tree inline_conversion PARAMS ((tree));
04446 extern tree decay_conversion PARAMS ((tree));
04447 extern tree build_class_member_access_expr (tree, tree, tree, bool);
04448 extern tree finish_class_member_access_expr (tree, tree);
04449 extern tree build_x_indirect_ref PARAMS ((tree, const char *));
04450 extern tree build_indirect_ref PARAMS ((tree, const char *));
04451 extern tree build_array_ref PARAMS ((tree, tree));
04452 extern tree get_member_function_from_ptrfunc PARAMS ((tree *, tree));
04453 extern tree build_function_call_real PARAMS ((tree, tree, int));
04454 extern tree build_function_call_maybe PARAMS ((tree, tree));
04455 extern tree convert_arguments PARAMS ((tree, tree, tree, int));
04456 extern tree build_x_binary_op PARAMS ((enum tree_code, tree, tree));
04457 extern tree build_x_unary_op PARAMS ((enum tree_code, tree));
04458 extern tree unary_complex_lvalue PARAMS ((enum tree_code, tree));
04459 extern tree build_x_conditional_expr PARAMS ((tree, tree, tree));
04460 extern tree build_x_compound_expr PARAMS ((tree));
04461 extern tree build_compound_expr PARAMS ((tree));
04462 extern tree build_static_cast PARAMS ((tree, tree));
04463 extern tree build_reinterpret_cast PARAMS ((tree, tree));
04464 extern tree build_const_cast PARAMS ((tree, tree));
04465 extern tree build_c_cast PARAMS ((tree, tree));
04466 extern tree build_x_modify_expr PARAMS ((tree, enum tree_code, tree));
04467 extern tree build_modify_expr PARAMS ((tree, enum tree_code, tree));
04468 extern tree dubious_conversion_warnings PARAMS ((tree, tree, const char *, tree, int));
04469 extern tree convert_for_initialization PARAMS ((tree, tree, tree, int, const char *, tree, int));
04470 extern int comp_ptr_ttypes PARAMS ((tree, tree));
04471 extern int ptr_reasonably_similar PARAMS ((tree, tree));
04472 extern tree build_ptrmemfunc PARAMS ((tree, tree, int));
04473 extern int cp_type_quals PARAMS ((tree));
04474 extern int cp_has_mutable_p PARAMS ((tree));
04475 extern int at_least_as_qualified_p PARAMS ((tree, tree));
04476 extern int more_qualified_p PARAMS ((tree, tree));
04477 extern tree build_ptrmemfunc1 PARAMS ((tree, tree, tree));
04478 extern void expand_ptrmemfunc_cst PARAMS ((tree, tree *, tree *));
04479 extern tree pfn_from_ptrmemfunc PARAMS ((tree));
04480 extern tree type_after_usual_arithmetic_conversions PARAMS ((tree, tree));
04481 extern tree composite_pointer_type PARAMS ((tree, tree, tree, tree,
04482 const char*));
04483 extern tree merge_types PARAMS ((tree, tree));
04484 extern tree check_return_expr PARAMS ((tree));
04485 #define cp_build_binary_op(code, arg1, arg2) \
04486 build_binary_op(code, arg1, arg2, 1)
04487 #define cxx_sizeof(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, true)
04488 #define cxx_alignof(T) cxx_sizeof_or_alignof_type (T, ALIGNOF_EXPR, true)
04489 extern tree build_ptrmemfunc_access_expr (tree, tree);
04490 extern tree build_address (tree);
04491 extern tree build_nop (tree, tree);
04492
04493 /* in typeck2.c */
04494 extern void require_complete_eh_spec_types PARAMS ((tree, tree));
04495 extern void cxx_incomplete_type_diagnostic PARAMS ((tree, tree, int));
04496 #undef cxx_incomplete_type_error
04497 extern void cxx_incomplete_type_error PARAMS ((tree, tree));
04498 #define cxx_incomplete_type_error(V,T) \
04499 (cxx_incomplete_type_diagnostic ((V), (T), 0))
04500 extern tree error_not_base_type PARAMS ((tree, tree));
04501 extern tree binfo_or_else PARAMS ((tree, tree));
04502 extern void readonly_error PARAMS ((tree, const char *, int));
04503 extern int abstract_virtuals_error PARAMS ((tree, tree));
04504
04505 extern tree store_init_value PARAMS ((tree, tree));
04506 extern tree digest_init PARAMS ((tree, tree, tree *));
04507 extern tree build_scoped_ref PARAMS ((tree, tree, tree *));
04508 extern tree build_x_arrow PARAMS ((tree));
04509 extern tree build_m_component_ref PARAMS ((tree, tree));
04510 extern tree build_functional_cast PARAMS ((tree, tree));
04511 extern void check_for_new_type PARAMS ((const char *, flagged_type_tree));
04512 extern tree add_exception_specifier PARAMS ((tree, tree, int));
04513 extern tree merge_exception_specifiers PARAMS ((tree, tree));
04514
04515 /* in mangle.c */
04516 extern void init_mangle PARAMS ((void));
04517 extern void mangle_decl PARAMS ((tree));
04518 extern const char *mangle_type_string PARAMS ((tree));
04519 extern tree mangle_type PARAMS ((tree));
04520 extern tree mangle_typeinfo_for_type PARAMS ((tree));
04521 extern tree mangle_typeinfo_string_for_type PARAMS ((tree));
04522 extern tree mangle_vtbl_for_type PARAMS ((tree));
04523 extern tree mangle_vtt_for_type PARAMS ((tree));
04524 extern tree mangle_ctor_vtbl_for_type PARAMS ((tree, tree));
04525 extern tree mangle_thunk PARAMS ((tree, tree, tree));
04526 extern tree mangle_conv_op_name_for_type PARAMS ((tree));
04527 extern tree mangle_guard_variable PARAMS ((tree));
04528 extern tree mangle_ref_init_variable PARAMS ((tree));
04529
04530 /* in dump.c */
04531 extern int cp_dump_tree PARAMS ((void *, tree));
04532
04533 /* -- end of C++ */
04534
04535 #endif /* ! GCC_CP_TREE_H */