📄 tree.h
字号:
HOST_WIDE_INT int_cst_low; HOST_WIDE_INT int_cst_high;};/* In REAL_CST, STRING_CST, COMPLEX_CST nodes, and CONSTRUCTOR nodes, and generally in all kinds of constants that could be given labels (rather than being immediate). */#define TREE_CST_RTL(NODE) ((NODE)->real_cst.rtl)/* In a REAL_CST node. *//* We can represent a real value as either a `double' or a string. Strings don't allow for any optimization, but they do allow for cross-compilation. */#define TREE_REAL_CST(NODE) ((NODE)->real_cst.real_cst)#include "real.h"struct tree_real_cst{ char common[sizeof (struct tree_common)]; struct rtx_def *rtl; /* acts as link to register transfer language (rtl) info */ REAL_VALUE_TYPE real_cst;};/* In a STRING_CST */#define TREE_STRING_LENGTH(NODE) ((NODE)->string.length)#define TREE_STRING_POINTER(NODE) ((NODE)->string.pointer)struct tree_string{ char common[sizeof (struct tree_common)]; struct rtx_def *rtl; /* acts as link to register transfer language (rtl) info */ int length; char *pointer;};/* In a COMPLEX_CST node. */#define TREE_REALPART(NODE) ((NODE)->complex.real)#define TREE_IMAGPART(NODE) ((NODE)->complex.imag)struct tree_complex{ char common[sizeof (struct tree_common)]; struct rtx_def *rtl; /* acts as link to register transfer language (rtl) info */ union tree_node *real; union tree_node *imag;};/* Define fields and accessors for some special-purpose tree nodes. */#define IDENTIFIER_LENGTH(NODE) ((NODE)->identifier.length)#define IDENTIFIER_POINTER(NODE) ((NODE)->identifier.pointer)struct tree_identifier{ char common[sizeof (struct tree_common)]; int length; char *pointer;};/* In a TREE_LIST node. */#define TREE_PURPOSE(NODE) ((NODE)->list.purpose)#define TREE_VALUE(NODE) ((NODE)->list.value)struct tree_list{ char common[sizeof (struct tree_common)]; union tree_node *purpose; union tree_node *value;};/* In a TREE_VEC node. */#define TREE_VEC_LENGTH(NODE) ((NODE)->vec.length)#define TREE_VEC_ELT(NODE,I) ((NODE)->vec.a[I])#define TREE_VEC_END(NODE) (&((NODE)->vec.a[(NODE)->vec.length]))struct tree_vec{ char common[sizeof (struct tree_common)]; int length; union tree_node *a[1];};/* Define fields and accessors for some nodes that represent expressions. *//* In a SAVE_EXPR node. */#define SAVE_EXPR_CONTEXT(NODE) TREE_OPERAND(NODE, 1)#define SAVE_EXPR_RTL(NODE) (*(struct rtx_def **) &(NODE)->exp.operands[2])/* In a RTL_EXPR node. */#define RTL_EXPR_SEQUENCE(NODE) (*(struct rtx_def **) &(NODE)->exp.operands[0])#define RTL_EXPR_RTL(NODE) (*(struct rtx_def **) &(NODE)->exp.operands[1])/* In a CALL_EXPR node. */#define CALL_EXPR_RTL(NODE) (*(struct rtx_def **) &(NODE)->exp.operands[2])/* In a CONSTRUCTOR node. */#define CONSTRUCTOR_ELTS(NODE) TREE_OPERAND (NODE, 1)/* In ordinary expression nodes. */#define TREE_OPERAND(NODE, I) ((NODE)->exp.operands[I])#define TREE_COMPLEXITY(NODE) ((NODE)->exp.complexity)struct tree_exp{ char common[sizeof (struct tree_common)]; int complexity; union tree_node *operands[1];};/* In a BLOCK node. */#define BLOCK_VARS(NODE) ((NODE)->block.vars)#define BLOCK_TYPE_TAGS(NODE) ((NODE)->block.type_tags)#define BLOCK_SUBBLOCKS(NODE) ((NODE)->block.subblocks)#define BLOCK_SUPERCONTEXT(NODE) ((NODE)->block.supercontext)/* Note: when changing this, make sure to find the places that use chainon or nreverse. */#define BLOCK_CHAIN(NODE) TREE_CHAIN (NODE)#define BLOCK_ABSTRACT_ORIGIN(NODE) ((NODE)->block.abstract_origin)#define BLOCK_ABSTRACT(NODE) ((NODE)->block.abstract_flag)#define BLOCK_END_NOTE(NODE) ((NODE)->block.end_note)/* Nonzero means that this block is prepared to handle exceptions listed in the BLOCK_VARS slot. */#define BLOCK_HANDLER_BLOCK(NODE) ((NODE)->block.handler_block_flag)struct tree_block{ char common[sizeof (struct tree_common)]; unsigned handler_block_flag : 1; unsigned abstract_flag : 1; union tree_node *vars; union tree_node *type_tags; union tree_node *subblocks; union tree_node *supercontext; union tree_node *abstract_origin; struct rtx_def *end_note;};/* Define fields and accessors for nodes representing data types. *//* See tree.def for documentation of the use of these fields. Look at the documentation of the various ..._TYPE tree codes. */#define TYPE_UID(NODE) ((NODE)->type.uid)#define TYPE_SIZE(NODE) ((NODE)->type.size)#define TYPE_MODE(NODE) ((NODE)->type.mode)#define TYPE_VALUES(NODE) ((NODE)->type.values)#define TYPE_DOMAIN(NODE) ((NODE)->type.values)#define TYPE_FIELDS(NODE) ((NODE)->type.values)#define TYPE_METHODS(NODE) ((NODE)->type.maxval)#define TYPE_VFIELD(NODE) ((NODE)->type.minval)#define TYPE_ARG_TYPES(NODE) ((NODE)->type.values)#define TYPE_METHOD_BASETYPE(NODE) ((NODE)->type.maxval)#define TYPE_OFFSET_BASETYPE(NODE) ((NODE)->type.maxval)#define TYPE_POINTER_TO(NODE) ((NODE)->type.pointer_to)#define TYPE_REFERENCE_TO(NODE) ((NODE)->type.reference_to)#define TYPE_MIN_VALUE(NODE) ((NODE)->type.minval)#define TYPE_MAX_VALUE(NODE) ((NODE)->type.maxval)#define TYPE_PRECISION(NODE) ((NODE)->type.precision)#define TYPE_PARSE_INFO(NODE) ((NODE)->type.parse_info)#define TYPE_SYMTAB_ADDRESS(NODE) ((NODE)->type.symtab_address)#define TYPE_NAME(NODE) ((NODE)->type.name)#define TYPE_NEXT_VARIANT(NODE) ((NODE)->type.next_variant)#define TYPE_MAIN_VARIANT(NODE) ((NODE)->type.main_variant)#define TYPE_BINFO(NODE) ((NODE)->type.binfo)#define TYPE_NONCOPIED_PARTS(NODE) ((NODE)->type.noncopied_parts)#define TYPE_CONTEXT(NODE) ((NODE)->type.context)#define TYPE_LANG_SPECIFIC(NODE) ((NODE)->type.lang_specific)/* The alignment necessary for objects of this type. The value is an int, measured in bits. */#define TYPE_ALIGN(NODE) ((NODE)->type.align)#define TYPE_STUB_DECL(NODE) (TREE_CHAIN (NODE))/* In a RECORD_TYPE or UNION_TYPE, it means the type has BLKmode only because it lacks the alignment requirement for its size. */#define TYPE_NO_FORCE_BLK(NODE) ((NODE)->type.no_force_blk_flag)/* Nonzero in a type considered volatile as a whole. */#define TYPE_VOLATILE(NODE) ((NODE)->common.volatile_flag)/* Means this type is const-qualified. */#define TYPE_READONLY(NODE) ((NODE)->common.readonly_flag)/* These flags are available for each language front end to use internally. */#define TYPE_LANG_FLAG_0(NODE) ((NODE)->type.lang_flag_0)#define TYPE_LANG_FLAG_1(NODE) ((NODE)->type.lang_flag_1)#define TYPE_LANG_FLAG_2(NODE) ((NODE)->type.lang_flag_2)#define TYPE_LANG_FLAG_3(NODE) ((NODE)->type.lang_flag_3)#define TYPE_LANG_FLAG_4(NODE) ((NODE)->type.lang_flag_4)#define TYPE_LANG_FLAG_5(NODE) ((NODE)->type.lang_flag_5)#define TYPE_LANG_FLAG_6(NODE) ((NODE)->type.lang_flag_6)struct tree_type{ char common[sizeof (struct tree_common)]; union tree_node *values; union tree_node *size; unsigned uid;#ifdef ONLY_INT_FIELDS int mode : 8;#else enum machine_mode mode : 8;#endif unsigned char precision; unsigned no_force_blk_flag : 1; unsigned lang_flag_0 : 1; unsigned lang_flag_1 : 1; unsigned lang_flag_2 : 1; unsigned lang_flag_3 : 1; unsigned lang_flag_4 : 1; unsigned lang_flag_5 : 1; unsigned lang_flag_6 : 1; unsigned int align; union tree_node *pointer_to; union tree_node *reference_to; int parse_info; int symtab_address; union tree_node *name; union tree_node *minval; union tree_node *maxval; union tree_node *next_variant; union tree_node *main_variant; union tree_node *binfo; union tree_node *noncopied_parts; union tree_node *context; /* Points to a structure whose details depend on the language in use. */ struct lang_type *lang_specific;};/* Define accessor macros for information about type inheritance and basetypes. A "basetype" means a particular usage of a data type for inheritance in another type. Each such basetype usage has its own "binfo" object to describe it. The binfo object is a TREE_VEC node. Inheritance is represented by the binfo nodes allocated for a given type. For example, given types C and D, such that D is inherited by C, 3 binfo nodes will be allocated: one for describing the binfo properties of C, similarly one for D, and one for describing the binfo properties of D as a base type for C. Thus, given a pointer to class C, one can get a pointer to the binfo of D acting as a basetype for C by looking at C's binfo's basetypes. *//* The actual data type node being inherited in this basetype. */#define BINFO_TYPE(NODE) TREE_TYPE (NODE)/* The offset where this basetype appears in its containing type. BINFO_OFFSET slot holds the offset (in bytes) from the base of the complete object to the base of the part of the object that is allocated on behalf of this `type'. This is always 0 except when there is multiple inheritance. */ #define BINFO_OFFSET(NODE) TREE_VEC_ELT ((NODE), 1)#define TYPE_BINFO_OFFSET(NODE) BINFO_OFFSET (TYPE_BINFO (NODE))#define BINFO_OFFSET_ZEROP(NODE) (BINFO_OFFSET (NODE) == integer_zero_node)/* The virtual function table belonging to this basetype. Virtual function tables provide a mechanism for run-time method dispatching. The entries of a virtual function table are language-dependent. */#define BINFO_VTABLE(NODE) TREE_VEC_ELT ((NODE), 2)#define TYPE_BINFO_VTABLE(NODE) BINFO_VTABLE (TYPE_BINFO (NODE))/* The virtual functions in the virtual function table. This is a TREE_LIST that is used as an initial approximation for building a virtual function table for this basetype. */#define BINFO_VIRTUALS(NODE) TREE_VEC_ELT ((NODE), 3)#define TYPE_BINFO_VIRTUALS(NODE) BINFO_VIRTUALS (TYPE_BINFO (NODE))/* A vector of additional binfos for the types inherited by this basetype. If this basetype describes type D as inherited in C, and if the basetypes of D are E anf F, then this vector contains binfos for inheritance of E and F by C. ??? This could probably be done by just allocating the base types at the end of this TREE_VEC (instead of using another TREE_VEC). This would simplify the calculation of how many basetypes a given type had. */#define BINFO_BASETYPES(NODE) TREE_VEC_ELT ((NODE), 4)#define TYPE_BINFO_BASETYPES(NODE) TREE_VEC_ELT (TYPE_BINFO (NODE), 4)/* For a BINFO record describing an inheritance, this yields a pointer to the artificial FIELD_DECL node which contains the "virtual base class pointer" for the given inheritance. */#define BINFO_VPTR_FIELD(NODE) TREE_VEC_ELT ((NODE), 5)/* Accessor macro to get to the Nth basetype of this basetype. */#define BINFO_BASETYPE(NODE,N) TREE_VEC_ELT (BINFO_BASETYPES (NODE), (N))#define TYPE_BINFO_BASETYPE(NODE,N) BINFO_TYPE (TREE_VEC_ELT (BINFO_BASETYPES (TYPE_BINFO (NODE)), (N)))/* Slot used to build a chain that represents a use of inheritance. For example, if X is derived from Y, and Y is derived from Z, then this field can be used to link the binfo node for X to the binfo node for X's Y to represent the use of inheritance from X to Y. Similarly, this slot of the binfo node for X's Y can point to the Z from which Y is inherited (in X's inheritance hierarchy). In this fashion, one can represent and traverse specific uses of inheritance using the binfo nodes themselves (instead of consing new space pointing to binfo nodes). It is up to the language-dependent front-ends to maintain this information as necessary. */#define BINFO_INHERITANCE_CHAIN(NODE) TREE_VEC_ELT ((NODE), 0)/* Define fields and accessors for nodes representing declared names. *//* This is the name of the object as written by the user. It is an IDENTIFIER_NODE. */#define DECL_NAME(NODE) ((NODE)->decl.name)/* This macro is marked for death. */#define DECL_PRINT_NAME(NODE) ((NODE)->decl.print_name)/* This is the name of the object as the assembler will see it (but before any translations made by ASM_OUTPUT_LABELREF). Often this is the same as DECL_NAME. It is an IDENTIFIER_NODE. */#define DECL_ASSEMBLER_NAME(NODE) ((NODE)->decl.assembler_name)/* For FIELD_DECLs, this is the RECORD_TYPE or UNION_TYPE node that the field is a member of. For VAR_DECL, PARM_DECL, FUNCTION_DECL, LABEL_DECL, and CONST_DECL nodes, this points to the FUNCTION_DECL for the containing function, or else yields NULL_TREE if the given decl has "file scope". */#define DECL_CONTEXT(NODE) ((NODE)->decl.context)#define DECL_FIELD_CONTEXT(NODE) ((NODE)->decl.context)/* In a FIELD_DECL, this is the field position, counting in bits, of the bit closest to the beginning of the structure. */#define DECL_FIELD_BITPOS(NODE) ((NODE)->decl.arguments)/* In a FIELD_DECL, this indicates whether the field was a bit-field and if so, the type that was originally specified for it. TREE_TYPE may have been modified (in finish_struct). */#define DECL_BIT_FIELD_TYPE(NODE) ((NODE)->decl.result)/* In FUNCTION_DECL, a chain of ..._DECL nodes. *//* VAR_DECL and PARM_DECL reserve the arguments slot for language-specific uses. */#define DECL_ARGUMENTS(NODE) ((NODE)->decl.arguments)/* In FUNCTION_DECL, holds the decl for the return value. */#define DECL_RESULT(NODE) ((NODE)->decl.result)/* In PARM_DECL, holds the type as written (perhaps a function or array). */#define DECL_ARG_TYPE_AS_WRITTEN(NODE) ((NODE)->decl.result)/* For a FUNCTION_DECL, holds the tree of BINDINGs. For a VAR_DECL, holds the initial value. For a PARM_DECL, not used--default values for parameters are encoded in the type of the function, not in the PARM_DECL slot. */#define DECL_INITIAL(NODE) ((NODE)->decl.initial)/* For a PARM_DECL, records the data type used to pass the argument,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -