Commit 8702f84
committed
[WebAssembly] Generate invokes with llvm.wasm.(re)throw
Even though `__builtin_wasm_throw`, which is lowered down to
`llvm.wasm.throw`, throws,
```cpp
try {
__builtin_wasm_throw(0, obj);
} catch (...) {
}
```
does not generate `invoke`. This is because we have assumed the
intrinsic cannot be invoked, which doesn't make much sense. (See #128104
for the historical context)
#128104 made `llvm.wasm.throw` intrinsic invokable in the backend. This
actually generates `invoke`s in Clang for `__builtin_wasm_throw`.
While we're at it, this also generates `invoke`s for
`__builtin_wasm_rethrow`, which is actually not used anywhere in C++
support. I haven't deleted it just in case in may have uses later. (For
example, to support rethrow functionality that carries stack trace
with exnref)
Depends on #128104 for the CI to pass.
Fixes #124710.1 parent 7c24041 commit 8702f84
File tree
2 files changed
+22
-2
lines changed- clang
- lib/CodeGen
- test/CodeGenCXX
2 files changed
+22
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22493 | 22493 | | |
22494 | 22494 | | |
22495 | 22495 | | |
22496 | | - | |
| 22496 | + | |
22497 | 22497 | | |
22498 | 22498 | | |
22499 | 22499 | | |
22500 | | - | |
| 22500 | + | |
22501 | 22501 | | |
22502 | 22502 | | |
22503 | 22503 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
0 commit comments