On 04/14/2014 04:06 PM, Jan Hubicka wrote:
1) write backend pass that walks vtables and for every non-hidden noreturn
function
it can produce hidden COMDAT wrapper with a fixed (GCC local) mangling.
Perhaps with a command line option to do so for all virtual functions;
while this
would introduce extra call into most of virtual calls, this may not be too
bad
with LTO, where we can do that only for virtuals that are exported from
unit.
With LTO, we could do this for all virtuals that are not defined
locally; nothing in the language allows you to compare the address value
of a vtable element...but I suppose speculative devirtualization does,
so maybe not.
2) make something similar in C++ FE (probably not so cool idea because of the
comment
above)
3) introduce hidden local_cxa_pure_virtual into bits that are linked into every
DSO so we do not need to play with COMDAT.
This makes sense to me.
Jason