[PATCH] D43746: [WebAssembly] Add Wasm exception handling prepare pass

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 17 09:30:45 PDT 2018


dschuff added a comment.

The Wasm code looks good with the one comment so LGTM if @majnemer is OK with the modification to `WinEHPrepare`.



================
Comment at: lib/CodeGen/WasmEHPrepare.cpp:195
+  // it
+  CatchF = Intrinsic::getDeclaration(&M, Intrinsic::wasm_catch_extract);
+  // wasm.eh.landingpad.index() intrinsic, which is to specify landingpad index
----------------
aheejin wrote:
> dschuff wrote:
> > Could these `getDeclaration`s, `getOrInsertFunction`s, GlobalVariable fields etc be moved to `doInitialization`? Or maybe all except the one that requires the TargetMachine?
> Done. I initially put them in `runOnFunction` because I didn't want to insert them if the program does not use exceptions thus has no landing pad. But they are gonna be deleted anyway at the end if unused, so I guess it's fine to move.
Oh, that's a good point; I think you had it right the first time and that it does make sense not to unnecessarily add the globals (even if the cost is a bit of redundancy). Can you put it back? (sorry!)


Repository:
  rL LLVM

https://reviews.llvm.org/D43746





More information about the llvm-commits mailing list