[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


================
@@ -1529,8 +1529,14 @@ void ASTDeclWriter::VisitCXXRecordDecl(CXXRecordDecl *D) {
   if (D->isThisDeclarationADefinition())
     Record.AddCXXDefinitionData(D);
 
+  if (D->isCompleteDefinition() && D->isInNamedModule())
+    Writer.AddDeclRef(D, Writer.ModularCodegenDecls);
+
   // Store (what we currently believe to be) the key function to avoid
   // deserializing every method so we can compute it.
+  //
+  // FIXME: Avoid adding the key function if the class is defined in
+  // module purview since the key function is meaningless in module purview.
----------------
mizvekov wrote:

```suggestion
  // module purview since in that case the key function is meaningless.
```

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


More information about the cfe-commits mailing list