[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.
This commit is contained in:
Fangrui Song 2023-02-08 10:50:44 -08:00
parent 3ff636729d
commit dc6f8ef57c

View File

@ -71,13 +71,9 @@ private:
void assignWildcardVersion(SymbolVersion ver, uint16_t versionId,
bool includeNonDefault);
// The order the global symbols are in is not defined. We can use an arbitrary
// order, but it has to be reproducible. That is true even when cross linking.
// The default hashing of StringRef produces different results on 32 and 64
// bit systems so we use a map to a vector. That is arbitrary, deterministic
// but a bit inefficient.
// FIXME: Experiment with passing in a custom hashing or sorting the symbols
// once symbol resolution is finished.
// Global symbols and a map from symbol name to the index. The order is not
// defined. We can use an arbitrary order, but it has to be deterministic even
// when cross linking.
llvm::DenseMap<llvm::CachedHashStringRef, int> symMap;
SmallVector<Symbol *, 0> symVector;