Skip to content

Commit 0c98776

Browse files
authored
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.
1 parent bd92e46 commit 0c98776

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Object/RecordStreamer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define LLVM_LIB_OBJECT_RECORDSTREAMER_H
1111

1212
#include "llvm/ADT/DenseMap.h"
13+
#include "llvm/ADT/MapVector.h"
1314
#include "llvm/ADT/StringMap.h"
1415
#include "llvm/MC/MCDirectives.h"
1516
#include "llvm/MC/MCStreamer.h"
@@ -32,7 +33,7 @@ class RecordStreamer : public MCStreamer {
3233
// Map of aliases created by .symver directives, saved so we can update
3334
// their symbol binding after parsing complete. This maps from each
3435
// aliasee to its list of aliases.
35-
DenseMap<const MCSymbol *, std::vector<StringRef>> SymverAliasMap;
36+
MapVector<const MCSymbol *, std::vector<StringRef>> SymverAliasMap;
3637

3738
/// Get the state recorded for the given symbol.
3839
State getSymbolState(const MCSymbol *Sym);

0 commit comments

Comments
 (0)