diff options
Diffstat (limited to 'src/passes')
-rw-r--r-- | src/passes/DeadCodeElimination.cpp | 4 | ||||
-rw-r--r-- | src/passes/Print.cpp | 18 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/passes/DeadCodeElimination.cpp b/src/passes/DeadCodeElimination.cpp index bf1c0705a..7562645e0 100644 --- a/src/passes/DeadCodeElimination.cpp +++ b/src/passes/DeadCodeElimination.cpp @@ -375,6 +375,10 @@ struct DeadCodeElimination DELEGATE(TupleMake); case Expression::Id::TupleExtractId: DELEGATE(TupleExtract); + case Expression::Id::I31NewId: + DELEGATE(I31New); + case Expression::Id::I31GetId: + DELEGATE(I31Get); case Expression::Id::InvalidId: WASM_UNREACHABLE("unimp"); case Expression::Id::NumExpressionIds: diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 27c3e327c..ac115edc3 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -1474,6 +1474,10 @@ struct PrintExpressionContents printMedium(o, "tuple.extract "); o << curr->index; } + void visitI31New(I31New* curr) { printMedium(o, "i31.new"); } + void visitI31Get(I31Get* curr) { + printMedium(o, curr->signed_ ? "i31.get_s" : "i31.get_u"); + } }; // Prints an expression in s-expr format, including both the @@ -2063,6 +2067,20 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> { printFullLine(curr->tuple); decIndent(); } + void visitI31New(I31New* curr) { + o << '('; + PrintExpressionContents(currFunction, o).visit(curr); + incIndent(); + printFullLine(curr->value); + decIndent(); + } + void visitI31Get(I31Get* curr) { + o << '('; + PrintExpressionContents(currFunction, o).visit(curr); + incIndent(); + printFullLine(curr->i31); + decIndent(); + } // Module-level visitors void handleSignature(Signature curr, Name* funcName = nullptr) { o << "(func"; |