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

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 16:34:47 PST 2018


rnk added inline comments.


================
Comment at: lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp:900
+
+static ManagedStatic<StaticLibcallNameMap> LibcallNameMap;
+// TODO: If the RTLIB::Libcall-taking flavor of GetSignature remains unsed
----------------
dschuff wrote:
> dblaikie wrote:
> > 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)
> Yeah, it could, and it would be a bit simpler. The motivation was to avoid constructing the big data structures (signature table and name map) unless the wasm backend was actually used. Also I wanted to avoid having a static std::map.  Chrome has a pretty strong convention against static constructors, does LLVM have anything similar?
We do, but static locals are fine. They allow for lazy initialization at a small performance cost. Consider that errs() and outs() are implemented that way.


Repository:
  rL LLVM

https://reviews.llvm.org/D35592





More information about the llvm-commits mailing list