diff options
author | Thomas Lively <tlively@google.com> | 2023-01-10 15:05:56 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-10 13:05:56 -0800 |
commit | 31171ca083c7a4d1394ad7812369d385e1dd38a0 (patch) | |
tree | 51d6691faf64fdd266ca31acb5b66295a53d9cc5 /src/wasm/wat-parser.cpp | |
parent | 36e2abbcdd22b2b1707757b49fb4ac8844f28e5d (diff) | |
download | binaryen-31171ca083c7a4d1394ad7812369d385e1dd38a0.tar.gz binaryen-31171ca083c7a4d1394ad7812369d385e1dd38a0.tar.bz2 binaryen-31171ca083c7a4d1394ad7812369d385e1dd38a0.zip |
[Wasm GC] Replace `HeapType::data` with `HeapType::struct_` (#5416)
`struct` has replaced `data` in the upstream spec, so update Binaryen's types to
match. We had already supported `struct` as an alias for data, but now remove
support for `data` entirely. Also remove instructions like `ref.is_data` that
are deprecated and do not make sense without a `data` type.
Diffstat (limited to 'src/wasm/wat-parser.cpp')
-rw-r--r-- | src/wasm/wat-parser.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/wasm/wat-parser.cpp b/src/wasm/wat-parser.cpp index c2d06ae90..66bba8862 100644 --- a/src/wasm/wat-parser.cpp +++ b/src/wasm/wat-parser.cpp @@ -491,7 +491,7 @@ struct NullTypeParserCtx { HeapTypeT makeExtern() { return Ok{}; } HeapTypeT makeEq() { return Ok{}; } HeapTypeT makeI31() { return Ok{}; } - HeapTypeT makeData() { return Ok{}; } + HeapTypeT makeStructType() { return Ok{}; } HeapTypeT makeArrayType() { return Ok{}; } TypeT makeI32() { return Ok{}; } @@ -575,7 +575,7 @@ template<typename Ctx> struct TypeParserCtx { HeapTypeT makeExtern() { return HeapType::ext; } HeapTypeT makeEq() { return HeapType::eq; } HeapTypeT makeI31() { return HeapType::i31; } - HeapTypeT makeData() { return HeapType::data; } + HeapTypeT makeStructType() { return HeapType::struct_; } HeapTypeT makeArrayType() { return HeapType::array; } TypeT makeI32() { return Type::i32; } @@ -2449,8 +2449,8 @@ template<typename Ctx> Result<typename Ctx::HeapTypeT> heaptype(Ctx& ctx) { if (ctx.in.takeKeyword("i31"sv)) { return ctx.makeI31(); } - if (ctx.in.takeKeyword("data"sv)) { - return ctx.makeData(); + if (ctx.in.takeKeyword("struct"sv)) { + return ctx.makeStructType(); } if (ctx.in.takeKeyword("array"sv)) { return ctx.makeArrayType(); @@ -2465,7 +2465,7 @@ template<typename Ctx> Result<typename Ctx::HeapTypeT> heaptype(Ctx& ctx) { // | 'anyref' => anyref // | 'eqref' => eqref // | 'i31ref' => i31ref -// | 'dataref' => dataref +// | 'structref' => structref // | 'arrayref' => arrayref // | '(' ref null? t:heaptype ')' => ref null? t template<typename Ctx> MaybeResult<typename Ctx::TypeT> reftype(Ctx& ctx) { @@ -2484,8 +2484,8 @@ template<typename Ctx> MaybeResult<typename Ctx::TypeT> reftype(Ctx& ctx) { if (ctx.in.takeKeyword("i31ref"sv)) { return ctx.makeRefType(ctx.makeI31(), Nullable); } - if (ctx.in.takeKeyword("dataref"sv)) { - return ctx.makeRefType(ctx.makeData(), Nullable); + if (ctx.in.takeKeyword("structref"sv)) { + return ctx.makeRefType(ctx.makeStructType(), Nullable); } if (ctx.in.takeKeyword("arrayref"sv)) { return ctx.in.err("arrayref not yet supported"); |