llvm-project/llvm/lib/CodeGen/AsmPrinter
Heejin Ahn d6f487863d [WebAssembly] Exception handling: Switch to the new proposal
Summary:
This switches the EH implementation to the new proposal:
https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md
(The previous proposal was
 https://github.com/WebAssembly/exception-handling/blob/master/proposals/old/Exceptions.md)

- Instruction changes
  - Now we have one single `catch` instruction that returns a except_ref
    value
  - `throw` now can take variable number of operations
  - `rethrow` does not have 'depth' argument anymore
  - `br_on_exn` queries an except_ref to see if it matches the tag and
    branches to the given label if true.
  - `extract_exception` is a pseudo instruction that simulates popping
    values from wasm stack. This is to make `br_on_exn`, a very special
    instruction, work: `br_on_exn` puts values onto the stack only if it
    is taken, and the # of values can vay depending on the tag.

- Now there's only one `catch` per `try`, this patch removes all special
  handling for terminate pad with a call to `__clang_call_terminate`.
  Before it was the only case there are two catch clauses (a normal
  `catch` and `catch_all` per `try`).

- Make `rethrow` act as a terminator like `throw`. This splits BB after
  `rethrow` in WasmEHPrepare, and deletes an unnecessary `unreachable`
  after `rethrow` in LateEHPrepare.

- Now we stop at all catchpads (because we add wasm `catch` instruction
  that catches all exceptions), this creates new
  `findWasmUnwindDestinations` function in SelectionDAGBuilder.

- Now we use `br_on_exn` instrution to figure out if an except_ref
  matches the current tag or not, LateEHPrepare generates this sequence
  for catch pads:
```
  catch
  block i32
  br_on_exn $__cpp_exception
  end_block
  extract_exception
```

- Branch analysis for `br_on_exn` in WebAssemblyInstrInfo

- Other various misc. changes to switch to the new proposal.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 352598
2019-01-30 03:21:57 +00:00
..
ARMException.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
AccelTable.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
AddressPool.cpp DebugInfo: Use assembly label arithmetic for address pool size for easier reading/editing 2019-01-24 03:27:57 +00:00
AddressPool.h DebugInfo: Use assembly label arithmetic for address pool size for easier reading/editing 2019-01-24 03:27:57 +00:00
AsmPrinter.cpp [MC] Teach the MachO object writer about N_FUNC_COLD 2019-01-25 18:30:22 +00:00
AsmPrinterDwarf.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
AsmPrinterInlineAsm.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ByteStreamer.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt Revert "[BTF] Add BTF DebugInfo" 2018-11-30 16:54:43 +00:00
CodeViewDebug.cpp [CodeView] Allow empty types in member functions 2019-01-23 00:53:22 +00:00
CodeViewDebug.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DIE.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DIEHash.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DIEHash.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DIEHashAttributes.def Fix DIEHash refactoring that dropped the DW_AT_name from the hash 2017-05-23 18:36:07 +00:00
DbgEntityHistoryCalculator.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DebugHandlerBase.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DebugLocEntry.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DebugLocStream.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DebugLocStream.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DwarfCFIException.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DwarfCompileUnit.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DwarfCompileUnit.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DwarfDebug.cpp [TEST][COMMIT] - fix comment typo in AsmPrinter/DwarfDebug.cpp - NFC 2019-01-25 16:29:35 +00:00
DwarfDebug.h [DEBUG_INFO, NVPTX] Fix relocation info. 2019-01-22 17:24:16 +00:00
DwarfException.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DwarfExpression.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DwarfExpression.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DwarfFile.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DwarfFile.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DwarfStringPool.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DwarfStringPool.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DwarfUnit.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DwarfUnit.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
EHStreamer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
EHStreamer.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ErlangGCPrinter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
OcamlGCPrinter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
WasmException.cpp [WebAssembly] Exception handling: Switch to the new proposal 2019-01-30 03:21:57 +00:00
WasmException.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
WinCFGuard.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
WinCFGuard.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
WinException.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
WinException.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00