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

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 16 15:43:47 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 =
----------------
sbc100 wrote:
> aheejin wrote:
> > Why delete and inline these strings in code?
> I find this pattern needlessly complex for single use strings.  At least in lld we try to avoid this.
Hmm, I see. Then maybe it would be better to inline other strings to be consistent, not necessarily in this CL though...


================
Comment at: lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp:723
     Changed = true; // We have setjmp or longjmp somewhere
 
     // Register saveSetjmp function
----------------
sbc100 wrote:
> aheejin wrote:
> > What happens now with the new linker when malloc and free are not in the module?
> If you don't include malloc/free (i.e. if you don't link with libc) and this pass adds references you will get "undefined symbol: malloc" at link time.  Seems reasonable?  
Yeah that sounds good.


Repository:
  rL LLVM

https://reviews.llvm.org/D49263





More information about the llvm-commits mailing list