[PATCH] D35592: [WebAssembly] Remove duplicated RTLIB names

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 08:26:08 PDT 2017


dblaikie added inline comments.


================
Comment at: lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp:92-95
+  RuntimeLibcallSignatureTable() {
+    Table.resize(RTLIB::UNKNOWN_LIBCALL);
+    // Any newly-added libcalls will be unsupported by default.
+    std::fill(Table.begin(), Table.end(), unsupported);
----------------
Looks like all this should be:

  RuntimeLibcallSignatureTable() : Table(RTLIB::UNKNOWN_LIBCALL, unsupported) {


================
Comment at: lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp:95
+    // Any newly-added libcalls will be unsupported by default.
+    std::fill(Table.begin(), Table.end(), unsupported);
+
----------------
If this table is filled with 'unsupported' - could this do away with all the unsupported cases/initializations below?


================
Comment at: lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp:900
+
+static ManagedStatic<StaticLibcallNameMap> LibcallNameMap;
+// TODO: If the RTLIB::Libcall-taking flavor of GetSignature remains unsed
----------------
Could this maybe be a static local in GetSignature instead? Seems like it'd be simpler - there's no need to destroy it with llvm_shutdown, etc. (I suppose arguably it'd reduce memory usage/free unused memory for a client that's finished using LLVM for now, etc)


https://reviews.llvm.org/D35592





More information about the llvm-commits mailing list