📄 cp-tree.h
字号:
#define VF_BINFO_VALUE(NODE) TREE_PURPOSE (NODE)/* Get that same information as a _TYPE. */#define VF_BASETYPE_VALUE(NODE) TREE_VALUE (NODE)/* Get the value of the top-most type dominating the non-`normal' vfields. */#define VF_DERIVED_VALUE(NODE) (VF_BINFO_VALUE (NODE) ? BINFO_TYPE (VF_BINFO_VALUE (NODE)) : NULL_TREE)/* Get the value of the top-most type that's `normal' for the vfield. */#define VF_NORMAL_VALUE(NODE) TREE_TYPE (NODE)/* Nonzero for TREE_LIST node means that this list of things is a list of parameters, as opposed to a list of expressions. */#define TREE_PARMLIST(NODE) ((NODE)->common.unsigned_flag) /* overloaded! *//* For FUNCTION_TYPE or METHOD_TYPE, a list of the exceptions that this type can raise. */#define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_NONCOPIED_PARTS (NODE)/* The binding level associated with the namespace. */#define NAMESPACE_LEVEL(NODE) ((NODE)->decl.arguments)struct lang_decl_flags{#ifdef ONLY_INT_FIELDS int language : 8;#else enum languages language : 8;#endif unsigned operator_attr : 1; unsigned constructor_attr : 1; unsigned returns_first_arg : 1; unsigned preserves_first_arg : 1; unsigned friend_attr : 1; unsigned static_function : 1; unsigned const_memfunc : 1; unsigned volatile_memfunc : 1; unsigned abstract_virtual : 1; unsigned permanent_attr : 1 ; unsigned constructor_for_vbase_attr : 1; unsigned mutable_flag : 1; unsigned is_default_implementation : 1; unsigned saved_inline : 1; unsigned use_template : 2; unsigned c_static : 1; unsigned nonconverting : 1; unsigned declared_inline : 1; unsigned not_really_extern : 1; unsigned dummy : 4; tree access; tree context; tree memfunc_pointer_to;};struct lang_decl{ struct lang_decl_flags decl_flags; struct template_info *template_info; tree main_decl_variant; struct pending_inline *pending_inline_info; tree next_method; tree chain;};/* Non-zero if NODE is a _DECL with TREE_READONLY set. */#define TREE_READONLY_DECL_P(NODE) \ (TREE_READONLY (NODE) && TREE_CODE_CLASS (TREE_CODE (NODE)) == 'd')/* For FUNCTION_DECLs: return the language in which this decl was declared. */#define DECL_LANGUAGE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.language)/* For FUNCTION_DECLs: nonzero means that this function is a constructor. */#define DECL_CONSTRUCTOR_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_attr)/* For FUNCTION_DECLs: nonzero means that this function is a constructor for an object with virtual baseclasses. */#define DECL_CONSTRUCTOR_FOR_VBASE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_for_vbase_attr)/* For FUNCTION_DECLs: nonzero means that this function is a default implementation of a signature method. */#define IS_DEFAULT_IMPLEMENTATION(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.is_default_implementation)/* For FUNCTION_DECLs: nonzero means that the constructor is known to return a non-zero `this' unchanged. */#define DECL_RETURNS_FIRST_ARG(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.returns_first_arg)/* Nonzero for FUNCTION_DECL means that this constructor is known to not make any assignment to `this', and therefore can be trusted to return it unchanged. Otherwise, we must re-assign `current_class_decl' after performing base initializations. */#define DECL_PRESERVES_THIS(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.preserves_first_arg)/* Nonzero for _DECL means that this decl appears in (or will appear in) as a member in a RECORD_TYPE or UNION_TYPE node. It is also for detecting circularity in case members are multiply defined. In the case of a VAR_DECL, it is also used to determine how program storage should be allocated. */#define DECL_IN_AGGR_P(NODE) (DECL_LANG_FLAG_3(NODE))/* Nonzero for FUNCTION_DECL means that this decl is just a friend declaration, and should not be added to the list of member functions for this class. */#define DECL_FRIEND_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.friend_attr)/* Nonzero for FUNCTION_DECL means that this decl is a static member function. */#define DECL_STATIC_FUNCTION_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.static_function)/* Nonzero for a class member means that it is shared between all objects of that class. */#define SHARED_MEMBER_P(NODE) \ (TREE_CODE (NODE) == VAR_DECL || TREE_CODE (NODE) == TYPE_DECL \ || TREE_CODE (NODE) == CONST_DECL) /* Nonzero for FUNCTION_DECL means that this decl is a member function (static or non-static). */#define DECL_FUNCTION_MEMBER_P(NODE) \ (TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE || DECL_STATIC_FUNCTION_P (NODE))/* Nonzero for FUNCTION_DECL means that this member function has `this' as const X *const. */#define DECL_CONST_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.const_memfunc)/* Nonzero for FUNCTION_DECL means that this member function has `this' as volatile X *const. */#define DECL_VOLATILE_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.volatile_memfunc)/* Nonzero for _DECL means that this member object type is mutable. */#define DECL_MUTABLE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag)/* Nonzero for _DECL means that this constructor is a non-converting constructor. */#define DECL_NONCONVERTING_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.nonconverting)/* Nonzero for FUNCTION_DECL means that this member function exists as part of an abstract class's interface. */#define DECL_ABSTRACT_VIRTUAL_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.abstract_virtual)/* Nonzero if allocated on permanent_obstack. */#define LANG_DECL_PERMANENT(LANGDECL) ((LANGDECL)->decl_flags.permanent_attr)/* The _TYPE context in which this _DECL appears. This field holds the class where a virtual function instance is actually defined, and the lexical scope of a friend function defined in a class body. */#define DECL_CLASS_CONTEXT(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.context)#define DECL_REAL_CONTEXT(NODE) \ ((TREE_CODE (NODE) == FUNCTION_DECL && DECL_FUNCTION_MEMBER_P (NODE)) \ ? DECL_CLASS_CONTEXT (NODE) : DECL_CONTEXT (NODE))/* For a FUNCTION_DECL: the chain through which the next method in the method chain is found. We now use TREE_CHAIN to link into the FIELD_DECL chain. */#if 1#define DECL_CHAIN(NODE) (DECL_LANG_SPECIFIC(NODE)->chain)#else#define DECL_CHAIN(NODE) (TREE_CHAIN (NODE))#endif/* Next method in CLASSTYPE_METHODS list. */#define DECL_NEXT_METHOD(NODE) (DECL_LANG_SPECIFIC(NODE)->next_method)/* In a VAR_DECL for a variable declared in a for statement, this is the shadowed variable. */#define DECL_SHADOWED_FOR_VAR(NODE) DECL_RESULT(NODE)/* Points back to the decl which caused this lang_decl to be allocated. */#define DECL_MAIN_VARIANT(NODE) (DECL_LANG_SPECIFIC(NODE)->main_decl_variant)/* For a FUNCTION_DECL: if this function was declared inline inside of a class declaration, this is where the text for the function is squirreled away. */#define DECL_PENDING_INLINE_INFO(NODE) (DECL_LANG_SPECIFIC(NODE)->pending_inline_info)/* True if on the saved_inlines (see decl2.c) list. */#define DECL_SAVED_INLINE(DECL) \ (DECL_LANG_SPECIFIC(DECL)->decl_flags.saved_inline)/* For a FUNCTION_DECL: if this function was declared inside a signature declaration, this is the corresponding member function pointer that was created for it. */#define DECL_MEMFUNC_POINTER_TO(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.memfunc_pointer_to)/* For a FIELD_DECL: this points to the signature member function from which this signature member function pointer was created. */#define DECL_MEMFUNC_POINTING_TO(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.memfunc_pointer_to)/* For a TEMPLATE_DECL: template-specific information. */#define DECL_TEMPLATE_INFO(NODE) (DECL_LANG_SPECIFIC(NODE)->template_info)/* Nonzero in INT_CST means that this int is negative by dint of using a twos-complement negated operand. */#define TREE_NEGATED_INT(NODE) (TREE_LANG_FLAG_0 (NODE))/* Nonzero in any kind of _EXPR or _REF node means that it is a call to a storage allocation routine. If, later, alternate storage is found to hold the object, this call can be ignored. */#define TREE_CALLS_NEW(NODE) (TREE_LANG_FLAG_1 (NODE))/* Nonzero in any kind of _TYPE that uses multiple inheritance or virtual baseclasses. */#define TYPE_USES_COMPLEX_INHERITANCE(NODE) (TREE_LANG_FLAG_1 (NODE))/* Nonzero in IDENTIFIER_NODE means that this name is not the name the user gave; it's a DECL_NESTED_TYPENAME. Someone may want to set this on mangled function names, too, but it isn't currently. */#define TREE_MANGLED(NODE) (TREE_LANG_FLAG_0 (NODE))#if 0 /* UNUSED *//* Nonzero in IDENTIFIER_NODE means that this name is overloaded, and should be looked up in a non-standard way. */#define DECL_OVERLOADED(NODE) (DECL_LANG_FLAG_4 (NODE))#endif/* Nonzero if this (non-TYPE)_DECL has its virtual attribute set. For a FUNCTION_DECL, this is when the function is a virtual function. For a VAR_DECL, this is when the variable is a virtual function table. For a FIELD_DECL, when the field is the field for the virtual function table. For an IDENTIFIER_NODE, nonzero if any function with this name has been declared virtual. For a _TYPE if it uses virtual functions (or is derived from one that does). */#define TYPE_VIRTUAL_P(NODE) (TREE_LANG_FLAG_2 (NODE))#if 0/* Same, but tells if this field is private in current context. */#define DECL_PRIVATE(NODE) (FOO)/* Same, but tells if this field is private in current context. */#define DECL_PROTECTED(NODE) (DECL_LANG_FLAG_6 (NODE))#define DECL_PUBLIC(NODE) (DECL_LANG_FLAG_7 (NODE))#endifextern int flag_new_for_scope;/* This flag is true of a local VAR_DECL if it was declared in a for statement, but we are no longer in the scope of the for. */#define DECL_DEAD_FOR_LOCAL(NODE) DECL_LANG_FLAG_7 (NODE)/* This flag is set on a VAR_DECL that is a DECL_DEAD_FOR_LOCAL if we already emitted a warning about using it. */#define DECL_ERROR_REPORTED(NODE) DECL_LANG_FLAG_0 (NODE)/* This _DECL represents a compiler-generated entity. */#define SET_DECL_ARTIFICIAL(NODE) (DECL_ARTIFICIAL (NODE) = 1)/* Record whether a typedef for type `int' was actually `signed int'. */#define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp))/* Nonzero if the type T promotes to itself. ANSI C states explicitly the list of types that promote; in particular, short promotes to int even if they have the same width. */#define C_PROMOTING_INTEGER_TYPE_P(t) \ (TREE_CODE ((t)) == INTEGER_TYPE \ && (TYPE_MAIN_VARIANT (t) == char_type_node \ || TYPE_MAIN_VARIANT (t) == signed_char_type_node \ || TYPE_MAIN_VARIANT (t) == unsigned_char_type_node \ || TYPE_MAIN_VARIANT (t) == short_integer_type_node \ || TYPE_MAIN_VARIANT (t) == short_unsigned_type_node))#define INTEGRAL_CODE_P(CODE) \ (CODE == INTEGER_TYPE || CODE == ENUMERAL_TYPE || CODE == BOOLEAN_TYPE)#define ARITHMETIC_TYPE_P(TYPE) (INTEGRAL_TYPE_P (TYPE) || FLOAT_TYPE_P (TYPE))/* Mark which labels are explicitly declared. These may be shadowed, and may be referenced from nested functions. */#define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label)/* Record whether a type or decl was written with nonconstant size. Note that TYPE_SIZE may have simplified to a constant. */#define C_TYPE_VARIABLE_SIZE(type) TREE_LANG_FLAG_4 (type)#define C_DECL_VARIABLE_SIZE(type) DECL_LANG_FLAG_8 (type)/* Nonzero for _TYPE means that the _TYPE defines at least one constructor. */#define TYPE_HAS_CONSTRUCTOR(NODE) (TYPE_LANG_FLAG_1(NODE))/* When appearing in an INDIRECT_REF, it means that the tree structure underneath is actually a call to a constructor. This is needed when the constructor must initialize local storage (which can be automatically destroyed), rather than allowing it to allocate 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)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -