[libcxxabi] Add macro for changing functions to support the relative vtables ABI
authorLeonard Chan <leonardchan@google.com>
Mon, 6 Apr 2020 23:08:58 +0000 (16:08 -0700)
committerLeonard Chan <leonardchan@google.com>
Mon, 30 Nov 2020 18:50:05 +0000 (10:50 -0800)
commit61aec69a65dec949f3d2556c4d0efaa87869e1ee
tree2f81c51a28509490a0ee1d69f6cfa0a775ac1558
parente425d0b92a1df69e5e41e6b23801fabeaaef7937
[libcxxabi] Add macro for changing functions to support the relative vtables ABI

Under the relative vtables ABI, __dynamic_cast will not work since it assumes
the vtable pointer is 2 ptrdiff_ts away from the start of the vtable (8-byte
offset to top + 8-byte pointer to typeinfo) when it is actually 8 bytes away
(4-byte offset to top + 4-byte offset to typeinfo). This adjusts the logic under
__dynamic_cast and other areas vtable calculations are done to support this ABI
when it's used.

Differential Revision: https://reviews.llvm.org/D77606
libcxxabi/src/private_typeinfo.cpp