summaryrefslogtreecommitdiff
path: root/src/passes
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes')
-rw-r--r--src/passes/TranslateEH.cpp8
-rw-r--r--src/passes/pass.cpp7
-rw-r--r--src/passes/passes.h2
3 files changed, 10 insertions, 7 deletions
diff --git a/src/passes/TranslateEH.cpp b/src/passes/TranslateEH.cpp
index 42cea6199..3d2f01510 100644
--- a/src/passes/TranslateEH.cpp
+++ b/src/passes/TranslateEH.cpp
@@ -15,7 +15,7 @@
*/
//
-// TranslateToNewEH translates the old Phase 3 EH instructions, which include
+// TranslateToExnref 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
@@ -39,7 +39,7 @@ namespace {
// Translates the old EH instructions (try / catch / catch_all / delegate /
// rethrow) into the new ones (try_table (+ catch / catch_ref / catch_all /
// catch_all_ref) / throw_ref).
-struct TranslateToNewEH : public WalkerPass<PostWalker<TranslateToNewEH>> {
+struct TranslateToExnref : public WalkerPass<PostWalker<TranslateToExnref>> {
bool isFunctionParallel() override { return true; }
// Scans and records which try labels are targeted by delegates and rethrows.
@@ -195,7 +195,7 @@ struct TranslateToNewEH : public WalkerPass<PostWalker<TranslateToNewEH>> {
std::unordered_map<Type, Index> typeToScratchLocal;
std::unique_ptr<Pass> create() override {
- return std::make_unique<TranslateToNewEH>();
+ return std::make_unique<TranslateToExnref>();
}
// Get a scratch local for a given type. These locals are used to contain
@@ -814,6 +814,6 @@ struct TranslateToNewEH : public WalkerPass<PostWalker<TranslateToNewEH>> {
} // namespace
-Pass* createTranslateToNewEHPass() { return new TranslateToNewEH(); }
+Pass* createTranslateToExnrefPass() { return new TranslateToExnref(); }
} // namespace wasm
diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp
index c5a2bcc55..5e5ee04a4 100644
--- a/src/passes/pass.cpp
+++ b/src/passes/pass.cpp
@@ -501,8 +501,11 @@ void PassRegistry::registerPasses() {
"strip the wasm target features section",
createStripTargetFeaturesPass);
registerPass("translate-to-new-eh",
- "translate old EH instructions to new ones",
- createTranslateToNewEHPass);
+ "deprecated; same as translate-to-exnref",
+ createTranslateToExnrefPass);
+ registerPass("translate-to-exnref",
+ "translate old Phase 3 EH instructions to new ones with exnref",
+ createTranslateToExnrefPass);
registerPass("trap-mode-clamp",
"replace trapping operations with clamping semantics",
createTrapModeClamp);
diff --git a/src/passes/passes.h b/src/passes/passes.h
index ac3e1ef29..88e0a7ccc 100644
--- a/src/passes/passes.h
+++ b/src/passes/passes.h
@@ -166,7 +166,7 @@ Pass* createStripEHPass();
Pass* createStubUnsupportedJSOpsPass();
Pass* createSSAifyPass();
Pass* createSSAifyNoMergePass();
-Pass* createTranslateToNewEHPass();
+Pass* createTranslateToExnrefPass();
Pass* createTrapModeClamp();
Pass* createTrapModeJS();
Pass* createTupleOptimizationPass();