Skip to content

Commit dc6f8ef

Browse files
committed
[ELF] Reword symMap/symVector comment. NFC
Having symVector makes iteration efficient and is actually more efficient than using llvm::DenseMap<llvm::CachedHashStringRef, Symbol *>, so the FIXME comment can be removed. Using an alternative implementation ankerl/unordered_dense.h decreases link time for chromium by 0.x% but I am unsure it justifies the extra header file.
1 parent 3ff6367 commit dc6f8ef

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lld/ELF/SymbolTable.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,9 @@ class SymbolTable {
7171
void assignWildcardVersion(SymbolVersion ver, uint16_t versionId,
7272
bool includeNonDefault);
7373

74-
// The order the global symbols are in is not defined. We can use an arbitrary
75-
// order, but it has to be reproducible. That is true even when cross linking.
76-
// The default hashing of StringRef produces different results on 32 and 64
77-
// bit systems so we use a map to a vector. That is arbitrary, deterministic
78-
// but a bit inefficient.
79-
// FIXME: Experiment with passing in a custom hashing or sorting the symbols
80-
// once symbol resolution is finished.
74+
// Global symbols and a map from symbol name to the index. The order is not
75+
// defined. We can use an arbitrary order, but it has to be deterministic even
76+
// when cross linking.
8177
llvm::DenseMap<llvm::CachedHashStringRef, int> symMap;
8278
SmallVector<Symbol *, 0> symVector;
8379

0 commit comments

Comments
 (0)