#include "function.h"
#include "hashtab.h"
#include "splay-tree.h"
+#include "vec.h"
#include "varray.h"
-
#include "c-common.h"
#include "name-lookup.h"
-
struct diagnostic_context;
/* Usage of TREE_LANG_FLAG_?:
- 0: BINFO_MARKED (BINFO nodes).
- IDENTIFIER_MARKED (IDENTIFIER_NODEs)
+ 0: IDENTIFIER_MARKED (IDENTIFIER_NODEs)
NEW_EXPR_USE_GLOBAL (in NEW_EXPR).
DELETE_EXPR_USE_GLOBAL (in DELETE_EXPR).
COMPOUND_EXPR_OVERLOADED (in COMPOUND_EXPR).
CLEANUP_P (in TRY_BLOCK)
AGGR_INIT_VIA_CTOR_P (in AGGR_INIT_EXPR)
PTRMEM_OK_P (in ADDR_EXPR, OFFSET_REF)
- PARMLIST_ELLIPSIS_P (in PARMLIST)
DECL_PRETTY_FUNCTION_P (in VAR_DECL)
KOENIG_LOOKUP_P (in CALL_EXPR)
STATEMENT_LIST_NO_SCOPE (in STATEMENT_LIST).
(TREE_CALLS_NEW) (in _EXPR or _REF) (commented-out).
TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (in _TYPE).
ICS_ELLIPSIS_FLAG (in _CONV)
- BINFO_DEPENDENT_BASE_P (in BINFO)
DECL_INITIALIZED_P (in VAR_DECL)
2: IDENTIFIER_OPNAME_P.
TYPE_POLYMORPHIC_P (in _TYPE)
ICS_THIS_FLAG (in _CONV)
- BINFO_LOST_PRIMARY_P (in BINFO)
- TREE_PARMLIST (in TREE_LIST)
DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (in VAR_DECL)
STATEMENT_LIST_TRY_BLOCK (in STATEMENT_LIST)
3: TYPE_USES_VIRTUAL_BASECLASSES (in a class TYPE).
- BINFO_VTABLE_PATH_MARKED.
- BINFO_PUSHDECLS_MARKED.
(TREE_REFERENCE_EXPR) (in NON_LVALUE_EXPR) (commented-out).
ICS_BAD_FLAG (in _CONV)
FN_TRY_BLOCK_P (in TRY_BLOCK)
IDENTIFIER_CTOR_OR_DTOR_P (in IDENTIFIER_NODE)
BIND_EXPR_BODY_BLOCK (in BIND_EXPR)
- 4: BINFO_NEW_VTABLE_MARKED.
- TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR,
+ 4: TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR,
or FIELD_DECL).
IDENTIFIER_TYPENAME_P (in IDENTIFIER_NODE)
5: C_IS_RESERVED_WORD (in IDENTIFIER_NODE)
Usage of language-independent fields in a language-dependent manner:
- TREE_USED
- This field is BINFO_INDIRECT_PRIMARY_P in a BINFO.
-
TYPE_ALIAS_SET
This field is used by TYPENAME_TYPEs, TEMPLATE_TYPE_PARMs, and so
forth as a substitute for the mark bits provided in `lang_type'.
At present, only the six low-order bits are used.
- TYPE_BINFO
+ TYPE_LANG_SLOT_1
For an ENUMERAL_TYPE, this is ENUM_TEMPLATE_INFO.
For a FUNCTION_TYPE or METHOD_TYPE, this is TYPE_RAISES_EXCEPTIONS
/* Language-specific tree checkers. */
-#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
+#define VAR_OR_FUNCTION_DECL_CHECK(NODE) \
+ TREE_CHECK2(NODE,VAR_DECL,FUNCTION_DECL)
-#define VAR_OR_FUNCTION_DECL_CHECK(NODE) __extension__ \
-({ const tree __t = (NODE); \
- enum tree_code const __c = TREE_CODE(__t); \
- if (__c != VAR_DECL && __c != FUNCTION_DECL) \
- tree_check_failed (__t, VAR_DECL, __FILE__, __LINE__, \
- __FUNCTION__); \
- __t; })
-
-#define VAR_FUNCTION_OR_PARM_DECL_CHECK(NODE) __extension__ \
-({ const tree __t = (NODE); \
- enum tree_code const __c = TREE_CODE(__t); \
- if (__c != VAR_DECL \
- && __c != FUNCTION_DECL \
- && __c != PARM_DECL) \
- tree_check_failed (__t, VAR_DECL, __FILE__, __LINE__, \
- __FUNCTION__); \
- __t; })
-
-#define VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK(NODE) __extension__ \
-({ const tree __t = (NODE); \
- enum tree_code const __c = TREE_CODE(__t); \
- if (__c != VAR_DECL \
- && __c != FUNCTION_DECL \
- && __c != TYPE_DECL \
- && __c != TEMPLATE_DECL) \
- tree_check_failed (__t, VAR_DECL, __FILE__, __LINE__, \
- __FUNCTION__); \
- __t; })
-
-#define RECORD_OR_UNION_TYPE_CHECK(NODE) __extension__ \
-({ const tree __t = (NODE); \
- enum tree_code const __c = TREE_CODE(__t); \
- if (__c != RECORD_TYPE && __c != UNION_TYPE) \
- tree_check_failed (__t, RECORD_TYPE, __FILE__, __LINE__, \
- __FUNCTION__); \
- __t; })
-
-#define BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK(NODE) __extension__ \
-({ const tree __t = (NODE); \
- enum tree_code const __c = TREE_CODE(__t); \
- if (__c != BOUND_TEMPLATE_TEMPLATE_PARM) \
- tree_check_failed (__t, BOUND_TEMPLATE_TEMPLATE_PARM, \
- __FILE__, __LINE__, __FUNCTION__); \
- __t; })
-
-#else /* not ENABLE_TREE_CHECKING, or not gcc */
-
-#define VAR_OR_FUNCTION_DECL_CHECK(NODE) (NODE)
-#define VAR_FUNCTION_OR_PARM_DECL_CHECK(NODE) (NODE)
-#define VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK(NODE) (NODE)
-#define RECORD_OR_UNION_TYPE_CHECK(NODE) (NODE)
-#define BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK(NODE) (NODE)
+#define VAR_FUNCTION_OR_PARM_DECL_CHECK(NODE) \
+ TREE_CHECK3(NODE,VAR_DECL,FUNCTION_DECL,PARM_DECL)
-#endif
+#define VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK(NODE) \
+ TREE_CHECK4(NODE,VAR_DECL,FUNCTION_DECL,TYPE_DECL,TEMPLATE_DECL)
+
+#define BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK(NODE) \
+ TREE_CHECK(NODE,BOUND_TEMPLATE_TEMPLATE_PARM)
\f
/* Language-dependent contents of an identifier. */
struct c_common_identifier c_common;
cxx_binding *namespace_bindings;
cxx_binding *bindings;
- tree class_value;
tree class_template_info;
tree label_value;
};
#define IDENTIFIER_BINDING(NODE) \
(LANG_IDENTIFIER_CAST (NODE)->bindings)
-/* The IDENTIFIER_VALUE is the value of the IDENTIFIER_BINDING, or
- NULL_TREE if there is no binding. */
-#define IDENTIFIER_VALUE(NODE) \
- (IDENTIFIER_BINDING (NODE) ? IDENTIFIER_BINDING (NODE)->value : NULL)
-
-/* If IDENTIFIER_CLASS_VALUE is set, then NODE is bound in the current
- class, and IDENTIFIER_CLASS_VALUE is the value binding. This is
- just a pointer to the VALUE field of one of the bindings in the
- IDENTIFIER_BINDINGs list, so any time that this is non-NULL so is
- IDENTIFIER_BINDING. */
-#define IDENTIFIER_CLASS_VALUE(NODE) \
- (LANG_IDENTIFIER_CAST (NODE)->class_value)
-
/* TREE_TYPE only indicates on local and class scope the current
type. For namespace scope, the presence of a type in any namespace
is indicated with global_type_node, and the real type behind must
#define C_TYPE_FIELDS_READONLY(TYPE) \
(LANG_TYPE_CLASS_CHECK (TYPE)->fields_readonly)
-/* Store a value in that field. */
-#define C_SET_EXP_ORIGINAL_CODE(EXP, CODE) \
- (TREE_COMPLEXITY (EXP) = (int)(CODE))
-
/* The tokens stored in the default argument. */
#define DEFARG_TOKENS(NODE) \
struct saved_scope GTY(())
{
- cxx_saved_binding *old_bindings;
+ VEC(cxx_saved_binding) *old_bindings;
tree old_namespace;
tree decl_ns_list;
tree class_name;
varray_type lang_base;
tree lang_name;
tree template_parms;
- tree x_previous_class_type;
- tree x_previous_class_values;
+ struct cp_binding_level *x_previous_class_level;
tree x_saved_tree;
HOST_WIDE_INT x_processing_template_decl;
#define processing_specialization scope_chain->x_processing_specialization
#define processing_explicit_instantiation scope_chain->x_processing_explicit_instantiation
-/* _TYPE: the previous type that was a class */
-
-#define previous_class_type scope_chain->x_previous_class_type
-
-/* This is a copy of the class_shadowed list of the previous class
- binding contour when at global scope. It's used to reset
- IDENTIFIER_CLASS_VALUEs when entering another class scope (i.e. a
- cache miss). */
+/* The cached class binding level, from the most recently exited
+ class, or NULL if none. */
-#define previous_class_values scope_chain->x_previous_class_values
+#define previous_class_level scope_chain->x_previous_class_level
/* A list of private types mentioned, for deferred access checking. */
unsigned ptrmemfunc_flag : 1;
unsigned was_anonymous : 1;
- unsigned has_real_assign_ref : 1;
+ unsigned lazy_default_ctor : 1;
+ unsigned lazy_copy_ctor : 1;
unsigned has_const_init_ref : 1;
unsigned has_complex_init_ref : 1;
unsigned has_complex_assign_ref : 1;
- unsigned has_abstract_assign_ref : 1;
unsigned non_aggregate : 1;
unsigned java_interface : 1;
tree vcall_indices;
tree vtables;
tree typeinfo_var;
- tree vbases;
+ VEC (tree) *vbases;
binding_table nested_udts;
tree as_base;
tree pure_virtuals;
tree friend_classes;
- tree GTY ((reorder ("resort_type_method_vec"))) methods;
+ VEC (tree) * GTY((reorder ("resort_type_method_vec"))) methods;
tree key_method;
tree decl_list;
tree template_info;
{
union lang_type_u
{
- struct lang_type_header GTY((tag ("2"))) h;
+ struct lang_type_header GTY((skip (""))) h;
struct lang_type_class GTY((tag ("1"))) c;
struct lang_type_ptrmem GTY((tag ("0"))) ptrmem;
} GTY((desc ("%h.h.is_lang_type_class"))) u;
#define TYPE_HAS_CONVERSION(NODE) \
(LANG_TYPE_CLASS_CHECK (NODE)->h.has_type_conversion)
+/* Nonzero means that NODE (a class type) has a default constructor --
+ but that it has not yet been declared. */
+#define CLASSTYPE_LAZY_DEFAULT_CTOR(NODE) \
+ (LANG_TYPE_CLASS_CHECK (NODE)->lazy_default_ctor)
+
+/* Nonzero means that NODE (a class type) has a copy constructor --
+ but that it has not yet been declared. */
+#define CLASSTYPE_LAZY_COPY_CTOR(NODE) \
+ (LANG_TYPE_CLASS_CHECK (NODE)->lazy_copy_ctor)
+
/* Nonzero means that this _CLASSTYPE node overloads operator=(X&). */
#define TYPE_HAS_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_assign_ref)
+
+/* True iff the class type NODE has an "operator =" whose parameter
+ has a parameter of type "const X&". */
#define TYPE_HAS_CONST_ASSIGN_REF(NODE) \
(LANG_TYPE_CLASS_CHECK (NODE)->h.has_const_assign_ref)
/* A FUNCTION_DECL or OVERLOAD for the constructors for NODE. These
are the constructors that take an in-charge parameter. */
#define CLASSTYPE_CONSTRUCTORS(NODE) \
- (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_CONSTRUCTOR_SLOT))
+ (VEC_index (tree, CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_CONSTRUCTOR_SLOT))
/* A FUNCTION_DECL for the destructor for NODE. These are the
destructors that take an in-charge parameter. */
#define CLASSTYPE_DESTRUCTORS(NODE) \
- (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_DESTRUCTOR_SLOT))
+ (VEC_index (tree, CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_DESTRUCTOR_SLOT))
/* Mark bits for depth-first and breath-first searches. */
#define CLASSTYPE_PRIMARY_BINFO(NODE) \
(LANG_TYPE_CLASS_CHECK (NODE)->primary_base)
-/* A chain of BINFOs for the direct and indirect virtual base classes
+/* A vector of BINFOs for the direct and indirect virtual base classes
that this type uses in a post-order depth-first left-to-right
order. (In other words, these bases appear in the order that they
should be initialized.) */
#define CLASSTYPE_VBASECLASSES(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->vbases)
-/* Number of direct baseclasses of NODE. */
-#define CLASSTYPE_N_BASECLASSES(NODE) \
- (BINFO_N_BASETYPES (TYPE_BINFO (NODE)))
-
/* The type corresponding to NODE when NODE is used as a base class,
i.e., NODE without virtual base classes. */
tree.h, this pointer is described as pointing in other
direction. The binfos of virtual bases are shared. */
-/* Nonzero means marked by DFS or BFS search. */
-#define BINFO_MARKED(NODE) TREE_LANG_FLAG_0 (NODE)
-
/* Nonzero means that this class is on a path leading to a new vtable. */
-#define BINFO_VTABLE_PATH_MARKED(NODE) TREE_LANG_FLAG_3 (NODE)
+#define BINFO_VTABLE_PATH_MARKED(NODE) BINFO_FLAG_1 (NODE)
/* Nonzero means B (a BINFO) has its own vtable. Any copies will not
have this flag set. */
-#define BINFO_NEW_VTABLE_MARKED(B) (TREE_LANG_FLAG_4 (B))
+#define BINFO_NEW_VTABLE_MARKED(B) (BINFO_FLAG_2 (B))
/* Any subobject that needs a new vtable must have a vptr and must not
be a non-virtual primary base (since it would then use the vtable from a
#define SET_BINFO_NEW_VTABLE_MARKED(B) \
(BINFO_NEW_VTABLE_MARKED (B) = 1, \
my_friendly_assert (!BINFO_PRIMARY_P (B) \
- || TREE_VIA_VIRTUAL (B), 20000517), \
+ || BINFO_VIRTUAL_P (B), 20000517), \
my_friendly_assert (CLASSTYPE_VFIELDS (BINFO_TYPE (B)) != NULL_TREE, \
20000517))
-/* Nonzero means this class has done dfs_pushdecls. */
-#define BINFO_PUSHDECLS_MARKED(NODE) BINFO_VTABLE_PATH_MARKED (NODE)
-
-/* Nonzero if this BINFO is a primary base class. Note, this can be
- set for non-canonical virtual bases. For a virtual primary base
- you might also need to check whether it is canonical. */
+/* Nonzero if this BINFO is a primary base class. */
#define BINFO_PRIMARY_P(NODE) \
(BINFO_PRIMARY_BASE_OF (NODE) != NULL_TREE)
-/* The index in the VTT where this subobject's sub-VTT can be found.
- NULL_TREE if there is no sub-VTT. */
-#define BINFO_SUBVTT_INDEX(NODE) TREE_VEC_ELT (NODE, BINFO_ELTS + 0)
-
-/* The index in the VTT where the vptr for this subobject can be
- found. NULL_TREE if there is no secondary vptr in the VTT. */
-#define BINFO_VPTR_INDEX(NODE) TREE_VEC_ELT (NODE, BINFO_ELTS + 1)
-
-/* The binfo of which NODE is a primary base. (This is different from
- BINFO_INHERITANCE_CHAIN for virtual base because a virtual base is
- sometimes a primary base for a class for which it is not an
- immediate base.) */
-#define BINFO_PRIMARY_BASE_OF(NODE) TREE_VEC_ELT (NODE, BINFO_ELTS + 2)
-
-/* C++ binfos have 3 additional entries. */
-
-#define BINFO_LANG_ELTS (BINFO_ELTS + 3)
-
/* Nonzero if this binfo is for a dependent base - one that should not
be searched. */
-#define BINFO_DEPENDENT_BASE_P(NODE) TREE_LANG_FLAG_1 (NODE)
+#define BINFO_DEPENDENT_BASE_P(NODE) BINFO_FLAG_3 (NODE)
/* Nonzero if this binfo has lost its primary base binfo (because that
is a nearly-empty virtual base that has been taken by some other
base in the complete hierarchy. */
-#define BINFO_LOST_PRIMARY_P(NODE) TREE_LANG_FLAG_2 (NODE)
+#define BINFO_LOST_PRIMARY_P(NODE) BINFO_FLAG_4 (NODE)
/* Nonzero if this binfo is an indirect primary base, i.e. a virtual
base that is a primary base of some of other class in the
hierarchy. */
-#define BINFO_INDIRECT_PRIMARY_P(NODE) TREE_USED (NODE)
+#define BINFO_INDIRECT_PRIMARY_P(NODE) BINFO_FLAG_5 (NODE)
/* Used by various search routines. */
#define IDENTIFIER_MARKED(NODE) TREE_LANG_FLAG_0 (NODE)
#define BV_FN(NODE) (TREE_VALUE (NODE))
\f
-/* 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) (TREE_LANG_FLAG_2 (NODE))
-
-/* Nonzero for a parmlist means that this parmlist ended in ... */
-#define PARMLIST_ELLIPSIS_P(NODE) TREE_LANG_FLAG_0 (NODE)
-
/* For FUNCTION_TYPE or METHOD_TYPE, a list of the exceptions that
this type can raise. Each TREE_VALUE is a _TYPE. The TREE_VALUE
will be NULL_TREE to indicate a throw specification of `()', or
no exceptions allowed. */
-#define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_BINFO (NODE)
+#define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_LANG_SLOT_1 (NODE)
/* For FUNCTION_TYPE or METHOD_TYPE, return 1 iff it is declared `throw()'. */
#define TYPE_NOTHROW_P(NODE) \
unsigned this_thunk_p : 1;
union lang_decl_u {
- /* In a FUNCTION_DECL for which DECL_THUNK_P does not hold,
+ /* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is
+ THUNK_ALIAS.
+ In a FUNCTION_DECL for which DECL_THUNK_P does not hold,
VAR_DECL, TYPE_DECL, or TEMPLATE_DECL, this is
DECL_TEMPLATE_INFO. */
tree GTY ((tag ("0"))) template_info;
/* In a NAMESPACE_DECL, this is NAMESPACE_LEVEL. */
struct cp_binding_level * GTY ((tag ("1"))) level;
-
- /* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is
- THUNK_ALIAS. */
- tree GTY ((tag ("2"))) thunk_alias;
} GTY ((desc ("%1.u1sel"))) u;
union lang_decl_u2 {
- /* This is DECL_ACCESS. */
+ /* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is
+ THUNK_VIRTUAL_OFFSET.
+ Otherwise this is DECL_ACCESS. */
tree GTY ((tag ("0"))) access;
/* For VAR_DECL in function, this is DECL_DISCRIMINATOR. */
int GTY ((tag ("1"))) discriminator;
-
- /* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is
- THUNK_VIRTUAL_OFFSET. */
- tree GTY((tag ("2"))) virtual_offset;
} GTY ((desc ("%1.u2sel"))) u2;
};
/* Template information for a RECORD_TYPE or UNION_TYPE. */
#define CLASSTYPE_TEMPLATE_INFO(NODE) \
- (LANG_TYPE_CLASS_CHECK (RECORD_OR_UNION_TYPE_CHECK (NODE))->template_info)
+ (LANG_TYPE_CLASS_CHECK (RECORD_OR_UNION_CHECK (NODE))->template_info)
/* Template information for an ENUMERAL_TYPE. Although an enumeration may
not be a primary template, it may be declared within the scope of a
primary template and the enumeration constants may depend on
non-type template parameters. */
-#define ENUM_TEMPLATE_INFO(NODE) (TYPE_BINFO (ENUMERAL_TYPE_CHECK (NODE)))
+#define ENUM_TEMPLATE_INFO(NODE) \
+ (TYPE_LANG_SLOT_1 (ENUMERAL_TYPE_CHECK (NODE)))
/* Template information for a template template parameter. */
#define TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO(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) (LANG_TYPE_CLASS_CHECK (NODE)->has_real_assign_ref)
#define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_complex_assign_ref)
-#define TYPE_HAS_ABSTRACT_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_abstract_assign_ref)
#define TYPE_HAS_COMPLEX_INIT_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_complex_init_ref)
/* Nonzero if TYPE has a trivial destructor. From [class.dtor]:
binfos.) */
#define THUNK_VIRTUAL_OFFSET(DECL) \
- (LANG_DECL_U2_CHECK (FUNCTION_DECL_CHECK (DECL), 0)->virtual_offset)
+ (LANG_DECL_U2_CHECK (FUNCTION_DECL_CHECK (DECL), 0)->access)
/* A thunk which is equivalent to another thunk. */
#define THUNK_ALIAS(DECL) \
- (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->decl_flags.u.thunk_alias)
+ (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->decl_flags.u.template_info)
/* For thunk NODE, this is the FUNCTION_DECL thunked to. */
#define THUNK_TARGET(NODE) \
#define THEN_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 1)
#define ELSE_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 2)
-/* The parameters for a call-declarator. */
-#define CALL_DECLARATOR_PARMS(NODE) \
- (TREE_PURPOSE (TREE_OPERAND (NODE, 1)))
-
-/* The cv-qualifiers for a call-declarator. */
-#define CALL_DECLARATOR_QUALS(NODE) \
- (TREE_VALUE (TREE_OPERAND (NODE, 1)))
-
-/* The exception-specification for a call-declarator. */
-#define CALL_DECLARATOR_EXCEPTION_SPEC(NODE) \
- (TREE_TYPE (NODE))
-
/* An enumeration of the kind of tags that C++ accepts. */
enum tag_types {
none_type = 0, /* Not a tag type. */
binfo. */
} base_kind;
-/* Set by add_implicitly_declared_members() to keep those members from
- being flagged as deprecated or reported as using deprecated
- types. */
-extern int adding_implicit_members;
-
/* in decl{2}.c */
/* A node that is a list (length 1) of error_mark_nodes. */
extern GTY(()) tree error_mark_list;
function, two inside the body of a function in a local class, etc.) */
extern int function_depth;
-typedef struct deferred_access GTY(())
-{
- /* A TREE_LIST representing name-lookups for which we have deferred
- checking access controls. We cannot check the accessibility of
- names used in a decl-specifier-seq until we know what is being
- declared because code like:
-
- class A {
- class B {};
- B* f();
- }
-
- A::B* A::f() { return 0; }
-
- is valid, even though `A::B' is not generally accessible.
-
- The TREE_PURPOSE of each node is the scope used to qualify the
- name being looked up; the TREE_VALUE is the DECL to which the
- name was resolved. */
- tree deferred_access_checks;
- /* The current mode of access checks. */
- enum deferring_kind deferring_access_checks_kind;
- /* The next deferred access data in stack or linked-list. */
- struct deferred_access *next;
-} deferred_access;
-
/* in pt.c */
/* These values are used for the `STRICT' parameter to type_unification and
LOOKUP_PREFER_NAMESPACES means not to accept objects, and possibly types.
LOOKUP_PREFER_BOTH means class-or-namespace-name. */
-#define LOOKUP_PROTECT (1)
-#define LOOKUP_COMPLAIN (2)
-#define LOOKUP_NORMAL (3)
-#define LOOKUP_NONVIRTUAL (8)
-#define LOOKUP_GLOBAL (16)
-#define LOOKUP_ONLYCONVERTING (128)
-#define DIRECT_BIND (256)
-#define LOOKUP_NO_CONVERSION (512)
-#define LOOKUP_DESTRUCTOR (512)
-#define LOOKUP_NO_TEMP_BIND (1024)
-#define LOOKUP_PREFER_TYPES (2048)
-#define LOOKUP_PREFER_NAMESPACES (4096)
-#define LOOKUP_PREFER_BOTH (6144)
+#define LOOKUP_PROTECT (1 << 0)
+#define LOOKUP_COMPLAIN (1 << 1)
+#define LOOKUP_NORMAL (LOOKUP_PROTECT | LOOKUP_COMPLAIN)
+#define LOOKUP_NONVIRTUAL (1 << 2)
+#define LOOKUP_GLOBAL (1 << 3)
+#define LOOKUP_ONLYCONVERTING (1 << 4)
+#define DIRECT_BIND (1 << 5)
+#define LOOKUP_NO_CONVERSION (1 << 6)
+#define LOOKUP_DESTRUCTOR (1 << 7)
+#define LOOKUP_NO_TEMP_BIND (1 << 8)
+#define LOOKUP_PREFER_TYPES (1 << 9)
+#define LOOKUP_PREFER_NAMESPACES (1 << 10)
+#define LOOKUP_PREFER_BOTH (LOOKUP_PREFER_TYPES | LOOKUP_PREFER_NAMESPACES)
+#define LOOKUP_CONSTRUCTOR_CALLABLE (1 << 11)
#define LOOKUP_NAMESPACES_ONLY(F) \
(((F) & LOOKUP_PREFER_NAMESPACES) && !((F) & LOOKUP_PREFER_TYPES))
extern GTY(()) operator_name_info_t assignment_operator_name_info
[(int) LAST_CPLUS_TREE_CODE];
+/* A type-qualifier, or bitmask therefore, using the TYPE_QUAL
+ constants. */
+
+typedef int cp_cv_quals;
+
+/* A storage class. */
+
+typedef enum cp_storage_class {
+ /* sc_none must be zero so that zeroing a cp_decl_specifier_seq
+ sets the storage_class field to sc_none. */
+ sc_none = 0,
+ sc_auto,
+ sc_register,
+ sc_static,
+ sc_extern,
+ sc_mutable
+} cp_storage_class;
+
+/* An individual decl-specifier. */
+
+typedef enum cp_decl_spec {
+ ds_first,
+ ds_signed = ds_first,
+ ds_unsigned,
+ ds_short,
+ ds_long,
+ ds_const,
+ ds_volatile,
+ ds_restrict,
+ ds_inline,
+ ds_virtual,
+ ds_explicit,
+ ds_friend,
+ ds_typedef,
+ ds_complex,
+ ds_thread,
+ ds_last
+} cp_decl_spec;
+
+/* A decl-specifier-seq. */
+
+typedef struct cp_decl_specifier_seq {
+ /* The number of times each of the keywords has been seen. */
+ unsigned specs[(int) ds_last];
+ /* The primary type, if any, given by the decl-specifier-seq.
+ Modifiers, like "short", "const", and "unsigned" are not
+ reflected here. This field will be a TYPE, unless a typedef-name
+ was used, in which case it will be a TYPE_DECL. */
+ tree type;
+ /* The attributes, if any, provided with the specifier sequence. */
+ tree attributes;
+ /* If non-NULL, a built-in type that the user attempted to redefine
+ to some other type. */
+ tree redefined_builtin_type;
+ /* The storage class specified -- or sc_none if no storage class was
+ explicitly specified. */
+ cp_storage_class storage_class;
+ /* True iff TYPE_SPEC indicates a user-defined type. */
+ BOOL_BITFIELD user_defined_type_p : 1;
+ /* True iff multiple types were (erroneously) specified for this
+ decl-specifier-seq. */
+ BOOL_BITFIELD multiple_types_p : 1;
+ /* True iff multiple storage classes were (erroneously) specified
+ for this decl-specifier-seq. */
+ BOOL_BITFIELD multiple_storage_classes_p : 1;
+ /* True iff at least one decl-specifier was found. */
+ BOOL_BITFIELD any_specifiers_p : 1;
+ /* True iff "int" was explicitly provided. */
+ BOOL_BITFIELD explicit_int_p : 1;
+ /* True iff "char" was explicitly provided. */
+ BOOL_BITFIELD explicit_char_p : 1;
+} cp_decl_specifier_seq;
+
+/* The various kinds of declarators. */
+
+typedef enum cp_declarator_kind {
+ cdk_id,
+ cdk_function,
+ cdk_array,
+ cdk_pointer,
+ cdk_reference,
+ cdk_ptrmem,
+ cdk_error
+} cp_declarator_kind;
+
+/* A declarator. */
+
+typedef struct cp_declarator cp_declarator;
+
+typedef struct cp_parameter_declarator cp_parameter_declarator;
+
+/* A parameter, before it has been semantically analyzed. */
+struct cp_parameter_declarator {
+ /* The next parameter, or NULL_TREE if none. */
+ cp_parameter_declarator *next;
+ /* The decl-specifiers-seq for the parameter. */
+ cp_decl_specifier_seq decl_specifiers;
+ /* The declarator for the parameter. */
+ cp_declarator *declarator;
+ /* The default-argument expression, or NULL_TREE, if none. */
+ tree default_argument;
+ /* True iff this is the first parameter in the list and the
+ parameter sequence ends with an ellipsis. */
+ bool ellipsis_p;
+};
+
+/* A declarator. */
+struct cp_declarator {
+ /* The kind of declarator. */
+ cp_declarator_kind kind;
+ /* Attributes that apply to this declarator. */
+ tree attributes;
+ /* For all but cdk_id and cdk_error, the contained declarator. For
+ cdk_id and cdk_error, guaranteed to be NULL. */
+ cp_declarator *declarator;
+ union {
+ /* For identifiers. */
+ struct {
+ /* The name of the function -- an IDENTIFIER_NODE, BIT_NOT_EXPR,
+ TEMPLATE_ID_EXPR, or SCOPE_REF. */
+ tree name;
+ /* If this is the name of a function, what kind of special
+ function (if any). */
+ special_function_kind sfk;
+ } id;
+ /* For functions. */
+ struct {
+ /* The parameters to the function. */
+ cp_parameter_declarator *parameters;
+ /* The cv-qualifiers for the function. */
+ cp_cv_quals qualifiers;
+ /* The exception-specification for the function. */
+ tree exception_specification;
+ } function;
+ /* For arrays. */
+ struct {
+ /* The bounds to the array. */
+ tree bounds;
+ } array;
+ /* For cdk_pointer, cdk_reference, and cdk_ptrmem. */
+ struct {
+ /* The cv-qualifiers for the pointer. */
+ cp_cv_quals qualifiers;
+ /* For cdk_ptrmem, the class type containing the member. */
+ tree class_type;
+ } pointer;
+ } u;
+};
+
+/* An erroneous declarator. */
+extern cp_declarator *cp_error_declarator;
+
+/* A parameter list indicating for a function with no parameters,
+ e.g "int f(void)". */
+extern cp_parameter_declarator *no_parameters;
+
/* in call.c */
extern bool check_dtor_name (tree, tree);
extern tree perform_implicit_conversion (tree, tree);
extern tree perform_direct_initialization_if_possible (tree, tree);
extern tree in_charge_arg_for_name (tree);
-extern tree build_cxx_call (tree, tree, tree);
+extern tree build_cxx_call (tree, tree);
#ifdef ENABLE_CHECKING
extern void validate_conversion_obstack (void);
#endif /* ENABLE_CHECKING */
extern tree get_vtable_decl (tree, int);
extern void resort_type_method_vec
(void *, void *, gt_pointer_operator, void *);
-extern void add_method (tree, tree, int);
+extern void add_method (tree, tree);
extern int currently_open_class (tree);
extern tree currently_open_derived_class (tree);
extern tree finish_struct (tree, tree);
extern tree get_primary_binfo (tree);
extern void debug_class (tree);
extern void debug_thunks (tree);
+extern tree cp_fold_obj_type_ref (tree, tree);
/* in cvt.c */
extern tree convert_to_reference (tree, tree, int, int, tree);
extern void adjust_clone_args (tree);
/* decl.c */
+extern tree poplevel (int, int, int);
extern void insert_block (tree);
-extern void set_block (tree);
extern tree pushdecl (tree);
extern void cxx_init_decl_processing (void);
enum cp_tree_node_structure_enum cp_tree_node_structure
extern tree push_void_library_fn (tree, tree);
extern tree push_throw_library_fn (tree, tree);
extern int init_type_desc (void);
-extern tree check_tag_decl (tree);
-extern tree shadow_tag (tree);
-extern tree groktypename (tree);
-extern tree start_decl (tree, tree, int, tree, tree);
+extern tree check_tag_decl (cp_decl_specifier_seq *);
+extern tree shadow_tag (cp_decl_specifier_seq *);
+extern tree groktypename (cp_decl_specifier_seq *, const cp_declarator *);
+extern tree start_decl (const cp_declarator *, cp_decl_specifier_seq *, int, tree, tree);
extern void start_decl_1 (tree);
extern void cp_finish_decl (tree, tree, tree, int);
extern void finish_decl (tree, tree, tree);
-extern void maybe_inject_for_scope_var (tree);
-extern tree start_handler_parms (tree, tree);
extern int complete_array_type (tree, tree, int);
extern tree build_ptrmemfunc_type (tree);
extern tree build_ptrmem_type (tree, tree);
/* the grokdeclarator prototype is in decl.h */
extern int copy_fn_p (tree);
-extern tree get_scope_of_declarator (tree);
+extern tree get_scope_of_declarator (const cp_declarator *);
extern void grok_special_member_properties (tree);
extern int grok_ctor_properties (tree, tree);
extern bool grok_op_properties (tree, int, bool);
extern tree start_enum (tree);
extern void finish_enum (tree);
extern void build_enumerator (tree, tree, tree);
-extern int start_function (tree, tree, tree, int);
+extern void start_preparsed_function (tree, tree, int);
+extern int start_function (cp_decl_specifier_seq *, const cp_declarator *, tree);
extern tree begin_function_body (void);
extern void finish_function_body (tree);
extern tree finish_function (int);
-extern tree start_method (tree, tree, tree);
+extern tree start_method (cp_decl_specifier_seq *, const cp_declarator *, tree);
extern tree finish_method (tree);
extern void maybe_register_incomplete_var (tree);
extern void complete_vars (tree);
extern void register_dtor_fn (tree);
extern tmpl_spec_kind current_tmpl_spec_kind (int);
extern tree cp_fname_init (const char *, tree *);
+extern tree builtin_function (const char *, tree, int, enum built_in_class,
+ const char *, tree);
extern tree check_elaborated_type_specifier (enum tag_types, tree, bool);
extern void warn_extern_redeclared_static (tree, tree);
extern bool cp_missing_noreturn_ok_p (tree);
/* in decl2.c */
extern bool check_java_method (tree);
-extern int grok_method_quals (tree, tree, tree);
-extern void grok_x_components (tree);
+extern cp_cv_quals grok_method_quals (tree, tree, cp_cv_quals);
extern void maybe_retrofit_in_chrg (tree);
extern void maybe_make_one_only (tree);
-extern void grokclassfn (tree, tree, enum overload_flags, tree);
+extern void grokclassfn (tree, tree, enum overload_flags, cp_cv_quals);
extern tree grok_array_decl (tree, tree);
extern tree delete_sanity (tree, tree, bool, int);
extern tree check_classfn (tree, tree, tree);
extern void check_member_template (tree);
-extern tree grokfield (tree, tree, tree, tree, tree);
-extern tree grokbitfield (tree, tree, tree);
+extern tree grokfield (const cp_declarator *, cp_decl_specifier_seq *, tree, tree, tree);
+extern tree grokbitfield (const cp_declarator *, cp_decl_specifier_seq *, tree);
extern tree groktypefield (tree, tree);
extern void cplus_decl_attributes (tree *, tree, int);
extern void finish_anon_union (tree);
extern tree expand_start_catch_block (tree);
extern void expand_end_catch_block (void);
extern void expand_builtin_throw (void);
-extern void expand_eh_spec_block (tree);
extern void expand_exception_blocks (void);
extern tree build_exc_ptr (void);
extern tree build_throw (tree);
extern int is_friend (tree, tree);
extern void make_friend_class (tree, tree, bool);
extern void add_friend (tree, tree, bool);
-extern tree do_friend (tree, tree, tree, tree, enum overload_flags, tree, int);
+extern tree do_friend (tree, tree, tree, tree, enum overload_flags, cp_cv_quals, int);
/* in init.c */
extern tree expand_member_init (tree);
extern tree build_aggr_init (tree, tree, int);
extern tree build_init (tree, tree, int);
extern int is_aggr_type (tree, int);
-extern tree get_aggr_from_typedef (tree, int);
extern tree get_type_value (tree);
extern tree build_zero_init (tree, tree, bool);
extern tree build_offset_ref (tree, tree, bool);
-extern tree build_new (tree, tree, tree, int);
+extern tree build_new (tree, tree, tree, tree, int);
extern tree build_vec_init (tree, tree, tree, int);
extern tree build_x_delete (tree, int, tree);
extern tree build_delete (tree, tree, special_function_kind, int, int);
extern void initialize_vtbl_ptrs (tree);
extern tree build_java_class_ref (tree);
-/* in input.c */
-
/* in lex.c */
extern void cxx_dup_lang_specific_decl (tree);
-extern tree make_pointer_declarator (tree, tree);
-extern tree make_reference_declarator (tree, tree);
-extern tree make_call_declarator (tree, tree, tree, tree);
-extern void set_quals_and_spec (tree, tree, tree);
extern void print_parse_statistics (void);
extern void do_pending_inlines (void);
extern void yyungetc (int, int);
extern void use_thunk (tree, bool);
extern void synthesize_method (tree);
extern tree implicitly_declare_fn (special_function_kind, tree, bool);
+extern tree lazily_declare_fn (special_function_kind, tree);
extern tree skip_artificial_parms_for (tree, tree);
/* In optimize.c */
extern void begin_explicit_instantiation (void);
extern void end_explicit_instantiation (void);
extern tree check_explicit_specialization (tree, tree, int, int);
-extern tree process_template_parm (tree, tree);
+extern tree process_template_parm (tree, tree, bool);
extern tree end_template_parm_list (tree);
extern void end_template_decl (void);
extern tree current_template_args (void);
extern void get_pure_virtuals (tree);
extern void maybe_suppress_debug_info (tree);
extern void note_debug_info_needed (tree);
-extern void push_class_decls (tree);
-extern void pop_class_decls (void);
-extern void unuse_fields (tree);
extern void print_search_statistics (void);
-extern void init_search_processing (void);
extern void reinit_search_statistics (void);
extern tree current_scope (void);
extern int at_function_scope_p (void);
extern tree lookup_conversions (tree);
extern tree binfo_for_vtable (tree);
extern tree binfo_from_vbase (tree);
+extern tree binfo_for_vbase (tree, tree);
extern tree look_for_overrides_here (tree, tree);
extern int check_final_overrider (tree, tree);
extern tree dfs_walk (tree,
extern void perform_deferred_access_checks (void);
extern void perform_or_defer_access_check (tree, tree);
extern void init_cp_semantics (void);
+extern void add_decl_expr (tree);
extern tree finish_expr_stmt (tree);
extern tree begin_if_stmt (void);
extern void finish_if_stmt_cond (tree, tree);
extern tree finish_unary_op_expr (enum tree_code, tree);
extern tree finish_compound_literal (tree, tree);
extern tree finish_fname (tree);
-extern int begin_function_definition (tree, tree, tree);
extern void finish_translation_unit (void);
extern tree finish_template_type_parm (tree, tree);
extern tree finish_template_template_parm (tree, tree);
-extern tree finish_parmlist (tree, int);
extern tree begin_class_definition (tree);
extern void finish_default_args (void);
-extern tree finish_member_class_template (tree);
extern void finish_template_decl (tree);
extern tree finish_template_type (tree, tree, int);
extern tree finish_base_specifier (tree, tree, bool);
extern int pod_type_p (tree);
extern int zero_init_p (tree);
extern tree canonical_type_variant (tree);
-extern tree copy_base_binfos (tree, tree, tree);
+extern tree copy_binfo (tree, tree, tree,
+ tree *, int);
extern int member_p (tree);
extern cp_lvalue_kind real_lvalue_p (tree);
extern int lvalue_or_else (tree, const char *);
extern tree hash_tree_cons (tree, tree, tree);
extern tree hash_tree_chain (tree, tree);
extern tree hash_chainon (tree, tree);
-extern tree make_binfo (tree, tree, tree, tree);
extern int count_functions (tree);
extern int is_overloaded_fn (tree);
extern tree get_first_fn (tree);
extern tree cp_add_pending_fn_decls (void*,tree);
extern int cp_is_overload_p (tree);
extern int cp_auto_var_in_fn_p (tree,tree);
-extern tree cp_copy_res_decl_for_inlining (tree, tree, tree, void*,
- int*, tree);
extern void cp_update_decl_after_saving (tree, void *);
/* in typeck.c */
extern tree error_not_base_type (tree, tree);
extern tree binfo_or_else (tree, tree);
extern void readonly_error (tree, const char *, int);
+extern void complete_type_check_abstract (tree);
extern int abstract_virtuals_error (tree, tree);
extern tree store_init_value (tree, tree);