[PATCH] D42271: [WebAssembly] Fix libcall signature lookup

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 08:44:32 PST 2018


dschuff added inline comments.


================
Comment at: lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp:476
+    if (name && RuntimeLibcallSignatures->Table[RTLIB::code] != unsupported) { \
+      assert(Map.find(StringRefOrEmpty(name)) == Map.end() && "duplicate libcall names in name map"); \
+      Map[StringRefOrEmpty(name)] = RTLIB::code; \
----------------
sbc100 wrote:
> No need for StringRefOrEmpty anymore since its already inside a null check?
Actually it is needed because the macro expands to `Map.find(nullptr)` and you can't construct a StringRef from nullptr. However I just double-checked that and discovered that I duplicated `StringRef::withNullAsEmpty()` so, switched to that 👍 


Repository:
  rL LLVM

https://reviews.llvm.org/D42271





More information about the llvm-commits mailing list