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

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 4 11:21:55 PDT 2024


================
@@ -3239,6 +3239,12 @@ bool ASTReader::isConsumerInterestedIn(Decl *D) {
     if (ES->hasExternalDefinitions(D) == ExternalASTSource::EK_Never)
       return true;
 
+  // The dynamic class defined in a named module is interesting.
+  // The code generator needs to emit its vtable there.
+  if (const auto *Class = dyn_cast<CXXRecordDecl>(D))
+    return Class->isInCurrentModuleUnit() &&
+           Class->getDefinition() && Class->isDynamicClass();
+
----------------
dwblaikie wrote:

Why is this needed? Why doesn't it fall out of the condition above that covers `hasExternalDefinitions`?

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


More information about the cfe-commits mailing list