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/Writer.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/Writer.cpp')
-rw-r--r-- | lld/wasm/Writer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp index b6ffd1ef983..3c6a90bf1bb 100644 --- a/lld/wasm/Writer.cpp +++ b/lld/wasm/Writer.cpp @@ -477,7 +477,7 @@ void Writer::createLinkingSection() { std::map<StringRef, std::vector<ComdatEntry>> Comdats; for (const InputFunction *F : InputFunctions) { - StringRef Comdat = F->getComdat(); + StringRef Comdat = F->getComdatName(); if (!Comdat.empty()) Comdats[Comdat].emplace_back( ComdatEntry{WASM_COMDAT_FUNCTION, F->getFunctionIndex()}); @@ -486,10 +486,10 @@ void Writer::createLinkingSection() { const auto &InputSegments = Segments[I]->InputSegments; if (InputSegments.empty()) continue; - StringRef Comdat = InputSegments[0]->getComdat(); + StringRef Comdat = InputSegments[0]->getComdatName(); #ifndef NDEBUG for (const InputSegment *IS : InputSegments) - assert(IS->getComdat() == Comdat); + assert(IS->getComdatName() == Comdat); #endif if (!Comdat.empty()) Comdats[Comdat].emplace_back(ComdatEntry{WASM_COMDAT_DATA, I}); |