[PATCH] D49263: [WebAssembly] Update WebAssemblyLowerEmscriptenEHSjLj to handle separate compilation

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 12 13:09:36 PDT 2018


aheejin added inline comments.


================
Comment at: lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp:310
-const char *WebAssemblyLowerEmscriptenEHSjLj::SetThrewFName = "setThrew";
-const char *WebAssemblyLowerEmscriptenEHSjLj::SetTempRet0FName = "setTempRet0";
 const char *WebAssemblyLowerEmscriptenEHSjLj::EmLongjmpFName =
----------------
Why delete and inline these strings in code?


================
Comment at: lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp:336
 
-// Returns an available name for a global value.
-// If the proposed name already exists in the module, adds '_' at the end of
-// the name until the name is available.
-static inline std::string createGlobalValueName(const Module &M,
-                                                const std::string &Propose) {
-  std::string Name = Propose;
-  while (M.getNamedGlobal(Name))
-    Name += "_";
-  return Name;
+static GlobalVariable *createGlobalVariable(Module &M, IRBuilder<> &IRB,
+                                            const char *Name) {
----------------
Nit: Maybe `createInt32GlobalVariable`? Because the int32 type is hardcoded here


================
Comment at: lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp:723
     Changed = true; // We have setjmp or longjmp somewhere
 
     // Register saveSetjmp function
----------------
What happens now with the new linker when malloc and free are not in the module?


Repository:
  rL LLVM

https://reviews.llvm.org/D49263





More information about the llvm-commits mailing list