summaryrefslogtreecommitdiffstats
path: root/lld/wasm/SymbolTable.cpp
diff options
context:
space:
mode:
authorNicholas Wilson <nicholas@nicholaswilson.me.uk>2018-03-14 15:45:11 +0000
committerNicholas Wilson <nicholas@nicholaswilson.me.uk>2018-03-14 15:45:11 +0000
commitc4d9aa1b5f9b7cd5982cdd3241a839bef22967ba (patch)
tree533a254d25aefb214ffb076dbb7e44d81e020f17 /lld/wasm/SymbolTable.cpp
parent027b9357a8f23fdf9b0ab013ff27eaf9ec080961 (diff)
downloadbcm5719-llvm-c4d9aa1b5f9b7cd5982cdd3241a839bef22967ba.tar.gz
bcm5719-llvm-c4d9aa1b5f9b7cd5982cdd3241a839bef22967ba.zip
[WebAssembly] Avoid COMDAT hashmap lookup for each symbol. NFC
This reduces the number of lookups to one per COMDAT group, rather than one per symbol in a COMDAT group. Differential Revision: https://reviews.llvm.org/D44344 llvm-svn: 327523
Diffstat (limited to 'lld/wasm/SymbolTable.cpp')
-rw-r--r--lld/wasm/SymbolTable.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lld/wasm/SymbolTable.cpp b/lld/wasm/SymbolTable.cpp
index a722472c291..153b507f89d 100644
--- a/lld/wasm/SymbolTable.cpp
+++ b/lld/wasm/SymbolTable.cpp
@@ -304,6 +304,6 @@ void SymbolTable::addLazy(ArchiveFile *File, const Archive::Symbol *Sym) {
}
}
-bool SymbolTable::addComdat(StringRef Name, const ObjFile *File) {
- return Comdats.insert({Name, File}).first->second == File;
+bool SymbolTable::addComdat(StringRef Name) {
+ return Comdats.insert(CachedHashStringRef(Name)).second;
}
OpenPOWER on IntegriCloud