the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include "c-common.h"
+#include "function.h"
+#include "varray.h"
+
#ifndef _CP_TREE_H
#define _CP_TREE_H
TREE_INDIRECT_USING (in NAMESPACE_DECL).
IDENTIFIER_MARKED (used by search routines).
LOCAL_BINDING_P (in CPLUS_BINDING)
+ ICS_USER_FLAG (in _CONV)
+ CLEANUP_P (in TRY_BLOCK)
+ AGGR_INIT_VIA_CTOR_P (in AGGR_INIT_EXPR)
1: IDENTIFIER_VIRTUAL_P.
TI_PENDING_TEMPLATE_FLAG.
TEMPLATE_PARMS_FOR_INLINE.
DELETE_EXPR_USE_VEC (in DELETE_EXPR).
(TREE_CALLS_NEW) (in _EXPR or _REF) (commented-out).
TYPE_USES_COMPLEX_INHERITANCE (in _TYPE).
- C_DECLARED_LABEL_FLAG.
+ C_DECLARED_LABEL_FLAG (in LABEL_DECL)
INHERITED_VALUE_BINDING_P (in CPLUS_BINDING)
BASELINK_P (in TREE_LIST)
+ ICS_ELLIPSIS_FLAG (in _CONV)
2: IDENTIFIER_OPNAME_P.
BINFO_VBASE_MARKED.
BINFO_FIELDS_MARKED.
TYPE_VIRTUAL_P.
+ ICS_THIS_FLAG (in _CONV)
+ BINDING_HAS_LEVEL_P (In CPLUS_BINDING)
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)
4: BINFO_NEW_VTABLE_MARKED.
TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR,
or FIELD_DECL).
+ NEED_TEMPORARY_P (in REF_BIND, BASE_CONV)
5: Not used.
6: Not used.
1: C_TYPEDEF_EXPLICITLY_SIGNED (in TYPE_DECL).
DECL_TEMPLATE_INSTANTIATED (in a VAR_DECL or a FUNCTION_DECL)
2: DECL_THIS_EXTERN (in VAR_DECL or FUNCTION_DECL).
+ DECL_IMPLICIT_TYPEDEF_P (in a TYPE_DECL)
3: DECL_IN_AGGR_P.
4: DECL_MAYBE_TEMPLATE.
5: DECL_INTERFACE_KNOWN.
DECL_SAVED_INSNS/DECL_FIELD_SIZE
For a static VAR_DECL, this is DECL_INIT_PRIORITY.
-*/
+
+ BINFO_VIRTUALS
+ For a binfo, this is a TREE_LIST. The TREE_PURPOSE of each node
+ gives the amount by which to adjust the `this' pointer when
+ calling the function. The TREE_VALUE is the declaration for the
+ virtual function itself. When CLASSTYPE_COM_INTERFACE_P does not
+ hold, the first entry does not have a TREE_VALUE; it is just an
+ offset. */
/* Language-dependent contents of an identifier. */
typedef struct
{
char common[sizeof (struct tree_common)];
- struct rtx_def *rtl; /* Unused, but required to match up with what
- the middle-end expects. */
HOST_WIDE_INT index;
HOST_WIDE_INT level;
HOST_WIDE_INT orig_level;
typedef struct ptrmem_cst
{
char common[sizeof (struct tree_common)];
+ /* This isn't used, but the middle-end expects all constants to have
+ this field. */
+ struct rtx_def *rtl;
tree member;
}* ptrmem_cst_t;
BINDING_LEVEL is used instead. */
#define BINDING_SCOPE(NODE) (((struct tree_binding*)NODE)->scope.scope)
+/* Nonzero if NODE has BINDING_LEVEL, rather than BINDING_SCOPE. */
+#define BINDING_HAS_LEVEL_P(NODE) TREE_LANG_FLAG_2 ((NODE))
+
/* This is the declaration bound to the name. Possible values:
variable, overloaded function, namespace, template, enumerator. */
#define BINDING_VALUE(NODE) (((struct tree_binding*)NODE)->value)
indicating a particular base class, and whose TREE_VALUE is a
(possibly overloaded) function from that base class. */
#define BASELINK_P(NODE) \
- (TREE_CODE ((NODE)) == TREE_LIST && TREE_LANG_FLAG_1 ((NODE)))
+ (TREE_CODE (NODE) == TREE_LIST && TREE_LANG_FLAG_1 (NODE))
#define SET_BASELINK_P(NODE) \
- (TREE_LANG_FLAG_1 ((NODE)) = 1)
+ (TREE_LANG_FLAG_1 (NODE) = 1)
-#define WRAPPER_PTR(NODE) (((struct tree_wrapper*)NODE)->u.ptr)
-#define WRAPPER_INT(NODE) (((struct tree_wrapper*)NODE)->u.i)
+#define WRAPPER_PTR(NODE) (((struct tree_wrapper*)(NODE))->u.ptr)
+#define WRAPPER_INT(NODE) (((struct tree_wrapper*)(NODE))->u.i)
struct tree_wrapper
{
#define IDENTIFIER_VIRTUAL_P(NODE) TREE_LANG_FLAG_1(NODE)
-/* Nonzero if this identifier is the prefix for a mangled C++ operator name. */
+/* Nonzero if this identifier is the prefix for a mangled C++ operator
+ name. */
#define IDENTIFIER_OPNAME_P(NODE) TREE_LANG_FLAG_2(NODE)
/* Nonzero if this identifier is the name of a type-conversion
next exception handler. */
extern tree exception_throw_decl;
-extern tree double_type_node, long_double_type_node, float_type_node;
-extern tree char_type_node, unsigned_char_type_node, signed_char_type_node;
-extern tree ptrdiff_type_node;
-
-extern tree short_integer_type_node, short_unsigned_type_node;
-extern tree long_integer_type_node, long_unsigned_type_node;
-extern tree long_long_integer_type_node, long_long_unsigned_type_node;
-extern tree widest_integer_literal_type_node, widest_unsigned_literal_type_node;
-extern tree unsigned_type_node;
-extern tree string_type_node, char_array_type_node, int_array_type_node;
-extern tree wchar_array_type_node;
-extern tree wchar_type_node, signed_wchar_type_node, unsigned_wchar_type_node;
-
-extern tree complex_integer_type_node;
-extern tree complex_float_type_node;
-extern tree complex_double_type_node;
-extern tree complex_long_double_type_node;
-
-extern tree intQI_type_node, unsigned_intQI_type_node;
-extern tree intHI_type_node, unsigned_intHI_type_node;
-extern tree intSI_type_node, unsigned_intSI_type_node;
-extern tree intDI_type_node, unsigned_intDI_type_node;
-#if HOST_BITS_PER_WIDE_INT >= 64
-extern tree intTI_type_node, unsigned_intTI_type_node;
-#endif
+enum cp_tree_index
+{
+ CPTI_JAVA_BYTE_TYPE,
+ CPTI_JAVA_SHORT_TYPE,
+ CPTI_JAVA_INT_TYPE,
+ CPTI_JAVA_LONG_TYPE,
+ CPTI_JAVA_FLOAT_TYPE,
+ CPTI_JAVA_DOUBLE_TYPE,
+ CPTI_JAVA_CHAR_TYPE,
+ CPTI_JAVA_BOOLEAN_TYPE,
+
+ CPTI_VOID_ZERO,
+ CPTI_WCHAR_DECL,
+ CPTI_VTABLE_ENTRY_TYPE,
+ CPTI_DELTA_TYPE,
+
+ CPTI_TP_DESC_TYPE,
+ CPTI_ACCESS_MODE_TYPE,
+ CPTI_BLTN_DESC_TYPE,
+ CPTI_USER_DESC_TYPE,
+ CPTI_CLASS_DESC_TYPE,
+ CPTI_PTR_DESC_TYPE,
+ CPTI_ATTR_DESC_TYPE,
+ CPTI_FUNC_DESC_TYPE,
+ CPTI_PTMF_DESC_TYPE,
+ CPTI_PTMD_DESC_TYPE,
+
+ CPTI_CLASS_STAR_TYPE,
+ CPTI_CLASS_TYPE,
+ CPTI_RECORD_TYPE,
+ CPTI_UNION_TYPE,
+ CPTI_ENUM_TYPE,
+ CPTI_UNKNOWN_TYPE,
+ CPTI_VTBL_TYPE,
+ CPTI_VTBL_PTR_TYPE,
+ CPTI_STD,
+ CPTI_TYPE_INFO_TYPE,
+ CPTI_TINFO_FN_ID,
+ CPTI_TINFO_FN_TYPE,
+ CPTI_ABORT_FNDECL,
+ CPTI_GLOBAL_DELETE_FNDECL,
+
+ CPTI_ACCESS_DEFAULT,
+ CPTI_ACCESS_PUBLIC,
+ CPTI_ACCESS_PROTECTED,
+ CPTI_ACCESS_PRIVATE,
+ CPTI_ACCESS_DEFAULT_VIRTUAL,
+ CPTI_ACCESS_PUBLIC_VIRTUAL,
+ CPTI_ACCESS_PROTECTED_VIRTUAL,
+ CPTI_ACCESS_PRIVATE_VIRTUAL,
+
+ CPTI_CTOR_IDENTIFIER,
+ CPTI_DELTA2_IDENTIFIER,
+ CPTI_DELTA_IDENTIFIER,
+ CPTI_DTOR_IDENTIFIER,
+ CPTI_IN_CHARGE_IDENTIFIER,
+ CPTI_INDEX_IDENTIFIER,
+ CPTI_NELTS_IDENTIFIER,
+ CPTI_THIS_IDENTIFIER,
+ CPTI_PFN_IDENTIFIER,
+ CPTI_PFN_OR_DELTA2_IDENTIFIER,
+ CPTI_VPTR_IDENTIFIER,
+
+ CPTI_LANG_NAME_C,
+ CPTI_LANG_NAME_CPLUSPLUS,
+ CPTI_LANG_NAME_JAVA,
+
+ CPTI_EMPTY_EXCEPT_SPEC,
+ CPTI_NULL,
+ CPTI_JCLASS,
+ CPTI_MINUS_ONE,
+ CPTI_TERMINATE,
+
+ CPTI_MAX
+};
-extern tree java_byte_type_node;
-extern tree java_short_type_node;
-extern tree java_int_type_node;
-extern tree java_long_type_node;
-extern tree java_float_type_node;
-extern tree java_double_type_node;
-extern tree java_char_type_node;
-extern tree java_boolean_type_node;
-
-extern int current_function_returns_value;
-extern int current_function_returns_null;
-extern tree current_function_return_value;
+extern tree cp_global_trees[CPTI_MAX];
+
+#define java_byte_type_node cp_global_trees[CPTI_JAVA_BYTE_TYPE]
+#define java_short_type_node cp_global_trees[CPTI_JAVA_SHORT_TYPE]
+#define java_int_type_node cp_global_trees[CPTI_JAVA_INT_TYPE]
+#define java_long_type_node cp_global_trees[CPTI_JAVA_LONG_TYPE]
+#define java_float_type_node cp_global_trees[CPTI_JAVA_FLOAT_TYPE]
+#define java_double_type_node cp_global_trees[CPTI_JAVA_DOUBLE_TYPE]
+#define java_char_type_node cp_global_trees[CPTI_JAVA_CHAR_TYPE]
+#define java_boolean_type_node cp_global_trees[CPTI_JAVA_BOOLEAN_TYPE]
+
+#define void_zero_node cp_global_trees[CPTI_VOID_ZERO]
+#define wchar_decl_node cp_global_trees[CPTI_WCHAR_DECL]
+#define vtable_entry_type cp_global_trees[CPTI_VTABLE_ENTRY_TYPE]
+#define delta_type_node cp_global_trees[CPTI_DELTA_TYPE]
+#define __tp_desc_type_node cp_global_trees[CPTI_TP_DESC_TYPE]
+#define __access_mode_type_node cp_global_trees[CPTI_ACCESS_MODE_TYPE]
+#define __bltn_desc_type_node cp_global_trees[CPTI_BLTN_DESC_TYPE]
+#define __user_desc_type_node cp_global_trees[CPTI_USER_DESC_TYPE]
+#define __class_desc_type_node cp_global_trees[CPTI_CLASS_DESC_TYPE]
+#define __ptr_desc_type_node cp_global_trees[CPTI_PTR_DESC_TYPE]
+#define __attr_desc_type_node cp_global_trees[CPTI_ATTR_DESC_TYPE]
+#define __func_desc_type_node cp_global_trees[CPTI_FUNC_DESC_TYPE]
+#define __ptmf_desc_type_node cp_global_trees[CPTI_PTMF_DESC_TYPE]
+#define __ptmd_desc_type_node cp_global_trees[CPTI_PTMD_DESC_TYPE]
+#define class_star_type_node cp_global_trees[CPTI_CLASS_STAR_TYPE]
+#define class_type_node cp_global_trees[CPTI_CLASS_TYPE]
+#define record_type_node cp_global_trees[CPTI_RECORD_TYPE]
+#define union_type_node cp_global_trees[CPTI_UNION_TYPE]
+#define enum_type_node cp_global_trees[CPTI_ENUM_TYPE]
+#define unknown_type_node cp_global_trees[CPTI_UNKNOWN_TYPE]
+#define vtbl_type_node cp_global_trees[CPTI_VTBL_TYPE]
+#define vtbl_ptr_type_node cp_global_trees[CPTI_VTBL_PTR_TYPE]
+#define std_node cp_global_trees[CPTI_STD]
+#define type_info_type_node cp_global_trees[CPTI_TYPE_INFO_TYPE]
+#define tinfo_fn_id cp_global_trees[CPTI_TINFO_FN_ID]
+#define tinfo_fn_type cp_global_trees[CPTI_TINFO_FN_TYPE]
+#define abort_fndecl cp_global_trees[CPTI_ABORT_FNDECL]
+#define global_delete_fndecl cp_global_trees[CPTI_GLOBAL_DELETE_FNDECL]
+
+/* Define the sets of attributes that member functions and baseclasses
+ can have. These are sensible combinations of {public,private,protected}
+ cross {virtual,non-virtual}. */
+
+#define access_default_node cp_global_trees[CPTI_ACCESS_DEFAULT]
+#define access_public_node cp_global_trees[CPTI_ACCESS_PUBLIC]
+#define access_protected_node cp_global_trees[CPTI_ACCESS_PROTECTED]
+#define access_private_node cp_global_trees[CPTI_ACCESS_PRIVATE]
+#define access_default_virtual_node cp_global_trees[CPTI_ACCESS_DEFAULT_VIRTUAL]
+#define access_public_virtual_node cp_global_trees[CPTI_ACCESS_PUBLIC_VIRTUAL]
+#define access_protected_virtual_node cp_global_trees[CPTI_ACCESS_PROTECTED_VIRTUAL]
+#define access_private_virtual_node cp_global_trees[CPTI_ACCESS_PRIVATE_VIRTUAL]
+
+/* We cache these tree nodes so as to call get_identifier less
+ frequently. */
+
+#define ctor_identifier cp_global_trees[CPTI_CTOR_IDENTIFIER]
+#define delta2_identifier cp_global_trees[CPTI_DELTA2_IDENTIFIER]
+#define delta_identifier cp_global_trees[CPTI_DELTA_IDENTIFIER]
+#define dtor_identifier cp_global_trees[CPTI_DTOR_IDENTIFIER]
+#define in_charge_identifier cp_global_trees[CPTI_IN_CHARGE_IDENTIFIER]
+#define index_identifier cp_global_trees[CPTI_INDEX_IDENTIFIER]
+#define nelts_identifier cp_global_trees[CPTI_NELTS_IDENTIFIER]
+#define this_identifier cp_global_trees[CPTI_THIS_IDENTIFIER]
+#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]
+
+#define lang_name_c cp_global_trees[CPTI_LANG_NAME_C]
+#define lang_name_cplusplus cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS]
+#define lang_name_java cp_global_trees[CPTI_LANG_NAME_JAVA]
+
+/* Exception specifier used for throw(). */
+#define empty_except_spec cp_global_trees[CPTI_EMPTY_EXCEPT_SPEC]
+
+/* The node for `__null'. */
+#define null_node cp_global_trees[CPTI_NULL]
+
+/* 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]
+
+/* Global state. */
+
+struct saved_scope {
+ tree old_bindings;
+ tree old_namespace;
+ tree class_name;
+ tree class_type;
+ tree access_specifier;
+ varray_type lang_base;
+ tree *lang_stack;
+ tree lang_name;
+ tree x_function_parms;
+ tree template_parms;
+ tree x_previous_class_type;
+ tree x_previous_class_values;
+
+ HOST_WIDE_INT x_processing_template_decl;
+ int x_processing_specialization;
+ int x_processing_explicit_instantiation;
+
+ char *firstobj;
+
+ struct binding_level *class_bindings;
+
+ struct saved_scope *prev;
+};
+
+/* The current open namespace. */
+
+#define current_namespace scope_chain->old_namespace
+
+/* IDENTIFIER_NODE: name of current class */
+
+#define current_class_name scope_chain->class_name
+
+/* _TYPE: the type of the current class */
+
+#define current_class_type scope_chain->class_type
+
+/* When parsing a class definition, the access specifier most recently
+ given by the user, or, if no access specifier was given, the
+ default value appropriate for the kind of class (i.e., struct,
+ class, or union). */
+
+#define current_access_specifier scope_chain->access_specifier
+
+/* 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
+
+/* Parsing a function declarator leaves a list of parameter names
+ or a chain or parameter decls here. */
+
+#define current_function_parms scope_chain->x_function_parms
+#define current_template_parms scope_chain->template_parms
+
+#define processing_template_decl scope_chain->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). */
+
+#define previous_class_values scope_chain->x_previous_class_values
+
+/* The low-water mark on the class-cache obstack. */
+
+#define class_cache_firstobj scope_chain->firstobj
+
+extern struct saved_scope *scope_chain;
+
+/* Global state pertinent to the current function. */
+
+struct language_function
+{
+ tree x_named_labels;
+ tree x_ctor_label;
+ tree x_dtor_label;
+ tree x_base_init_list;
+ tree x_member_init_list;
+ tree x_base_init_expr;
+ tree x_current_class_ptr;
+ tree x_current_class_ref;
+ tree x_last_tree;
+ tree x_last_expr_type;
+
+ struct rtx_def *x_last_dtor_insn;
+ struct rtx_def *x_last_parm_cleanup_insn;
+ struct rtx_def *x_result_rtx;
+
+ int returns_value;
+ int returns_null;
+ int assigns_this;
+ int just_assigned_this;
+ int parms_stored;
+ int temp_name_counter;
+ int static_labelno;
+ int in_function_try_handler;
+ int expanding_p;
+ int stmts_are_full_exprs_p;
+
+ struct named_label_list *named_label_uses;
+ struct binding_level *binding_level;
+};
+
+/* The current C++-specific per-function global variables. */
+
+#define cp_function_chain (outer_function_chain->language)
+
+/* In a destructor, the point at which all derived class destroying
+ has been done, just before any base class destroying will be done. */
+
+#define dtor_label cp_function_chain->x_dtor_label
+
+/* In a constructor, the point at which we are ready to return
+ the pointer to the initialized object. */
+
+#define ctor_label cp_function_chain->x_ctor_label
+
+/* In C++, structures with well-defined constructors are initialized by
+ those constructors, unasked. CURRENT_BASE_INIT_LIST
+ holds a list of stmts for a BASE_INIT term in the grammar.
+ This list has one element for each base class which must be
+ initialized. The list elements are [basename, init], with
+ type basetype. This allows the possibly anachronistic form
+ (assuming d : a, b, c) "d (int a) : c(a+5), b (a-4), a (a+3)"
+ where each successive term can be handed down the constructor
+ line. Perhaps this was not intended. */
+
+#define current_base_init_list cp_function_chain->x_base_init_list
+#define current_member_init_list cp_function_chain->x_member_init_list
+
+/* Sequence of insns which represents base initialization. */
+
+#define base_init_expr cp_function_chain->x_base_init_expr
+
+/* When we're processing a member function, current_class_ptr is the
+ PARM_DECL for the `this' pointer. The current_class_ref is an
+ expression for `*this'. */
+
+#define current_class_ptr cp_function_chain->x_current_class_ptr
+#define current_class_ref cp_function_chain->x_current_class_ref
+
+/* When building a statement-tree, this is the last node added to the
+ tree. */
+
+#define last_tree cp_function_chain->x_last_tree
+
+/* The type of the last expression-statement we have seen. This is
+ required because the type of a statement-expression is the type of
+ the last expression statement. */
+
+#define last_expr_type cp_function_chain->x_last_expr_type
+
+/* Set to 0 at beginning of a function definition, set to 1 if
+ a return statement that specifies a return value is seen. */
+
+#define current_function_returns_value cp_function_chain->returns_value
-extern tree current_namespace;
+/* Set to 0 at beginning of a function definition, set to 1 if
+ a return statement with no argument is seen. */
+
+#define current_function_returns_null cp_function_chain->returns_null
+
+#define current_function_just_assigned_this \
+ cp_function_chain->just_assigned_this
+
+#define current_function_parms_stored \
+ cp_function_chain->parms_stored
+
+/* Used to help generate temporary names which are unique within
+ a function. Reset to 0 by start_function. */
+
+#define temp_name_counter cp_function_chain->temp_name_counter
+
+#define static_labelno cp_function_chain->static_labelno
+
+/* Non-zero if we should generate RTL for functions that we process.
+ When this is zero, we just accumulate tree structure, without
+ interacting with the back end. */
+
+#define expanding_p cp_function_chain->expanding_p
+
+/* Non-zero if we should treat statements as full expressions. In
+ particular, this variable is no-zero if at the end of a statement
+ we should destroy any temporaries created during that statement.
+ Similarly, if, at the end of a block, we should destroy any local
+ variables in this block. Normally, this variable is non-zero,
+ since those are the normal semantics of C++.
+
+ However, in order to represent aggregate initialization code as
+ tree structure, we use statement-expressions. The statements
+ within the statement expression should not result in cleanups being
+ run until the entire enclosing statement is complete. */
+
+#define stmts_are_full_exprs_p cp_function_chain->stmts_are_full_exprs_p
+
+#define in_function_try_handler cp_function_chain->in_function_try_handler
+
+extern tree current_function_return_value;
extern tree global_namespace;
extern tree ridpointers[];
extern tree ansi_opname[];
extern tree ansi_assopname[];
+extern tree null_pointer_node;
/* Nonzero means `$' can be in an identifier. */
extern int flag_signed_bitfields;
-/* 3 means write out only virtuals function tables `defined'
- in this implementation file.
- 2 means write out only specific virtual function tables
- and give them (C) public access.
- 1 means write out virtual function tables and give them
- (C) public access.
- 0 means write out virtual function tables and give them
- (C) static access (default).
- -1 means declare virtual function tables extern. */
-
-extern int write_virtuals;
-
/* True for more efficient but incompatible (not fully tested)
vtable implementation (using thunks).
0 is old behavior; 1 is new behavior. */
extern int flag_ansi;
-/* Nonzero means recognize and handle signature language constructs. */
-
-extern int flag_handle_signatures;
-
/* Nonzero means that member functions defined in class scope are
inline by default. */
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;
+
/* Nonzero if we want to issue diagnostics that the standard says are not
required. */
extern int flag_optional_diags;
extern int flag_access_control;
+/* If this variable is defined to a non-NULL value, it will be called
+ after the file has been completely parsed. The argument will be
+ the GLOBAL_NAMESPACE. */
+
+extern void (*back_end_hook) PROTO((tree));
+
\f
/* C++ language-specific tree codes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
#define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE)))
/* Nonzero if T is a class (or struct or union) type. Also nonzero
- for template type parameters and typename types. Despite its name,
+ for template type parameters, typename types, and instantiated
+ template template parameters. Despite its name,
this macro has nothing to do with the definition of aggregate given
in the standard. Think of this macro as MAYBE_CLASS_TYPE_P. */
#define IS_AGGR_TYPE(t) \
- (TREE_CODE (t) == TEMPLATE_TYPE_PARM \
- || TREE_CODE (t) == TYPENAME_TYPE \
+ (TREE_CODE (t) == TEMPLATE_TYPE_PARM \
+ || TREE_CODE (t) == TYPENAME_TYPE \
|| TREE_CODE (t) == TYPEOF_TYPE \
+ || (TREE_CODE (t) == TEMPLATE_TEMPLATE_PARM \
+ && TYPE_TEMPLATE_INFO (t)) \
|| TYPE_LANG_FLAG_5 (t))
/* Set IS_AGGR_TYPE for T to VAL. T must be a class, struct, or
#define IS_AGGR_TYPE_CODE(t) (t == RECORD_TYPE || t == UNION_TYPE)
#define IS_AGGR_TYPE_2(TYPE1,TYPE2) \
(TREE_CODE (TYPE1) == TREE_CODE (TYPE2) \
- && IS_AGGR_TYPE (TYPE1)&IS_AGGR_TYPE (TYPE2))
+ && IS_AGGR_TYPE (TYPE1) && IS_AGGR_TYPE (TYPE2))
#define IS_OVERLOAD_TYPE(t) \
(IS_AGGR_TYPE (t) || TREE_CODE (t) == ENUMERAL_TYPE)
a minimum. */
struct lang_type
{
- struct
- {
- unsigned has_type_conversion : 1;
- unsigned has_init_ref : 1;
- unsigned has_default_ctor : 1;
- unsigned uses_multiple_inheritance : 1;
- unsigned const_needs_init : 1;
- unsigned ref_needs_init : 1;
- unsigned has_const_assign_ref : 1;
- unsigned anon_aggr : 1;
-
- unsigned has_nonpublic_ctor : 2;
- unsigned has_nonpublic_assign_ref : 2;
- unsigned vtable_needs_writing : 1;
- unsigned has_assign_ref : 1;
- unsigned gets_new : 2;
-
- unsigned gets_delete : 2;
- unsigned has_call_overloaded : 1;
- unsigned has_array_ref_overloaded : 1;
- unsigned has_arrow_overloaded : 1;
- unsigned interface_only : 1;
- unsigned interface_unknown : 1;
- unsigned needs_virtual_reinit : 1;
-
- unsigned marks: 6;
- unsigned vec_delete_takes_size : 1;
- unsigned declared_class : 1;
-
- unsigned being_defined : 1;
- unsigned redefined : 1;
- unsigned debug_requested : 1;
- unsigned use_template : 2;
- unsigned got_semicolon : 1;
- unsigned ptrmemfunc_flag : 1;
- unsigned is_signature : 1;
-
- unsigned is_signature_pointer : 1;
- unsigned is_signature_reference : 1;
- unsigned has_opaque_typedecls : 1;
- unsigned sigtable_has_been_generated : 1;
- unsigned was_anonymous : 1;
- unsigned has_real_assign_ref : 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 is_partial_instantiation : 1;
- unsigned has_mutable : 1;
- unsigned com_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 so, make sure to copy it in instantiate_class_template! */
-
- /* The MIPS compiler gets it wrong if this struct also
- does not fill out to a multiple of 4 bytes. Add a
- member `dummy' with new bits if you go over the edge. */
- unsigned dummy : 10;
- } type_flags;
+ unsigned char align;
+ unsigned has_type_conversion : 1;
+ unsigned has_init_ref : 1;
+ unsigned has_default_ctor : 1;
+ unsigned uses_multiple_inheritance : 1;
+ unsigned const_needs_init : 1;
+ unsigned ref_needs_init : 1;
+ unsigned has_const_assign_ref : 1;
+ unsigned anon_aggr : 1;
+
+ unsigned has_nonpublic_ctor : 2;
+ unsigned has_nonpublic_assign_ref : 2;
+ unsigned vtable_needs_writing : 1;
+ unsigned has_assign_ref : 1;
+ unsigned gets_new : 2;
+
+ unsigned gets_delete : 2;
+ unsigned has_call_overloaded : 1;
+ unsigned has_array_ref_overloaded : 1;
+ unsigned has_arrow_overloaded : 1;
+ unsigned interface_only : 1;
+ unsigned interface_unknown : 1;
+ unsigned needs_virtual_reinit : 1;
+
+ unsigned marks: 6;
+ unsigned vec_delete_takes_size : 1;
+ unsigned declared_class : 1;
+
+ unsigned being_defined : 1;
+ unsigned redefined : 1;
+ unsigned debug_requested : 1;
+ unsigned use_template : 2;
+ unsigned got_semicolon : 1;
+ unsigned ptrmemfunc_flag : 1;
+ unsigned was_anonymous : 1;
+
+ unsigned has_real_assign_ref : 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 is_partial_instantiation : 1;
+ unsigned has_mutable : 1;
+
+ unsigned com_interface : 1;
+ unsigned non_pod_class : 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
+ so, make sure to copy it in instantiate_class_template! */
+
+ /* There are six bits left to fill out a 32-bit word. Keep track of
+ this by updating the size of this bitfield whenever you add or
+ remove a flag. */
+ unsigned dummy : 6;
+
int vsize;
int vfield_parent;
union tree_node *search_slot;
- unsigned char align;
- /* Room for another three unsigned chars. */
-
union tree_node *size;
union tree_node *abstract_virtuals;
union tree_node *methods;
- union tree_node *signature;
- union tree_node *signature_pointer_to;
- union tree_node *signature_reference_to;
union tree_node *template_info;
tree befriending_classes;
};
1=implicit template instantiation
2=explicit template specialization
3=explicit template instantiation */
-#define CLASSTYPE_USE_TEMPLATE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.use_template)
+#define CLASSTYPE_USE_TEMPLATE(NODE) (TYPE_LANG_SPECIFIC(NODE)->use_template)
/* Fields used for storing information before the class is defined.
After the class is defined, these fields hold other information. */
/* Nonzero for _CLASSTYPE means that operator new and delete are defined,
respectively. */
-#define TYPE_GETS_NEW(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_new)
-#define TYPE_GETS_DELETE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_delete)
+#define TYPE_GETS_NEW(NODE) (TYPE_LANG_SPECIFIC(NODE)->gets_new)
+#define TYPE_GETS_DELETE(NODE) (TYPE_LANG_SPECIFIC(NODE)->gets_delete)
#define TYPE_GETS_REG_DELETE(NODE) (TYPE_GETS_DELETE (NODE) & 1)
/* Nonzero for _CLASSTYPE means that operator vec delete is defined and
takes the optional size_t argument. */
#define TYPE_VEC_DELETE_TAKES_SIZE(NODE) \
- (TYPE_LANG_SPECIFIC(NODE)->type_flags.vec_delete_takes_size)
+ (TYPE_LANG_SPECIFIC(NODE)->vec_delete_takes_size)
#define TYPE_VEC_NEW_USES_COOKIE(NODE) \
(TYPE_NEEDS_DESTRUCTOR (NODE) \
|| (TYPE_LANG_SPECIFIC (NODE) && TYPE_VEC_DELETE_TAKES_SIZE (NODE)))
/* Nonzero means that this _CLASSTYPE node defines ways of converting
itself to other types. */
-#define TYPE_HAS_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_type_conversion)
+#define TYPE_HAS_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_type_conversion)
/* Nonzero means that this _CLASSTYPE node overloads operator=(X&). */
-#define TYPE_HAS_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_assign_ref)
-#define TYPE_HAS_CONST_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_const_assign_ref)
+#define TYPE_HAS_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_assign_ref)
+#define TYPE_HAS_CONST_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_const_assign_ref)
/* Nonzero means that this _CLASSTYPE node has an X(X&) constructor. */
-#define TYPE_HAS_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_init_ref)
-#define TYPE_HAS_CONST_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_const_init_ref)
+#define TYPE_HAS_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_init_ref)
+#define TYPE_HAS_CONST_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_const_init_ref)
/* Nonzero means that this type is being defined. I.e., the left brace
starting the definition of this type has been seen. */
-#define TYPE_BEING_DEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.being_defined)
+#define TYPE_BEING_DEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->being_defined)
/* Nonzero means that this type has been redefined. In this case, if
convenient, don't reprocess any methods that appear in its redefinition. */
-#define TYPE_REDEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.redefined)
-
-/* Nonzero means that this type is a signature. */
-# define IS_SIGNATURE(NODE) (TYPE_LANG_SPECIFIC(NODE)?TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature:0)
-# define SET_SIGNATURE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature=1)
-# define CLEAR_SIGNATURE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature=0)
-
-/* Nonzero means that this type is a signature pointer type. */
-# define IS_SIGNATURE_POINTER(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature_pointer)
-
-/* Nonzero means that this type is a signature reference type. */
-# define IS_SIGNATURE_REFERENCE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature_reference)
-
-/* Nonzero means that this signature contains opaque type declarations. */
-#define SIGNATURE_HAS_OPAQUE_TYPEDECLS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_opaque_typedecls)
-
-/* Nonzero means that a signature table has been generated
- for this signature. */
-#define SIGTABLE_HAS_BEEN_GENERATED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.sigtable_has_been_generated)
-
-/* If NODE is a class, this is the signature type that contains NODE's
- signature after it has been computed using sigof(). */
-#define CLASSTYPE_SIGNATURE(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature)
-
-/* If NODE is a signature pointer or signature reference, this is the
- signature type the pointer/reference points to. */
-#define SIGNATURE_TYPE(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature)
-
-/* If NODE is a signature, this is a vector of all methods defined
- in the signature or in its base types together with their default
- implementations. */
-#define SIGNATURE_METHOD_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature)
-
-/* If NODE is a signature, this is the _TYPE node that contains NODE's
- signature pointer type. */
-#define SIGNATURE_POINTER_TO(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature_pointer_to)
-
-/* If NODE is a signature, this is the _TYPE node that contains NODE's
- signature reference type. */
-#define SIGNATURE_REFERENCE_TO(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature_reference_to)
+#define TYPE_REDEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->redefined)
/* The is the basetype that contains NODE's rtti. */
#define CLASSTYPE_RTTI(NODE) (TYPE_LANG_SPECIFIC(NODE)->rtti)
/* Nonzero means that this _CLASSTYPE node overloads operator(). */
-#define TYPE_OVERLOADS_CALL_EXPR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_call_overloaded)
+#define TYPE_OVERLOADS_CALL_EXPR(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_call_overloaded)
/* Nonzero means that this _CLASSTYPE node overloads operator[]. */
-#define TYPE_OVERLOADS_ARRAY_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_array_ref_overloaded)
+#define TYPE_OVERLOADS_ARRAY_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_array_ref_overloaded)
/* Nonzero means that this _CLASSTYPE node overloads operator->. */
-#define TYPE_OVERLOADS_ARROW(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_arrow_overloaded)
+#define TYPE_OVERLOADS_ARROW(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_arrow_overloaded)
/* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
multiple inheritance. If this is 0 for the root of a type
hierarchy, then we can use more efficient search techniques. */
-#define TYPE_USES_MULTIPLE_INHERITANCE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.uses_multiple_inheritance)
+#define TYPE_USES_MULTIPLE_INHERITANCE(NODE) (TYPE_LANG_SPECIFIC(NODE)->uses_multiple_inheritance)
/* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
virtual base classes. If this is 0 for the root of a type
/* Get the value of the Nth mark bit. */
#define CLASSTYPE_MARKED_N(NODE, N) \
- (((CLASS_TYPE_P (NODE) ? TYPE_LANG_SPECIFIC (NODE)->type_flags.marks \
+ (((CLASS_TYPE_P (NODE) ? TYPE_LANG_SPECIFIC (NODE)->marks \
: TYPE_ALIAS_SET (NODE)) & (1 << N)) != 0)
/* Set the Nth mark bit. */
#define SET_CLASSTYPE_MARKED_N(NODE, N) \
(CLASS_TYPE_P (NODE) \
- ? (TYPE_LANG_SPECIFIC (NODE)->type_flags.marks |= (1 << (N))) \
+ ? (TYPE_LANG_SPECIFIC (NODE)->marks |= (1 << (N))) \
: (TYPE_ALIAS_SET (NODE) |= (1 << (N))))
/* Clear the Nth mark bit. */
#define CLEAR_CLASSTYPE_MARKED_N(NODE, N) \
(CLASS_TYPE_P (NODE) \
- ? (TYPE_LANG_SPECIFIC (NODE)->type_flags.marks &= ~(1 << (N))) \
+ ? (TYPE_LANG_SPECIFIC (NODE)->marks &= ~(1 << (N))) \
: (TYPE_ALIAS_SET (NODE) &= ~(1 << (N))))
/* Get the value of the mark bits. */
#define CLASSTYPE_ABSTRACT_VIRTUALS(NODE) (TYPE_LANG_SPECIFIC(NODE)->abstract_virtuals)
/* Nonzero means that this aggr type has been `closed' by a semicolon. */
-#define CLASSTYPE_GOT_SEMICOLON(NODE) (TYPE_LANG_SPECIFIC (NODE)->type_flags.got_semicolon)
+#define CLASSTYPE_GOT_SEMICOLON(NODE) (TYPE_LANG_SPECIFIC (NODE)->got_semicolon)
/* Nonzero means that the main virtual function table pointer needs to be
set because base constructors have placed the wrong value there.
If this is zero, it means that they placed the right value there,
and there is no need to change it. */
-#define CLASSTYPE_NEEDS_VIRTUAL_REINIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.needs_virtual_reinit)
+#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)->type_flags.vtable_needs_writing)
+#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)->type_flags.has_default_ctor)
+#define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_default_ctor)
/* Nonzero means the type declared a ctor as private or protected. We
use this to make sure we don't try to generate a copy ctor for a
class that has a member of type NODE. */
-#define TYPE_HAS_NONPUBLIC_CTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_nonpublic_ctor)
+#define TYPE_HAS_NONPUBLIC_CTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_nonpublic_ctor)
/* Ditto, for operator=. */
-#define TYPE_HAS_NONPUBLIC_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_nonpublic_assign_ref)
+#define TYPE_HAS_NONPUBLIC_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_nonpublic_assign_ref)
/* Nonzero means that this type contains a mutable member */
-#define CLASSTYPE_HAS_MUTABLE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_mutable)
+#define CLASSTYPE_HAS_MUTABLE(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_mutable)
#define TYPE_HAS_MUTABLE_P(NODE) (cp_has_mutable_p (NODE))
+/* Nonzero means that this class type is a non-POD class. */
+#define CLASSTYPE_NON_POD_P(NODE) (TYPE_LANG_SPECIFIC (NODE)->non_pod_class)
+
/* Nonzero means that this type is meant for communication via COM. */
#define CLASSTYPE_COM_INTERFACE(NODE) \
- (TYPE_LANG_SPECIFIC(NODE)->type_flags.com_interface)
+ (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
(TYPE_LANG_SPECIFIC (NODE)->befriending_classes)
/* Say whether this node was declared as a "class" or a "struct". */
-#define CLASSTYPE_DECLARED_CLASS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.declared_class)
+#define CLASSTYPE_DECLARED_CLASS(NODE) (TYPE_LANG_SPECIFIC(NODE)->declared_class)
/* Nonzero if this class has const members which have no specified initialization. */
-#define CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.const_needs_init)
+#define CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->const_needs_init)
/* Nonzero if this class has ref members which have no specified initialization. */
-#define CLASSTYPE_REF_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.ref_needs_init)
+#define CLASSTYPE_REF_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->ref_needs_init)
/* Nonzero if this class is included from a header file which employs
`#pragma interface', and it is not included in its implementation file. */
-#define CLASSTYPE_INTERFACE_ONLY(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_only)
+#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)->type_flags.interface_unknown)
-#define CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown == 0)
-#define SET_CLASSTYPE_INTERFACE_UNKNOWN_X(NODE,X) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = !!(X))
-#define SET_CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = 1)
-#define SET_CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = 0)
+#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)
/* Nonzero if a _DECL node requires us to output debug info for this class. */
-#define CLASSTYPE_DEBUG_REQUESTED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.debug_requested)
+#define CLASSTYPE_DEBUG_REQUESTED(NODE) (TYPE_LANG_SPECIFIC(NODE)->debug_requested)
\f
/* Additional macros for inheritance information. */
/* 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,
- equivalently, no throw specification. */
+ will be NULL_TREE to indicate a throw specification of `()', or
+ no exceptions allowed. */
#define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_NONCOPIED_PARTS (NODE)
/* For FUNCTION_TYPE or METHOD_TYPE, return 1 iff it is declared `throw()'. */
\f
/* If a DECL has DECL_LANG_SPECIFIC, it is either a lang_decl_flags or
- a lang_decl (which has lang_decl_flags as its initial prefix). A
- FUNCTION_DECL, NAMESPACE_DECL, TYPE_DECL, or USING_DECL may have a
- full lang_decl. A FIELD_DECL, or a static data member VAR_DECL,
- will have only lang_decl_flags. Thus, one should only access the
- members of lang_decl that are not in lang_decl_flags for DECLs that
- are not FIELD_DECLs or VAR_DECLs. */
+ a lang_decl (which has lang_decl_flags as its initial prefix).
+ This macro is nonzero for tree nodes whose DECL_LANG_SPECIFIC is
+ the full lang_decl, and not just lang_decl_flags. */
+#define CAN_HAVE_FULL_LANG_DECL_P(NODE) \
+ (!(TREE_CODE ((NODE)) == VAR_DECL \
+ || TREE_CODE ((NODE)) == CONST_DECL \
+ || TREE_CODE ((NODE)) == FIELD_DECL \
+ || TREE_CODE ((NODE)) == USING_DECL))
struct lang_decl_flags
{
unsigned static_function : 1;
unsigned const_memfunc : 1;
unsigned volatile_memfunc : 1;
-
unsigned abstract_virtual : 1;
- unsigned permanent_attr : 1 ;
unsigned constructor_for_vbase_attr : 1;
+
unsigned mutable_flag : 1;
- unsigned is_default_implementation : 1;
unsigned saved_inline : 1;
unsigned use_template : 2;
-
unsigned nonconverting : 1;
unsigned declared_inline : 1;
unsigned not_really_extern : 1;
unsigned needs_final_overrider : 1;
+
unsigned bitfield : 1;
unsigned defined_in_class : 1;
- unsigned dummy : 4;
+ unsigned dummy : 6;
tree access;
tree context;
- /* In a template FUNCTION_DECL, this is DECL_SAVED_TREE.
- In a non-template FUNCTION_DECL, this is DECL_MEMFUNC_POINTER_TO.
- In a FIELD_DECL, this is DECL_MEMFUNC_POINTING_TO. */
- tree memfunc_pointer_to;
-
union {
- /* In a FUNCTION_DECL, this is DECL_TEMPLATE_INFO. */
+ /* In a FUNCTION_DECL or a VAR_DECL, this is DECL_TEMPLATE_INFO. */
tree template_info;
/* In a NAMESPACE_DECL, this is NAMESPACE_LEVEL. */
tree main_decl_variant;
tree befriending_classes;
- struct pending_inline *pending_inline_info;
+
+ /* In a FUNCTION_DECL, this is DECL_SAVED_TREE. */
+ tree saved_tree;
+
+ union
+ {
+ tree sorted_fields;
+ struct pending_inline *pending_inline_info;
+ } u;
};
/* Non-zero if NODE is a _DECL with TREE_READONLY set. */
(DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (NODE)) \
&& DECL_LANGUAGE (NODE) == lang_cplusplus)
+/* Non-zero if NODE is a user-defined conversion operator. */
#define DECL_CONV_FN_P(NODE) \
(IDENTIFIER_TYPENAME_P (DECL_NAME (NODE)) && TREE_TYPE (DECL_NAME (NODE)))
+/* Non-zero if NODE is an overloaded operator. */
+#define DECL_OVERLOADED_OPERATOR_P(NODE) \
+ (IDENTIFIER_OPNAME_P (DECL_NAME ((NODE))))
+
/* For FUNCTION_DECLs: nonzero means that this function is a constructor
for an object with virtual baseclasses. */
#define DECL_CONSTRUCTOR_FOR_VBASE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_for_vbase_attr)
#define SET_DECL_TINFO_FN_P(NODE) \
(DECL_LANG_SPECIFIC((NODE))->decl_flags.mutable_flag = 1)
-/* For FUNCTION_DECLs: nonzero means that this function is a default
- implementation of a signature method. */
-#define IS_DEFAULT_IMPLEMENTATION(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.is_default_implementation)
-
/* Nonzero for _DECL means that this decl appears in (or will appear
in) as a member in a RECORD_TYPE or UNION_TYPE node. It is also for
detecting circularity in case members are multiply defined. In the
must be overridden by derived classes. */
#define DECL_NEEDS_FINAL_OVERRIDER_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.needs_final_overrider)
-/* Nonzero if allocated on permanent_obstack. */
-#define LANG_DECL_PERMANENT(LANGDECL) ((LANGDECL)->decl_flags.permanent_attr)
-
/* The _TYPE context in which this _DECL appears. This field holds the
class where a virtual function instance is actually defined, and the
lexical scope of a friend function defined in a class body. */
(DECL_CONTEXT (NODE) ? DECL_CONTEXT (NODE) : global_namespace)
#define FROB_CONTEXT(NODE) ((NODE) == global_namespace ? NULL_TREE : (NODE))
+/* For a virtual function, the base where we find its vtable entry.
+ For a non-virtual function, the base where it is defined. */
+#define DECL_VIRTUAL_CONTEXT(NODE) DECL_CONTEXT (NODE)
+
/* 1 iff NODE has namespace scope, including the global namespace. */
#define DECL_NAMESPACE_SCOPE_P(NODE) \
(DECL_CONTEXT (NODE) == NULL_TREE \
/* For a FUNCTION_DECL: if this function was declared inline inside of
a class declaration, this is where the text for the function is
squirreled away. */
-#define DECL_PENDING_INLINE_INFO(NODE) (DECL_LANG_SPECIFIC(NODE)->pending_inline_info)
+#define DECL_PENDING_INLINE_INFO(NODE) (DECL_LANG_SPECIFIC(NODE)->u.pending_inline_info)
+
+/* For a TYPE_DECL: if this function has many fields, we'll sort them
+ and put them into a TREE_VEC. */
+#define DECL_SORTED_FIELDS(NODE) (DECL_LANG_SPECIFIC(NODE)->u.sorted_fields)
/* True if on the saved_inlines (see decl2.c) list. */
#define DECL_SAVED_INLINE(DECL) \
(DECL_LANG_SPECIFIC(DECL)->decl_flags.saved_inline)
-/* For a FUNCTION_DECL: if this function was declared inside a signature
- declaration, this is the corresponding member function pointer that was
- created for it. */
-#define DECL_MEMFUNC_POINTER_TO(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.memfunc_pointer_to)
-
-/* For a FIELD_DECL: this points to the signature member function from
- which this signature member function pointer was created. */
-#define DECL_MEMFUNC_POINTING_TO(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.memfunc_pointer_to)
-
/* For a VAR_DECL or FUNCTION_DECL: template-specific information. */
#define DECL_TEMPLATE_INFO(NODE) \
(DECL_LANG_SPECIFIC(NODE)->decl_flags.u.template_info)
/* In a template FUNCTION_DECL, the tree structure that will be
substituted into to obtain instantiations. */
-#define DECL_SAVED_TREE(NODE) DECL_MEMFUNC_POINTER_TO (NODE)
+#define DECL_SAVED_TREE(NODE) \
+ (DECL_LANG_SPECIFIC ((NODE))->saved_tree)
#define COMPOUND_STMT_NO_SCOPE(NODE) TREE_LANG_FLAG_0 (NODE)
#define NEW_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
#define DELETE_EXPR_USE_VEC(NODE) TREE_LANG_FLAG_1 (NODE)
#define LOOKUP_EXPR_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
+/* Nonzero if this AGGR_INIT_EXPR provides for initialization via a
+ constructor call, rather than an ordinary function call. */
+#define AGGR_INIT_VIA_CTOR_P(NODE) TREE_LANG_FLAG_0 (NODE)
+
/* The TYPE_MAIN_DECL for a class template type is a TYPE_DECL, not a
TEMPLATE_DECL. This macro determines whether or not a given class
type is really a template type, as opposed to an instantiation or
#define IMPLICIT_TYPENAME_P(NODE) \
(TREE_CODE (NODE) == TYPENAME_TYPE && TREE_TYPE (NODE))
+/* Nonzero if NODE is a TYPE_DECL that should not be visible because
+ it is from a dependent base class. */
+#define IMPLICIT_TYPENAME_TYPE_DECL_P(NODE) \
+ (TREE_CODE (NODE) == TYPE_DECL \
+ && DECL_ARTIFICIAL (NODE) \
+ && IMPLICIT_TYPENAME_P (TREE_TYPE (NODE)))
+
/* Nonzero in INTEGER_CST means that this int is negative by dint of
using a twos-complement negated operand. */
#define TREE_NEGATED_INT(NODE) (TREE_LANG_FLAG_0 (NODE))
#define SET_DECL_C_BIT_FIELD(NODE) \
(DECL_LANG_SPECIFIC (NODE)->decl_flags.bitfield = 1)
-/* Nonzero if the type T promotes to itself.
- ANSI C states explicitly the list of types that promote;
- in particular, short promotes to int even if they have the same width. */
-#define C_PROMOTING_INTEGER_TYPE_P(t) \
- (TREE_CODE ((t)) == INTEGER_TYPE \
- && (TYPE_MAIN_VARIANT (t) == char_type_node \
- || TYPE_MAIN_VARIANT (t) == signed_char_type_node \
- || TYPE_MAIN_VARIANT (t) == unsigned_char_type_node \
- || TYPE_MAIN_VARIANT (t) == short_integer_type_node \
- || TYPE_MAIN_VARIANT (t) == short_unsigned_type_node))
-
#define INTEGRAL_CODE_P(CODE) \
(CODE == INTEGER_TYPE || CODE == ENUMERAL_TYPE || CODE == BOOLEAN_TYPE)
-#define ARITHMETIC_TYPE_P(TYPE) (INTEGRAL_TYPE_P (TYPE) || FLOAT_TYPE_P (TYPE))
+
+/* [basic.fundamental]
+
+ Types bool, char, wchar_t, and the signed and unsigned integer types
+ are collectively called integral types.
+
+ Note that INTEGRAL_TYPE_P, as defined in tree.h, allows enumeration
+ types as well, which is incorrect in C++. */
+#define CP_INTEGRAL_TYPE_P(TYPE) \
+ (TREE_CODE ((TYPE)) == BOOLEAN_TYPE \
+ || TREE_CODE ((TYPE)) == INTEGER_TYPE)
+
+/* [basic.fundamental]
+
+ Integral and floating types are collectively called arithmetic
+ types. */
+#define ARITHMETIC_TYPE_P(TYPE) \
+ (CP_INTEGRAL_TYPE_P (TYPE) || TREE_CODE (TYPE) == REAL_TYPE)
/* Mark which labels are explicitly declared.
These may be shadowed, and may be referenced from nested functions. */
/* Nonzero for _TYPE means that the _TYPE defines a destructor. */
#define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2(NODE))
-#if 0
-/* Nonzero for _TYPE node means that creating an object of this type
- will involve a call to a constructor. This can apply to objects
- of ARRAY_TYPE if the type of the elements needs a constructor. */
-#define TYPE_NEEDS_CONSTRUCTING(NODE) ... defined in ../tree.h ...
-#endif
-
/* Nonzero means that an object of this type can not be initialized using
an initializer list. */
#define CLASSTYPE_NON_AGGREGATE(NODE) \
- (TYPE_LANG_SPECIFIC (NODE)->type_flags.non_aggregate)
+ (TYPE_LANG_SPECIFIC (NODE)->non_aggregate)
#define TYPE_NON_AGGREGATE_CLASS(NODE) \
(IS_AGGR_TYPE (NODE) && CLASSTYPE_NON_AGGREGATE (NODE))
/* Nonzero if there is a user-defined X::op=(x&) for this class. */
-#define TYPE_HAS_REAL_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_real_assign_ref)
-#define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_complex_assign_ref)
-#define TYPE_HAS_ABSTRACT_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_abstract_assign_ref)
-#define TYPE_HAS_COMPLEX_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_complex_init_ref)
+#define TYPE_HAS_REAL_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_real_assign_ref)
+#define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_complex_assign_ref)
+#define TYPE_HAS_ABSTRACT_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_abstract_assign_ref)
+#define TYPE_HAS_COMPLEX_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_complex_init_ref)
/* Nonzero for _TYPE node means that destroying an object of this type
will involve a call to a destructor. This can apply to objects
/* Nonzero for _TYPE node means that this type is a pointer to member
function type. */
-#define TYPE_PTRMEMFUNC_P(NODE) \
- (TREE_CODE(NODE) == RECORD_TYPE && TYPE_PTRMEMFUNC_FLAG (NODE))
+#define TYPE_PTRMEMFUNC_P(NODE) \
+ (TREE_CODE(NODE) == RECORD_TYPE \
+ && TYPE_LANG_SPECIFIC(NODE) \
+ && TYPE_PTRMEMFUNC_FLAG (NODE))
+
#define TYPE_PTRMEMFUNC_FLAG(NODE) \
- (TYPE_LANG_SPECIFIC(NODE)->type_flags.ptrmemfunc_flag)
+ (TYPE_LANG_SPECIFIC(NODE)->ptrmemfunc_flag)
/* A pointer-to-function member type looks like:
#define DELTA2_FROM_PTRMEMFUNC(NODE) delta2_from_ptrmemfunc ((NODE))
#define PFN_FROM_PTRMEMFUNC(NODE) pfn_from_ptrmemfunc ((NODE))
+/* For a pointer-to-member type of the form `T X::*', this is `X'. */
+#define TYPE_PTRMEM_CLASS_TYPE(NODE) \
+ (TYPE_PTRMEM_P ((NODE)) \
+ ? TYPE_OFFSET_BASETYPE (TREE_TYPE ((NODE))) \
+ : TYPE_PTRMEMFUNC_OBJECT_TYPE ((NODE)))
+
+/* For a pointer-to-member type of the form `T X::*', this is `T'. */
+#define TYPE_PTRMEM_POINTED_TO_TYPE(NODE) \
+ (TYPE_PTRMEM_P ((NODE)) \
+ ? TREE_TYPE (TREE_TYPE (NODE)) \
+ : TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE ((NODE))))
+
/* For a pointer-to-member constant `X::Y' this is the RECORD_TYPE for
`X'. */
-#define PTRMEM_CST_CLASS(NODE) \
- (TYPE_PTRMEM_P (TREE_TYPE (NODE)) \
- ? TYPE_OFFSET_BASETYPE (TREE_TYPE (TREE_TYPE (NODE))) \
- : TYPE_PTRMEMFUNC_OBJECT_TYPE (TREE_TYPE (NODE)))
+#define PTRMEM_CST_CLASS(NODE) \
+ TYPE_PTRMEM_CLASS_TYPE (TREE_TYPE (NODE))
/* For a pointer-to-member constant `X::Y' this is the _DECL for
`Y'. */
flag for this because "A union for which objects or pointers are
declared is not an anonymous union" [class.union]. */
#define ANON_AGGR_TYPE_P(NODE) \
- (TYPE_LANG_SPECIFIC (NODE) \
- && TYPE_LANG_SPECIFIC (NODE)->type_flags.anon_aggr)
+ (CLASS_TYPE_P (NODE) && TYPE_LANG_SPECIFIC (NODE)->anon_aggr)
#define SET_ANON_AGGR_TYPE_P(NODE) \
- (TYPE_LANG_SPECIFIC (NODE)->type_flags.anon_aggr = 1)
+ (TYPE_LANG_SPECIFIC (NODE)->anon_aggr = 1)
#define UNKNOWN_TYPE LANG_TYPE
#define DECL_VPARENT(NODE) ((NODE)->decl.arguments)
#endif
-#define TYPE_WAS_ANONYMOUS(NODE) (TYPE_LANG_SPECIFIC (NODE)->type_flags.was_anonymous)
+#define TYPE_WAS_ANONYMOUS(NODE) (TYPE_LANG_SPECIFIC (NODE)->was_anonymous)
/* C++: all of these are overloaded! These apply only to TYPE_DECLs. */
#define DECL_DECLARES_TYPE_P(NODE) \
(TREE_CODE (NODE) == TYPE_DECL || DECL_CLASS_TEMPLATE_P (NODE))
+/* Nonzero if NODE is the typedef implicitly generated for a type when
+ the type is declared. (In C++, `struct S {};' is roughly equivalent
+ to `struct S {}; typedef struct S S;' in C. This macro will hold
+ for the typedef indicated in this example. Note that in C++, there
+ is a second implicit typedef for each class, in the scope of `S'
+ itself, so that you can `S::S'. This macro does *not* hold for
+ those typedefs. */
+#define DECL_IMPLICIT_TYPEDEF_P(NODE) \
+ (TREE_CODE ((NODE)) == TYPE_DECL && DECL_LANG_FLAG_2 ((NODE)))
+#define SET_DECL_IMPLICIT_TYPEDEF_P(NODE) \
+ (DECL_LANG_FLAG_2 ((NODE)) = 1)
+
/* A `primary' template is one that has its own template header. A
member function of a class template is a template, but not primary.
A member template is primary. Friend templates are primary, too. */
i.e., an instantiation whose instantiation arguments involve
template types. */
#define PARTIAL_INSTANTIATION_P(TYPE) \
- (TYPE_LANG_SPECIFIC (TYPE)->type_flags.is_partial_instantiation)
+ (TYPE_LANG_SPECIFIC (TYPE)->is_partial_instantiation)
/* Non-zero iff we are currently processing a declaration for an
entity with its own template parameter list, and which is not a
#define DEFARG_LENGTH(NODE) (DEFARG_NODE_CHECK(NODE)->identifier.length)
#define DEFARG_POINTER(NODE) (DEFARG_NODE_CHECK(NODE)->identifier.pointer)
-#define builtin_function(NAME, TYPE, CODE, LIBNAME) \
- define_function (NAME, TYPE, CODE, (void (*) PROTO((tree)))pushdecl, LIBNAME)
-
/* These macros provide convenient access to the various _STMT nodes
created when parsing template declarations. */
#define IF_COND(NODE) TREE_OPERAND (NODE, 0)
#define GOTO_DESTINATION(NODE) TREE_OPERAND (NODE, 0)
#define TRY_STMTS(NODE) TREE_OPERAND (NODE, 0)
#define TRY_HANDLERS(NODE) TREE_OPERAND (NODE, 1)
+#define CLEANUP_P(NODE) TREE_LANG_FLAG_0 (NODE)
#define HANDLER_PARMS(NODE) TREE_OPERAND (NODE, 0)
#define HANDLER_BODY(NODE) TREE_OPERAND (NODE, 1)
#define COMPOUND_BODY(NODE) TREE_OPERAND (NODE, 0)
#define ASM_OUTPUTS(NODE) TREE_OPERAND (NODE, 2)
#define ASM_INPUTS(NODE) TREE_OPERAND (NODE, 3)
#define ASM_CLOBBERS(NODE) TREE_OPERAND (NODE, 4)
+#define DECL_STMT_DECL(NODE) TREE_OPERAND (NODE, 0)
+#define STMT_EXPR_STMT(NODE) TREE_OPERAND (NODE, 0)
+#define SUBOBJECT_CLEANUP(NODE) TREE_OPERAND (NODE, 0)
+#define LABEL_STMT_LABEL(NODE) TREE_OPERAND (NODE, 0)
+
+/* Nonzero for an ASM_STMT if the assembly statement is volatile. */
+#define ASM_VOLATILE_P(NODE) \
+ (ASM_CV_QUAL ((NODE)) != NULL_TREE)
+
+/* The line-number at which a statement began. */
+#define STMT_LINENO(NODE) \
+ (TREE_COMPLEXITY ((NODE)))
+
+/* 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 { record_type, class_type, union_type, enum_type,
- signature_type };
+enum tag_types { record_type, class_type, union_type, enum_type };
+
+/* The various kinds of lvalues we distinguish. */
+typedef enum cp_lvalue_kind {
+ clk_none = 0, /* Things that are not an lvalue. */
+ clk_ordinary = 1, /* An ordinary lvalue. */
+ clk_class = 2, /* An rvalue of class-type. */
+ clk_bitfield = 4, /* An lvalue for a bit-field. */
+} cp_lvalue_kind;
/* Zero means prototype weakly, as in ANSI C (no args means nothing).
Each language context defines how this variable should be set. */
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;
+
/* Non-zero means to collect statistics which might be expensive
and to print them when we are done. */
extern int flag_detailed_statistics;
extern int c_get_alias_set PROTO((tree));
/* in decl{2}.c */
-extern tree void_list_node;
-extern tree void_zero_node;
-extern tree default_function_type;
-extern tree vtable_entry_type;
-extern tree sigtable_entry_type;
-extern tree __t_desc_type_node;
-#if 0
-extern tree __tp_desc_type_node;
-#endif
-extern tree __access_mode_type_node;
-extern tree __bltn_desc_type_node, __user_desc_type_node;
-extern tree __class_desc_type_node, __attr_desc_type_node;
-extern tree __ptr_desc_type_node, __func_desc_type_node;
-extern tree __ptmf_desc_type_node, __ptmd_desc_type_node;
-extern tree type_info_type_node;
-extern tree class_star_type_node;
-extern tree this_identifier;
-extern tree ctor_identifier, dtor_identifier;
-extern tree pfn_identifier;
-extern tree index_identifier;
-extern tree delta_identifier;
-extern tree delta2_identifier;
-extern tree pfn_or_delta2_identifier;
-extern tree tag_identifier;
-extern tree vt_off_identifier;
-
/* A node that is a list (length 1) of error_mark_nodes. */
extern tree error_mark_list;
-extern tree ptr_type_node;
-extern tree class_type_node, record_type_node, union_type_node, enum_type_node;
-extern tree unknown_type_node;
-extern tree opaque_type_node, signature_type_node;
+/* 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 \
(flag_vtable_thunks ? vtable_entry_type : ptr_type_node)
-/* The type of a vtbl, i.e., an array of vtable entries. */
-extern tree vtbl_type_node;
-/* The type of a class vtbl pointer, i.e., a pointer to a vtable entry. */
-extern tree vtbl_ptr_type_node;
-extern tree delta_type_node;
-extern tree std_node;
-extern tree long_long_integer_type_node, long_long_unsigned_type_node;
/* For building calls to `delete'. */
extern tree integer_two_node, integer_three_node;
-extern tree boolean_type_node, boolean_true_node, boolean_false_node;
-
-extern tree null_node;
extern tree anonymous_namespace_name;
-/* The FUNCTION_DECL for the default `::operator delete'. */
-
-extern tree global_delete_fndecl;
-
/* in pt.c */
/* These values are used for the `STRICT' parameter to type_unfication and
DEDUCE_EXACT
} unification_kind_t;
-extern tree current_template_parms;
-extern HOST_WIDE_INT processing_template_decl;
-extern tree last_tree;
-
/* The template currently being instantiated, and where the instantiation
was triggered. */
struct tinst_level
struct tinst_level *next;
};
-extern int minimal_parse_mode;
-
extern void maybe_print_template_context PROTO ((void));
/* in class.c */
-/* When parsing a class definition, the access specifier most recently
- given by the user, or, if no access specifier was given, the
- default value appropriate for the kind of class (i.e., struct,
- class, or union). */
-extern tree current_access_specifier;
-
-extern tree current_class_name;
-extern tree current_class_type;
-extern tree current_class_ptr;
-extern tree previous_class_type;
-extern tree current_class_ref;
extern int current_class_depth;
-extern tree current_lang_name;
-extern tree lang_name_cplusplus, lang_name_c, lang_name_java;
-
-/* The low-water mark on the class-cache obstack. */
-extern char *class_cache_firstobj;
-
/* Points to the name of that function. May not be the DECL_NAME
of CURRENT_FUNCTION_DECL due to overloading */
extern tree original_function_name;
/* in init.c */
extern tree global_base_init_list;
-extern tree current_base_init_list, current_member_init_list;
-extern int current_function_just_assigned_this;
-extern int current_function_parms_stored;
\f
/* Here's where we control how name mangling takes place. */
#define VTABLE_PFN_NAME "__pfn"
#define VTABLE_DELTA2_NAME "__delta2"
-#define SIGNATURE_FIELD_NAME "__s_"
-#define SIGNATURE_FIELD_NAME_FORMAT "__s_%s"
-#define SIGNATURE_OPTR_NAME "__optr"
-#define SIGNATURE_SPTR_NAME "__sptr"
-#define SIGNATURE_POINTER_NAME "__sp_"
-#define SIGNATURE_POINTER_NAME_FORMAT "__%s%s%ssp_%s"
-#define SIGNATURE_REFERENCE_NAME "__sr_"
-#define SIGNATURE_REFERENCE_NAME_FORMAT "__%s%s%ssr_%s"
-
-#define SIGTABLE_PTR_TYPE "__sigtbl_ptr_type"
-#define SIGTABLE_NAME_FORMAT "__st_%s_%s"
-#define SIGTABLE_NAME_FORMAT_LONG "__st_%s_%s_%d"
-#define SIGTABLE_TAG_NAME "__tag"
-#define SIGTABLE_VB_OFF_NAME "__vb_off"
-#define SIGTABLE_VT_OFF_NAME "__vt_off"
#define EXCEPTION_CLEANUP_NAME "exception cleanup"
#define THIS_NAME_P(ID_NODE) (strcmp(IDENTIFIER_POINTER (ID_NODE), "this") == 0)
&& MAIN_NAME_P (DECL_NAME (NODE)))
\f
-/* Define the sets of attributes that member functions and baseclasses
- can have. These are sensible combinations of {public,private,protected}
- cross {virtual,non-virtual}. */
-
-/* in class.c. */
-extern tree access_default_node; /* 0 */
-extern tree access_public_node; /* 1 */
-extern tree access_protected_node; /* 2 */
-extern tree access_private_node; /* 3 */
-extern tree access_default_virtual_node; /* 4 */
-extern tree access_public_virtual_node; /* 5 */
-extern tree access_protected_virtual_node; /* 6 */
-extern tree access_private_virtual_node; /* 7 */
-
/* Things for handling inline functions. */
struct pending_inline
enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
-/* The following two can be derived from the previous one */
-extern tree current_class_name; /* IDENTIFIER_NODE: name of current class */
-
/* Some macros for char-based bitfields. */
#define B_SET(a,x) (a[x>>3] |= (1 << (x&7)))
#define B_CLR(a,x) (a[x>>3] &= ~(1 << (x&7)))
/* Indexed by TREE_CODE, these tables give C-looking names to
operators represented by TREE_CODES. For example,
opname_tab[(int) MINUS_EXPR] == "-". */
-extern char **opname_tab, **assignop_tab;
+extern const char **opname_tab, **assignop_tab;
\f
/* in call.c */
extern int check_dtor_name PROTO((tree, tree));
extern tree convert_default_arg PROTO((tree, tree, tree));
extern tree convert_arg_to_ellipsis PROTO((tree));
extern int is_properly_derived_from PROTO((tree, tree));
+extern tree initialize_reference PROTO((tree, tree));
+extern tree strip_top_quals PROTO((tree));
+extern tree perform_implicit_conversion PROTO((tree, tree));
/* in class.c */
extern tree build_vbase_path PROTO((enum tree_code, tree, tree, tree, int));
extern int currently_open_class PROTO((tree));
extern tree get_vfield_offset PROTO((tree));
extern void duplicate_tag_error PROTO((tree));
-extern tree finish_struct PROTO((tree, tree, int));
-extern void finish_struct_1 PROTO((tree, int));
+extern tree finish_struct PROTO((tree, tree));
+extern void finish_struct_1 PROTO((tree));
extern int resolves_to_fixed_type_p PROTO((tree, int *));
extern void init_class_processing PROTO((void));
extern int is_empty_class PROTO((tree));
extern int global_bindings_p PROTO((void));
extern int toplevel_bindings_p PROTO((void));
extern int namespace_bindings_p PROTO((void));
-extern void keep_next_level PROTO((void));
+extern void keep_next_level PROTO((int));
extern int kept_level_p PROTO((void));
extern void declare_parm_level PROTO((void));
extern void declare_pseudo_global_level PROTO((void));
extern void push_class_level_binding PROTO((tree, tree));
extern tree implicitly_declare PROTO((tree));
extern tree lookup_label PROTO((tree));
-extern tree shadow_label PROTO((tree));
+extern tree declare_local_label PROTO((tree));
extern tree define_label PROTO((char *, int, tree));
extern void push_switch PROTO((void));
extern void pop_switch PROTO((void));
extern void begin_only_namespace_names PROTO((void));
extern void end_only_namespace_names PROTO((void));
extern tree namespace_ancestor PROTO((tree, tree));
-extern int lookup_using_namespace PROTO((tree,tree,tree,tree,int));
-extern int qualified_lookup_using_namespace PROTO((tree,tree,tree,int));
+extern tree unqualified_namespace_lookup PROTO((tree, int, tree *));
+extern int lookup_using_namespace PROTO((tree, tree, tree, tree, int, tree *));
+extern int qualified_lookup_using_namespace PROTO((tree, tree, tree, int));
extern tree auto_function PROTO((tree, tree, enum built_in_function));
extern void init_decl_processing PROTO((void));
extern int init_type_desc PROTO((void));
extern tree define_function
PROTO((const char *, tree, enum built_in_function,
- void (*) (tree), const char *));
+ void (*) (tree), const char *));
extern tree check_tag_decl PROTO((tree));
extern void shadow_tag PROTO((tree));
extern tree groktypename PROTO((tree));
extern void start_decl_1 PROTO((tree));
extern void cp_finish_decl PROTO((tree, tree, tree, int, int));
extern void finish_decl PROTO((tree, tree, tree));
+extern void maybe_inject_for_scope_var PROTO((tree));
+extern void initialize_local_var PROTO((tree, tree, int));
extern void expand_static_init PROTO((tree, tree));
+extern void start_handler_parms PROTO((tree, tree));
extern int complete_array_type PROTO((tree, tree, int));
extern tree build_ptrmemfunc_type PROTO((tree));
/* the grokdeclarator prototype is in decl.h */
extern int start_function PROTO((tree, tree, tree, int));
extern void expand_start_early_try_stmts PROTO((void));
extern void store_parm_decls PROTO((void));
-extern void store_return_init PROTO((tree, tree));
-extern void finish_function PROTO((int, int, int));
+extern void store_return_init PROTO((tree));
+extern void finish_function PROTO((int, int));
extern tree start_method PROTO((tree, tree, tree));
extern tree finish_method PROTO((tree));
extern void hack_incomplete_structures PROTO((tree));
extern tree maybe_build_cleanup PROTO((tree));
extern void cplus_expand_expr_stmt PROTO((tree));
extern void finish_stmt PROTO((void));
-extern void push_cp_function_context PROTO((tree));
-extern void pop_cp_function_context PROTO((tree));
extern int in_function_p PROTO((void));
extern void replace_defarg PROTO((tree, tree));
extern void print_other_binding_stack PROTO((struct binding_level *));
extern int walk_namespaces PROTO((walk_namespaces_fn,
void *));
extern int wrapup_globals_for_namespace PROTO((tree, void *));
+extern tree cp_namespace_decls PROTO((tree));
+extern tree create_implicit_typedef PROTO((tree, tree));
+extern tree maybe_push_decl PROTO((tree));
/* in decl2.c */
+extern void init_decl2 PROTO((void));
extern int check_java_method PROTO((tree));
extern int lang_decode_option PROTO((int, char **));
extern tree grok_method_quals PROTO((tree, tree, tree));
extern void mark_inline_for_output PROTO((tree));
extern void clear_temp_name PROTO((void));
extern tree get_temp_name PROTO((tree, int));
-extern tree get_temp_regvar PROTO((tree, tree));
extern void finish_anon_union PROTO((tree));
extern tree finish_table PROTO((tree, tree, tree, int));
extern void finish_builtin_type PROTO((tree, const char *,
extern tree lookup_arg_dependent PROTO((tree, tree, tree));
extern void finish_static_data_member_decl PROTO((tree, tree, tree, int, int));
+/* in parse.y */
+extern void cp_parse_init PROTO((void));
+
/* in errfn.c */
/* The cp_* functions aren't suitable for ATTRIBUTE_PRINTF. */
extern void cp_error PVPROTO((const char *, ...));
/* in error.c */
extern void init_error PROTO((void));
-extern char *fndecl_as_string PROTO((tree, int));
-extern char *type_as_string PROTO((tree, int));
-extern char *type_as_string_real PROTO((tree, int, int));
-extern char *args_as_string PROTO((tree, int));
-extern char *decl_as_string PROTO((tree, int));
-extern char *expr_as_string PROTO((tree, int));
-extern char *code_as_string PROTO((enum tree_code, int));
-extern char *language_as_string PROTO((enum languages, int));
-extern char *parm_as_string PROTO((int, int));
-extern char *op_as_string PROTO((enum tree_code, int));
-extern char *assop_as_string PROTO((enum tree_code, int));
-extern char *cv_as_string PROTO((tree, int));
-extern char *lang_decl_name PROTO((tree, int));
-extern char *cp_file_of PROTO((tree));
+extern const char *fndecl_as_string PROTO((tree, int));
+extern const char *type_as_string PROTO((tree, int));
+extern const char *type_as_string_real PROTO((tree, int, int));
+extern const char *args_as_string PROTO((tree, int));
+extern const char *decl_as_string PROTO((tree, int));
+extern const char *expr_as_string PROTO((tree, int));
+extern const char *code_as_string PROTO((enum tree_code, int));
+extern const char *language_as_string PROTO((enum languages, int));
+extern const char *parm_as_string PROTO((int, int));
+extern const char *op_as_string PROTO((enum tree_code, int));
+extern const char *assop_as_string PROTO((enum tree_code, int));
+extern const char *cv_as_string PROTO((tree, int));
+extern const char *lang_decl_name PROTO((tree, int));
+extern const char *cp_file_of PROTO((tree));
extern int cp_line_of PROTO((tree));
/* in except.c */
extern void init_exception_processing PROTO((void));
-extern void expand_start_catch_block PROTO((tree, tree));
+extern void expand_start_catch_block PROTO((tree));
extern void expand_end_catch_block PROTO((void));
extern void expand_builtin_throw PROTO((void));
extern void expand_start_eh_spec PROTO((void));
/* in init.c */
extern void init_init_processing PROTO((void));
extern void expand_direct_vtbls_init PROTO((tree, tree, int, int, tree));
-extern void emit_base_init PROTO((tree, int));
+extern void emit_base_init PROTO((tree));
extern void check_base_init PROTO((tree));
extern void expand_member_init PROTO((tree, tree, tree));
-extern void expand_aggr_init PROTO((tree, tree, int));
+extern tree build_aggr_init PROTO((tree, tree, int));
extern int is_aggr_typedef PROTO((tree, int));
extern int is_aggr_type PROTO((tree, int));
extern tree get_aggr_from_typedef PROTO((tree, int));
extern tree decl_constant_value PROTO((tree));
extern tree build_new PROTO((tree, tree, tree, int));
extern tree build_new_1 PROTO((tree));
-extern tree expand_vec_init PROTO((tree, tree, tree, tree, int));
+extern tree build_vec_init PROTO((tree, tree, tree, tree, int));
extern tree build_x_delete PROTO((tree, int, tree));
extern tree build_delete PROTO((tree, tree, tree, int, int));
extern tree build_vbase_delete PROTO((tree, tree));
extern tree build_vec_delete PROTO((tree, tree, tree, tree, int));
+extern tree create_temporary_var PROTO((tree));
+extern void begin_init_stmts PROTO((tree *, tree *));
+extern tree finish_init_stmts PROTO((tree, tree));
/* in input.c */
extern tree make_reference_declarator PROTO((tree, tree));
extern tree make_call_declarator PROTO((tree, tree, tree, tree));
extern void set_quals_and_spec PROTO((tree, tree, tree));
-extern char *operator_name_string PROTO((tree));
+extern const char *operator_name_string PROTO((tree));
extern void lang_init PROTO((void));
extern void lang_finish PROTO((void));
#if 0
extern void print_parse_statistics PROTO((void));
extern void extract_interface_info PROTO((void));
extern void do_pending_inlines PROTO((void));
-extern void process_next_inline PROTO((tree));
+extern void process_next_inline PROTO((struct pending_inline *));
extern struct pending_input *save_pending_input PROTO((void));
extern void restore_pending_input PROTO((struct pending_input *));
extern void yyungetc PROTO((int, int));
extern int is_rid PROTO((tree));
extern tree build_lang_decl PROTO((enum tree_code, tree, tree));
extern void retrofit_lang_decl PROTO((tree));
-extern tree build_lang_field_decl PROTO((enum tree_code, tree, tree));
extern void copy_lang_decl PROTO((tree));
extern tree make_lang_type PROTO((enum tree_code));
extern void dump_time_statistics PROTO((void));
extern tree make_thunk PROTO((tree, int));
extern void emit_thunk PROTO((tree));
extern void synthesize_method PROTO((tree));
-extern tree get_id_2 PROTO((char *, tree));
+extern tree get_id_2 PROTO((const char *, tree));
/* in pt.c */
+extern void init_pt PROTO ((void));
extern void check_template_shadow PROTO ((tree));
extern tree innermost_args PROTO ((tree));
extern tree tsubst PROTO ((tree, tree, int, tree));
extern void do_decl_instantiation PROTO((tree, tree, tree));
extern void do_type_instantiation PROTO((tree, tree));
extern tree instantiate_decl PROTO((tree));
-extern tree do_poplevel PROTO((void));
extern tree get_bindings PROTO((tree, tree, tree));
-/* CONT ... */
extern void add_tree PROTO((tree));
extern void begin_tree PROTO((void));
extern void end_tree PROTO((void));
extern void add_maybe_template PROTO((tree, tree));
extern void pop_tinst_level PROTO((void));
extern int more_specialized_class PROTO((tree, tree));
-extern void do_pushlevel PROTO((void));
extern int is_member_template PROTO((tree));
extern int template_parms_equal PROTO((tree, tree));
extern int comp_template_parms PROTO((tree, tree));
extern tree most_specialized_instantiation PROTO((tree, tree));
extern void print_candidates PROTO((tree));
extern int instantiate_pending_templates PROTO((void));
+extern tree tsubst_default_argument PROTO((tree, tree, tree));
-extern int processing_specialization;
-extern int processing_explicit_instantiation;
extern int processing_template_parmlist;
/* in repo.c */
extern void init_search_processing PROTO((void));
extern void reinit_search_statistics PROTO((void));
extern tree current_scope PROTO((void));
+extern int at_function_scope_p PROTO((void));
extern tree lookup_conversions PROTO((tree));
extern tree binfo_for_vtable PROTO((tree));
+extern int binfo_from_vbase PROTO((tree));
extern tree dfs_walk PROTO((tree,
tree (*)(tree, void *),
tree (*) (tree, void *),
extern tree begin_try_block PROTO((void));
extern void finish_try_block PROTO((tree));
extern void finish_handler_sequence PROTO((tree));
+extern tree begin_function_try_block PROTO((void));
+extern void finish_function_try_block PROTO((tree));
+extern void finish_function_handler_sequence PROTO((tree));
extern tree begin_handler PROTO((void));
+extern void start_handler_parms PROTO((tree, tree));
extern void finish_handler_parms PROTO((tree));
extern void finish_handler PROTO((tree));
+extern void finish_cleanup PROTO((tree, tree));
extern tree begin_compound_stmt PROTO((int));
extern tree finish_compound_stmt PROTO((int, tree));
extern void finish_asm_stmt PROTO((tree, tree, tree, tree, tree));
+extern void finish_label_stmt PROTO((tree));
+extern void finish_label_decl PROTO((tree));
+extern void finish_subobject PROTO((tree));
extern tree finish_parenthesized_expr PROTO((tree));
extern tree begin_stmt_expr PROTO((void));
extern tree finish_stmt_expr PROTO((tree, tree));
extern void finish_template_decl PROTO((tree));
extern tree finish_template_type PROTO((tree, tree, int));
extern void enter_scope_of PROTO((tree));
-extern tree finish_base_specifier PROTO((tree, tree, int));
+extern tree finish_base_specifier PROTO((tree, tree));
extern void finish_member_declaration PROTO((tree));
extern void check_multiple_declarators PROTO((void));
extern tree finish_typeof PROTO((tree));
-
-/* in sig.c */
-extern tree build_signature_pointer_type PROTO((tree));
-extern tree build_signature_reference_type PROTO((tree));
-extern tree build_signature_pointer_constructor PROTO((tree, tree));
-extern tree build_signature_method_call PROTO((tree, tree));
-extern tree build_optr_ref PROTO((tree));
-extern void append_signature_fields PROTO((tree));
+extern void add_decl_stmt PROTO((tree));
+extern void finish_named_return_value PROTO((tree, tree));
+extern tree expand_stmt PROTO((tree));
+extern void expand_body PROTO((tree));
+extern void begin_stmt_tree PROTO((tree));
+extern void finish_stmt_tree PROTO((tree));
+/* Non-zero if we are presently building a statement tree, rather
+ than expanding each statement as we encounter it. */
+#define building_stmt_tree() \
+ (processing_template_decl || !expanding_p)
/* in spew.c */
extern void init_spew PROTO((void));
extern tree arbitrate_lookup PROTO((tree, tree, tree));
/* in tree.c */
+extern void init_tree PROTO((void));
+extern void cplus_unsave_expr_now PROTO((tree));
extern int pod_type_p PROTO((tree));
extern void unshare_base_binfos PROTO((tree));
extern int member_p PROTO((tree));
-extern int real_lvalue_p PROTO((tree));
+extern cp_lvalue_kind real_lvalue_p PROTO((tree));
extern tree build_min PVPROTO((enum tree_code, tree, ...));
extern tree build_min_nt PVPROTO((enum tree_code, ...));
extern tree min_tree_cons PROTO((tree, tree, tree));
extern int count_functions PROTO((tree));
extern int is_overloaded_fn PROTO((tree));
extern tree get_first_fn PROTO((tree));
-extern tree binding_init PROTO((struct tree_binding*));
extern int bound_pmf_p PROTO((tree));
extern tree ovl_cons PROTO((tree, tree));
extern tree scratch_ovl_cons PROTO((tree, tree));
extern tree function_arg_chain PROTO((tree));
extern int promotes_to_aggr_type PROTO((tree, enum tree_code));
extern int is_aggr_type_2 PROTO((tree, tree));
-extern char *lang_printable_name PROTO((tree, int));
+extern const char *lang_printable_name PROTO((tree, int));
extern tree build_exception_variant PROTO((tree, tree));
extern tree copy_template_template_parm PROTO((tree));
-extern tree copy_to_permanent PROTO((tree));
-extern tree permanent_p PROTO((tree));
extern void print_lang_statistics PROTO((void));
extern void __eprintf
PROTO((const char *, const char *, unsigned, const char *));
extern tree no_linkage_check PROTO((tree));
extern void debug_binfo PROTO((tree));
extern void push_expression_obstack PROTO((void));
+extern void push_permanent_obstack PROTO((void));
extern tree build_dummy_object PROTO((tree));
extern tree maybe_dummy_object PROTO((tree, tree *));
extern int is_dummy_object PROTO((tree));
cp_build_qualified_type_real ((TYPE), (QUALS), /*complain=*/1)
#define scratchalloc expralloc
-#define scratch_tree_cons expr_tree_cons
#define build_scratch_list build_expr_list
#define make_scratch_vec make_temp_vec
#define push_scratch_obstack push_expression_obstack
extern tree commonparms PROTO((tree, tree));
extern tree original_type PROTO((tree));
extern tree common_type PROTO((tree, tree));
-extern int compexcepttypes PROTO((tree, tree));
+extern int comp_except_specs PROTO((tree, tree, int));
extern int comptypes PROTO((tree, tree, int));
extern int comp_target_types PROTO((tree, tree, int));
extern int compparms PROTO((tree, tree));
extern int comp_target_types PROTO((tree, tree, int));
extern int comp_cv_qualification PROTO((tree, tree));
extern int comp_cv_qual_signature PROTO((tree, tree));
-extern int self_promoting_args_p PROTO((tree));
extern tree unsigned_type PROTO((tree));
extern tree signed_type PROTO((tree));
extern tree signed_or_unsigned_type PROTO((int, tree));
extern int comp_ptr_ttypes PROTO((tree, tree));
extern int ptr_reasonably_similar PROTO((tree, tree));
extern tree build_ptrmemfunc PROTO((tree, tree, int));
+extern tree strip_array_types PROTO((tree));
extern int cp_type_quals PROTO((tree));
extern int cp_has_mutable_p PROTO((tree));
extern int at_least_as_qualified_p PROTO((tree, tree));
extern void expand_ptrmemfunc_cst PROTO((tree, tree *, tree *, tree *, tree *));
extern tree delta2_from_ptrmemfunc PROTO((tree));
extern tree pfn_from_ptrmemfunc PROTO((tree));
+extern tree type_after_usual_arithmetic_conversions PROTO((tree, tree));
+extern tree composite_pointer_type PROTO((tree, tree, tree, tree,
+ const char*));
/* in typeck2.c */
extern tree error_not_base_type PROTO((tree, tree));
extern tree binfo_or_else PROTO((tree, tree));
extern void readonly_error PROTO((tree, const char *, int));
-extern void abstract_virtuals_error PROTO((tree, tree));
-extern void signature_error PROTO((tree, tree));
+extern int abstract_virtuals_error PROTO((tree, tree));
extern void incomplete_type_error PROTO((tree, tree));
extern void my_friendly_abort PROTO((int))
ATTRIBUTE_NORETURN;
extern char *enum_name_string PROTO((tree, tree));
extern void report_case_error PROTO((int, tree, tree, tree));
extern void check_for_new_type PROTO((const char *, flagged_type_tree));
-extern tree initializer_constant_valid_p PROTO((tree, tree));
+extern tree add_exception_specifier PROTO((tree, tree, int));
/* in xref.c */
extern void GNU_xref_begin PROTO((const char *));
extern void GNU_xref_hier PROTO((tree, tree, int, int, int));
extern void GNU_xref_member PROTO((tree, tree));
+/* in dump.c */
+extern void dump_node_to_file PROTO ((tree, const char *));
+
/* -- end of C++ */
#endif /* not _CP_TREE_H */