diff options
author | Nicholas Wilson <nicholas@nicholaswilson.me.uk> | 2018-03-14 15:45:11 +0000 |
---|---|---|
committer | Nicholas Wilson <nicholas@nicholaswilson.me.uk> | 2018-03-14 15:45:11 +0000 |
commit | c4d9aa1b5f9b7cd5982cdd3241a839bef22967ba (patch) | |
tree | 533a254d25aefb214ffb076dbb7e44d81e020f17 /lld/wasm/InputChunks.cpp | |
parent | 027b9357a8f23fdf9b0ab013ff27eaf9ec080961 (diff) | |
download | bcm5719-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.cpp | 7 |
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; |