diff options
| author | Nathan Sidwell <nathan@codesourcery.com> | 2001-07-21 09:42:21 +0000 |
|---|---|---|
| committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2001-07-21 09:42:21 +0000 |
| commit | c4372ef4c6476dc6ed6da01dbe1b44564aee938f (patch) | |
| tree | 600fa30db184de710e309de080b6a3ad19d82722 /gcc/cp/class.c | |
| parent | f4653d92782e80a2ebceae16e81a2850452aa0c3 (diff) | |
| download | gcc-c4372ef4c6476dc6ed6da01dbe1b44564aee938f.zip gcc-c4372ef4c6476dc6ed6da01dbe1b44564aee938f.tar.gz gcc-c4372ef4c6476dc6ed6da01dbe1b44564aee938f.tar.bz2 | |
tm.texi: Remove DEFAULT_VTABLE_THUNKS.
gcc:
* doc/tm.texi: Remove DEFAULT_VTABLE_THUNKS.
* config/freebsd.h: Likewise.
* config/linux.h: Likewise.
* config/openbsd.h: Likewise.
* config/alpha/linux-elf.h: Likewise.
* config/arm/linux-elf.h: Likewise.
* config/d30v/d30v.h: Likewise.
* config/fr30/fr30.h: Likewise.
* config/ia64/aix.h: Likewise.
* config/ia64/ia64.h: Likewise.
* config/mips/linux.h: Likewise.
* config/pj/pj.h: Likewise.
* config/rs6000/linux.h: Likewise.
* config/sparc/linux.h: Likewise.
* config/sparc/linux64.h: Likewise.
cp:
Remove flag_vtable_thunk. It is always on for the 3.0 ABI.
* cp-tree.h (CPTI_DELTA2_IDENTIFIER): Remove.
(CPTI_INDEX_IDENTIFIER): Remove.
(CPT_PFN_OR_DELTA2_IDENTIFIER): Remove.
(delta2_identifier): Remove.
(index_identifier): Remove.
(pfn_or_delta2_identifier): Remove.
(flag_vtable_thunks): Remove.
(VTABLE_DELTA2_NAME): Remove.
(VTABLE_INDEX_NAME): Remove.
(FNADDR_FROM_VTABLE_ENTRY): Adjust.
(vfunc_ptr_type_node): Adjust.
(VTABLE_NAME_PREFIX): Adjust.
(build_vfn_ref): Lose first parameter.
(fixup_all_virtual_upcast_offsets): Remove.
* decl.c (initialize_predefined_identifiers): Remove
delta2_identifier, index_identifier, pfn_or_delta2_identifier.
(init_decl_processing): Remove no-vtable-thunk code.
* decl2.c (flag_vtable_thunks): Remove.
(mark_vtable_entries): Remove no-vtable-thunk code.
* error.c (dump_decl): Remove no-vtable-thunk code.
(dump_expr): Adjust ptr to member function code.
* init.c (initialize_vtable_ptrs): Remove no-vtable-thunk
code.
* rtti.c (build_headof): Remove no-vtable-thunk code.
(get_tinfo_decl_dynamic): Adjust build_vfn_ref call.
* search.c (get_base_distance): Remove expand_upcast_fixups case.
(virtual_context) Remove.
(expand_upcast_fixups): Remove.
(fixup_virtual_upcast_offsets): Remove.
(fixup_all_virtual_upcast_offsets): Remove.
* typeck.c (get_member_function_from_ptrfunc): Remove
no-vtable-thunk code.
* call.c (build_over_call): Adjust call to build_vfn_ref.
* class.c (build_vfn_ref): Lose first parameter. Remove
no-vtable-thunk code.
(build_rtti_vtbl_entries): Remove no-vtable-thunk code.
(build_vtable_entry): Remove no-vtable-thunk code.
From-SVN: r44227
Diffstat (limited to 'gcc/cp/class.c')
| -rw-r--r-- | gcc/cp/class.c | 101 |
1 files changed, 20 insertions, 81 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 99c8638..1667758 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -543,37 +543,16 @@ build_vtbl_ref (instance, idx) } /* Given an object INSTANCE, return an expression which yields the - virtual function corresponding to INDEX. There are many special - cases for INSTANCE which we take care of here, mainly to avoid - creating extra tree nodes when we don't have to. */ + virtual function corresponding to IDX. */ tree -build_vfn_ref (ptr_to_instptr, instance, idx) - tree *ptr_to_instptr, instance; +build_vfn_ref (instance, idx) + tree instance; tree idx; { tree aref = build_vtbl_ref (instance, idx); - /* When using thunks, there is no extra delta, and we get the pfn - directly. */ - if (flag_vtable_thunks) - return aref; - - if (ptr_to_instptr) - { - /* Save the intermediate result in a SAVE_EXPR so we don't have to - compute each component of the virtual function pointer twice. */ - if (TREE_CODE (aref) == INDIRECT_REF) - TREE_OPERAND (aref, 0) = save_expr (TREE_OPERAND (aref, 0)); - - *ptr_to_instptr - = build (PLUS_EXPR, TREE_TYPE (*ptr_to_instptr), - *ptr_to_instptr, - cp_convert (ptrdiff_type_node, - build_component_ref (aref, delta_identifier, NULL_TREE, 0))); - } - - return build_component_ref (aref, pfn_identifier, NULL_TREE, 0); + return aref; } /* Return the name of the virtual function table (as an IDENTIFIER_NODE) @@ -8019,16 +7998,12 @@ build_rtti_vtbl_entries (binfo, vid) vid->last_init = &TREE_CHAIN (*vid->last_init); /* Add the offset-to-top entry. It comes earlier in the vtable that - the the typeinfo entry. */ - if (flag_vtable_thunks) - { - /* Convert the offset to look like a function pointer, so that - we can put it in the vtable. */ - init = build1 (NOP_EXPR, vfunc_ptr_type_node, offset); - TREE_CONSTANT (init) = 1; - *vid->last_init = build_tree_list (NULL_TREE, init); - vid->last_init = &TREE_CHAIN (*vid->last_init); - } + the the typeinfo entry. Convert the offset to look like a + function pointer, so that we can put it in the vtable. */ + init = build1 (NOP_EXPR, vfunc_ptr_type_node, offset); + TREE_CONSTANT (init) = 1; + *vid->last_init = build_tree_list (NULL_TREE, init); + vid->last_init = &TREE_CHAIN (*vid->last_init); } /* Build an entry in the virtual function table. DELTA is the offset @@ -8045,54 +8020,18 @@ build_vtable_entry (delta, vcall_index, entry) tree vcall_index; tree entry; { - if (flag_vtable_thunks) - { - tree fn; - - fn = TREE_OPERAND (entry, 0); - if ((!integer_zerop (delta) || vcall_index != NULL_TREE) - && fn != abort_fndecl) - { - entry = make_thunk (entry, delta, vcall_index); - entry = build1 (ADDR_EXPR, vtable_entry_type, entry); - TREE_READONLY (entry) = 1; - TREE_CONSTANT (entry) = 1; - } -#ifdef GATHER_STATISTICS - n_vtable_entries += 1; -#endif - return entry; - } - else + tree fn = TREE_OPERAND (entry, 0); + + if ((!integer_zerop (delta) || vcall_index != NULL_TREE) + && fn != abort_fndecl) { - tree elems = tree_cons (NULL_TREE, delta, - tree_cons (NULL_TREE, integer_zero_node, - build_tree_list (NULL_TREE, entry))); - tree entry = build (CONSTRUCTOR, vtable_entry_type, NULL_TREE, elems); - - /* We don't use vcall offsets when not using vtable thunks. */ - my_friendly_assert (vcall_index == NULL_TREE, 20000125); - - /* DELTA used to be constructed by `size_int' and/or size_binop, - which caused overflow problems when it was negative. That should - be fixed now. */ - - if (! int_fits_type_p (delta, delta_type_node)) - { - if (flag_huge_objects) - sorry ("object size exceeds built-in limit for virtual function table implementation"); - else - sorry ("object size exceeds normal limit for virtual function table implementation, recompile all source and use -fhuge-objects"); - } - - TREE_CONSTANT (entry) = 1; - TREE_STATIC (entry) = 1; + entry = make_thunk (entry, delta, vcall_index); + entry = build1 (ADDR_EXPR, vtable_entry_type, entry); TREE_READONLY (entry) = 1; - + TREE_CONSTANT (entry) = 1; + } #ifdef GATHER_STATISTICS - n_vtable_entries += 1; + n_vtable_entries += 1; #endif - - return entry; - } + return entry; } |
