summaryrefslogtreecommitdiff
path: root/src/ir
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir')
-rw-r--r--src/ir/ExpressionAnalyzer.cpp2
-rw-r--r--src/ir/ExpressionManipulator.cpp6
-rw-r--r--src/ir/ReFinalize.cpp2
-rw-r--r--src/ir/effects.h2
-rw-r--r--src/ir/utils.h4
5 files changed, 16 insertions, 0 deletions
diff --git a/src/ir/ExpressionAnalyzer.cpp b/src/ir/ExpressionAnalyzer.cpp
index 766d4023e..562631420 100644
--- a/src/ir/ExpressionAnalyzer.cpp
+++ b/src/ir/ExpressionAnalyzer.cpp
@@ -235,6 +235,8 @@ template<typename T> void visitImmediates(Expression* curr, T& visitor) {
void visitTupleExtract(TupleExtract* curr) {
visitor.visitIndex(curr->index);
}
+ void visitI31New(I31New* curr) {}
+ void visitI31Get(I31Get* curr) { visitor.visitInt(curr->signed_); }
} singleton(curr, visitor);
}
diff --git a/src/ir/ExpressionManipulator.cpp b/src/ir/ExpressionManipulator.cpp
index 95fee632f..b0616e34d 100644
--- a/src/ir/ExpressionManipulator.cpp
+++ b/src/ir/ExpressionManipulator.cpp
@@ -269,6 +269,12 @@ flexibleCopy(Expression* original, Module& wasm, CustomCopier custom) {
Expression* visitTupleExtract(TupleExtract* curr) {
return builder.makeTupleExtract(copy(curr->tuple), curr->index);
}
+ Expression* visitI31New(I31New* curr) {
+ return builder.makeI31New(copy(curr->value));
+ }
+ Expression* visitI31Get(I31Get* curr) {
+ return builder.makeI31Get(copy(curr->i31), curr->signed_);
+ }
};
Copier copier(wasm, custom);
diff --git a/src/ir/ReFinalize.cpp b/src/ir/ReFinalize.cpp
index 99387ada1..c6b3ab855 100644
--- a/src/ir/ReFinalize.cpp
+++ b/src/ir/ReFinalize.cpp
@@ -141,6 +141,8 @@ void ReFinalize::visitUnreachable(Unreachable* curr) { curr->finalize(); }
void ReFinalize::visitPop(Pop* curr) { curr->finalize(); }
void ReFinalize::visitTupleMake(TupleMake* curr) { curr->finalize(); }
void ReFinalize::visitTupleExtract(TupleExtract* curr) { curr->finalize(); }
+void ReFinalize::visitI31New(I31New* curr) { curr->finalize(); }
+void ReFinalize::visitI31Get(I31Get* curr) { curr->finalize(); }
void ReFinalize::visitFunction(Function* curr) {
// we may have changed the body from unreachable to none, which might be bad
diff --git a/src/ir/effects.h b/src/ir/effects.h
index a90e902b0..8199092ea 100644
--- a/src/ir/effects.h
+++ b/src/ir/effects.h
@@ -505,6 +505,8 @@ struct EffectAnalyzer
}
void visitTupleMake(TupleMake* curr) {}
void visitTupleExtract(TupleExtract* curr) {}
+ void visitI31New(I31New* curr) {}
+ void visitI31Get(I31Get* curr) {}
// Helpers
diff --git a/src/ir/utils.h b/src/ir/utils.h
index 428657e88..7d8b28759 100644
--- a/src/ir/utils.h
+++ b/src/ir/utils.h
@@ -160,6 +160,8 @@ struct ReFinalize
void visitPop(Pop* curr);
void visitTupleMake(TupleMake* curr);
void visitTupleExtract(TupleExtract* curr);
+ void visitI31New(I31New* curr);
+ void visitI31Get(I31Get* curr);
void visitFunction(Function* curr);
@@ -230,6 +232,8 @@ struct ReFinalizeNode : public OverriddenVisitor<ReFinalizeNode> {
void visitPop(Pop* curr) { curr->finalize(); }
void visitTupleMake(TupleMake* curr) { curr->finalize(); }
void visitTupleExtract(TupleExtract* curr) { curr->finalize(); }
+ void visitI31New(I31New* curr) { curr->finalize(); }
+ void visitI31Get(I31Get* curr) { curr->finalize(); }
void visitExport(Export* curr) { WASM_UNREACHABLE("unimp"); }
void visitGlobal(Global* curr) { WASM_UNREACHABLE("unimp"); }