[PATCH] D59353: [WebAssembly] Use rethrow intrinsic in the rethrow block

Heejin Ahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 14 03:38:31 PDT 2019


aheejin created this revision.
aheejin added a reviewer: dschuff.
Herald added subscribers: cfe-commits, sunfish, jgravelle-google, sbc100.
Herald added a project: clang.

Because in wasm we merge all catch clauses into one big catchpad, in
case none of the types in catch handlers matches after we test against
each of them, we should unwind to the next EH enclosing scope. For this,
we should NOT use a call to `__cxa_rethrow` but rather a call to our own
rethrow intrinsic, because what we're trying to do here is just to
transfer the control flow into the next enclosing EH pad (or the
caller). Calls to `__cxa_rethrow` should only be used after a call to
`__cxa_begin_catch`.


Repository:
  rC Clang

https://reviews.llvm.org/D59353

Files:
  include/clang/Basic/BuiltinsWebAssembly.def
  lib/CodeGen/CGBuiltin.cpp
  lib/CodeGen/CGException.cpp
  test/CodeGen/builtins-wasm.c
  test/CodeGenCXX/wasm-eh.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59353.190587.patch
Type: text/x-patch
Size: 4416 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190314/57bfe4c0/attachment.bin>


More information about the cfe-commits mailing list