Open Trass3r opened 7 years ago
A function of interest is CodeGenFunction::CanDevirtualizeMemberFunctionCall.
// If that method is marked final, we can devirtualize it.
if (DevirtualizedMethod->hasAttr
// Similarly, if the class itself is marked 'final' it can't be overridden
// and we can therefore devirtualize the member function call.
if (BestDynamicDecl->hasAttr
Extended Description
Original patch: https://gcc.gnu.org/ml/gcc-patches/2014-08/msg00119.html
Explained in detail here: http://hubicka.blogspot.ch/2014/08/devirtualization-in-c-part-5-asking.html
Marking certain types final manually had significant performance impact on our code.