forked from OSchip/llvm-project
[WebAssembly] Optimize Writer::lookupType
Followup on https://reviews.llvm.org/D41894 llvm-svn: 322219
This commit is contained in:
parent
70f137b6bf
commit
8d027d6758
|
@ -571,9 +571,12 @@ void Writer::calculateImports() {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Writer::lookupType(const WasmSignature &Sig) {
|
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));
|
error("type not found: " + toString(Sig));
|
||||||
return TypeIndices.lookup(Sig);
|
return 0;
|
||||||
|
}
|
||||||
|
return It->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Writer::registerType(const WasmSignature &Sig) {
|
uint32_t Writer::registerType(const WasmSignature &Sig) {
|
||||||
|
|
Loading…
Reference in New Issue