📄 tree.h
字号:
#define DECL_INLINE(NODE) ((NODE)->decl.inline_flag)/* Nonzero in a FUNCTION_DECL means this is a built-in function that is not specified by ansi C and that users are supposed to be allowed to redefine for any purpose whatever. */#define DECL_BUILT_IN_NONANSI(NODE) ((NODE)->common.unsigned_flag)/* Nonzero in a FIELD_DECL means it is a bit field, and must be accessed specially. */#define DECL_BIT_FIELD(NODE) ((NODE)->decl.bit_field_flag)/* In a LABEL_DECL, nonzero means label was defined inside a binding contour that restored a stack level and which is now exited. */#define DECL_TOO_LATE(NODE) ((NODE)->decl.bit_field_flag)/* In a FUNCTION_DECL, nonzero means a built in function. */#define DECL_BUILT_IN(NODE) ((NODE)->decl.bit_field_flag)/* In a VAR_DECL that's static, nonzero if the space is in the text section. */#define DECL_IN_TEXT_SECTION(NODE) ((NODE)->decl.bit_field_flag)/* Used in VAR_DECLs to indicate that the variable is a vtable. Used in FIELD_DECLs for vtable pointers. Used in FUNCTION_DECLs to indicate that the function is virtual. */#define DECL_VIRTUAL_P(NODE) ((NODE)->decl.virtual_flag)/* Used to indicate that the linkage status of this DECL is not yet known, so it should not be output now. */#define DECL_DEFER_OUTPUT(NODE) ((NODE)->decl.defer_output)/* Used in PARM_DECLs whose type are unions to indicate that the argument should be passed in the same way that the first union alternative would be passed. */#define DECL_TRANSPARENT_UNION(NODE) ((NODE)->decl.transparent_union)/* Used in FUNCTION_DECLs to indicate that they should be run automatically at the beginning or end of execution. */#define DECL_STATIC_CONSTRUCTOR(NODE) ((NODE)->decl.static_ctor_flag)#define DECL_STATIC_DESTRUCTOR(NODE) ((NODE)->decl.static_dtor_flag)/* Used to indicate that this DECL represents a compiler-generated entity. */#define DECL_ARTIFICIAL(NODE) ((NODE)->decl.artificial_flag)/* Used to indicate that this DECL has weak linkage. */#define DECL_WEAK(NODE) ((NODE)->decl.weak_flag)/* Used in TREE_PUBLIC decls to indicate that copies of this DECL in multiple translation units should be merged. */#define DECL_ONE_ONLY(NODE) ((NODE)->decl.transparent_union)/* Additional flags for language-specific uses. */#define DECL_LANG_FLAG_0(NODE) ((NODE)->decl.lang_flag_0)#define DECL_LANG_FLAG_1(NODE) ((NODE)->decl.lang_flag_1)#define DECL_LANG_FLAG_2(NODE) ((NODE)->decl.lang_flag_2)#define DECL_LANG_FLAG_3(NODE) ((NODE)->decl.lang_flag_3)#define DECL_LANG_FLAG_4(NODE) ((NODE)->decl.lang_flag_4)#define DECL_LANG_FLAG_5(NODE) ((NODE)->decl.lang_flag_5)#define DECL_LANG_FLAG_6(NODE) ((NODE)->decl.lang_flag_6)#define DECL_LANG_FLAG_7(NODE) ((NODE)->decl.lang_flag_7)struct tree_decl{ char common[sizeof (struct tree_common)]; char *filename; int linenum; unsigned int uid; union tree_node *size;#ifdef ONLY_INT_FIELDS int mode : 8;#else enum machine_mode mode : 8;#endif unsigned external_flag : 1; unsigned nonlocal_flag : 1; unsigned regdecl_flag : 1; unsigned inline_flag : 1; unsigned bit_field_flag : 1; unsigned virtual_flag : 1; unsigned ignored_flag : 1; unsigned abstract_flag : 1; unsigned in_system_header_flag : 1; unsigned common_flag : 1; unsigned defer_output : 1; unsigned transparent_union : 1; unsigned static_ctor_flag : 1; unsigned static_dtor_flag : 1; unsigned artificial_flag : 1; unsigned weak_flag : 1; /* room for no more */ 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 lang_flag_7 : 1; /* For a FUNCTION_DECL, if inline, this is the size of frame needed. If built-in, this is the code for which built-in function. For other kinds of decls, this is DECL_ALIGN. */ union { int i; unsigned int u; enum built_in_function f; } frame_size; union tree_node *name; union tree_node *context; union tree_node *arguments; union tree_node *result; union tree_node *initial; union tree_node *abstract_origin; union tree_node *assembler_name; union tree_node *section_name; union tree_node *machine_attributes; struct rtx_def *rtl; /* acts as link to register transfer language (rtl) info */ /* For FUNCTION_DECLs: points to insn that constitutes its definition on the permanent obstack. For any other kind of decl, this is the alignment. */ union { struct rtx_def *r; HOST_WIDE_INT i; } saved_insns; union tree_node *vindex; /* Points to a structure whose details depend on the language in use. */ struct lang_decl *lang_specific;};/* Define the overall contents of a tree node. It may be any of the structures declared above for various types of node. */union tree_node{ struct tree_common common; struct tree_int_cst int_cst; struct tree_real_cst real_cst; struct tree_string string; struct tree_complex complex; struct tree_identifier identifier; struct tree_decl decl; struct tree_type type; struct tree_list list; struct tree_vec vec; struct tree_exp exp; struct tree_block block; };#include "gansidecl.h"#define NULL_TREE (tree) NULL/* The following functions accept a wide integer argument. Rather than having to cast on every function call, we use a macro instead, that is defined here and in rtl.h. */#ifndef exact_log2#define exact_log2(N) exact_log2_wide ((HOST_WIDE_INT) (N))#define floor_log2(N) floor_log2_wide ((HOST_WIDE_INT) (N))#endif#if 0/* At present, don't prototype xrealloc, since all of the callers don't cast their pointers to char *, and all of the xrealloc's don't use void * yet. */extern char *xmalloc PROTO((size_t));extern char *xrealloc PROTO((void *, size_t));#elseextern char *xmalloc ();extern char *xrealloc ();#endifextern char *xstrdup PROTO((char *));extern char *oballoc PROTO((int));extern char *permalloc PROTO((int));extern char *savealloc PROTO((int));extern char *expralloc PROTO((int));#ifdef NEED_DECLARATION_FREEextern void free PROTO((void *));#endif/* Lowest level primitive for allocating a node. The TREE_CODE is the only argument. Contents are initialized to zero except for a few of the common fields. */extern tree make_node PROTO((enum tree_code));/* Make a copy of a node, with all the same contents except for TREE_PERMANENT. (The copy is permanent iff nodes being made now are permanent.) */extern tree copy_node PROTO((tree));/* Make a copy of a chain of TREE_LIST nodes. */extern tree copy_list PROTO((tree));/* Make a TREE_VEC. */extern tree make_tree_vec PROTO((int));/* Return the (unique) IDENTIFIER_NODE node for a given name. The name is supplied as a char *. */extern tree get_identifier PROTO((char *));/* If an identifier with the name TEXT (a null-terminated string) has previously been referred to, return that node; otherwise return NULL_TREE. */extern tree maybe_get_identifier PROTO((char *));/* Construct various types of nodes. */#define build_int_2(LO,HI) \ build_int_2_wide ((HOST_WIDE_INT) (LO), (HOST_WIDE_INT) (HI))extern tree build PVPROTO((enum tree_code, tree, ...));extern tree build_nt PVPROTO((enum tree_code, ...));extern tree build_parse_node PVPROTO((enum tree_code, ...));extern tree build_int_2_wide PROTO((HOST_WIDE_INT, HOST_WIDE_INT));extern tree build_real PROTO((tree, REAL_VALUE_TYPE));extern tree build_real_from_int_cst PROTO((tree, tree));extern tree build_complex PROTO((tree, tree, tree));extern tree build_string PROTO((int, char *));extern tree build1 PROTO((enum tree_code, tree, tree));extern tree build_tree_list PROTO((tree, tree));extern tree build_decl_list PROTO((tree, tree));extern tree build_expr_list PROTO((tree, tree));extern tree build_decl PROTO((enum tree_code, tree, tree));extern tree build_block PROTO((tree, tree, tree, tree, tree));/* Construct various nodes representing data types. */extern tree make_signed_type PROTO((int));extern tree make_unsigned_type PROTO((int));extern tree signed_or_unsigned_type PROTO((int, tree));extern void fixup_unsigned_type PROTO((tree));extern tree build_pointer_type PROTO((tree));extern tree build_reference_type PROTO((tree));extern tree build_index_type PROTO((tree));extern tree build_index_2_type PROTO((tree, tree));extern tree build_array_type PROTO((tree, tree));extern tree build_function_type PROTO((tree, tree));extern tree build_method_type PROTO((tree, tree));extern tree build_offset_type PROTO((tree, tree));extern tree build_complex_type PROTO((tree));extern tree array_type_nelts PROTO((tree));extern tree value_member PROTO((tree, tree));extern tree purpose_member PROTO((tree, tree));extern tree binfo_member PROTO((tree, tree));extern int attribute_hash_list PROTO((tree));extern int attribute_list_equal PROTO((tree, tree));extern int attribute_list_contained PROTO((tree, tree));extern int tree_int_cst_equal PROTO((tree, tree));extern int tree_int_cst_lt PROTO((tree, tree));extern int tree_int_cst_sgn PROTO((tree));extern int index_type_equal PROTO((tree, tree));/* From expmed.c. Since rtl.h is included after tree.h, we can't put the prototype here. Rtl.h does declare the prototype if tree.h had been included. */extern tree make_tree ();/* Return a type like TTYPE except that its TYPE_ATTRIBUTES is ATTRIBUTE. Such modified types already made are recorded so that duplicates are not made. */extern tree build_type_attribute_variant PROTO((tree, tree));extern tree build_decl_attribute_variant PROTO((tree, tree));/* Return 1 if an attribute and its arguments are valid for a decl or type. */extern int valid_machine_attribute PROTO((tree, tree, tree, tree));/* Given a tree node and a string, return non-zero if the tree node is a valid attribute name for the string. */extern int is_attribute_p PROTO((char *, tree));/* Given an attribute name and a list of attributes, return the list element of the attribute or NULL_TREE if not found. */extern tree lookup_attribute PROTO((char *, tree));/* Given two attributes lists, return a list of their union. */extern tree merge_attributes PROTO((tree, tree));/* Given a type node TYPE, and CONSTP and VOLATILEP, return a type for the same kind of data as TYPE describes. Variants point to the "main variant" (which has neither CONST nor VOLATILE) via TYPE_MAIN_VARIANT, and it points to a chain of other variants so that duplicate variants are never made. Only main variants should ever appear as types of expressions. */extern tree build_type_variant PROTO((tree, int, int));/* Make a copy of a type node. */extern tree build_type_copy PROTO((tree));/* Given a ..._TYPE node, calculate the TYPE_SIZE, TYPE_SIZE_UNIT, TYPE_ALIGN and TYPE_MODE fields. If called more than once on one node, does nothing except for the first time. */extern void layout_type PROTO((tree));/* Given a hashcode and a ..._TYPE node (for which the hashcode was made), return a canonicalized ..._TYPE node, so that duplicates are not made. How the hash code is computed is up to the caller, as long as any two callers that could hash identical-looking type nodes agree. */extern tree type_hash_canon PROTO((int, tree));/* Given a VAR_DECL, PARM_DECL, RESULT_DECL or FIELD_DECL node, calculates the DECL_SIZE, DECL_SIZE_UNIT, DECL_ALIGN and DECL_MODE fields. Call this only once for any given decl node. Second argument is the boundary that this field can be assumed to be starting at (in bits). Zero means it can be assumed aligned on any boundary that may be needed. */extern void layout_decl PROTO((tree, unsigned));/* Return an expr equal to X but certainly not valid as an lvalue. */extern tree non_lvalue PROTO((tree));extern tree pedantic_non_lvalue PROTO((tree));extern tree convert PROTO((tree, tree));extern tree size_in_bytes PROTO((tree));extern int int_size_in_bytes PROTO((tree));extern tree size_binop PROTO((enum tree_code, tree, tree));extern tree size_int PROTO((unsigned HOST_WIDE_INT));extern tree round_up PROTO((tree, int));extern tree get_pending_sizes PROTO((void));extern void put_pending_sizes PROTO((tree));/* Type for sizes of data-type. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -