[llvm] 0c98776 - Use MapVector to fix lld thinLTO "nondeterminism" issue. (#117551)

via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 2 14:16:24 PST 2024


Author: llvmssh
Date: 2024-12-02T14:16:19-08:00
New Revision: 0c98776159cea0d1f391a8e1ac290483d4490240

URL: https://github.com/llvm/llvm-project/commit/0c98776159cea0d1f391a8e1ac290483d4490240
DIFF: https://github.com/llvm/llvm-project/commit/0c98776159cea0d1f391a8e1ac290483d4490240.diff

LOG: Use MapVector to fix lld thinLTO "nondeterminism" issue. (#117551)

When the ModuleSymbolTable is generated, the binary consistency problem occurs due to the
data structure for collecting asm symbols was ordered by memory pointers.

Added: 
    

Modified: 
    llvm/lib/Object/RecordStreamer.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Object/RecordStreamer.h b/llvm/lib/Object/RecordStreamer.h
index 70b41f270720b4..d9ef27c7901683 100644
--- a/llvm/lib/Object/RecordStreamer.h
+++ b/llvm/lib/Object/RecordStreamer.h
@@ -10,6 +10,7 @@
 #define LLVM_LIB_OBJECT_RECORDSTREAMER_H
 
 #include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/MapVector.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/MC/MCDirectives.h"
 #include "llvm/MC/MCStreamer.h"
@@ -32,7 +33,7 @@ class RecordStreamer : public MCStreamer {
   // Map of aliases created by .symver directives, saved so we can update
   // their symbol binding after parsing complete. This maps from each
   // aliasee to its list of aliases.
-  DenseMap<const MCSymbol *, std::vector<StringRef>> SymverAliasMap;
+  MapVector<const MCSymbol *, std::vector<StringRef>> SymverAliasMap;
 
   /// Get the state recorded for the given symbol.
   State getSymbolState(const MCSymbol *Sym);


        


More information about the llvm-commits mailing list