[PATCH] D52748: [WebAssembly] LSDA info generation

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 1 14:09:13 PDT 2018


aheejin created this revision.
aheejin added reviewers: dschuff, sbc100, majnemer.
Herald added subscribers: llvm-commits, sunfish, jgravelle-google, mgorny.

This adds support for LSDA (exception table) generation for wasm EH.
Wasm EH mostly follows the structure of Itanium-style exception tables,
with one exception: a call site table entry in wasm EH corresponds to
not a call site but a landing pad.

In wasm EH, the VM is responsible for stack unwinding. After an
exception occurs and the stack is unwound, the control flow is
transferred to wasm 'catch' instruction by the VM, after which the
personality function is called from the compiler-generated code. (Refer
to WasmEHPrepare pass for more information on this part.)

This patch:

- Changes wasm.landingpad.index intrinsic to take a token argument, to

make this 1:1 match with a catchpad instruction

- Stores landingpad index info and catch type info MachineFunction in

before instruction selection

- Lowers wasm.lsda intrinsic to an MCSymbol pointing to the start of an

exception table

- Adds WasmException class with overridden methods for table generation
- Add support for LSDA section in Wasm object writer


Repository:
  rL LLVM

https://reviews.llvm.org/D52748

Files:
  include/llvm/CodeGen/MachineFunction.h
  include/llvm/IR/IntrinsicsWebAssembly.td
  lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  lib/CodeGen/AsmPrinter/CMakeLists.txt
  lib/CodeGen/AsmPrinter/EHStreamer.cpp
  lib/CodeGen/AsmPrinter/EHStreamer.h
  lib/CodeGen/AsmPrinter/WasmException.cpp
  lib/CodeGen/AsmPrinter/WasmException.h
  lib/CodeGen/MachineFunction.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
  lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  lib/CodeGen/WasmEHPrepare.cpp
  lib/MC/MCObjectFileInfo.cpp
  lib/MC/WasmObjectWriter.cpp
  lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
  lib/Target/WebAssembly/WebAssemblyInstrInfo.td
  lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
  test/CodeGen/WebAssembly/eh-lsda.ll
  test/CodeGen/WebAssembly/wasmehprepare.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52748.167829.patch
Type: text/x-patch
Size: 38815 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181001/14c91968/attachment.bin>


More information about the llvm-commits mailing list