From bbd15aac6fc179e9cb610f89f681c574a68f038c Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Mon, 17 Jan 2000 04:08:01 +0000 Subject: cp-tree.h (flag_new_abi): Move. * cp-tree.h (flag_new_abi): Move. (flag_use_cxa_atexit): Likewise. (flag_honor_std): Likewise. (flag_rtti): Likewise. (vbase_offsets_in_vtable_p): Define. (vptrs_present_everywhere_p): Likewise. (TYPE_CONTAINS_VPTR_P): Likewise. (dfs_walk_real): Declare. * class.c (build_vbase_pointer_fields): Check vbase_offsets_in_vtable_p. (dfs_build_vbase_offset_vtbl_entries): Record the vbase indices in BINFO_VPTR_FIELD. (build_vbase_offset_vtbl_entries): Simplify. (build_vbase_offset_vtbl_entries): Adjust. (build_vbase_pointer): Add ability to look up vbase offsets in vtable. (start_vtable): New function. (add_virtual_function): Use it. (determine_primary_base): Use TYPE_CONTAINS_VPTR_P. (num_extra_vtbl_entries): Use vbase_offsets_in_vtable_p. (build_vtbl_initializer): Take the type of the complete object as input. Use it to correctly calculate vbase offsets. (dfs_finish_vtbls): Pass the complete type to build_vtbl_initializer. (check_bases_and_members): Use TYPE_CONTAINS_VPTR_P. (create_vtable_ptr): Create a vtable even if there are no new virtual functions, under the new ABI. (finish_struct_1): Likewise. (get_vfield_name): Use TYPE_CONTAINS_VPTR_P. * decl.c (exapnd_static_init): Remove call to preserve_initializer. * decl2.c (mark_vtable_entries): Tweak to handle vbase offsets in vtables. * init.c (initialize_vtbl_ptrs): Initialize them in pre-order. (expand_virtual_init): Use vbase_offsets_in_vtable_p. (construct_virtual_bases): Don't initialize virtual base pointers under the new ABI. (build_aggr_init): Clean up comment. (expand_aggr_init_1): Likewise. * rtti.c (expand_class_desc): Store the virtual function table index where the vbase offset lives in the offset field. * search.c (dfs_walk_real): Make it global. (dfs_debug_mark): Use TYPE_CONTAINS_VPTR_P. * tree.c (make_binfo): Don't clear BINFO_VPTR_FIELD. * tinfo.h (USItype): Make it signed under the new ABI. * tinfo.cc (convert_to_base): New function. Encapsulate base conversion logic here. (__class_type_info::do_upcast): Use it. (__class_type_info::do_dyncast): Likewise. (__class_type_info::do_find_public_subobj): Likewise. From-SVN: r31452 --- gcc/cp/decl.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'gcc/cp/decl.c') diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index d8a57e5..0a5dc56 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8201,15 +8201,7 @@ expand_static_init (decl, init) finish_if_stmt (); } else - { - /* This code takes into account memory allocation policy of - `start_decl'. Namely, if TYPE_NEEDS_CONSTRUCTING does not - hold for this object, then we must make permanent the storage - currently in the temporary obstack. */ - if (!TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl))) - preserve_initializer (); - static_aggregates = tree_cons (init, decl, static_aggregates); - } + static_aggregates = tree_cons (init, decl, static_aggregates); } /* Finish the declaration of a catch-parameter. */ -- cgit v1.1