This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -fvtable-gc
- To: Richard Henderson <rth at redhat dot com>
- Subject: Re: -fvtable-gc
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 12 Feb 2001 02:40:56 -0200
- Cc: Jason Merrill <jason at redhat dot com>, mark at codesourcery dot com, gcc at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
- References: <20010211201552.A15572@redhat.com>
On Feb 12, 2001, Richard Henderson <rth@redhat.com> wrote:
> typedef void (F::*F_ptr)();
> F_ptr baz() { return &F::foo; }
> I get an OFFSET_REF, which isn't actually documented anywhere,
> and I can't figure out what it means exactly.
Assuming F::foo is non-static (in which case you'll get a regular
pointer to function), its meaning depends on whether F::foo is virtual
or non-virtual. &F::foo is a struct containing (i) an offset into the
vtable or a pointer to the address of the non-virtual member function,
respectively, and (ii) a displacement to be applied to the
pointer-to-object when the pointer-to-method is used to invoke the
pointed-to method. Well, at least, it used to be something like
that. It may have changed since the last time I looked at it, which
was long before the introduction of the new abi. But the ideas should
still be similar.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me