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