This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] ctor vtable vcall offsets
- To: jason at redhat dot com
- Subject: Re: [C++ PATCH] ctor vtable vcall offsets
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Tue, 27 Feb 2001 10:21:21 -0800
- Cc: nathan at codesourcery dot com, gcc-patches at gcc dot gnu dot org
- Organization: CodeSourcery, LLC
- References: <u97l2cmawv.fsf@casey.cambridge.redhat.com>
>>>>> "Jason" == Jason Merrill <jason@redhat.com> writes:
Jason> Actually, I don't see why we ever need to emit thunks with
Jason> the vtable. The example in the ABI document is
Jason> struct A { virtual void f(); }; struct B : virtual public
Jason> A { int i; }; struct C : virtual public A { int j; };
Jason> struct D : public B, public C {};
Jason> But here, calling A::f() means converting to A* then
Jason> calling through the A vtable, so the entry in the C vtable
Jason> is never used.
Jason> What am I missing?
I thought the intent was to avoid having to do that conversion.
At the time you do the conversion, you don't know where the override
will be; in many cases it will be wasted work.
So, I thought the intent was to make sure that the entry in C's vtable
(which contains an entry for `f' since A is the primary base) is
valid.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com