summaryrefslogtreecommitdiff
path: root/src/wasm
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2023-11-15 01:43:27 +0100
committerGitHub <noreply@github.com>2023-11-15 01:43:27 +0100
commit325d588b0bf1497322d75c35ef8e017f9a8a5d7c (patch)
treec7bca1234294a5c92304c1191efa4ca1448f3919 /src/wasm
parent8eb4899d8dafe02c0440c5e33aaf37529e8fc941 (diff)
downloadbinaryen-325d588b0bf1497322d75c35ef8e017f9a8a5d7c.tar.gz
binaryen-325d588b0bf1497322d75c35ef8e017f9a8a5d7c.tar.bz2
binaryen-325d588b0bf1497322d75c35ef8e017f9a8a5d7c.zip
[Parser] Parse ref.test and ref.cast (#6099)
Diffstat (limited to 'src/wasm')
-rw-r--r--src/wasm/wasm-ir-builder.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/wasm/wasm-ir-builder.cpp b/src/wasm/wasm-ir-builder.cpp
index cbb16ff68..c973238e9 100644
--- a/src/wasm/wasm-ir-builder.cpp
+++ b/src/wasm/wasm-ir-builder.cpp
@@ -919,9 +919,19 @@ Result<> IRBuilder::makeI31Get(bool signed_) {
// Result<> IRBuilder::makeCallRef() {}
-// Result<> IRBuilder::makeRefTest() {}
+Result<> IRBuilder::makeRefTest(Type type) {
+ RefTest curr;
+ CHECK_ERR(visitRefTest(&curr));
+ push(builder.makeRefTest(curr.ref, type));
+ return Ok{};
+}
-// Result<> IRBuilder::makeRefCast() {}
+Result<> IRBuilder::makeRefCast(Type type) {
+ RefCast curr;
+ CHECK_ERR(visitRefCast(&curr));
+ push(builder.makeRefCast(curr.ref, type));
+ return Ok{};
+}
// Result<> IRBuilder::makeBrOn() {}