📄 cp-tree.h
字号:
/* Nonzero means warn about non virtual destructors in classes that have virtual functions. */extern int warn_nonvdtor;/* Nonzero means do some things the same way PCC does. */extern int flag_traditional;/* Nonzero means to treat bitfields as unsigned unless they say `signed'. */extern int flag_signed_bitfields;/* 3 means write out only virtuals function tables `defined' in this implementation file. 2 means write out only specific virtual function tables and give them (C) public visibility. 1 means write out virtual function tables and give them (C) public visibility. 0 means write out virtual function tables and give them (C) static visibility (default). -1 means declare virtual function tables extern. */extern int write_virtuals;/* INTERFACE_ONLY nonzero means that we are in an "interface" section of the compiler. INTERFACE_UNKNOWN nonzero means we cannot trust the value of INTERFACE_ONLY. If INTERFACE_UNKNOWN is zero and INTERFACE_ONLY is zero, it means that we are responsible for exporting definitions that others might need. */extern int interface_only, interface_unknown;/* Nonzero means we should attempt to elide constructors when possible. */extern int flag_elide_constructors;/* Nonzero means recognize and handle exception handling constructs. */extern int flag_handle_exceptions;/* Nonzero means recognize and handle ansi-style exception handling constructs. */extern int flag_ansi_exceptions;/* Nonzero means that member functions defined in class scope are inline by default. */extern int flag_default_inline;/* Nonzero means emit cadillac protocol. */extern int flag_cadillac;/* C++ language-specific tree codes. */#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,enum cplus_tree_code { __DUMMY = LAST_AND_UNUSED_TREE_CODE,#include "cp-tree.def" LAST_CPLUS_TREE_CODE};#undef DEFTREECODEenum languages { lang_c, lang_cplusplus };/* Macros to make error reporting functions' lives easier. */#if !PARANOID#define TYPE_IDENTIFIER(NODE) (DECL_NAME (TYPE_NAME (NODE)))#else#define TYPE_IDENTIFIER(NODE) (*TYPE_IDENTIFIER_PTR (NODE))#ifdef __GNUC____inline#endifstatic tree *TYPE_IDENTIFIER_PTR(NODE) tree NODE; { return (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 327), &DECL_NAME (TYPE_NAME (NODE))) ;}#endif#define TYPE_NAME_STRING(NODE) (IDENTIFIER_POINTER (TYPE_IDENTIFIER (NODE)))#define TYPE_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (TYPE_IDENTIFIER (NODE)))#define TYPE_ASSEMBLER_NAME_STRING(NODE) (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE))))#define TYPE_ASSEMBLER_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE))))#define IS_AGGR_TYPE_2(TYPE1,TYPE2) \ (TREE_CODE (TYPE1) == TREE_CODE (TYPE2) \ && IS_AGGR_TYPE (TYPE1)&IS_AGGR_TYPE (TYPE2))/* Macros which might want to be replaced by function calls. */#if 1/* Virtual function addresses can be gotten from a virtual function table entry using this macro. */#define FNADDR_FROM_VTABLE_ENTRY(ENTRY) \ TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY))))#define SET_FNADDR_FROM_VTABLE_ENTRY(ENTRY,VALUE) \ (TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY)))) = (VALUE))#define FUNCTION_ARG_CHAIN(NODE) (TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (NODE))))#define PROMOTES_TO_AGGR_TYPE(NODE,CODE) \ (((CODE) == TREE_CODE (NODE) \ && IS_AGGR_TYPE (TREE_TYPE (NODE))) \ || IS_AGGR_TYPE (NODE))#elseextern tree fnaddr_from_vtable_entry ();extern void set_fnaddr_from_vtable_entry ();extern tree function_arg_chain ();extern int promotes_to_aggr_type ();extern int is_aggr_type_2 ();#define FNADDR_FROM_VTABLE_ENTRY(ENTRY) (fnaddr_from_vtable_entry (ENTRY))#define SET_FNADDR_FROM_VTABLE_ENTRY(ENTRY,VALUE) \ (set_fnaddr_from_vtable_entry (ENTRY, VALUE))/* #define TYPE_NAME_STRING(NODE) (type_name_string (NODE)) */#define FUNCTION_ARG_CHAIN(NODE) (function_arg_chain (NODE))#define PROMOTES_TO_AGGR_TYPE(NODE,CODE) (promotes_to_aggr_type (NODE, CODE))/* #define IS_AGGR_TYPE_2(TYPE1, TYPE2) (is_aggr_type_2 (TYPE1, TYPE2)) */#endif/* Nonzero iff TYPE is uniquely derived from PARENT. Under MI, PARENT can be an ambiguous base class of TYPE, and this macro will be false. */#define UNIQUELY_DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 0, 0) >= 0)enum conversion_type { ptr_conv, constptr_conv, int_conv, real_conv, last_conversion_type };/* Statistics show that while the GNU C++ compiler may generate thousands of different types during a compilation run, it generates relatively few (tens) of classtypes. Because of this, it is not costly to store a generous amount of information in classtype nodes. This struct must fill out to a multiple of 4 bytes. */struct lang_type{ struct { unsigned has_type_conversion : 1; unsigned has_int_conversion : 1; unsigned has_float_conversion : 1; unsigned has_init_ref : 1; unsigned gets_init_ref : 1; unsigned gets_init_aggr : 1; unsigned has_assignment : 1; unsigned gets_assignment : 1; unsigned needs_constructor : 1; unsigned has_default_ctor : 1; unsigned uses_multiple_inheritance : 1; unsigned const_needs_init : 1; unsigned ref_needs_init : 1; unsigned gets_const_init_ref : 1; unsigned has_const_assign_ref : 1; unsigned gets_const_assign_ref : 1; unsigned vtable_needs_writing : 1; unsigned has_assign_ref : 1; unsigned gets_assign_ref : 1; unsigned gets_new : 1; unsigned gets_delete : 1; unsigned has_call_overloaded : 1; unsigned has_array_ref_overloaded : 1; unsigned has_arrow_overloaded : 1; unsigned local_typedecls : 1; unsigned interface_only : 1; unsigned interface_unknown : 1; unsigned needs_virtual_reinit : 1; unsigned declared_exception : 1; unsigned declared_class : 1; unsigned being_defined : 1; unsigned redefined : 1; unsigned marked : 1; unsigned marked2 : 1; unsigned marked3 : 1; unsigned marked4 : 1; unsigned marked5 : 1; unsigned marked6 : 1; unsigned use_template : 2; unsigned debug_requested : 1; unsigned dynamic : 1; unsigned has_method_call_overloaded : 1; unsigned private_attr : 1; unsigned alters_visibilities : 1; unsigned got_semicolon : 1; unsigned dummy : 1; /* The MIPS compiler gets it wrong if this struct also does not fill out to a multiple of 4 bytes. */ unsigned n_vancestors : 16; } type_flags; int cid; int n_ancestors; int vsize; int max_depth; union tree_node *vbinfo[2]; union tree_node *baselink_vec; union tree_node *vfields; union tree_node *vbases; union tree_node *vbase_size; union tree_node *tags; char *memoized_table_entry; char *search_slot;#ifdef ONLY_INT_FIELDS unsigned int mode : 8;#else enum machine_mode mode : 8;#endif unsigned char size_unit; unsigned char align; unsigned char sep_unit; union tree_node *sep; union tree_node *size; union tree_node *base_init_list; union tree_node *abstract_virtuals; union tree_node *as_list; union tree_node *id_as_list; union tree_node *binfo_as_list; union tree_node *vtbl_ptr; union tree_node *instance_variable; union tree_node *friend_classes; char *mi_matrix; union tree_node *conversions[last_conversion_type]; union tree_node *dossier;#ifdef SOS union tree_node *typename_as_string; union tree_node *dynamic_filename; union tree_node *dynamic_table;#endif};/* Indicates whether a template should be (or has been) expanded for this class definition. 0=do, 1=did, 2=don't, 3=didn't. */#define CLASSTYPE_USE_TEMPLATE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.use_template)/* Fields used for storing information before the class is defined. After the class is defined, these fields hold other information. *//* List of friends which were defined inline in this class definition. */#define CLASSTYPE_INLINE_FRIENDS(NODE) (TYPE_NONCOPIED_PARTS (NODE))/* Nonzero for _CLASSTYPE means that the _CLASSTYPE either has a special meaning for the assignment operator ("operator="), or one of its fields (or base members) has a special meaning defined. */#define TYPE_HAS_ASSIGNMENT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_assignment)#define TYPE_GETS_ASSIGNMENT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_assignment)/* Nonzero for _CLASSTYPE means that operator new and delete are defined, respectively. */#define TREE_GETS_NEW(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_new)#define TREE_GETS_DELETE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_delete)/* Nonzero for TREE_LIST or _TYPE node means that this node is class-local. */#define TREE_NONLOCAL_FLAG(NODE) (TREE_LANG_FLAG_0 (NODE))/* Nonzero for a _CLASSTYPE node which we know to be private. */#define TYPE_PRIVATE_P(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.private_attr)/* Nonzero means that this _CLASSTYPE node defines ways of converting itself to other types. */#define TYPE_HAS_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_type_conversion)/* Nonzero means that this _CLASSTYPE node can convert itself to an INTEGER_TYPE. */#define TYPE_HAS_INT_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_int_conversion)/* Nonzero means that this _CLASSTYPE node can convert itself to an REAL_TYPE. */#define TYPE_HAS_REAL_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_float_conversion)/* Nonzero means that this _CLASSTYPE node overloads operator=(X&). */#define TYPE_HAS_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_assign_ref)#define TYPE_GETS_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_assign_ref)#define TYPE_HAS_CONST_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_const_assign_ref)#define TYPE_GETS_CONST_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_const_assign_ref)/* Nonzero means that this _CLASSTYPE node has an X(X&) constructor. */#define TYPE_HAS_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_init_ref)#define TYPE_GETS_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_init_ref)#define TYPE_GETS_CONST_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_const_init_ref)/* Nonzero means that this _CLASSTYPE node has an X(X ...) constructor. Note that there must be other arguments, or this constructor is flagged as being erroneous. */#define TYPE_GETS_INIT_AGGR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_init_aggr)/* Nonzero means that this type is being defined. I.e., the left brace starting the definition of this type has been seen. */#define TYPE_BEING_DEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.being_defined)/* Nonzero means that this type has been redefined. In this case, if convenient, don't reprocess any methods that appear in its redefinition. */#define TYPE_REDEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.redefined)/* Nonzero means that this _CLASSTYPE node overloads the method call operator. In this case, all method calls go through `operator->()(...). */#define TYPE_OVERLOADS_METHOD_CALL_EXPR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_method_call_overloaded)/* The is the VAR_DECL that contains NODE's dossier. */#define CLASSTYPE_DOSSIER(NODE) (TYPE_LANG_SPECIFIC(NODE)->dossier)/* Nonzero means that this _CLASSTYPE node overloads operator(). */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -