[WebAssembly] Update InstPrinter support for EH
authorHeejin Ahn <aheejin@gmail.com>
Sun, 27 Dec 2020 09:10:53 +0000 (01:10 -0800)
committerHeejin Ahn <aheejin@gmail.com>
Sat, 9 Jan 2021 10:42:35 +0000 (02:42 -0800)
commit0d8dfbb42a7d5e152bb98e50f170317ba60c47ef
tree20742252d196e53b8efa9d71b69f18ecc8a25059
parentbb0e621387f86c1e40b39fcfd9127d4d18294748
[WebAssembly] Update InstPrinter support for EH

- Updates InstPrinter to handle `catch_all`.
- Makes `rethrow` condition an early exit from the function to make the
  rest simpler.
- Unify label and catch counters. They don't need to be counted
  separately and this will help `delegate` instruction later.
- Removes `LastSeenEHInst` field. This was first introduced to handle
  when there are more than one `catch` blocks per `try`, but this was
  not implemented correctly and not being used at the moment anyway.
- Reenables all tests in cfg-stackify-eh.ll that don't deal with unwind
  destination mismatches, which will be handled in a later CL.

Reviewed By: dschuff, tlively, aardappel

Differential Revision: https://reviews.llvm.org/D94043
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.cpp
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.h
llvm/test/CodeGen/WebAssembly/cfg-stackify-eh.ll
llvm/test/MC/WebAssembly/annotations.s