summaryrefslogtreecommitdiff
path: root/src/passes
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes')
-rw-r--r--src/passes/Print.cpp36
-rw-r--r--src/passes/TypeGeneralizing.cpp2
2 files changed, 38 insertions, 0 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index b6060a853..948e8d239 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -316,6 +316,7 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> {
void visitLoop(Loop* curr);
void visitTry(Try* curr);
void visitTryTable(TryTable* curr);
+ void visitResume(Resume* curr);
void maybePrintUnreachableReplacement(Expression* curr, Type type);
void maybePrintUnreachableOrNullReplacement(Expression* curr, Type type);
void visitCallRef(CallRef* curr) {
@@ -2438,6 +2439,24 @@ struct PrintExpressionContents
void visitStringSliceIter(StringSliceIter* curr) {
printMedium(o, "stringview_iter.slice");
}
+
+ void visitResume(Resume* curr) {
+ printMedium(o, "resume");
+
+ o << ' ';
+ printHeapType(curr->contType);
+
+ // We deliberate keep all (tag ...) clauses on the same line as the resume
+ // itself to work around a quirk in update_lit_checks.py
+ for (Index i = 0; i < curr->handlerTags.size(); i++) {
+ o << " (";
+ printMedium(o, "tag ");
+ printName(curr->handlerTags[i], o);
+ o << ' ';
+ printName(curr->handlerBlocks[i], o);
+ o << ')';
+ }
+ }
};
void PrintSExpression::setModule(Module* module) {
@@ -2786,6 +2805,23 @@ void PrintSExpression::visitTryTable(TryTable* curr) {
controlFlowDepth--;
}
+void PrintSExpression::visitResume(Resume* curr) {
+ controlFlowDepth++;
+ o << '(';
+ printExpressionContents(curr);
+
+ incIndent();
+
+ for (Index i = 0; i < curr->operands.size(); i++) {
+ printFullLine(curr->operands[i]);
+ }
+
+ printFullLine(curr->cont);
+
+ controlFlowDepth--;
+ decIndent();
+}
+
void PrintSExpression::maybePrintUnreachableReplacement(Expression* curr,
Type type) {
// See the parallel function
diff --git a/src/passes/TypeGeneralizing.cpp b/src/passes/TypeGeneralizing.cpp
index d167b89a9..293d17cdf 100644
--- a/src/passes/TypeGeneralizing.cpp
+++ b/src/passes/TypeGeneralizing.cpp
@@ -874,6 +874,8 @@ struct TransferFn : OverriddenVisitor<TransferFn> {
void visitStringIterMove(StringIterMove* curr) { WASM_UNREACHABLE("TODO"); }
void visitStringSliceWTF(StringSliceWTF* curr) { WASM_UNREACHABLE("TODO"); }
void visitStringSliceIter(StringSliceIter* curr) { WASM_UNREACHABLE("TODO"); }
+
+ void visitResume(Resume* curr) { WASM_UNREACHABLE("TODO"); }
};
struct TypeGeneralizing : WalkerPass<PostWalker<TypeGeneralizing>> {