diff options
author | Thomas Lively <tlively@google.com> | 2023-09-11 19:47:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-12 00:47:08 +0000 |
commit | 592f6ccba11e0d9b74d9fb6965eae17c76aa45b8 (patch) | |
tree | 3ef82e0feab0539980b61a709abf660d02f16c19 /src | |
parent | e9d0fb7251dd6dd3d629fe6c389490a0a0e92c24 (diff) | |
download | binaryen-592f6ccba11e0d9b74d9fb6965eae17c76aa45b8.tar.gz binaryen-592f6ccba11e0d9b74d9fb6965eae17c76aa45b8.tar.bz2 binaryen-592f6ccba11e0d9b74d9fb6965eae17c76aa45b8.zip |
Remove legacy GC text syntax (#5929)
Remove the old forms of ref.test and ref.cast that took heap types instead of
ref types and remove the old array.init_static name for array.new_fixed.
Diffstat (limited to 'src')
-rw-r--r-- | src/gen-s-parser.inc | 10 | ||||
-rw-r--r-- | src/wasm/wasm-s-parser.cpp | 38 |
2 files changed, 4 insertions, 44 deletions
diff --git a/src/gen-s-parser.inc b/src/gen-s-parser.inc index 14386334e..57fd2ffed 100644 --- a/src/gen-s-parser.inc +++ b/src/gen-s-parser.inc @@ -46,9 +46,6 @@ switch (buf[0]) { case 'e': if (op == "array.init_elem"sv) { return makeArrayInitElem(s); } goto parse_error; - case 's': - if (op == "array.init_static"sv) { return makeArrayNewFixed(s); } - goto parse_error; default: goto parse_error; } } @@ -3650,13 +3647,6 @@ switch (buf[0]) { return *ret; } goto parse_error; - case 's': - if (op == "array.init_static"sv) { - auto ret = makeArrayNewFixed(ctx, pos); - CHECK_ERR(ret); - return *ret; - } - goto parse_error; default: goto parse_error; } } diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index e30901c5b..d4dd99c2c 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -2854,44 +2854,14 @@ Expression* SExpressionWasmBuilder::makeI31Get(Element& s, bool signed_) { } Expression* SExpressionWasmBuilder::makeRefTest(Element& s) { - int i = 1; - Type castType; - if (s[i]->isList() || - !(s[i]->dollared() || - stringToType(s[i]->str(), true /* allowError */) == Type::none)) { - castType = elementToType(*s[i++]); - } else { - // legacy syntax - auto nullability = NonNullable; - if (s[1]->str().str == "null") { - nullability = Nullable; - ++i; - } - auto type = parseHeapType(*s[i++]); - castType = Type(type, nullability); - } - auto* ref = parseExpression(*s[i++]); + Type castType = elementToType(*s[1]); + auto* ref = parseExpression(*s[2]); return Builder(wasm).makeRefTest(ref, castType); } Expression* SExpressionWasmBuilder::makeRefCast(Element& s) { - int i = 1; - Type castType; - if (s[i]->isList() || - !(s[i]->dollared() || - stringToType(s[i]->str(), true /* allowError */) == Type::none)) { - castType = elementToType(*s[i++]); - } else { - // legacy syntax - Nullability nullability = NonNullable; - if (s[i]->str().str == "null") { - nullability = Nullable; - ++i; - } - auto type = parseHeapType(*s[i++]); - castType = Type(type, nullability); - } - auto* ref = parseExpression(*s[i++]); + Type castType = elementToType(*s[1]); + auto* ref = parseExpression(*s[2]); return Builder(wasm).makeRefCast(ref, castType); } |