[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 25 00:48:09 PST 2024


================
@@ -1046,6 +1046,15 @@ CodeGenModule::getVTableLinkage(const CXXRecordDecl *RD) {
   if (!RD->isExternallyVisible())
     return llvm::GlobalVariable::InternalLinkage;
 
+  // Previously we'll decide the linkage of the vtable by the linkage
+  // of the key function. But within modules, the concept of key functions
+  // becomes meaningless. So the linkage of the vtable should always be
+  // external if the class is externally visible.
+  //
+  // TODO: How about the case of AppleKext, DLLExportAttr and DLLImportAttr.
----------------
ChuanqiXu9 wrote:

I've updated the comments. And I'd like to leave the simplification to later patches.

https://github.com/llvm/llvm-project/pull/75912


More information about the cfe-commits mailing list