Skip to content

Commit 8ea504b

Browse files
zygoloidtru
authored andcommitted
Add release node for exact dynamic_cast optimization.
1 parent a72cc97 commit 8ea504b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ C++ Language Changes
8585
- Implemented `CWG2518 <https://wg21.link/CWG2518>`_ which allows ``static_assert(false)``
8686
to not be ill-formed when its condition is evaluated in the context of a template definition.
8787
- Declaring namespace std to be an inline namespace is now prohibited, `[namespace.std]p7`.
88+
- Improved code generation for ``dynamic_cast`` to a ``final`` type. Instead of
89+
dispatching to the runtime library to compare the RTTI data, Clang now
90+
generates a direct comparison of the vtable pointer in cases where the ABI
91+
requires the vtable for a class to be unique. This optimization can be
92+
disabled with ``-fno-assume-unique-vtables``. This optimization is not yet
93+
implemented for the MS C++ ABI.
8894

8995
C++20 Feature Support
9096
^^^^^^^^^^^^^^^^^^^^^
@@ -279,6 +285,8 @@ New Compiler Flags
279285
and thread-local variables—to guarantee that they can be directly addressed.
280286
Since this inhibits the merging of the affected variables, the number of
281287
individual relocations in the program will generally increase.
288+
- ``-f[no-]assume-unique-vtables`` controls whether Clang assumes that each
289+
class has a unique vtable address, when that is required by the ABI.
282290

283291
Deprecated Compiler Flags
284292
-------------------------

0 commit comments

Comments
 (0)