[clang] [C++20][Modules] Fix non-determinism in serialized AST (PR #110131)

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 26 09:24:23 PDT 2024


================
@@ -5713,8 +5713,7 @@ void ASTWriter::WriteDeclAndTypes(ASTContext &Context) {
     // efficent becuase it allows lazy deserialization.
     RecordData FunctionToLambdasMapRecord;
     for (const auto &Pair : FunctionToLambdasMap) {
----------------
rnk wrote:

This is now an iteration of a DenseMap of non-pointers, which I suppose is arbitrary, but determinstic. Are you sure it isn't preferable to write these in the order in which they were added to the map? That's the behavior you'd get from a MapVector, which seems better.

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


More information about the cfe-commits mailing list