summaryrefslogtreecommitdiff
path: root/src/wasm
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2023-09-11 19:47:08 -0500
committerGitHub <noreply@github.com>2023-09-12 00:47:08 +0000
commit592f6ccba11e0d9b74d9fb6965eae17c76aa45b8 (patch)
tree3ef82e0feab0539980b61a709abf660d02f16c19 /src/wasm
parente9d0fb7251dd6dd3d629fe6c389490a0a0e92c24 (diff)
downloadbinaryen-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/wasm')
-rw-r--r--src/wasm/wasm-s-parser.cpp38
1 files changed, 4 insertions, 34 deletions
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);
}