From adf62863f35c84e4c5708f3dc5a1589ce958a238 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 25 Aug 2024 12:56:24 +0200 Subject: Vendor import of llvm-project branch release/19.x llvmorg-19.1.0-rc3-0-g437434df21d8. --- clang/lib/Serialization/ASTWriterDecl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/lib/Serialization/ASTWriterDecl.cpp') diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp index 17c774038571..8a4ca54349e3 100644 --- a/clang/lib/Serialization/ASTWriterDecl.cpp +++ b/clang/lib/Serialization/ASTWriterDecl.cpp @@ -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 in that case the key function is meaningless. if (D->isCompleteDefinition()) Record.AddDeclRef(Context.getCurrentKeyFunction(D)); -- cgit v1.3