Skip to content

Commit 046ebef

Browse files
committed
[EH] Add translator from old to new EH instructions
This translates the old Phase 3 EH instructions, which include `try`, `catch`, `catch_all`, `delegate`, and `rethrow`, into the new EH instructions, which include `try_table` (with `catch` / `catch_ref` / `catch_all` / `catch_all_ref`) and `throw_ref`, passed at the Oct 2023 CG meeting. This translator can be used as a standalone tool by users of the previous EH toolchain to generate binaries for the new spec without recompiling, and also can be used at the end of the Binaryen pipeline to produce binaries for the new spec while the end-to-end toolchain implementation for the new spec is in progress. While the goal of this pass is not optimization, this tries to a little better than the most naive implementation, namely by omitting a few instructions where possible and trying to minimize the number of additional locals, because this can be used as a standalone translator or the last stage of the pipeline while we can't post-optimize the results because the whole pipeline (-On) is not ready for the new EH.
1 parent 82057de commit 046ebef

File tree

8 files changed

+2257
-1
lines changed

8 files changed

+2257
-1
lines changed

src/passes/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ set(passes_SOURCES
119119
StripEH.cpp
120120
SSAify.cpp
121121
TupleOptimization.cpp
122+
TranslateEH.cpp
122123
TypeFinalizing.cpp
123124
Unsubtyping.cpp
124125
Untee.cpp

0 commit comments

Comments
 (0)