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

David Majnemer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 25 20:07:20 PST 2018


majnemer added inline comments.


================
Comment at: include/llvm/CodeGen/Passes.h:325
   /// adapted to code generation.  Required if using dwarf exception handling.
-  FunctionPass *createDwarfEHPass();
+  FunctionPass *createDwarfEHPass(bool PruneUnreachableResumes=true);
 
----------------
clang-format this


================
Comment at: include/llvm/IR/IntrinsicsWebAssembly.td:37-48
+// This intrinsic has a functionality of wasm catch / if_except / else / end
+// instructions combined. Wasm catch instruction returns a caught wasm
+// exception, which is of wasm except_ref type. Wasm if_except instruction is
+// used to extract a LLVM IR pointer from it. A call to this instruction is
+// lowered into a sequence of catch / if_except / else / end in the backend.
+def int_wasm_catch_extract : Intrinsic<[llvm_ptr_ty], [], [IntrHasSideEffects]>;
+// WebAssembly EH must maintain the landingpads in the order assigned to them
----------------
Please add some white space before each comment block, it is tough to read this.


================
Comment at: lib/CodeGen/WasmEHPrepare.cpp:180-183
+  for (BasicBlock &BB : F) {
+    if (BB.isEHPad())
+      LPads.push_back(&BB);
+  }
----------------
No need to brace.


================
Comment at: lib/CodeGen/WasmEHPrepare.cpp:288-291
+  // If this is not a top level landing pad, i.e., there is another landing pad
+  // that dominates this landing pad, we don't need to store LSDA address again,
+  // because they are the same throughout the function and have been already
+  // stored before.
----------------
What if this landing pad is dominated by two landing pads which are both top-level?


Repository:
  rL LLVM

https://reviews.llvm.org/D43746





More information about the llvm-commits mailing list