diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2002-12-30 13:39:48 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2002-12-30 13:39:48 +0000 |
commit | 07fa4878595a4d496d066941d948186fe701afdf (patch) | |
tree | b2f4b26dcfa4c39b16e56aaa74b284dd0dfd7bbe /gcc/cp/mangle.c | |
parent | 5a5cccaa4e00fd06fd8e8bf4e9f731dbda799dd3 (diff) | |
download | gcc-07fa4878595a4d496d066941d948186fe701afdf.zip gcc-07fa4878595a4d496d066941d948186fe701afdf.tar.gz gcc-07fa4878595a4d496d066941d948186fe701afdf.tar.bz2 |
cp-tree.h (THUNK_TARGET): New macro.
cp:
* cp-tree.h (THUNK_TARGET): New macro.
(THUNK_VIRTUAL_OFFSET): For result thunks it is always a binfo.
(finish_thunk): Remove offset parms.
* class.c (find_final_overrider): Look through thunks.
(get_vcall_index): Use THUNK_TARGET.
(update_vtable_entry_for_fn): Look through thunks. Set covariant
fixed offset here. Adjust finish_thunk call.
(build_vtbl_initializer): Adjust finish_thunk calls.
* mangle.c (mangle_call_offset): Remove superfluous if.
(mangle_thunk): Adjust.
* method.c (make_thunk): Adjust.
(finish_thunk): Adjust.
(thunk_adjust): Remove assert.
(use_thunk): Use THUNK_TARGET
* dump1.c (cp_dump_tree): Adjust thunk dumping.
testsuite:
* g++.dg/inherit/covariant5.C: New test.
* g++.dg/inherit/covariant6.C: New test.
* g++.dg/inherit/covariant7.C: New test.
From-SVN: r60628
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r-- | gcc/cp/mangle.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index cf106d5..70443aa 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -2545,10 +2545,7 @@ mangle_call_offset (fixed_offset, virtual_offset) tree fixed_offset; tree virtual_offset; { - if (virtual_offset) - write_char (virtual_offset ? 'v' : 'h'); - else - write_char ('h'); + write_char (virtual_offset ? 'v' : 'h'); /* For either flavor, write the fixed offset. */ write_integer_cst (fixed_offset); @@ -2590,24 +2587,27 @@ mangle_thunk (fn_decl, this_adjusting, fixed_offset, virtual_offset) write_string ("_Z"); write_char ('T'); - if (this_adjusting && !DECL_RESULT_THUNK_P (fn_decl)) - /* Plain this adjusting thunk. */ - mangle_call_offset (fixed_offset, virtual_offset); - else if (!this_adjusting) + if (!this_adjusting) { /* Covariant thunk with no this adjustment */ write_char ('c'); mangle_call_offset (integer_zero_node, NULL_TREE); mangle_call_offset (fixed_offset, virtual_offset); } + else if (!DECL_THUNK_P (fn_decl)) + /* Plain this adjusting thunk. */ + mangle_call_offset (fixed_offset, virtual_offset); else { /* This adjusting thunk to covariant thunk. */ write_char ('c'); mangle_call_offset (fixed_offset, virtual_offset); - mangle_call_offset (ssize_int (THUNK_FIXED_OFFSET (fn_decl)), - THUNK_VIRTUAL_OFFSET (fn_decl)); - fn_decl = TREE_OPERAND (DECL_INITIAL (fn_decl), 0); + fixed_offset = ssize_int (THUNK_FIXED_OFFSET (fn_decl)); + virtual_offset = THUNK_VIRTUAL_OFFSET (fn_decl); + if (virtual_offset) + virtual_offset = BINFO_VPTR_FIELD (virtual_offset); + mangle_call_offset (fixed_offset, virtual_offset); + fn_decl = THUNK_TARGET (fn_decl); } /* Scoped name. */ |