diff options
author | Heejin Ahn <aheejin@gmail.com> | 2024-09-04 16:12:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-04 16:12:58 -0700 |
commit | 9790ca3ce809cb6bf26445babcbb49434c8ac71b (patch) | |
tree | 8e4a63464558462ebb12a9a3a366a8c44f469ad3 | |
parent | 852baadb27c68a56080ca88769d7e272c4e90235 (diff) | |
download | binaryen-9790ca3ce809cb6bf26445babcbb49434c8ac71b.tar.gz binaryen-9790ca3ce809cb6bf26445babcbb49434c8ac71b.tar.bz2 binaryen-9790ca3ce809cb6bf26445babcbb49434c8ac71b.zip |
[EH] Rename Catch(All)_P3 to Catch(All)_Legacy (NFC) (#6901)
This renames `Catch(All)_P3` enum to denote the old Phase 3
`catch(_all)` instructions to `Catch(All)_Legacy`, which sounds clearer.
This is also to be consistent with
https://github.com/llvm/llvm-project/pull/107187.
-rw-r--r-- | src/wasm-binary.h | 4 | ||||
-rw-r--r-- | src/wasm/wasm-binary.cpp | 13 | ||||
-rw-r--r-- | src/wasm/wasm-stack.cpp | 4 |
3 files changed, 11 insertions, 10 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 91c6b98ec..d7fde5913 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -1108,8 +1108,8 @@ enum ASTNodes { // exception handling opcodes Try = 0x06, - Catch_P3 = 0x07, // Old Phase 3 'catch' - CatchAll_P3 = 0x19, // Old Phase 3 'catch_all' + Catch_Legacy = 0x07, // Legacy 'catch' + CatchAll_Legacy = 0x19, // Legacy 'catch_all' Delegate = 0x18, Throw = 0x08, Rethrow = 0x09, diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index 542eab4b4..3c8cc86df 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -3121,7 +3121,8 @@ void WasmBinaryReader::processExpressions() { } auto peek = input[pos]; if (peek == BinaryConsts::End || peek == BinaryConsts::Else || - peek == BinaryConsts::Catch_P3 || peek == BinaryConsts::CatchAll_P3 || + peek == BinaryConsts::Catch_Legacy || + peek == BinaryConsts::CatchAll_Legacy || peek == BinaryConsts::Delegate) { BYN_TRACE("== processExpressions finished with unreachable" << std::endl); @@ -4070,8 +4071,8 @@ BinaryConsts::ASTNodes WasmBinaryReader::readExpression(Expression*& curr) { } break; case BinaryConsts::Else: - case BinaryConsts::Catch_P3: - case BinaryConsts::CatchAll_P3: { + case BinaryConsts::Catch_Legacy: + case BinaryConsts::CatchAll_Legacy: { curr = nullptr; if (DWARF && currFunction) { assert(!controlFlowStack.empty()); @@ -7213,9 +7214,9 @@ void WasmBinaryReader::visitTryOrTryInBlock(Expression*& out) { // here, then do that later. std::vector<Index> tagIndexes; - while (lastSeparator == BinaryConsts::Catch_P3 || - lastSeparator == BinaryConsts::CatchAll_P3) { - if (lastSeparator == BinaryConsts::Catch_P3) { + while (lastSeparator == BinaryConsts::Catch_Legacy || + lastSeparator == BinaryConsts::CatchAll_Legacy) { + if (lastSeparator == BinaryConsts::Catch_Legacy) { auto index = getU32LEB(); if (index >= wasm.tags.size()) { throwError("bad tag index"); diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp index ac79d0135..a1446c2de 100644 --- a/src/wasm/wasm-stack.cpp +++ b/src/wasm/wasm-stack.cpp @@ -2142,7 +2142,7 @@ void BinaryInstWriter::emitCatch(Try* curr, Index i) { if (func && !sourceMap) { parent.writeExtraDebugLocation(curr, func, i); } - o << int8_t(BinaryConsts::Catch_P3) + o << int8_t(BinaryConsts::Catch_Legacy) << U32LEB(parent.getTagIndex(curr->catchTags[i])); } @@ -2150,7 +2150,7 @@ void BinaryInstWriter::emitCatchAll(Try* curr) { if (func && !sourceMap) { parent.writeExtraDebugLocation(curr, func, curr->catchBodies.size()); } - o << int8_t(BinaryConsts::CatchAll_P3); + o << int8_t(BinaryConsts::CatchAll_Legacy); } void BinaryInstWriter::emitDelegate(Try* curr) { |