This marks virtual function declarations, as well as runtime library functions
cxa_pure_virtual, cxa_deleted_virtual and _purecall, as unnamed_addr. This
will allow us to correctly form relative references to them from vtables in
the relative vtable ABI.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
The underscore check seems over-broad; we support a lot of language dialects and runtimes besides the Itanium C++ runtime. This would be both more conservative and more convincing if it were constrained to the functions that we expect to put in v-tables.
Done (this also affects _purecall in the MS ABI; I don't think this change should break anything there, but someone working on that might want to comment). Since this patch is now specific to virtual tables anyway, I've incorporated another relevant change, which is to mark virtual function declarations as unnamed_addr.
I see, they weren't being set on declarations, just definitions. Yes, this seems reasonable.
That shouldn't matter. Virtual member functions are wrapped with a thunk, so comparisons won't actually involve pointers to __purecall.
Member function comparisons of virtual functions aren't required to work anyway. Itanium just happens to implement them in a way that kindof gets it right (for simple cases).