Skip to content

Commit 56e28a9

Browse files
committed
Use MapVector to fix lld thinLTO nondeterminism issue.
When the ModuleSymbolTable is generated, the binary consistency problem occurs due to the unorder of the data structure when collecting asm symbols.
1 parent ceaf6e9 commit 56e28a9

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
@@ -11,6 +11,7 @@
1111

1212
#include "llvm/ADT/DenseMap.h"
1313
#include "llvm/ADT/StringMap.h"
14+
#include "llvm/ADT/MapVector.h"
1415
#include "llvm/MC/MCDirectives.h"
1516
#include "llvm/MC/MCStreamer.h"
1617
#include "llvm/Support/SMLoc.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)