[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 May 30 18:59:18 PDT 2024


================
@@ -1802,6 +1802,12 @@ void ItaniumCXXABI::emitVTableDefinitions(CodeGenVTables &CGVT,
   if (VTable->hasInitializer())
     return;
 
+  // If the class is attached to a C++ named module other than the one
+  // we're currently compiling, the vtable should be defined there.
+  if (Module *M = RD->getOwningModule();
+      M && M->isNamedModule() && M != CGM.getContext().getCurrentNamedModule())
----------------
ChuanqiXu9 wrote:

Yeah, understood. I just wanted to avoid checkout the old branch so that I can save the building time locally. And this point looks minor. I feel good to make it in following patches or with other required changes together in this patch.

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


More information about the cfe-commits mailing list