diff options
Diffstat (limited to 'contrib/gcc/cp/cp-tree.h')
-rw-r--r-- | contrib/gcc/cp/cp-tree.h | 98 |
1 files changed, 44 insertions, 54 deletions
diff --git a/contrib/gcc/cp/cp-tree.h b/contrib/gcc/cp/cp-tree.h index f7cddac..584491a 100644 --- a/contrib/gcc/cp/cp-tree.h +++ b/contrib/gcc/cp/cp-tree.h @@ -28,6 +28,10 @@ Boston, MA 02111-1307, USA. */ #ifndef GCC_CP_TREE_H #define GCC_CP_TREE_H +#ifndef __GNUC__ +#error "You should be using 'make bootstrap' -- see installation instructions" +#endif + #include "c-common.h" /* Usage of TREE_LANG_FLAG_?: @@ -318,8 +322,6 @@ typedef struct ptrmem_cst set_namespace_binding ((NODE), current_namespace, (VAL)) #define CLEANUP_P(NODE) TREE_LANG_FLAG_0 (TRY_BLOCK_CHECK (NODE)) -#define CLEANUP_DECL(NODE) TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 0) -#define CLEANUP_EXPR(NODE) TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 1) /* Returns nonzero iff TYPE1 and TYPE2 are the same type, in the usual sense of `same'. */ @@ -727,8 +729,8 @@ struct saved_scope tree x_previous_class_type; tree x_previous_class_values; tree x_saved_tree; - tree incomplete; tree lookups; + tree last_parms; HOST_WIDE_INT x_processing_template_decl; int x_processing_specialization; @@ -791,10 +793,6 @@ struct saved_scope #define previous_class_values scope_chain->x_previous_class_values -/* A list of the declarations with incomplete type at namespace scope. */ - -#define namespace_scope_incomplete scope_chain->incomplete - /* A list of private types mentioned, for deferred access checking. */ #define type_lookups scope_chain->lookups @@ -821,6 +819,7 @@ struct cp_language_function int returns_value; int returns_null; + int returns_abnormally; int in_function_try_handler; int x_expanding_p; @@ -883,6 +882,12 @@ struct cp_language_function #define current_function_returns_null cp_function_chain->returns_null +/* Set to 0 at beginning of a function definition, set to 1 if + a call to a noreturn function is seen. */ + +#define current_function_returns_abnormally \ + cp_function_chain->returns_abnormally + /* 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. */ @@ -925,10 +930,6 @@ extern int flag_no_gnu_keywords; extern int flag_operator_names; -/* For cross referencing. */ - -extern int flag_gnu_xref; - /* For environments where you can use GNU binutils (as, ld in particular). */ extern int flag_gnu_binutils; @@ -1583,11 +1584,11 @@ struct lang_type #define SET_BINFO_MARKED(NODE) \ (TREE_VIA_VIRTUAL(NODE) \ ? SET_CLASSTYPE_MARKED (BINFO_TYPE (NODE)) \ - : (TREE_LANG_FLAG_0 (NODE) = 1)) + : (void)(TREE_LANG_FLAG_0 (NODE) = 1)) #define CLEAR_BINFO_MARKED(NODE) \ (TREE_VIA_VIRTUAL (NODE) \ ? CLEAR_CLASSTYPE_MARKED (BINFO_TYPE (NODE)) \ - : (TREE_LANG_FLAG_0 (NODE) = 0)) + : (void)(TREE_LANG_FLAG_0 (NODE) = 0)) /* Nonzero means that this class is on a path leading to a new vtable. */ #define BINFO_VTABLE_PATH_MARKED(NODE) \ @@ -1626,12 +1627,10 @@ struct lang_type #define SET_BINFO_PUSHDECLS_MARKED(NODE) SET_BINFO_VTABLE_PATH_MARKED (NODE) #define CLEAR_BINFO_PUSHDECLS_MARKED(NODE) CLEAR_BINFO_VTABLE_PATH_MARKED (NODE) -/* Nonzero if this BINFO is a primary base class. +/* Nonzero if this BINFO is a primary base class. Note, this can be + set for non-canononical virtual bases. For a virtual primary base + you might also need to check whether it is canonical. */ - In the TYPE_BINFO hierarchy, this flag is never set for a base - 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_P(NODE) \ (BINFO_PRIMARY_BASE_OF (NODE) != NULL_TREE) @@ -3060,13 +3059,19 @@ typedef enum linkage_kind { lk_external /* External linkage. */ } linkage_kind; -/* Bitmask flags to pass to instantiate_type. */ -typedef enum instantiate_type_flags { - itf_none = 0, /* nothing special */ - itf_complain = 1 << 0, /* complain about errors */ - itf_no_attributes = 1 << 1, /* ignore attributes on comparisons */ - itf_ptrmem_ok = 1 << 2, /* pointers to member ok (internal use) */ -} instantiate_type_flags; +/* Bitmask flags to control type substitution. */ +typedef enum tsubst_flags_t { + tf_none = 0, /* nothing special */ + tf_error = 1 << 0, /* give error messages */ + tf_warning = 1 << 1, /* give warnings too */ + tf_no_attributes = 1 << 2, /* ignore attributes on comparisons + (instantiate_type use) */ + tf_ignore_bad_quals = 1 << 3, /* ignore bad cvr qualifiers */ + tf_keep_type_decl = 1 << 4, /* retain typedef type decls + (make_typename_type use) */ + tf_ptrmem_ok = 1 << 5 /* pointers to member ok (internal + instantiate_type use) */ +} tsubst_flags_t; /* The kind of checking we can do looking in a class hierarchy. */ typedef enum base_access { @@ -3595,7 +3600,7 @@ 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 tree instantiate_type PARAMS ((tree, tree, tsubst_flags_t)); extern void print_class_statistics PARAMS ((void)); extern void cxx_print_statistics PARAMS ((void)); extern void cxx_print_xnode PARAMS ((FILE *, tree, int)); @@ -3687,7 +3692,7 @@ extern tree namespace_binding PARAMS ((tree, tree)); extern void set_namespace_binding PARAMS ((tree, tree, tree)); extern tree lookup_namespace_name PARAMS ((tree, tree)); extern tree build_typename_type PARAMS ((tree, tree, tree, tree)); -extern tree make_typename_type PARAMS ((tree, tree, int)); +extern tree make_typename_type PARAMS ((tree, tree, tsubst_flags_t)); extern tree make_unbound_class_template PARAMS ((tree, tree, int)); extern tree lookup_name_nonclass PARAMS ((tree)); extern tree lookup_function_nonclass PARAMS ((tree, tree)); @@ -3739,7 +3744,8 @@ extern void finish_function_body PARAMS ((tree)); 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 void maybe_register_incomplete_var PARAMS ((tree)); +extern void complete_vars PARAMS ((tree)); extern void finish_stmt PARAMS ((void)); extern void print_other_binding_stack PARAMS ((struct binding_level *)); extern void revert_static_member_fn PARAMS ((tree)); @@ -3901,7 +3907,7 @@ extern tree build_new PARAMS ((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 void push_base_cleanups PARAMS ((void)); +extern void perform_base_cleanups PARAMS ((void)); extern tree build_vbase_delete PARAMS ((tree, tree)); extern tree build_vec_delete PARAMS ((tree, tree, special_function_kind, int)); extern tree create_temporary_var PARAMS ((tree)); @@ -3969,9 +3975,9 @@ extern int maybe_clone_body PARAMS ((tree)); extern void init_pt PARAMS ((void)); extern void check_template_shadow PARAMS ((tree)); extern tree get_innermost_template_args PARAMS ((tree, int)); -extern tree tsubst PARAMS ((tree, tree, int, tree)); -extern tree tsubst_expr PARAMS ((tree, tree, int, tree)); -extern tree tsubst_copy PARAMS ((tree, tree, int, tree)); +extern tree tsubst PARAMS ((tree, tree, tsubst_flags_t, tree)); +extern tree tsubst_expr PARAMS ((tree, tree, tsubst_flags_t, tree)); +extern tree tsubst_copy PARAMS ((tree, tree, tsubst_flags_t, tree)); extern void maybe_begin_member_template_processing PARAMS ((tree)); extern void maybe_end_member_template_processing PARAMS ((void)); extern tree finish_member_template_decl PARAMS ((tree)); @@ -3989,7 +3995,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, int)); +extern tree lookup_template_class PARAMS ((tree, tree, tree, tree, int, tsubst_flags_t)); extern tree lookup_template_function PARAMS ((tree, tree)); extern int uses_template_parms PARAMS ((tree)); extern tree instantiate_class_template PARAMS ((tree)); @@ -4000,7 +4006,7 @@ extern void mark_decl_instantiated PARAMS ((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)); +extern void do_type_instantiation PARAMS ((tree, tree, tsubst_flags_t)); extern tree instantiate_decl PARAMS ((tree, int)); extern tree get_bindings PARAMS ((tree, tree, tree)); extern int push_tinst_level PARAMS ((tree)); @@ -4047,8 +4053,6 @@ extern int types_overlap_p PARAMS ((tree, tree)); extern tree get_vbase PARAMS ((tree, 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)); @@ -4084,8 +4088,6 @@ extern tree dfs_walk_real PARAMS ((tree, extern tree dfs_unmark PARAMS ((tree, void *)); extern tree markedp PARAMS ((tree, void *)); extern tree unmarkedp PARAMS ((tree, void *)); -extern tree dfs_skip_nonprimary_vbases_unmarkedp PARAMS ((tree, void *)); -extern tree dfs_skip_nonprimary_vbases_markedp PARAMS ((tree, void *)); extern tree dfs_unmarked_real_bases_queue_p PARAMS ((tree, void *)); extern tree dfs_marked_real_bases_queue_p PARAMS ((tree, void *)); extern tree dfs_skip_vbases PARAMS ((tree, void *)); @@ -4156,6 +4158,7 @@ extern tree finish_qualified_call_expr PARAMS ((tree, 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)); +extern void reset_type_access_control PARAMS ((void)); extern void decl_type_access_control PARAMS ((tree)); extern int begin_function_definition PARAMS ((tree, tree)); extern tree begin_constructor_declarator PARAMS ((tree, tree)); @@ -4259,9 +4262,9 @@ extern tree maybe_dummy_object PARAMS ((tree, tree *)); extern int is_dummy_object PARAMS ((tree)); extern const struct attribute_spec cp_attribute_table[]; extern tree make_ptrmem_cst PARAMS ((tree, tree)); -extern tree cp_build_qualified_type_real PARAMS ((tree, int, int)); +extern tree cp_build_qualified_type_real PARAMS ((tree, int, tsubst_flags_t)); #define cp_build_qualified_type(TYPE, QUALS) \ - cp_build_qualified_type_real ((TYPE), (QUALS), /*complain=*/1) + cp_build_qualified_type_real ((TYPE), (QUALS), tf_error | tf_warning) extern tree build_shared_int_cst PARAMS ((int)); extern special_function_kind special_function_p PARAMS ((tree)); extern int count_trees PARAMS ((tree)); @@ -4340,6 +4343,7 @@ 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, const char*)); +extern tree merge_types PARAMS ((tree, tree)); extern tree check_return_expr PARAMS ((tree)); #define cp_build_binary_op(code, arg1, arg2) \ build_binary_op(code, arg1, arg2, 1) @@ -4363,20 +4367,6 @@ 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 *)); -extern void GNU_xref_end PARAMS ((int)); -extern void GNU_xref_file PARAMS ((const char *)); -extern void GNU_xref_start_scope PARAMS ((HOST_WIDE_INT)); -extern void GNU_xref_end_scope PARAMS ((HOST_WIDE_INT, HOST_WIDE_INT, int, int)); -extern void GNU_xref_ref PARAMS ((tree, const char *)); -extern void GNU_xref_decl PARAMS ((tree, tree)); -extern void GNU_xref_call PARAMS ((tree, const char *)); -extern void GNU_xref_function PARAMS ((tree, tree)); -extern void GNU_xref_assign PARAMS ((tree)); -extern void GNU_xref_hier PARAMS ((tree, tree, int, int, int)); -extern void GNU_xref_member PARAMS ((tree, tree)); - /* in mangle.c */ extern void init_mangle PARAMS ((void)); extern void mangle_decl PARAMS ((tree)); |