[lld] r322219 - [WebAssembly] Optimize Writer::lookupType
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 10 12:12:26 PST 2018
Author: sbc
Date: Wed Jan 10 12:12:26 2018
New Revision: 322219
URL: http://llvm.org/viewvc/llvm-project?rev=322219&view=rev
Log:
[WebAssembly] Optimize Writer::lookupType
Followup on https://reviews.llvm.org/D41894
Modified:
lld/trunk/wasm/Writer.cpp
Modified: lld/trunk/wasm/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/Writer.cpp?rev=322219&r1=322218&r2=322219&view=diff
==============================================================================
--- lld/trunk/wasm/Writer.cpp (original)
+++ lld/trunk/wasm/Writer.cpp Wed Jan 10 12:12:26 2018
@@ -571,9 +571,12 @@ void Writer::calculateImports() {
}
uint32_t Writer::lookupType(const WasmSignature &Sig) {
- if (TypeIndices.count(Sig) == 0)
+ auto It = TypeIndices.find(Sig);
+ if (It == TypeIndices.end()) {
error("type not found: " + toString(Sig));
- return TypeIndices.lookup(Sig);
+ return 0;
+ }
+ return It->second;
}
uint32_t Writer::registerType(const WasmSignature &Sig) {
More information about the llvm-commits
mailing list