HomePhabricator

[WebAssembly] CFG stackify support for exception handling

Description

[WebAssembly] CFG stackify support for exception handling

Summary:
This adds support for exception handling to CFGStackify pass. This only
adds TRY / END_TRY markers and DOES NOT yet fix unwind mismatches that
can be created by the linearization of the CFG into the structural wasm
format. The mismatch fix will be added by following patches.

In detail, this patch

  • Added support for TRY / END_TRY markers to support EH
  • Changed many static functions into class member functions as they take

too many arguments now

  • Added several more bookeeping data structures
  • Refactored routines that decide where to insert markers, because

without refactoring this got too complicated as we added support for new
kinds of markers (TRY/END_TRY).

  • Rewrote rethrow instructions' BB arguments to relative depths in EH

pad stack.

Reviewers: dschuff, sunfish

Subscribers: sbc100, jgravelle-google, llvm-commits

Differential Revision: https://reviews.llvm.org/D48273

Details

Committed
aheejinAug 16 2018, 4:50 PM
Differential Revision
D48273: [WebAssembly] CFG stackify support for exception handling
Parents
rL339966: Revert "Implement a (simple) Markdown generator"
Branches
Unknown
Tags
Unknown

Event Timeline

RKSimon added inline comments.
/llvm/trunk/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
200

@aheejin gcc7.3 is complaining that WebAssemblyCFGStackify::unregisterScope is defined but not used.

OK to remove or just #if 0 out as it will be used in the future?

This comment was removed by aheejin.
aheejin marked 2 inline comments as done.Dec 7 2018, 1:35 PM
aheejin added inline comments.
/llvm/trunk/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
200

Sorry! Deleted the function in rL348647.