X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fcp%2Fcp-tree.h;h=66ce4fb0d31418aebb26bde50f84fdbb410753ce;hb=b1d10e9386544e3b3357b983ae1fe9f512c1e134;hp=b0802e1977ece6ad5f821279cc1293e59a0bc9a5;hpb=2e0e6579cae2c8c0f61d55a81315d6166f7d95c3;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index b0802e1977e..66ce4fb0d31 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1,6 +1,6 @@ /* Definitions for C++ parsing and type checking. - Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 - Free Software Foundation, Inc. + Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GNU CC. @@ -25,8 +25,8 @@ Boston, MA 02111-1307, USA. */ #include "splay-tree.h" #include "varray.h" -#ifndef _CP_TREE_H -#define _CP_TREE_H +#ifndef GCC_CP_TREE_H +#define GCC_CP_TREE_H #include "c-common.h" @@ -55,12 +55,12 @@ Boston, MA 02111-1307, USA. */ BASELINK_P (in TREE_LIST) ICS_ELLIPSIS_FLAG (in _CONV) BINFO_ACCESS (in BINFO) - BV_GENERATE_THUNK_WITH_VTABLE_P (in TREE_LIST) 2: IDENTIFIER_OPNAME_P. TYPE_POLYMORHPIC_P (in _TYPE) ICS_THIS_FLAG (in _CONV) BINDING_HAS_LEVEL_P (in CPLUS_BINDING) - BINFO_OVERRIDE_ALONG_VIRTUAL_PATH_P (in BINFO) + BINFO_LOST_PRIMARY_P (in BINFO) + TREE_PARMLIST (in TREE_LIST) 3: TYPE_USES_VIRTUAL_BASECLASSES (in a class TYPE). BINFO_VTABLE_PATH_MARKED. BINFO_PUSHDECLS_MARKED. @@ -131,12 +131,6 @@ Boston, MA 02111-1307, USA. */ use a virtual thunk, as opposed to an ordinary thunk. The BV_FN is the declaration for the virtual function itself. - When CLASSTYPE_COM_INTERFACE_P does not hold, the first entry - does not have a BV_FN; it is just an offset. - - The BV_OVERRIDING_BASE is the binfo for the final overrider for - this function. (This binfo's BINFO_TYPE will always be the same - as the DECL_CLASS_CONTEXT for the function.) BINFO_VTABLE Sometimes this is a VAR_DECL. Under the new ABI, it is instead @@ -212,10 +206,6 @@ Boston, MA 02111-1307, USA. */ /* ABI control. */ -/* Nonzero to enable experimental ABI changes. */ - -extern int flag_new_abi; - /* Nonzero to use __cxa_atexit, rather than atexit, to register destructors for local statics and global objects. */ @@ -237,12 +227,12 @@ extern int flag_huge_objects; /* Nonzero if virtual base class offsets are stored in the virtual function table. Zero if, instead, a pointer to the virtual base is stored in the object itself. */ -#define vbase_offsets_in_vtable_p() (flag_new_abi) +#define vbase_offsets_in_vtable_p() (1) /* Nonzero if displacements to the `this' pointer to use when calling virtual functions in a virtual base class are present in the vtable. */ -#define vcall_offsets_in_vtable_p() (flag_new_abi) +#define vcall_offsets_in_vtable_p() (1) /* Nonzero if a derived class that needs a vptr should always get one, even if a non-primary base class already has one. For example, @@ -254,7 +244,7 @@ extern int flag_huge_objects; one could either reuse the vptr in `S' for `T', or create a new vptr for `T'. If this flag is nonzero we choose the latter alternative; otherwise, we choose the former. */ -#define vptrs_present_everywhere_p() (flag_new_abi) +#define vptrs_present_everywhere_p() (1) /* Nonzero if the vtable for a derived class should contain the virtual functions from the primary base and all virtual functions @@ -262,29 +252,23 @@ extern int flag_huge_objects; only those virtual functions from the primary base together with the functions declared in the derived class (but not in any base class). */ -#define all_overridden_vfuns_in_vtables_p() (flag_new_abi) - -/* Nonzero if we use access type_info objects directly, and use the - cross-vendor layout for them. Zero if we use an accessor function - to get the type_info object address. */ -#define new_abi_rtti_p() (flag_new_abi) +#define all_overridden_vfuns_in_vtables_p() (1) /* Nonzero if primary and secondary vtables are combined into a single vtable. */ -#define merge_primary_and_secondary_vtables_p() (flag_new_abi) +#define merge_primary_and_secondary_vtables_p() (1) /* Language-dependent contents of an identifier. */ struct lang_identifier { - struct tree_identifier ignore; + struct c_common_identifier ignore; tree namespace_bindings; tree bindings; tree class_value; tree class_template_info; struct lang_id2 *x; - enum rid rid_code; }; /* In an IDENTIFIER_NODE, nonzero if this identifier is actually a @@ -292,12 +276,9 @@ struct lang_identifier and C_RID_YYCODE is the token number wanted by Yacc. */ #define C_IS_RESERVED_WORD(id) TREE_LANG_FLAG_5 (id) -#define C_RID_CODE(id) \ - (((struct lang_identifier *) (id))->rid_code) extern const short rid_to_yy[RID_MAX]; -#define C_RID_YYCODE(id) \ - rid_to_yy[((struct lang_identifier *) (id))->rid_code] +#define C_RID_YYCODE(id) rid_to_yy[C_RID_CODE (id)] #define LANG_IDENTIFIER_CAST(NODE) \ ((struct lang_identifier*)IDENTIFIER_NODE_CHECK (NODE)) @@ -532,16 +513,9 @@ struct tree_srcloc #define IDENTIFIER_CTOR_OR_DTOR_P(NODE) \ TREE_LANG_FLAG_3 (NODE) -/* Nonzero means reject anything that ISO standard C++ forbids. */ -extern int pedantic; - /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only. */ #define C_TYPE_FIELDS_READONLY(type) TYPE_LANG_FLAG_0 (type) -/* Record in each node resulting from a binary operator - what operator was specified for it. */ -#define C_EXP_ORIGINAL_CODE(exp) ((enum tree_code) TREE_COMPLEXITY (exp)) - /* Store a value in that field. */ #define C_SET_EXP_ORIGINAL_CODE(exp, code) \ (TREE_COMPLEXITY (exp) = (int)(code)) @@ -624,7 +598,6 @@ enum cp_tree_index CPTI_PFN_IDENTIFIER, CPTI_PFN_OR_DELTA2_IDENTIFIER, CPTI_VPTR_IDENTIFIER, - CPTI_PUSH_EXCEPTION_IDENTIFIER, CPTI_STD_IDENTIFIER, CPTI_LANG_NAME_C, @@ -634,8 +607,8 @@ enum cp_tree_index CPTI_EMPTY_EXCEPT_SPEC, CPTI_NULL, CPTI_JCLASS, - CPTI_MINUS_ONE, CPTI_TERMINATE, + CPTI_CALL_UNEXPECTED, CPTI_ATEXIT, CPTI_DSO_HANDLE, CPTI_DCAST, @@ -749,9 +722,6 @@ extern tree cp_global_trees[CPTI_MAX]; #define pfn_identifier cp_global_trees[CPTI_PFN_IDENTIFIER] #define pfn_or_delta2_identifier cp_global_trees[CPTI_PFN_OR_DELTA2_IDENTIFIER] #define vptr_identifier cp_global_trees[CPTI_VPTR_IDENTIFIER] -/* The name of the function to call to push an exception onto the - exception stack. */ -#define cp_push_exception_identifier cp_global_trees[CPTI_PUSH_EXCEPTION_IDENTIFIER] /* The name of the std namespace. */ #define std_identifier cp_global_trees[CPTI_STD_IDENTIFIER] #define lang_name_c cp_global_trees[CPTI_LANG_NAME_C] @@ -767,12 +737,12 @@ extern tree cp_global_trees[CPTI_MAX]; /* If non-NULL, a POINTER_TYPE equivalent to (java::lang::Class*). */ #define jclass_node cp_global_trees[CPTI_JCLASS] -/* A node for `(int) -1'. */ -#define minus_one_node cp_global_trees[CPTI_MINUS_ONE] - /* The declaration for `std::terminate'. */ #define terminate_node cp_global_trees[CPTI_TERMINATE] +/* The declaration for "__cxa_call_unexpected". */ +#define call_unexpected_node cp_global_trees[CPTI_CALL_UNEXPECTED] + /* A pointer to `std::atexit'. */ #define atexit_node cp_global_trees[CPTI_ATEXIT] @@ -791,15 +761,16 @@ extern tree cp_global_trees[CPTI_MAX]; /* Global state. */ -struct saved_scope { +struct saved_scope +{ tree old_bindings; tree old_namespace; + tree decl_ns_list; tree class_name; tree class_type; tree access_specifier; tree function_decl; varray_type lang_base; - tree *lang_stack; tree lang_name; tree template_parms; tree x_previous_class_type; @@ -825,6 +796,10 @@ struct saved_scope { #define current_namespace scope_chain->old_namespace +/* The stack for namespaces of current declarations. */ + +#define decl_namespace_list scope_chain->decl_ns_list + /* IDENTIFIER_NODE: name of current class */ #define current_class_name scope_chain->class_name @@ -842,7 +817,6 @@ struct saved_scope { /* Pointer to the top of the language name stack. */ -#define current_lang_stack scope_chain->lang_stack #define current_lang_base scope_chain->lang_base #define current_lang_name scope_chain->lang_name @@ -886,8 +860,10 @@ struct cp_language_function tree x_dtor_label; tree x_current_class_ptr; tree x_current_class_ref; - tree x_eh_spec_try_block; + tree x_eh_spec_block; tree x_in_charge_parm; + tree x_vtt_parm; + tree x_return_value; tree *x_vcalls_possible_p; @@ -900,6 +876,7 @@ struct cp_language_function struct named_label_use_list *x_named_label_uses; struct named_label_list *x_named_labels; struct binding_level *bindings; + varray_type x_local_names; const char *cannot_inline; }; @@ -928,16 +905,21 @@ struct cp_language_function #define current_class_ref \ (cfun ? cp_function_chain->x_current_class_ref : NULL_TREE) -/* The TRY_BLOCK for the exception-specifiers for the current +/* The EH_SPEC_BLOCK for the exception-specifiers for the current function, if any. */ -#define current_eh_spec_try_block cp_function_chain->x_eh_spec_try_block +#define current_eh_spec_block cp_function_chain->x_eh_spec_block /* The `__in_chrg' parameter for the current function. Only used for - destructors. */ + constructors and destructors. */ #define current_in_charge_parm cp_function_chain->x_in_charge_parm +/* The `__vtt_parm' parameter for the current function. Only used for + constructors and destructors. */ + +#define current_vtt_parm cp_function_chain->x_vtt_parm + /* In destructors, this is a pointer to a condition in an if-statement. If the pointed-to value is boolean_true_node, then there may be virtual function calls in this destructor. */ @@ -972,13 +954,12 @@ struct cp_language_function #define in_function_try_handler cp_function_chain->in_function_try_handler -/* Nonzero if __FUNCTION__ and its ilk have been declared in this - function. */ +/* Expression always returned from function, or error_mark_node + otherwise, for use by the automatic named return value optimization. */ -#define function_name_declared_p \ - (cp_function_chain->base.x_function_name_declared_p) +#define current_function_return_value \ + (cp_function_chain->x_return_value) -extern tree current_function_return_value; extern tree global_namespace; #define ansi_opname(CODE) \ @@ -990,11 +971,6 @@ extern tree global_namespace; extern int dollars_in_ident; -/* Nonzero means allow type mismatches in conditional expressions; - just make their values `void'. */ - -extern int flag_cond_mismatch; - /* Nonzero means don't recognize the keyword `asm'. */ extern int flag_no_asm; @@ -1024,11 +1000,6 @@ extern int warn_implicit; extern int warn_ctor_dtor_privacy; -/* Nonzero means warn about function definitions that default the return type - or that use a null return and have a return-type other than void. */ - -extern int warn_return_type; - /* Nonzero means warn about deprecated conversion from string constant to `char *'. */ @@ -1084,10 +1055,6 @@ extern int warn_ecpp; extern int warn_sign_promo; -/* Non-zero means warn when a function is declared extern and later inline. */ - -extern int warn_extern_inline; - /* Non-zero means warn when an old-style cast is used. */ extern int warn_old_style_cast; @@ -1127,19 +1094,6 @@ extern int flag_ansi; extern int flag_default_inline; -/* The name-mangling scheme to use. Versions of gcc before 2.8 use - version 0. */ -extern int name_mangling_version; - -/* Nonzero if wchar_t should be `unsigned short' instead of whatever it - would normally be, for use with WINE. */ -extern int flag_short_wchar; - -/* Nonzero if squashed mangling is to be performed. - This uses the B and K codes to reference previously seen class types - and class qualifiers. */ -extern int flag_do_squangling; - /* Nonzero means generate separate instantiation control files and juggle them at link time. */ extern int flag_use_repository; @@ -1184,12 +1138,18 @@ enum languages { lang_c, lang_cplusplus, lang_java }; /* Macros to make error reporting functions' lives easier. */ #define TYPE_IDENTIFIER(NODE) (DECL_NAME (TYPE_NAME (NODE))) +#define TYPE_LINKAGE_IDENTIFIER(NODE) \ + (TYPE_IDENTIFIER (TYPE_MAIN_VARIANT (NODE))) #define TYPE_NAME_STRING(NODE) (IDENTIFIER_POINTER (TYPE_IDENTIFIER (NODE))) #define TYPE_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (TYPE_IDENTIFIER (NODE))) #define TYPE_ASSEMBLER_NAME_STRING(NODE) (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE)))) #define TYPE_ASSEMBLER_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE)))) +/* Nonzero if NODE has no name for linkage purposes. */ +#define TYPE_ANONYMOUS_P(NODE) \ + (TAGGED_TYPE_P (NODE) && ANON_AGGRNAME_P (TYPE_LINKAGE_IDENTIFIER (NODE))) + /* The _DECL for this _TYPE. */ #define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE))) @@ -1219,8 +1179,9 @@ enum languages { lang_c, lang_cplusplus, lang_java }; #define IS_AGGR_TYPE_2(TYPE1,TYPE2) \ (TREE_CODE (TYPE1) == TREE_CODE (TYPE2) \ && IS_AGGR_TYPE (TYPE1) && IS_AGGR_TYPE (TYPE2)) -#define IS_OVERLOAD_TYPE(t) \ - (IS_AGGR_TYPE (t) || TREE_CODE (t) == ENUMERAL_TYPE) +#define TAGGED_TYPE_P(t) \ + (CLASS_TYPE_P (t) || TREE_CODE (t) == ENUMERAL_TYPE) +#define IS_OVERLOAD_TYPE(T) TAGGED_TYPE_P (T) /* In a *_TYPE, nonzero means a built-in type. */ #define TYPE_BUILT_IN(NODE) TYPE_LANG_FLAG_6(NODE) @@ -1261,7 +1222,18 @@ enum languages { lang_c, lang_cplusplus, lang_java }; ? (ENTRY) \ : DECL_INITIAL (TREE_OPERAND ((ENTRY), 0))) -#define FUNCTION_ARG_CHAIN(NODE) (TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (NODE)))) +#define FUNCTION_ARG_CHAIN(NODE) \ + (TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (NODE)))) + +/* Given a FUNCTION_DECL, returns the first TREE_LIST out of TYPE_ARG_TYPES + which refers to a user-written parameter. */ +#define FUNCTION_FIRST_USER_PARMTYPE(NODE) \ + (skip_artificial_parms_for (NODE, TYPE_ARG_TYPES (TREE_TYPE (NODE)))) + +/* Similarly, but for DECL_ARGUMENTS. */ +#define FUNCTION_FIRST_USER_PARM(NODE) \ + (skip_artificial_parms_for (NODE, DECL_ARGUMENTS (NODE))) + #define PROMOTES_TO_AGGR_TYPE(NODE,CODE) \ (((CODE) == TREE_CODE (NODE) \ && IS_AGGR_TYPE (TREE_TYPE (NODE))) \ @@ -1305,7 +1277,7 @@ struct lang_type unsigned com_interface : 1; unsigned non_pod_class : 1; unsigned nearly_empty_p : 1; - unsigned vtable_needs_writing : 1; + unsigned user_align : 1; unsigned has_assign_ref : 1; unsigned has_new : 1; unsigned has_array_new : 1; @@ -1337,7 +1309,7 @@ struct lang_type unsigned has_abstract_assign_ref : 1; unsigned non_aggregate : 1; unsigned is_partial_instantiation : 1; - unsigned user_align : 1; + unsigned java_interface : 1; /* When adding a flag here, consider whether or not it ought to apply to a template instance if it applies to the template. If @@ -1468,7 +1440,7 @@ struct lang_type #define CLASSTYPE_CONSTRUCTORS(NODE) \ (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_CONSTRUCTOR_SLOT)) -/* A FUNCTION_DECL for the destructor for NODE. These are te +/* 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)) @@ -1568,6 +1540,10 @@ struct lang_type #define CLASSTYPE_ALIGN_UNIT(NODE) \ (CLASSTYPE_ALIGN (NODE) / BITS_PER_UNIT) +/* True if this a Java interface type, declared with + '__attribute__ ((java_interface))'. */ +#define TYPE_JAVA_INTERFACE(NODE) (TYPE_LANG_SPECIFIC(NODE)->java_interface) + /* A cons list of virtual functions which cannot be inherited by derived classes. When deriving from this type, the derived class must provide its own definition for each of these functions. */ @@ -1582,10 +1558,6 @@ struct lang_type and there is no need to change it. */ #define CLASSTYPE_NEEDS_VIRTUAL_REINIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->needs_virtual_reinit) -/* Nonzero means that if this type has virtual functions, that - the virtual function table will be written out. */ -#define CLASSTYPE_VTABLE_NEEDS_WRITING(NODE) (TYPE_LANG_SPECIFIC(NODE)->vtable_needs_writing) - /* Nonzero means that this type has an X() constructor. */ #define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_default_ctor) @@ -1601,10 +1573,6 @@ struct lang_type #define CLASSTYPE_NEARLY_EMPTY_P(NODE) \ (TYPE_LANG_SPECIFIC (NODE)->nearly_empty_p) -/* Nonzero means that this type is meant for communication via COM. */ -#define CLASSTYPE_COM_INTERFACE(NODE) \ - (TYPE_LANG_SPECIFIC(NODE)->com_interface) - /* A list of class types of which this type is a friend. The TREE_VALUE is normally a TYPE, but will be a TEMPLATE_DECL in the case of a template friend. */ @@ -1627,12 +1595,23 @@ struct lang_type `#pragma interface', and it is not included in its implementation file. */ #define CLASSTYPE_INTERFACE_ONLY(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_only) -/* Same as above, but for classes whose purpose we do not know. */ -#define CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown) -#define CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown == 0) -#define SET_CLASSTYPE_INTERFACE_UNKNOWN_X(NODE,X) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = !!(X)) -#define SET_CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = 1) -#define SET_CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = 0) +/* True if we have already determined whether or not vtables, VTTs, + typeinfo, and other similar per-class data should be emitted in + this translation unit. This flag does not indicate whether or not + these items should be emitted; it only indicates that we know one + way or the other. */ +#define CLASSTYPE_INTERFACE_KNOWN(NODE) \ + (TYPE_LANG_SPECIFIC(NODE)->interface_unknown == 0) +/* The opposite of CLASSTYPE_INTERFANCE_KNOWN. */ +#define CLASSTYPE_INTERFACE_UNKNOWN(NODE) \ + (TYPE_LANG_SPECIFIC(NODE)->interface_unknown) + +#define SET_CLASSTYPE_INTERFACE_UNKNOWN_X(NODE,X) \ + (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = !!(X)) +#define SET_CLASSTYPE_INTERFACE_UNKNOWN(NODE) \ + (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = 1) +#define SET_CLASSTYPE_INTERFACE_KNOWN(NODE) \ + (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = 0) /* Nonzero if a _DECL node requires us to output debug info for this class. */ #define CLASSTYPE_DEBUG_REQUESTED(NODE) (TYPE_LANG_SPECIFIC(NODE)->debug_requested) @@ -1650,6 +1629,10 @@ struct lang_type inheritance is indicated by the absence of the other two flags, not by TREE_VIA_PRIVATE, which is unused. */ +/* Mark the binfo, whether shared or not. Each instance of a virtual + base can be separately marked. */ +#define BINFO_UNSHARED_MARKED(NODE) TREE_LANG_FLAG_0(NODE) + /* Nonzero means marked by DFS or BFS search, including searches by `get_binfo' and `get_base_distance'. */ #define BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED(BINFO_TYPE(NODE)):TREE_LANG_FLAG_0(NODE)) @@ -1673,11 +1656,11 @@ struct lang_type (TREE_LANG_FLAG_4 (CANONICAL_BINFO (B, C))) /* Any subobject that needs a new vtable must have a vptr and must not - be a primary base (since it would then use the vtable from a - derived class.) */ + be a non-virtual primary base (since it would then use the vtable from a + derived class and never become non-primary.) */ #define SET_BINFO_NEW_VTABLE_MARKED(B, C) \ (BINFO_NEW_VTABLE_MARKED (B, C) = 1, \ - my_friendly_assert (!BINFO_PRIMARY_MARKED_P (B), 20000517), \ + my_friendly_assert (!BINFO_PRIMARY_P (B) || TREE_VIA_VIRTUAL (B), 20000517), \ my_friendly_assert (CLASSTYPE_VFIELDS (BINFO_TYPE (B)) != NULL_TREE, \ 20000517)) @@ -1692,7 +1675,7 @@ struct lang_type class of a non-primary virtual base. This flag is only valid for paths (given by BINFO_INHERITANCE_CHAIN) that really exist in the final object. */ -#define BINFO_PRIMARY_MARKED_P(NODE) \ +#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. @@ -1709,9 +1692,10 @@ struct lang_type immediate base.) */ #define BINFO_PRIMARY_BASE_OF(NODE) TREE_VEC_ELT ((NODE), 10) -/* Nonzero if this binfo declares a virtual function which is - overridden along a virtual path. */ -#define BINFO_OVERRIDE_ALONG_VIRTUAL_PATH_P(NODE) TREE_LANG_FLAG_2 (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 heirarchy. */ +#define BINFO_LOST_PRIMARY_P(NODE) TREE_LANG_FLAG_2 (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 @@ -1753,18 +1737,10 @@ struct lang_type /* Nonzero if we should use a virtual thunk for this entry. */ #define BV_USE_VCALL_INDEX_P(NODE) \ (TREE_LANG_FLAG_0 (NODE)) - -/* Nonzero if we should generate this thunk when the vtable that - references it is emitted, rather than with the final overrider. */ -#define BV_GENERATE_THUNK_WITH_VTABLE_P(NODE) \ - (TREE_LANG_FLAG_1 (NODE)) - -/* The most derived class. */ - /* 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! */ +#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) @@ -1808,7 +1784,7 @@ struct lang_decl_flags unsigned static_function : 1; unsigned pure_virtual : 1; unsigned has_in_charge_parm_p : 1; - unsigned uninlinable : 1; + unsigned has_vtt_parm_p : 1; unsigned deferred : 1; unsigned use_template : 2; @@ -1816,16 +1792,14 @@ struct lang_decl_flags unsigned declared_inline : 1; unsigned not_really_extern : 1; unsigned needs_final_overrider : 1; - unsigned defined_in_class : 1; + unsigned initialized_in_class : 1; unsigned pending_inline_p : 1; unsigned global_ctor_p : 1; unsigned global_dtor_p : 1; - unsigned tinfo_fn_p : 1; unsigned assignment_operator_p : 1; unsigned anticipated_p : 1; - unsigned generate_with_vtable_p : 1; - unsigned dummy : 1; + /* Three unused bits. */ union { /* In a FUNCTION_DECL, VAR_DECL, TYPE_DECL, or TEMPLATE_DECL, this @@ -1840,6 +1814,9 @@ struct lang_decl_flags /* This is DECL_ACCESS. */ tree access; + /* For VAR_DECL in function, this is DECL_DISCRIMINATOR. */ + int discriminator; + /* In a namespace-scope FUNCTION_DECL, this is GLOBAL_INIT_PRIORITY. */ int init_priority; @@ -1865,6 +1842,10 @@ struct lang_decl /* In a FUNCTION_DECL, this is DECL_CLONED_FUNCTION. */ tree cloned_function; + /* In a FUNCTION_DECL, these are function data which is to be kept + as long as FUNCTION_DECL is kept. */ + tree inlined_fns; + union { tree sorted_fields; @@ -1876,13 +1857,10 @@ struct lang_decl /* In an overloaded operator, this is the value of DECL_OVERLOADED_OPERATOR_P. */ enum tree_code operator_code; - /* In a maybe-in-charge constructor or destructor, this is - DECL_VTT_PARM. */ - tree vtt_parm; } u2; }; -#define DEFARG_POINTER(NODE) (DEFAULT_ARG_CHECK(NODE)->identifier.pointer) +#define DEFARG_POINTER(NODE) (DEFAULT_ARG_CHECK(NODE)->identifier.id.str) /* Non-zero if NODE is a _DECL with TREE_READONLY set. */ #define TREE_READONLY_DECL_P(NODE) \ @@ -1895,9 +1873,10 @@ struct lang_decl just been used somewhere, even if it's not really needed. We need anything that isn't comdat, but we don't know for sure whether or not something is comdat until end-of-file. */ -#define DECL_NEEDED_P(DECL) \ - ((at_eof && TREE_PUBLIC (DECL) && !DECL_COMDAT (DECL)) \ - || (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME ((DECL)))) \ +#define DECL_NEEDED_P(DECL) \ + ((at_eof && TREE_PUBLIC (DECL) && !DECL_COMDAT (DECL)) \ + || (DECL_ASSEMBLER_NAME_SET_P (DECL) \ + && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME ((DECL)))) \ || (flag_syntax_only && TREE_USED ((DECL)))) /* Non-zero iff DECL is memory-based. The DECL_RTL of @@ -1906,11 +1885,26 @@ struct lang_decl here because on most RISC machines, a variable's address is not, by itself, a legitimate address. */ #define DECL_IN_MEMORY_P(NODE) \ - (DECL_RTL (NODE) != NULL_RTX && GET_CODE (DECL_RTL (NODE)) == MEM) + (DECL_RTL_SET_P (NODE) && GET_CODE (DECL_RTL (NODE)) == MEM) -/* For FUNCTION_DECLs: return the language in which this decl - was declared. */ -#define DECL_LANGUAGE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.language) +/* For a FUNCTION_DECL or a VAR_DECL, the language linkage for the + declaration. Some entities (like a member function in a local + class, or a local variable) do not have linkage at all, and this + macro should not be used in those cases. + + Implementation note: A FUNCTION_DECL without DECL_LANG_SPECIFIC was + created by language-independent code, and has C linkage. Most + VAR_DECLs have C++ linkage, and do not have DECL_LANG_SPECIFIC, but + we do create DECL_LANG_SPECIFIC for variables with non-C++ linkage. */ +#define DECL_LANGUAGE(NODE) \ + (DECL_LANG_SPECIFIC (NODE) \ + ? DECL_LANG_SPECIFIC(NODE)->decl_flags.language \ + : (TREE_CODE (NODE) == FUNCTION_DECL \ + ? lang_c : lang_cplusplus)) + +/* Set the language linkage for NODE to LANGUAGE. */ +#define SET_DECL_LANGUAGE(NODE, LANGUAGE) \ + (DECL_LANG_SPECIFIC (NODE)->decl_flags.language = 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) @@ -1968,7 +1962,9 @@ struct lang_decl /* Nonzero if NODE (a FUNCTION_DECL) is a cloned constructor or destructor. */ #define DECL_CLONED_FUNCTION_P(NODE) \ - (DECL_LANG_SPECIFIC (NODE) \ + ((TREE_CODE (NODE) == FUNCTION_DECL \ + || TREE_CODE (NODE) == TEMPLATE_DECL) \ + && DECL_LANG_SPECIFIC (NODE) \ && DECL_CLONED_FUNCTION (NODE) != NULL_TREE) /* If DECL_CLONED_FUNCTION_P holds, this is the function that was @@ -1976,17 +1972,22 @@ struct lang_decl #define DECL_CLONED_FUNCTION(NODE) \ (DECL_LANG_SPECIFIC (NODE)->cloned_function) -/* In a maybe-in-charge constructor or destructor, this is the VTT - parameter. It's not actually on the DECL_ARGUMENTS list. */ -#define DECL_VTT_PARM(NODE) \ - (DECL_LANG_SPECIFIC (NODE)->u2.vtt_parm) +/* List of FUNCION_DECLs inlined into this function's body. */ +#define DECL_INLINED_FNS(NODE) \ + (DECL_LANG_SPECIFIC (NODE)->inlined_fns) -/* If there's a DECL_VTT_PARM, this is a magic variable that indicates - whether or not the VTT parm should be used. In a subobject - constructor, `true' is substituted for this value; in a complete - object constructor, `false' is substituted instead. */ -#define DECL_USE_VTT_PARM(NODE) \ - (TREE_CHAIN (DECL_VTT_PARM (NODE))) +/* Nonzero if NODE has DECL_DISCRIMINATOR and not DECL_ACCESS. */ +#define DECL_DISCRIMINATOR_P(NODE) \ + (TREE_CODE (NODE) == VAR_DECL \ + && DECL_FUNCTION_SCOPE_P (NODE)) + +/* Discriminator for name mangling. */ +#define DECL_DISCRIMINATOR(NODE) \ + (DECL_LANG_SPECIFIC (NODE)->decl_flags.u2.discriminator) + +/* Non-zero if the VTT parm has been added to NODE. */ +#define DECL_HAS_VTT_PARM_P(NODE) \ + (DECL_LANG_SPECIFIC (NODE)->decl_flags.has_vtt_parm_p) /* Non-zero if NODE is a FUNCTION_DECL for which a VTT parameter is required. */ @@ -2024,17 +2025,6 @@ struct lang_decl #define DECL_HAS_IN_CHARGE_PARM_P(NODE) \ (DECL_LANG_SPECIFIC (NODE)->decl_flags.has_in_charge_parm_p) -/* Non-zero for a FUNCTION_DECL that declares a type-info function. - This only happens in the old abi. */ -#define DECL_TINFO_FN_P(NODE) \ - (TREE_CODE (NODE) == FUNCTION_DECL \ - && DECL_ARTIFICIAL (NODE) \ - && DECL_LANG_SPECIFIC(NODE)->decl_flags.tinfo_fn_p) - -/* Mark NODE as a type-info function. */ -#define SET_DECL_TINFO_FN_P(NODE) \ - (DECL_LANG_SPECIFIC((NODE))->decl_flags.tinfo_fn_p = 1) - /* Nonzero if NODE is an overloaded `operator delete[]' function. */ #define DECL_ARRAY_DELETE_OPERATOR_P(NODE) \ (DECL_OVERLOADED_OPERATOR_P (NODE) == VEC_DELETE_EXPR) @@ -2046,10 +2036,10 @@ struct lang_decl should be allocated. */ #define DECL_IN_AGGR_P(NODE) (DECL_LANG_FLAG_3(NODE)) -/* Nonzero if the DECL was defined in the class definition itself, +/* Nonzero if the DECL was initialized in the class definition itself, rather than outside the class. */ -#define DECL_DEFINED_IN_CLASS_P(DECL) \ - (DECL_LANG_SPECIFIC (DECL)->decl_flags.defined_in_class) +#define DECL_INITIALIZED_IN_CLASS_P(DECL) \ + (DECL_LANG_SPECIFIC (DECL)->decl_flags.initialized_in_class) /* Nonzero for FUNCTION_DECL means that this decl is just a friend declaration, and should not be added to the list of @@ -2064,12 +2054,6 @@ struct lang_decl 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 non-static member function. */ #define DECL_NONSTATIC_MEMBER_FUNCTION_P(NODE) \ @@ -2346,7 +2330,7 @@ struct lang_decl /* The number of levels of template parameters given by NODE. */ #define TMPL_PARMS_DEPTH(NODE) \ - (TREE_INT_CST_HIGH (TREE_PURPOSE (NODE))) + (TREE_INT_CST_LOW (TREE_PURPOSE (NODE))) /* The TEMPLATE_DECL instantiated or specialized by NODE. This TEMPLATE_DECL will be the immediate parent, not the most general @@ -2481,10 +2465,6 @@ extern int flag_new_for_scope; /* Record whether a typedef for type `int' was actually `signed int'. */ #define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp)) -/* In a FUNCTION_DECL, nonzero if the function cannot be inlined. */ -#define DECL_UNINLINABLE(NODE) \ - (DECL_LANG_SPECIFIC (NODE)->decl_flags.uninlinable) - /* Returns non-zero if DECL has external linkage, as specified by the language standard. (This predicate may hold even when the corresponding entity is not actually given external linkage in the @@ -2675,15 +2655,25 @@ extern int flag_new_for_scope; (We don't need DELTA2, because the vtable is always the first thing in the object.) If the function is virtual, then PFN is one plus twice the index into the vtable; otherwise, it is just a pointer to - the function. */ + the function. + + Unfortunately, using the lowest bit of PFN doesn't work in + architectures that don't impose alignment requirements on function + addresses, or that use the lowest bit to tell one ISA from another, + for example. For such architectures, we use the lowest bit of + DELTA instead of the lowest bit of the PFN, and DELTA will be + multiplied by 2. */ +enum ptrmemfunc_vbit_where_t +{ + ptrmemfunc_vbit_in_pfn, + ptrmemfunc_vbit_in_delta +}; /* 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) \ - (flag_new_abi \ - ? (TREE_TYPE (TYPE_FIELDS (NODE))) \ - : (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (NODE)))))))) + (TREE_TYPE (TYPE_FIELDS (NODE))) /* Returns `A' for a type like `int (A::*)(double)' */ #define TYPE_PTRMEMFUNC_OBJECT_TYPE(NODE) \ @@ -2693,11 +2683,14 @@ extern int flag_new_for_scope; 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) delta2_from_ptrmemfunc ((NODE)) +/* Returns the pfn field from a TYPE_PTRMEMFUNC_P. */ #define PFN_FROM_PTRMEMFUNC(NODE) pfn_from_ptrmemfunc ((NODE)) -/* For a pointer-to-member type of the form `T X::*', this is `X'. */ +/* For a pointer-to-member type of the form `T X::*', this is `X'. + For a type like `void (X::*)() const', this type is `X', not `const + X'. To get at the `const X' you have to look at the + TYPE_PTRMEM_POINTED_TO_TYPE; there, the first parameter will have + type `const X*'. */ #define TYPE_PTRMEM_CLASS_TYPE(NODE) \ (TYPE_PTRMEM_P ((NODE)) \ ? TYPE_OFFSET_BASETYPE (TREE_TYPE ((NODE))) \ @@ -2791,7 +2784,7 @@ extern int flag_new_for_scope; /* Accessor macros for C++ template decl nodes. */ /* The DECL_TEMPLATE_PARMS are a list. The TREE_PURPOSE of each node - is a INT_CST whose TREE_INT_CST_HIGH indicates the level of the + is a INT_CST whose TREE_INT_CST_LOW indicates the level of the template parameters, with 1 being the outermost set of template parameters. The TREE_VALUE is a vector, whose elements are the template parameters at each level. Each element in the vector is a @@ -2919,7 +2912,7 @@ extern int flag_new_for_scope; #define PRIMARY_TEMPLATE_P(NODE) (DECL_PRIMARY_TEMPLATE (NODE) == NODE) #define CLASSTYPE_TEMPLATE_LEVEL(NODE) \ - (TREE_INT_CST_HIGH (TREE_PURPOSE (CLASSTYPE_TI_TEMPLATE (NODE)))) + (TREE_INT_CST_LOW (TREE_PURPOSE (CLASSTYPE_TI_TEMPLATE (NODE)))) /* Indicates whether or not (and how) a template was expanded for this FUNCTION_DECL or VAR_DECL. @@ -2991,7 +2984,7 @@ extern int flag_new_for_scope; /* 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) \ +#define DECL_DECLARED_INLINE_P(NODE) \ (DECL_LANG_SPECIFIC (NODE)->decl_flags.declared_inline) /* DECL_EXTERNAL must be set on a decl until the decl is actually emitted, @@ -3035,23 +3028,22 @@ extern int flag_new_for_scope; #define THUNK_VCALL_OFFSET(DECL) \ (DECL_LANG_SPECIFIC (DECL)->decl_flags.u2.vcall_offset) -/* Nonzero if this thunk should be generated with the vtable that - references it. */ -#define THUNK_GENERATE_WITH_VTABLE_P(DECL) \ - (DECL_LANG_SPECIFIC (DECL)->decl_flags.generate_with_vtable_p) - /* These macros provide convenient access to the various _STMT nodes created when parsing template declarations. */ #define TRY_STMTS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 0) #define TRY_HANDLERS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 1) +#define EH_SPEC_STMTS(NODE) TREE_OPERAND (EH_SPEC_BLOCK_CHECK (NODE), 0) +#define EH_SPEC_RAISES(NODE) TREE_OPERAND (EH_SPEC_BLOCK_CHECK (NODE), 1) + +#define USING_STMT_NAMESPACE(NODE) TREE_OPERAND (USING_STMT_CHECK (NODE), 0) + /* Nonzero if this try block is a function try block. */ #define FN_TRY_BLOCK_P(NODE) TREE_LANG_FLAG_3 (TRY_BLOCK_CHECK (NODE)) #define HANDLER_PARMS(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 0) #define HANDLER_BODY(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 1) +#define HANDLER_TYPE(NODE) TREE_TYPE (HANDLER_CHECK (NODE)) #define SUBOBJECT_CLEANUP(NODE) TREE_OPERAND (SUBOBJECT_CHECK (NODE), 0) -#define START_CATCH_TYPE(NODE) TREE_TYPE (START_CATCH_STMT_CHECK (NODE)) - /* Nonzero if this CTOR_STMT is for the beginning of a constructor. */ #define CTOR_BEGIN_P(NODE) \ @@ -3170,10 +3162,6 @@ typedef enum instantiate_type_flags { itf_ptrmem_ok = 1 << 2, /* pointers to member ok (internal use) */ } instantiate_type_flags; -/* Non-zero means that if a label exists, and no other identifier - applies, use the value of the label. */ -extern int flag_labels_ok; - /* Nonzero means allow Microsoft extensions without a pedwarn. */ extern int flag_ms_extensions; @@ -3194,9 +3182,6 @@ extern int warn_nontemplate_friend; /* A node that is a list (length 1) of error_mark_nodes. */ extern tree error_mark_list; -/* A list of virtual function tables we must make sure to write out. */ -extern tree pending_vtables; - /* Node for "pointer to (virtual) function". This may be distinct from ptr_type_node so gdb can distinguish them. */ #define vfunc_ptr_type_node \ @@ -3215,14 +3200,15 @@ extern int function_depth; /* in pt.c */ -/* These values are used for the `STRICT' parameter to type_unfication and +/* These values are used for the `STRICT' parameter to type_unification and fn_type_unification. Their meanings are described with the documentation for fn_type_unification. */ typedef enum unification_kind_t { DEDUCE_CALL, DEDUCE_CONV, - DEDUCE_EXACT + DEDUCE_EXACT, + DEDUCE_ORDER } unification_kind_t; /* Macros for operating on a template instantation level node, represented @@ -3246,10 +3232,6 @@ extern varray_type local_classes; /* Here's where we control how name mangling takes place. */ -#define OPERATOR_ASSIGN_FORMAT "__a%s" -#define OPERATOR_FORMAT "__%s" -#define OPERATOR_TYPENAME_FORMAT "__op" - /* Cannot use '$' up front, because this confuses gdb (names beginning with '$' are gdb-local identifiers). @@ -3425,10 +3407,6 @@ extern varray_type local_classes; /* Things for handling inline functions. */ -/* Negative values means we know `this' to be of static type. */ - -extern int flag_this_is_variable; - /* Nonzero means do emit exported implementations of functions even if they can be inlined. */ @@ -3452,8 +3430,10 @@ extern int flag_implicit_templates; extern int flag_weak; -/* Nonzero if we should expand functions calls inline at the tree - level, rather than at the RTL level. */ +/* 0 if we should not perform inlining. + 1 if we should expand functions calls inline at the tree level. + 2 if we should consider *all* functions to be inline + candidates. */ extern int flag_inline_trees; @@ -3629,7 +3609,7 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; TFF_CLASS_SCOPE: if possible, include the class-name part of a qualified-id. This flag may be implied in some circumstances by TFF_NAMESPACE_SCOPE. - TFF_SCOPE: the combinaison of the two above. + TFF_SCOPE: the combination of the two above. TFF_CHASE_TYPEDEF: print the original type-id instead of the typedef-name. TFF_DECL_SPECIFIERS: print decl-specifiers. TFF_CLASS_KEY_OR_ENUM: precede a class-type name (resp. enum name) with @@ -3637,9 +3617,9 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; TFF_RETURN_TYPE: include function return type. TFF_FUNCTION_DEFAULT_ARGUMENTS: include function default parameter values. TFF_EXCEPTION_SPECIFICATION: show function exception specification. - TFF_TEMPLATE_HEADER: show the template<...> hearder in a + TFF_TEMPLATE_HEADER: show the template<...> header in a template-declaration. - TFF_TEMPLATE_DEFAULT_ARGUMENTS: show template paramter default values. + TFF_TEMPLATE_DEFAULT_ARGUMENTS: show template parameter default values. TFF_TEMPLATE_NAME: show only template-name. TFF_EXPR_IN_PARENS: Parenthesize expressions. */ @@ -3723,7 +3703,6 @@ extern tree get_vtable_decl PARAMS ((tree, int)); extern void add_method PARAMS ((tree, tree, int)); extern int currently_open_class PARAMS ((tree)); extern tree currently_open_derived_class PARAMS ((tree)); -extern tree get_vfield_offset PARAMS ((tree)); extern void duplicate_tag_error PARAMS ((tree)); extern tree finish_struct PARAMS ((tree, tree)); extern void finish_struct_1 PARAMS ((tree)); @@ -3734,12 +3713,13 @@ extern void pushclass PARAMS ((tree, int)); extern void popclass PARAMS ((void)); extern void push_nested_class PARAMS ((tree, int)); extern void pop_nested_class PARAMS ((void)); +extern int current_lang_depth PARAMS ((void)); extern void push_lang_context PARAMS ((tree)); extern void pop_lang_context PARAMS ((void)); extern tree instantiate_type PARAMS ((tree, tree, enum instantiate_type_flags)); extern void print_class_statistics PARAMS ((void)); -extern int first_vfun_index PARAMS ((tree)); extern void build_self_reference PARAMS ((void)); +extern int same_signature_p PARAMS ((tree, tree)); extern void warn_hidden PARAMS ((tree)); extern tree get_enclosing_class PARAMS ((tree)); int is_base_of_enclosing_class PARAMS ((tree, tree)); @@ -3755,38 +3735,37 @@ extern tree get_primary_binfo PARAMS ((tree)); /* in cvt.c */ extern tree convert_to_reference PARAMS ((tree, tree, int, int, tree)); extern tree convert_from_reference PARAMS ((tree)); +extern tree convert_lvalue PARAMS ((tree, tree)); extern tree convert_pointer_to_real PARAMS ((tree, tree)); extern tree convert_pointer_to PARAMS ((tree, tree)); extern tree ocp_convert PARAMS ((tree, tree, int, int)); extern tree cp_convert PARAMS ((tree, tree)); extern tree convert_to_void PARAMS ((tree, const char */*implicit context*/)); -extern tree convert PARAMS ((tree, tree)); extern tree convert_force PARAMS ((tree, tree, int)); extern tree build_type_conversion PARAMS ((tree, tree, int)); extern tree build_expr_type_conversion PARAMS ((int, tree, int)); extern tree type_promotes_to PARAMS ((tree)); extern tree perform_qualification_conversions PARAMS ((tree, tree)); extern void clone_function_decl PARAMS ((tree, int)); +extern void adjust_clone_args PARAMS ((tree)); /* decl.c */ /* resume_binding_level */ -extern void set_identifier_local_value PARAMS ((tree, tree)); -extern int global_bindings_p PARAMS ((void)); extern int toplevel_bindings_p PARAMS ((void)); extern int namespace_bindings_p PARAMS ((void)); extern void keep_next_level PARAMS ((int)); extern int kept_level_p PARAMS ((void)); extern int template_parm_scope_p PARAMS ((void)); extern void set_class_shadows PARAMS ((tree)); +extern void maybe_push_cleanup_level PARAMS ((tree)); extern void begin_scope PARAMS ((scope_kind)); extern void finish_scope PARAMS ((void)); extern void note_level_for_for PARAMS ((void)); -extern void note_level_for_eh PARAMS ((void)); +extern void note_level_for_try PARAMS ((void)); +extern void note_level_for_catch PARAMS ((void)); extern void resume_level PARAMS ((struct binding_level *)); extern void delete_block PARAMS ((tree)); -extern void insert_block PARAMS ((tree)); extern void add_block_current_level PARAMS ((tree)); -extern void set_block PARAMS ((tree)); extern void pushlevel_class PARAMS ((void)); extern void poplevel_class PARAMS ((void)); extern void print_binding_stack PARAMS ((void)); @@ -3808,7 +3787,6 @@ extern tree make_anon_name PARAMS ((void)); extern void clear_anon_tags PARAMS ((void)); extern int decls_match PARAMS ((tree, tree)); extern int duplicate_decls PARAMS ((tree, tree)); -extern tree pushdecl PARAMS ((tree)); extern tree pushdecl_top_level PARAMS ((tree)); extern void pushdecl_class_level PARAMS ((tree)); extern tree pushdecl_namespace_level PARAMS ((tree)); @@ -3816,13 +3794,10 @@ extern tree push_using_decl PARAMS ((tree, tree)); extern tree push_using_directive PARAMS ((tree)); extern void push_class_level_binding PARAMS ((tree, tree)); extern tree implicitly_declare PARAMS ((tree)); -extern tree lookup_label PARAMS ((tree)); extern tree declare_local_label PARAMS ((tree)); extern tree define_label PARAMS ((const char *, int, tree)); extern void check_goto PARAMS ((tree)); extern void define_case_label PARAMS ((void)); -extern tree getdecls PARAMS ((void)); -extern tree gettags PARAMS ((void)); extern tree binding_for_name PARAMS ((tree, tree)); extern tree namespace_binding PARAMS ((tree, tree)); extern void set_namespace_binding PARAMS ((tree, tree, tree)); @@ -3847,7 +3822,6 @@ extern tree build_cp_library_fn_ptr PARAMS ((const char *, tree)); extern tree push_library_fn PARAMS ((tree, tree)); extern tree push_void_library_fn PARAMS ((tree, tree)); extern tree push_throw_library_fn PARAMS ((tree, tree)); -extern void init_decl_processing PARAMS ((void)); extern int init_type_desc PARAMS ((void)); extern tree check_tag_decl PARAMS ((tree)); extern void shadow_tag PARAMS ((tree)); @@ -3871,16 +3845,14 @@ extern tree xref_tag PARAMS ((tree, tree, int)); extern tree xref_tag_from_type PARAMS ((tree, tree, int)); extern void xref_basetypes PARAMS ((tree, tree, tree, tree)); extern tree start_enum PARAMS ((tree)); -extern tree finish_enum PARAMS ((tree)); +extern void finish_enum PARAMS ((tree)); extern void build_enumerator PARAMS ((tree, tree, tree)); extern int start_function PARAMS ((tree, tree, tree, int)); extern tree finish_function PARAMS ((int)); extern tree start_method PARAMS ((tree, tree, tree)); extern tree finish_method PARAMS ((tree)); extern void hack_incomplete_structures PARAMS ((tree)); -extern tree maybe_build_cleanup PARAMS ((tree)); extern void finish_stmt PARAMS ((void)); -extern void replace_defarg PARAMS ((tree, tree)); extern void print_other_binding_stack PARAMS ((struct binding_level *)); extern void revert_static_member_fn PARAMS ((tree)); extern void fixup_anonymous_aggr PARAMS ((tree)); @@ -3913,11 +3885,12 @@ extern int nonstatic_local_decl_p PARAMS ((tree)); extern tree declare_global_var PARAMS ((tree, tree)); extern void register_dtor_fn PARAMS ((tree)); extern tmpl_spec_kind current_tmpl_spec_kind PARAMS ((int)); +extern tree cp_fname_init PARAMS ((const char *)); /* in decl2.c */ extern void init_decl2 PARAMS ((void)); extern int check_java_method PARAMS ((tree)); -extern int lang_decode_option PARAMS ((int, char **)); +extern int cxx_decode_option PARAMS ((int, char **)); extern int grok_method_quals PARAMS ((tree, tree, tree)); extern void warn_if_unknown_interface PARAMS ((tree)); extern void grok_x_components PARAMS ((tree)); @@ -3937,8 +3910,7 @@ extern int copy_assignment_arg_p PARAMS ((tree, int)); extern void cplus_decl_attributes PARAMS ((tree, tree, tree)); extern tree constructor_name_full PARAMS ((tree)); extern tree constructor_name PARAMS ((tree)); -extern void setup_vtbl_ptr PARAMS ((tree, tree)); -extern void defer_fn PARAMS ((tree)); +extern void defer_fn PARAMS ((tree)); extern tree get_temp_name PARAMS ((tree)); extern void finish_anon_union PARAMS ((tree)); extern tree finish_table PARAMS ((tree, tree, tree, int)); @@ -4014,15 +3986,16 @@ extern cp_printer *cp_printers[256]; /* in except.c */ extern void init_exception_processing PARAMS ((void)); extern tree expand_start_catch_block PARAMS ((tree)); -extern void expand_end_catch_block PARAMS ((tree)); +extern void expand_end_catch_block PARAMS ((void)); extern void expand_builtin_throw PARAMS ((void)); -extern tree expand_start_eh_spec PARAMS ((void)); -extern void expand_end_eh_spec PARAMS ((tree, tree)); +extern void expand_eh_spec_block PARAMS ((tree)); extern void expand_exception_blocks PARAMS ((void)); +extern tree build_exc_ptr PARAMS ((void)); extern tree build_throw PARAMS ((tree)); extern void mark_all_runtime_matches PARAMS ((void)); extern int nothrow_libfn_p PARAMS ((tree)); extern void check_handlers PARAMS ((tree)); +extern void choose_personality_routine PARAMS ((enum languages)); /* in expr.c */ extern void init_cplus_expand PARAMS ((void)); @@ -4047,7 +4020,7 @@ extern tree build_member_call PARAMS ((tree, tree, tree)); extern tree build_offset_ref PARAMS ((tree, tree)); extern tree resolve_offset_ref PARAMS ((tree)); extern tree build_new PARAMS ((tree, tree, tree, int)); -extern tree build_vec_init PARAMS ((tree, tree, tree, tree, int)); +extern tree build_vec_init PARAMS ((tree, tree, int)); extern tree build_x_delete PARAMS ((tree, int, tree)); extern tree build_delete PARAMS ((tree, tree, special_function_kind, int, int)); extern tree build_vbase_delete PARAMS ((tree, tree)); @@ -4061,13 +4034,10 @@ extern tree build_java_class_ref PARAMS ((tree)); /* in input.c */ /* in lex.c */ -extern char *file_name_nondirectory PARAMS ((const char *)); extern tree make_pointer_declarator PARAMS ((tree, tree)); extern tree make_reference_declarator PARAMS ((tree, tree)); extern tree make_call_declarator PARAMS ((tree, tree, tree, tree)); extern void set_quals_and_spec PARAMS ((tree, tree, tree)); -extern void lang_init PARAMS ((void)); -extern void lang_finish PARAMS ((void)); extern void print_parse_statistics PARAMS ((void)); extern void do_pending_inlines PARAMS ((void)); extern void process_next_inline PARAMS ((struct unparsed_text *)); @@ -4086,37 +4056,25 @@ extern tree identifier_typedecl_value PARAMS ((tree)); extern tree build_lang_decl PARAMS ((enum tree_code, tree, tree)); extern void retrofit_lang_decl PARAMS ((tree)); extern tree copy_decl PARAMS ((tree)); -extern void copy_lang_decl PARAMS ((tree)); extern tree cp_make_lang_type PARAMS ((enum tree_code)); extern tree make_aggr_type PARAMS ((enum tree_code)); extern void compiler_error PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1; extern void yyerror PARAMS ((const char *)); extern void clear_inline_text_obstack PARAMS ((void)); -extern void maybe_snarf_defarg PARAMS ((void)); -extern void add_defarg_fn PARAMS ((tree)); -extern void do_pending_defargs PARAMS ((void)); extern void yyhook PARAMS ((int)); extern int cp_type_qual_from_rid PARAMS ((tree)); /* in method.c */ extern void init_method PARAMS ((void)); -extern char *build_overload_name PARAMS ((tree, int, int)); -extern tree build_static_name PARAMS ((tree, tree)); -extern tree build_decl_overload_real PARAMS ((tree, tree, tree, tree, - tree, int)); extern void set_mangled_name_for_decl PARAMS ((tree)); -extern tree build_typename_overload PARAMS ((tree)); -extern tree build_overload_with_type PARAMS ((tree, tree)); -extern tree build_destructor_name PARAMS ((tree)); extern tree build_opfncall PARAMS ((enum tree_code, int, tree, tree, tree)); extern tree hack_identifier PARAMS ((tree, tree)); -extern tree make_thunk PARAMS ((tree, tree, tree, int)); +extern tree make_thunk PARAMS ((tree, tree, tree)); extern void use_thunk PARAMS ((tree, int)); extern void synthesize_method PARAMS ((tree)); -extern tree get_id_2 PARAMS ((const char *, tree)); extern tree implicitly_declare_fn PARAMS ((special_function_kind, tree, int)); -extern tree get_ctor_vtbl_name PARAMS ((tree, tree)); +extern tree skip_artificial_parms_for PARAMS ((tree, tree)); /* In optimize.c */ extern void optimize_function PARAMS ((tree)); @@ -4147,7 +4105,7 @@ extern tree current_template_args PARAMS ((void)); extern tree push_template_decl PARAMS ((tree)); extern tree push_template_decl_real PARAMS ((tree, int)); extern void redeclare_class_template PARAMS ((tree, tree)); -extern tree lookup_template_class PARAMS ((tree, tree, tree, tree, int)); +extern tree lookup_template_class PARAMS ((tree, tree, tree, tree, int, int)); extern tree lookup_template_function PARAMS ((tree, tree)); extern int uses_template_parms PARAMS ((tree)); extern tree instantiate_class_template PARAMS ((tree)); @@ -4155,7 +4113,7 @@ extern tree instantiate_template PARAMS ((tree, tree)); extern int fn_type_unification PARAMS ((tree, tree, tree, tree, tree, unification_kind_t, int)); extern tree tinst_for_decl PARAMS ((void)); extern void mark_decl_instantiated PARAMS ((tree, int)); -extern int more_specialized PARAMS ((tree, tree, int)); +extern int more_specialized PARAMS ((tree, tree, int, int)); extern void mark_class_instantiated PARAMS ((tree, int)); extern void do_decl_instantiation PARAMS ((tree, tree, tree)); extern void do_type_instantiation PARAMS ((tree, tree, int)); @@ -4195,7 +4153,6 @@ extern tree get_tinfo_decl PARAMS((tree)); extern tree get_typeid PARAMS((tree)); extern tree get_typeid_1 PARAMS((tree)); extern tree build_dynamic_cast PARAMS((tree, tree)); -extern void synthesize_tinfo_fn PARAMS((tree)); extern void emit_support_tinfos PARAMS((void)); extern int tinfo_decl_p PARAMS((tree, void *)); extern int emit_tinfo_decl PARAMS((tree *, void *)); @@ -4207,6 +4164,8 @@ extern tree get_binfo PARAMS ((tree, tree, int)); extern int get_base_distance PARAMS ((tree, tree, int, tree *)); extern tree get_dynamic_cast_base_type PARAMS ((tree, tree)); extern void type_access_control PARAMS ((tree, tree)); +extern void skip_type_access_control PARAMS ((void)); +extern void reset_type_access_control PARAMS ((void)); extern int accessible_p PARAMS ((tree, tree)); extern tree lookup_field PARAMS ((tree, tree, int, int)); extern int lookup_fnfields_1 PARAMS ((tree, tree)); @@ -4226,9 +4185,11 @@ extern void init_search_processing PARAMS ((void)); extern void reinit_search_statistics PARAMS ((void)); extern tree current_scope PARAMS ((void)); extern int at_function_scope_p PARAMS ((void)); +extern tree context_for_name_lookup PARAMS ((tree)); extern tree lookup_conversions PARAMS ((tree)); extern tree binfo_for_vtable PARAMS ((tree)); extern tree binfo_from_vbase PARAMS ((tree)); +extern tree look_for_overrides_here PARAMS ((tree, tree)); extern tree dfs_walk PARAMS ((tree, tree (*) (tree, void *), tree (*) (tree, void *), @@ -4251,6 +4212,7 @@ extern tree unmarked_vtable_pathp PARAMS ((tree, void *)); extern tree convert_pointer_to_vbase PARAMS ((tree, tree)); extern tree find_vbase_instance PARAMS ((tree, tree)); extern tree binfo_for_vbase PARAMS ((tree, tree)); +extern tree binfo_via_virtual PARAMS ((tree, tree)); extern void fixup_all_virtual_upcast_offsets PARAMS ((tree)); /* in semantics.c */ @@ -4283,15 +4245,17 @@ extern tree finish_case_label PARAMS ((tree, tree)); extern tree finish_goto_stmt PARAMS ((tree)); extern tree begin_try_block PARAMS ((void)); extern void finish_try_block PARAMS ((tree)); +extern tree begin_eh_spec_block PARAMS ((void)); +extern void finish_eh_spec_block PARAMS ((tree, tree)); extern void finish_handler_sequence PARAMS ((tree)); extern tree begin_function_try_block PARAMS ((void)); extern void finish_function_try_block PARAMS ((tree)); extern void finish_function_handler_sequence PARAMS ((tree)); extern void finish_cleanup_try_block PARAMS ((tree)); extern tree begin_handler PARAMS ((void)); -extern tree finish_handler_parms PARAMS ((tree, tree)); +extern void finish_handler_parms PARAMS ((tree, tree)); extern void begin_catch_block PARAMS ((tree)); -extern void finish_handler PARAMS ((tree, tree)); +extern void finish_handler PARAMS ((tree)); extern void finish_cleanup PARAMS ((tree, tree)); extern tree begin_compound_stmt PARAMS ((int)); extern tree finish_compound_stmt PARAMS ((int, tree)); @@ -4309,7 +4273,6 @@ extern tree finish_object_call_expr PARAMS ((tree, tree, tree)); extern tree finish_qualified_object_call_expr PARAMS ((tree, tree, tree)); extern tree finish_pseudo_destructor_call_expr PARAMS ((tree, tree, tree)); extern tree finish_qualified_call_expr PARAMS ((tree, tree)); -extern tree finish_label_address_expr PARAMS ((tree)); extern tree finish_unary_op_expr PARAMS ((enum tree_code, tree)); extern tree finish_id_expr PARAMS ((tree)); extern void save_type_access_control PARAMS ((tree)); @@ -4337,11 +4300,10 @@ extern tree finish_typeof PARAMS ((tree)); extern void finish_decl_cleanup PARAMS ((tree, tree)); extern void finish_named_return_value PARAMS ((tree, tree)); extern void expand_body PARAMS ((tree)); -extern void prep_stmt PARAMS ((tree)); extern void do_pushlevel PARAMS ((void)); extern tree do_poplevel PARAMS ((void)); extern void finish_mem_initializers PARAMS ((tree)); - +extern void setup_vtbl_ptr PARAMS ((tree, tree)); extern void clear_out_block PARAMS ((void)); extern tree begin_global_stmt_expr PARAMS ((void)); extern tree finish_global_stmt_expr PARAMS ((tree)); @@ -4350,9 +4312,14 @@ extern tree finish_global_stmt_expr PARAMS ((tree)); /* in spew.c */ extern void init_spew PARAMS ((void)); extern int peekyylex PARAMS ((void)); -extern int yylex PARAMS ((void)); extern tree arbitrate_lookup PARAMS ((tree, tree, tree)); extern tree frob_opname PARAMS ((tree)); +extern void maybe_snarf_defarg PARAMS ((void)); +extern void add_defarg_fn PARAMS ((tree)); +extern void do_pending_defargs PARAMS ((void)); +extern void done_pending_defargs PARAMS ((void)); +extern void unprocessed_defarg_fn PARAMS ((tree)); +extern void replace_defarg PARAMS ((tree, tree)); /* in tree.c */ extern void init_tree PARAMS ((void)); @@ -4363,8 +4330,6 @@ extern int member_p PARAMS ((tree)); extern cp_lvalue_kind real_lvalue_p PARAMS ((tree)); extern tree build_min PARAMS ((enum tree_code, tree, ...)); extern tree build_min_nt PARAMS ((enum tree_code, ...)); -extern int lvalue_p PARAMS ((tree)); -extern int lvalue_or_else PARAMS ((tree, const char *)); extern tree build_cplus_new PARAMS ((tree, tree)); extern tree get_target_expr PARAMS ((tree)); extern tree break_out_calls PARAMS ((tree)); @@ -4390,8 +4355,7 @@ extern int promotes_to_aggr_type PARAMS ((tree, enum tree_code)); extern int is_aggr_type_2 PARAMS ((tree, tree)); extern const char *lang_printable_name PARAMS ((tree, int)); extern tree build_exception_variant PARAMS ((tree, tree)); -extern tree copy_template_template_parm PARAMS ((tree, tree)); -extern void print_lang_statistics PARAMS ((void)); +extern tree bind_template_template_parm PARAMS ((tree, tree)); extern tree array_type_nelts_total PARAMS ((tree)); extern tree array_type_nelts_top PARAMS ((tree)); extern tree break_out_target_exprs PARAMS ((tree)); @@ -4401,13 +4365,11 @@ extern tree decl_namespace_context PARAMS ((tree)); extern tree lvalue_type PARAMS ((tree)); extern tree error_type PARAMS ((tree)); extern tree build_ptr_wrapper PARAMS ((void *)); -extern tree build_expr_ptr_wrapper PARAMS ((void *)); extern tree build_int_wrapper PARAMS ((int)); extern tree build_srcloc_here PARAMS ((void)); extern int varargs_function_p PARAMS ((tree)); extern int really_overloaded_fn PARAMS ((tree)); extern int cp_tree_equal PARAMS ((tree, tree)); -extern int can_free PARAMS ((struct obstack *, tree)); extern tree no_linkage_check PARAMS ((tree)); extern void debug_binfo PARAMS ((tree)); extern tree build_dummy_object PARAMS ((tree)); @@ -4450,12 +4412,8 @@ extern int comp_except_specs PARAMS ((tree, tree, int)); extern int comptypes PARAMS ((tree, tree, int)); extern int comp_target_types PARAMS ((tree, tree, int)); extern int compparms PARAMS ((tree, tree)); -extern int comp_target_types PARAMS ((tree, tree, int)); extern int comp_cv_qualification PARAMS ((tree, tree)); extern int comp_cv_qual_signature PARAMS ((tree, tree)); -extern tree unsigned_type PARAMS ((tree)); -extern tree signed_type PARAMS ((tree)); -extern tree signed_or_unsigned_type PARAMS ((int, tree)); extern tree expr_sizeof PARAMS ((tree)); extern tree c_sizeof PARAMS ((tree)); extern tree c_sizeof_nowarn PARAMS ((tree)); @@ -4472,13 +4430,11 @@ extern tree build_array_ref PARAMS ((tree, tree)); extern tree build_x_function_call PARAMS ((tree, tree, tree)); extern tree get_member_function_from_ptrfunc PARAMS ((tree *, tree)); extern tree build_function_call_real PARAMS ((tree, tree, int, int)); -extern tree build_function_call PARAMS ((tree, tree)); extern tree build_function_call_maybe PARAMS ((tree, tree)); extern tree convert_arguments PARAMS ((tree, tree, tree, int)); extern tree build_x_binary_op PARAMS ((enum tree_code, tree, tree)); extern tree build_x_unary_op PARAMS ((enum tree_code, tree)); extern tree unary_complex_lvalue PARAMS ((enum tree_code, tree)); -extern int mark_addressable PARAMS ((tree)); extern tree build_x_conditional_expr PARAMS ((tree, tree, tree)); extern tree build_conditional_expr PARAMS ((tree, tree, tree)); extern tree build_x_compound_expr PARAMS ((tree)); @@ -4498,9 +4454,8 @@ extern int cp_type_quals PARAMS ((tree)); extern int cp_has_mutable_p PARAMS ((tree)); extern int at_least_as_qualified_p PARAMS ((tree, tree)); extern int more_qualified_p PARAMS ((tree, tree)); -extern tree build_ptrmemfunc1 PARAMS ((tree, tree, tree, tree, tree)); -extern void expand_ptrmemfunc_cst PARAMS ((tree, tree *, tree *, tree *, tree *)); -extern tree delta2_from_ptrmemfunc PARAMS ((tree)); +extern tree build_ptrmemfunc1 PARAMS ((tree, tree, tree)); +extern void expand_ptrmemfunc_cst PARAMS ((tree, tree *, tree *)); extern tree pfn_from_ptrmemfunc PARAMS ((tree)); extern tree type_after_usual_arithmetic_conversions PARAMS ((tree, tree)); extern tree composite_pointer_type PARAMS ((tree, tree, tree, tree, @@ -4514,7 +4469,6 @@ extern tree error_not_base_type PARAMS ((tree, tree)); extern tree binfo_or_else PARAMS ((tree, tree)); extern void readonly_error PARAMS ((tree, const char *, int)); extern int abstract_virtuals_error PARAMS ((tree, tree)); -extern void incomplete_type_error PARAMS ((tree, tree)); extern void friendly_abort PARAMS ((int, const char *, int, const char *)) ATTRIBUTE_NORETURN; @@ -4532,6 +4486,7 @@ extern tree build_m_component_ref PARAMS ((tree, tree)); extern tree build_functional_cast PARAMS ((tree, tree)); extern void check_for_new_type PARAMS ((const char *, flagged_type_tree)); extern tree add_exception_specifier PARAMS ((tree, tree, int)); +extern tree merge_exception_specifiers PARAMS ((tree, tree)); /* in xref.c */ extern void GNU_xref_begin PARAMS ((const char *)); @@ -4549,7 +4504,7 @@ extern void GNU_xref_member PARAMS ((tree, tree)); /* in mangle.c */ extern void init_mangle PARAMS ((void)); -extern tree mangle_decl PARAMS ((tree)); +extern void mangle_decl PARAMS ((tree)); extern const char *mangle_type_string PARAMS ((tree)); extern tree mangle_type PARAMS ((tree)); extern tree mangle_typeinfo_for_type PARAMS ((tree)); @@ -4566,4 +4521,4 @@ extern int cp_dump_tree PARAMS ((dump_info_p, tree)); /* -- end of C++ */ -#endif /* not _CP_TREE_H */ +#endif /* ! GCC_CP_TREE_H */