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

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 7 12:17:29 PDT 2024


================
@@ -3219,7 +3219,8 @@ void CodeGenModule::EmitVTablesOpportunistically() {
   for (const CXXRecordDecl *RD : OpportunisticVTables) {
     assert(getVTables().isVTableExternal(RD) &&
            "This queue should only contain external vtables");
-    if (getCXXABI().canSpeculativelyEmitVTable(RD))
+    if (getCXXABI().canSpeculativelyEmitVTable(RD) &&
+        !RD->shouldEmitInExternalSource())
----------------
efriedma-quic wrote:

Can you sink this check into canSpeculativelyEmitVTable()?  If we're not going to do available_externally vtables, I think the other callers of canSpeculativelyEmitVTable also want this check.

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


More information about the cfe-commits mailing list