This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Add seperate Writer::lookupType and Writer::registerType. NFC
ClosedPublic

Authored by sbc100 on Jan 9 2018, 5:33 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

sbc100 created this revision.Jan 9 2018, 5:33 PM
sbc100 updated this revision to Diff 129202.Jan 9 2018, 5:34 PM
  • remove extra assert
sbc100 added a reviewer: ruiu.Jan 9 2018, 5:35 PM

This is small change that was split out from D41893

This revision was not accepted when it landed; it landed in state Needs Review.Jan 10 2018, 11:19 AM
This revision was automatically updated to reflect the committed changes.
ruiu added inline comments.Jan 10 2018, 11:24 AM
lld/trunk/wasm/Writer.cpp
574–576
auto It = TypeIndices.find(Sig);
if (It == TypeIndices.end()) {
  error(...);
  return 0;
}
return *It;

is faster because it looks up the hash table only once.

sbc100 added inline comments.Jan 10 2018, 12:14 PM
lld/trunk/wasm/Writer.cpp
574–576

Fixed in followup CL: rL322219