summaryrefslogtreecommitdiffstats
path: root/lld/wasm/InputChunks.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/InputChunks.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/InputChunks.cpp')
-rw-r--r--lld/wasm/InputChunks.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lld/wasm/InputChunks.cpp b/lld/wasm/InputChunks.cpp
index ef3edb8b9ca..0cac19b3d4e 100644
--- a/lld/wasm/InputChunks.cpp
+++ b/lld/wasm/InputChunks.cpp
@@ -36,6 +36,13 @@ std::string lld::toString(const InputChunk *C) {
return (toString(C->File) + ":(" + C->getName() + ")").str();
}
+StringRef InputChunk::getComdatName() const {
+ uint32_t Index = getComdat();
+ if (Index == UINT32_MAX)
+ return StringRef();
+ return File->getWasmObj()->linkingData().Comdats[Index];
+}
+
void InputChunk::copyRelocations(const WasmSection &Section) {
if (Section.Relocations.empty())
return;
OpenPOWER on IntegriCloud