[clang] [C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #109167)
Reid Kleckner via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 26 09:16:59 PDT 2024
================
@@ -5706,6 +5707,27 @@ void ASTWriter::WriteDeclAndTypes(ASTContext &Context) {
Stream.EmitRecord(DELAYED_NAMESPACE_LEXICAL_VISIBLE_RECORD,
DelayedNamespaceRecord);
+ if (!FunctionToLambdasMap.empty()) {
+ // TODO: on disk hash table for function to lambda mapping might be more
+ // efficent becuase it allows lazy deserialization.
+ RecordData FunctionToLambdasMapRecord;
+ for (const auto &Pair : FunctionToLambdasMap) {
----------------
rnk wrote:
This looks like the non-deterministic for loop, this is the DenseMap iteration that decides what to write to disk. I'll just send a patch to make this a MapVector.
https://github.com/llvm/llvm-project/pull/109167
More information about the cfe-commits
mailing list