summaryrefslogtreecommitdiff
path: root/src/wasm/literal.cpp
diff options
context:
space:
mode:
authorFrank Emrich <git@emrich.io>2024-04-04 18:46:04 +0100
committerGitHub <noreply@github.com>2024-04-04 10:46:04 -0700
commit365f12ed2388c610511bd17ce097021e0babcaa9 (patch)
treea5243d82ad8ba8843d6e483d1d4c395dcb91fd87 /src/wasm/literal.cpp
parent83d3059361c17db19080735ae6a85435f7308c80 (diff)
downloadbinaryen-365f12ed2388c610511bd17ce097021e0babcaa9.tar.gz
binaryen-365f12ed2388c610511bd17ce097021e0babcaa9.tar.bz2
binaryen-365f12ed2388c610511bd17ce097021e0babcaa9.zip
Typed continuations: nocont and cont basic heap types (#6468)
This PR is part of a series that adds basic support for the typed continuations/wasmfx proposal. This particular PR adds cont and nocont as top and bottom types for continuation types, completely analogous to func and nofunc for function types (also: exn and noexn).
Diffstat (limited to 'src/wasm/literal.cpp')
-rw-r--r--src/wasm/literal.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp
index 887c777ec..48ade5447 100644
--- a/src/wasm/literal.cpp
+++ b/src/wasm/literal.cpp
@@ -138,10 +138,12 @@ Literal::Literal(const Literal& other) : type(other.type) {
case HeapType::noext:
case HeapType::nofunc:
case HeapType::noexn:
+ case HeapType::nocont:
WASM_UNREACHABLE("null literals should already have been handled");
case HeapType::any:
case HeapType::eq:
case HeapType::func:
+ case HeapType::cont:
case HeapType::struct_:
case HeapType::array:
case HeapType::exn:
@@ -622,6 +624,9 @@ std::ostream& operator<<(std::ostream& o, Literal literal) {
case HeapType::noexn:
o << "nullexnref";
break;
+ case HeapType::nocont:
+ o << "nullcontref";
+ break;
case HeapType::ext:
o << "externref";
break;
@@ -631,6 +636,7 @@ std::ostream& operator<<(std::ostream& o, Literal literal) {
case HeapType::any:
case HeapType::eq:
case HeapType::func:
+ case HeapType::cont:
case HeapType::struct_:
case HeapType::array:
WASM_UNREACHABLE("invalid type");