cp-tree.h
来自「GCC编译器源代码」· C头文件 代码 · 共 1,508 行 · 第 1/5 页
H
1,508 行
space from the heap. When appearing in a SAVE_EXPR, it means that underneath is a call to a constructor. When appearing in a CONSTRUCTOR, it means that it was a GNU C constructor expression. When appearing in a FIELD_DECL, it means that this field has been duly initialized in its constructor. */#define TREE_HAS_CONSTRUCTOR(NODE) (TREE_LANG_FLAG_4(NODE))#define EMPTY_CONSTRUCTOR_P(NODE) (TREE_CODE (NODE) == CONSTRUCTOR \ && CONSTRUCTOR_ELTS (NODE) == NULL_TREE)#if 0/* Indicates that a NON_LVALUE_EXPR came from a C++ reference. Used to generate more helpful error message in case somebody tries to take its address. */#define TREE_REFERENCE_EXPR(NODE) (TREE_LANG_FLAG_3(NODE))#endif/* Nonzero for _TYPE means that the _TYPE defines a destructor. */#define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2(NODE))#if 0/* Nonzero for _TYPE node means that creating an object of this type will involve a call to a constructor. This can apply to objects of ARRAY_TYPE if the type of the elements needs a constructor. */#define TYPE_NEEDS_CONSTRUCTING(NODE) (TYPE_LANG_FLAG_3(NODE))#endif/* Nonzero means that an object of this type can not be initialized using an initializer list. */#define CLASSTYPE_NON_AGGREGATE(NODE) \ (TYPE_LANG_SPECIFIC (NODE)->type_flags.non_aggregate)#define TYPE_NON_AGGREGATE_CLASS(NODE) \ (IS_AGGR_TYPE (NODE) && CLASSTYPE_NON_AGGREGATE (NODE))/* Nonzero if there is a user-defined X::op=(x&) for this class. */#define TYPE_HAS_REAL_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_real_assign_ref)#define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_complex_assign_ref)#define TYPE_HAS_ABSTRACT_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_abstract_assign_ref)#define TYPE_HAS_COMPLEX_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_complex_init_ref)/* Nonzero for _TYPE node means that destroying an object of this type will involve a call to a destructor. This can apply to objects of ARRAY_TYPE is the type of the elements needs a destructor. */#define TYPE_NEEDS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_4(NODE))/* Nonzero for class type means that initialization of this type can use a bitwise copy. */#define TYPE_HAS_TRIVIAL_INIT_REF(NODE) \ (TYPE_HAS_INIT_REF (NODE) && ! TYPE_HAS_COMPLEX_INIT_REF (NODE))/* Nonzero for class type means that assignment of this type can use a bitwise copy. */#define TYPE_HAS_TRIVIAL_ASSIGN_REF(NODE) \ (TYPE_HAS_ASSIGN_REF (NODE) && ! TYPE_HAS_COMPLEX_ASSIGN_REF (NODE))#define TYPE_PTRMEM_P(NODE) \ (TREE_CODE (NODE) == POINTER_TYPE \ && TREE_CODE (TREE_TYPE (NODE)) == OFFSET_TYPE)#define TYPE_PTR_P(NODE) \ (TREE_CODE (NODE) == POINTER_TYPE \ && TREE_CODE (TREE_TYPE (NODE)) != OFFSET_TYPE)#define TYPE_PTROB_P(NODE) \ (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE \ && TREE_CODE (TREE_TYPE (NODE)) != VOID_TYPE)#define TYPE_PTROBV_P(NODE) \ (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE)#define TYPE_PTRFN_P(NODE) \ (TREE_CODE (NODE) == POINTER_TYPE \ && TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE)/* Nonzero for _TYPE node means that this type is a pointer to member function type. */#define TYPE_PTRMEMFUNC_P(NODE) (TREE_CODE(NODE) == RECORD_TYPE && TYPE_LANG_SPECIFIC(NODE)->type_flags.ptrmemfunc_flag)#define TYPE_PTRMEMFUNC_FLAG(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.ptrmemfunc_flag)/* Get the POINTER_TYPE to the METHOD_TYPE associated with this pointer to member function. TYPE_PTRMEMFUNC_P _must_ be true, before using this macro. */#define TYPE_PTRMEMFUNC_FN_TYPE(NODE) (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (NODE)))))))/* These are use to manipulate the the canonical RECORD_TYPE from the hashed POINTER_TYPE, and can only be used on the POINTER_TYPE. */#define TYPE_GET_PTRMEMFUNC_TYPE(NODE) ((tree)TYPE_LANG_SPECIFIC(NODE))#define TYPE_SET_PTRMEMFUNC_TYPE(NODE, VALUE) (TYPE_LANG_SPECIFIC(NODE) = ((struct lang_type *)(void*)(VALUE)))/* These are to get the delta2 and pfn fields from a TYPE_PTRMEMFUNC_P. */#define DELTA2_FROM_PTRMEMFUNC(NODE) (build_component_ref (build_component_ref ((NODE), pfn_or_delta2_identifier, NULL_TREE, 0), delta2_identifier, NULL_TREE, 0))#define PFN_FROM_PTRMEMFUNC(NODE) (build_component_ref (build_component_ref ((NODE), pfn_or_delta2_identifier, NULL_TREE, 0), pfn_identifier, NULL_TREE, 0))/* Nonzero for VAR_DECL and FUNCTION_DECL node means that `extern' was specified in its declaration. */#define DECL_THIS_EXTERN(NODE) (DECL_LANG_FLAG_2(NODE))/* Nonzero for VAR_DECL and FUNCTION_DECL node means that `static' was specified in its declaration. */#define DECL_THIS_STATIC(NODE) (DECL_LANG_FLAG_6(NODE))/* Nonzero for SAVE_EXPR if used to initialize a PARM_DECL. */#define PARM_DECL_EXPR(NODE) (TREE_LANG_FLAG_2(NODE))/* Nonzero in FUNCTION_DECL means it is really an operator. Just used to communicate formatting information to dbxout.c. */#define DECL_OPERATOR(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.operator_attr)#define ANON_UNION_P(NODE) (DECL_NAME (NODE) == 0)#define UNKNOWN_TYPE LANG_TYPE/* Define fields and accessors for nodes representing declared names. */#if 0/* C++: A derived class may be able to directly use the virtual function table of a base class. When it does so, it may still have a decl node used to access the virtual function table (so that variables of this type can initialize their virtual function table pointers by name). When such thievery is committed, know exactly which base class's virtual function table is the one being stolen. This effectively computes the transitive closure. */#define DECL_VPARENT(NODE) ((NODE)->decl.arguments)#endif#define TYPE_WAS_ANONYMOUS(NODE) (TYPE_LANG_SPECIFIC (NODE)->type_flags.was_anonymous)/* C++: all of these are overloaded! These apply only to TYPE_DECLs. */#define DECL_FRIENDLIST(NODE) (DECL_INITIAL (NODE))/* The DECL_ACCESS is used to record under which context special access rules apply. */#define DECL_ACCESS(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.access)/* C++: all of these are overloaded! These apply to PARM_DECLs and VAR_DECLs. */#define DECL_REFERENCE_SLOT(NODE) ((tree)(NODE)->decl.arguments)#define SET_DECL_REFERENCE_SLOT(NODE,VAL) ((NODE)->decl.arguments=VAL)/* Accessor macros for C++ template decl nodes. */#define DECL_TEMPLATE_PARMS(NODE) DECL_ARGUMENTS(NODE)#define DECL_INNERMOST_TEMPLATE_PARMS(NODE) \ INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (NODE))#define DECL_NTPARMS(NODE) \ TREE_VEC_LENGTH (DECL_INNERMOST_TEMPLATE_PARMS (NODE))/* For class templates. */#define DECL_TEMPLATE_SPECIALIZATIONS(NODE) DECL_SIZE(NODE)/* For function, method, class-data templates. */#define DECL_TEMPLATE_RESULT(NODE) DECL_RESULT(NODE)#define DECL_TEMPLATE_INSTANTIATIONS(NODE) DECL_VINDEX(NODE)#define DECL_TEMPLATE_INJECT(NODE) DECL_INITIAL(NODE)#define DECL_FUNCTION_TEMPLATE_P(NODE) \ (TREE_CODE (NODE) == TEMPLATE_DECL \ && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == FUNCTION_DECL)#define PRIMARY_TEMPLATE_P(NODE) \ (TREE_TYPE (DECL_INNERMOST_TEMPLATE_PARMS (NODE)) == (NODE))#define CLASSTYPE_TEMPLATE_LEVEL(NODE) \ (TREE_INT_CST_HIGH (TREE_PURPOSE (CLASSTYPE_TI_TEMPLATE (NODE))))/* Indicates whether or not (and how) a template was expanded for this FUNCTION_DECL or VAR_DECL. 0=normal declaration, e.g. int min (int, int); 1=implicit template instantiation 2=explicit template specialization, e.g. int min<int> (int, int); 3=explicit template instantiation, e.g. template int min<int> (int, int); */#define DECL_USE_TEMPLATE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.use_template)#define DECL_TEMPLATE_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) & 1)#define CLASSTYPE_TEMPLATE_INSTANTIATION(NODE) \ (CLASSTYPE_USE_TEMPLATE (NODE) & 1)#define DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) == 2)#define SET_DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) = 2)#define CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \ (CLASSTYPE_USE_TEMPLATE (NODE) == 2)#define SET_CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \ (CLASSTYPE_USE_TEMPLATE (NODE) = 2)#define DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 1)#define SET_DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) = 1)#define CLASSTYPE_IMPLICIT_INSTANTIATION(NODE) \ (CLASSTYPE_USE_TEMPLATE(NODE) == 1)#define SET_CLASSTYPE_IMPLICIT_INSTANTIATION(NODE) \ (CLASSTYPE_USE_TEMPLATE(NODE) = 1)#define DECL_EXPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 3)#define SET_DECL_EXPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) = 3)#define CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \ (CLASSTYPE_USE_TEMPLATE(NODE) == 3)#define SET_CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \ (CLASSTYPE_USE_TEMPLATE(NODE) = 3)/* This function may be a guiding decl for a template. */#define DECL_MAYBE_TEMPLATE(NODE) DECL_LANG_FLAG_4 (NODE)/* We know what we're doing with this decl now. */#define DECL_INTERFACE_KNOWN(NODE) DECL_LANG_FLAG_5 (NODE)/* This function was declared inline. This flag controls the linkage semantics of 'inline'; whether or not the function is inlined is controlled by DECL_INLINE. */#define DECL_THIS_INLINE(NODE) \ (DECL_LANG_SPECIFIC (NODE)->decl_flags.declared_inline)/* DECL_EXTERNAL must be set on a decl until the decl is actually emitted, so that assemble_external will work properly. So we have this flag to tell us whether the decl is really not external. */#define DECL_NOT_REALLY_EXTERN(NODE) \ (DECL_LANG_SPECIFIC (NODE)->decl_flags.not_really_extern)#define DECL_REALLY_EXTERN(NODE) \ (DECL_EXTERNAL (NODE) && ! DECL_NOT_REALLY_EXTERN (NODE))#define THUNK_DELTA(DECL) ((DECL)->decl.frame_size.i)/* ...and for unexpanded-parameterized-type nodes. */#define UPT_TEMPLATE(NODE) TREE_PURPOSE(TYPE_VALUES(NODE))#define UPT_PARMS(NODE) TREE_VALUE(TYPE_VALUES(NODE))/* An un-parsed default argument looks like an identifier. */#define DEFARG_LENGTH(NODE) IDENTIFIER_LENGTH(NODE)#define DEFARG_POINTER(NODE) IDENTIFIER_POINTER(NODE)#define builtin_function(NAME, TYPE, CODE, LIBNAME) \ define_function (NAME, TYPE, CODE, (void (*) PROTO((tree)))pushdecl, LIBNAME)/* An enumeration of the kind of tags that C++ accepts. */enum tag_types { record_type, class_type, union_type, enum_type, signature_type };/* Zero means prototype weakly, as in ANSI C (no args means nothing). Each language context defines how this variable should be set. */extern int strict_prototype;extern int strict_prototypes_lang_c, strict_prototypes_lang_cplusplus;/* Non-zero means that if a label exists, and no other identifier applies, use the value of the label. */extern int flag_labels_ok;/* Non-zero means to collect statistics which might be expensive and to print them when we are done. */extern int flag_detailed_statistics;/* Non-zero means warn in function declared in derived class has the same name as a virtual in the base class, but fails to match the type signature of any virtual function in the base class. */extern int warn_overloaded_virtual;/* in c-common.c */extern void declare_function_name PROTO((void));extern void decl_attributes PROTO((tree, tree, tree));extern void init_function_format_info PROTO((void));extern void record_function_format PROTO((tree, tree, int, int, int));extern void check_function_format PROTO((tree, tree, tree));/* Print an error message for invalid operands to arith operation CODE. NOP_EXPR is used as a special case (see truthvalue_conversion). */extern void binary_op_error PROTO((enum tree_code));extern tree cp_build_type_variant PROTO((tree, int, int));extern void c_expand_expr_stmt PROTO((tree));/* Validate the expression after `case' and apply default promotions. */extern tree check_case_value PROTO((tree));/* Concatenate a list of STRING_CST nodes into one STRING_CST. */extern tree combine_strings PROTO((tree));extern void constant_expression_warning PROTO((tree));extern tree convert_and_check PROTO((tree, tree));extern void overflow_warning PROTO((tree));extern void unsigned_conversion_warning PROTO((tree, tree));/* Read the rest of the current #-directive line. */extern char *get_directive_line PROTO((FILE *));/* Subroutine of build_binary_op, used for comparison operations. See if the operands have both been converted from subword integer types and, if so, perhaps change them both back to their original type. */extern tree shorten_compare PROTO((tree *, tree *, tree *, enum tree_code *));/* Prepare expr to be an argument of a TRUTH_NOT_EXPR, or validate its data type for an `if' or `while' statement or ?..: exp. */extern tree truthvalue_conversion PROTO((tree));extern tree type_for_mode PROTO((enum machine_mode, int));extern tree type_for_size PROTO((unsigned, int));/* in decl{2}.c */extern tree void_list_node;extern tree void_zero_node;extern tree default_function_type;extern tree vtable_entry_type;extern tree sigtable_entry_type;extern tree __t_desc_type_node;#if 0extern tree __tp_desc_type_node;#endifextern tree __access_mode_type_node;extern tree __bltn_desc_type_node, __user_desc_type_node;extern tree __class_desc_type_node, __attr_desc_type_node;extern tree __ptr_desc_type_node, __func_desc_type_node;extern tree __ptmf_desc_type_node, __ptmd_desc_type_node;extern tree type_info_type_node;extern tree class_star_type_node;extern tree this_identifier;extern tree ctor_identifier, dtor_identifier;exte
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?