diff options
author | Mark Mitchell <mark@codesourcery.com> | 2002-11-04 01:45:58 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2002-11-04 01:45:58 +0000 |
commit | 548502d3b1a9d50061b1ee76ec6e94071d77029f (patch) | |
tree | d9bab1647f82529995df625763d3ea7ac083c4b2 /gcc/testsuite/g++.dg/abi | |
parent | 55376e412851fb852f4b5c72d1da5e12aec0a459 (diff) | |
download | gcc-548502d3b1a9d50061b1ee76ec6e94071d77029f.zip gcc-548502d3b1a9d50061b1ee76ec6e94071d77029f.tar.gz gcc-548502d3b1a9d50061b1ee76ec6e94071d77029f.tar.bz2 |
call.c (build_special_member_call): Do not try to lookup VTTs by name.
* call.c (build_special_member_call): Do not try to lookup VTTs by
name.
* class.c (vtbl_init_data): Add generate_vcall_entries.
(get_vtable_decl): Do not look up virtual tables by name.
(copy_virtuals): Do not use BV_USE_VCALL_INDEX_P.
(set_primary_base): Do not set CLASSTYPE_RTTI.
(determine_primary_base): Likewise.
(get_matching_virtual): Remove.
(get_vcall_index): New function.
(update_vtable_entry_for_fn): Do not try to use virtual thunks
when they are not required. Assign vcall indices at this point.
(finish_struct_1): Do not set CLASSTYPE_NEEDS_VIRTUAL_REINIT.
Do update dynamic_classes.
(build_vtt): Do not add VTTs to the symbol table.
(build_ctor_vtbl_group): Likewise.
(build_vtbl_initializer): Simplify handling of vcall indices.
(build_vcall_offset_vtbl_entries): Pretend to build vcall offsets
for the most derived class.
(add_vcall_offset_vtbl_entries_1): But do not actually add them to
the vtable.
* cp-tree.h (dynamic_classes): New macro.
(lang_type_class): Remove rtti. Add vtables. Add vcall_indices.
(CLASSTYPE_RTTI): Remove.
(CLASSTYPE_NEEDS_VIRTUAL_REINIT): Remove.
(CLASSTYPE_VCALL_INDICES): New macro.
(CLASSTYPE_VTABLES): Likewise.
(BV_USE_VCALL_INDEX_P): Remove.
(build_vtable_path): Remove.
* decl2.c (finish_vtable_vardecl): Remove.
(key_method): Remove #if 0'd code.
(finish_vtable_vardecl): Rename to ...
(maybe_emit_vtables): ... this.
(finish_file): Use it.
* search.c (look_for_overrides_here): Update comment.
* g++.dg/abi/thunk1.C: New test.
* g++.dg/abi/thunk2.C: Likewise.
* g++.dg/abi/vtt1.C: Likewise.
From-SVN: r58779
Diffstat (limited to 'gcc/testsuite/g++.dg/abi')
-rw-r--r-- | gcc/testsuite/g++.dg/abi/thunk1.C | 22 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/abi/thunk2.C | 26 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/abi/vtt1.C | 11 |
3 files changed, 59 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/abi/thunk1.C b/gcc/testsuite/g++.dg/abi/thunk1.C new file mode 100644 index 0000000..c9ad5b4 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/thunk1.C @@ -0,0 +1,22 @@ +// { dg-do compile { target i?86-*-* } } + +struct A { + virtual void f (); +}; + +struct B : public virtual A { + virtual void f (); +}; + +struct C { + virtual void g (); +}; + +struct D : public C, public B { + virtual void f (); +}; + +void D::f () {} + +// { dg-final { scan-assembler _ZThn4_N1D1fEv } } +// { dg-final { scan-assembler _ZTv0_n12_N1D1fEv } } diff --git a/gcc/testsuite/g++.dg/abi/thunk2.C b/gcc/testsuite/g++.dg/abi/thunk2.C new file mode 100644 index 0000000..b1c9788 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/thunk2.C @@ -0,0 +1,26 @@ +// { dg-do compile { target i?86-*-* } } +// { dg-options -w } + +struct A { + virtual void f2 (); + virtual void f3 (); +}; + +struct B : virtual public A { + virtual void f3 (); +}; + +struct C : public A, public B { + virtual void f4 (); +}; + +struct D : virtual public B, virtual public C, virtual public A +{ + virtual void f5 (); + virtual void f6 (); + virtual void f3 (); +}; + +void D::f3 () {} + +// { dg-final { scan-assembler _ZTvn4_n20_N1D2f3Ev } } diff --git a/gcc/testsuite/g++.dg/abi/vtt1.C b/gcc/testsuite/g++.dg/abi/vtt1.C new file mode 100644 index 0000000..8235c46 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/vtt1.C @@ -0,0 +1,11 @@ +// { dg-do compile } + +struct A { +}; + +struct B : virtual public A { +}; + +B b; + +// { dg-final { scan-assembler _ZTT1B } } |