Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Kyungwoo Lee <kyu...@meta.com>,Dmitry Polukhin <dmitry.poluk...@gmail.com> Message-ID: In-Reply-To: <llvm.org/llvm/llvm-project/pull/104...@github.com>
================ @@ -764,6 +792,15 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { Record.push_back(D->param_size()); for (auto *P : D->parameters()) Record.AddDeclRef(P); + + // Store references to all lambda decls inside function to load them + // immediately after loading the function to make sure that canonical + // decls for lambdas will be from the same module. + llvm::SmallVector<const Decl *, 2> Lambdas = collectLambdas(D); + Record.push_back(Lambdas.size()); + for (const auto *L : Lambdas) + Record.AddDeclRef(L); ---------------- ChuanqiXu9 wrote: Also probably we need to update the abbreviation. You need to look at `DeclCXXMethodAbbrev` and `getFunctionDeclAbbrev`. https://github.com/llvm/llvm-project/pull/104512 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits