[PATCH] D66621: [clang] Devirtualization for classes with destructors marked as 'final'

Hiroshi Yamauchi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 23 08:34:40 PDT 2019


yamauchi added a comment.

Nice.

In D66621#1642142 <https://reviews.llvm.org/D66621#1642142>, @rsmith wrote:

> This seems subtle, but I believe it is correct.
>
> I wonder whether we should provide a warning for a non-final class has a final destructor, since moving the `final` from the destructor to the class seems like a more obvious way to present the code (and will likely lead to better code generation in compilers that haven't realized they can do this).


Richard, do you think there may be some missed devirtualization optimizations that would trigger if the class, rather than the destructor, is declared final in Clang? It seems this patch would take care of common call devirtualizations.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66621/new/

https://reviews.llvm.org/D66621





More information about the cfe-commits mailing list