[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 7 11:12:38 PDT 2024
================
@@ -1216,6 +1228,21 @@ bool CodeGenVTables::isVTableExternal(const CXXRecordDecl *RD) {
TSK == TSK_ExplicitInstantiationDefinition)
return false;
+ // Itanium C++ ABI [5.2.3]:
+ // Virtual tables for dynamic classes are emitted as follows:
+ //
+ // - If the class is templated, the tables are emitted in every object that
+ // references any of them.
+ // - Otherwise, if the class is attached to a module, the tables are uniquely
+ // emitted in the object for the module unit in which it is defined.
+ // - Otherwise, if the class has a key function (see below), the tables are
+ // emitted in the object for the translation unit containing the definition of
+ // the key function. This is unique if the key function is not inline.
+ // - Otherwise, the tables are emitted in every object that references any of
+ // them.
----------------
mizvekov wrote:
Can you break this down and put the bullets at each part that handles it?
For example, we handle the first bullet just above.
The second bullet is handled here.
The third bullet goes just below.
The fourth bullet goes at the end of the function.
https://github.com/llvm/llvm-project/pull/102287
More information about the cfe-commits
mailing list