diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dataflow/graph.h | 2 | ||||
-rw-r--r-- | src/passes/CodePushing.cpp | 2 | ||||
-rw-r--r-- | src/passes/Vacuum.cpp | 3 | ||||
-rw-r--r-- | src/wasm-traversal.h | 2 |
4 files changed, 7 insertions, 2 deletions
diff --git a/src/dataflow/graph.h b/src/dataflow/graph.h index 41b145ee9..02679995b 100644 --- a/src/dataflow/graph.h +++ b/src/dataflow/graph.h @@ -198,6 +198,8 @@ struct Graph : public UnifiedExpressionVisitor<Graph, Node*> { // Visiting. Node* visitExpression(Expression* curr) { + // TODO Exception handling instruction support + // Control flow and get/set etc. are special. Aside from them, we just need // to do something very generic. if (auto* block = curr->dynCast<Block>()) { diff --git a/src/passes/CodePushing.cpp b/src/passes/CodePushing.cpp index 6907f4fdc..7fa50f39b 100644 --- a/src/passes/CodePushing.cpp +++ b/src/passes/CodePushing.cpp @@ -141,7 +141,7 @@ private: if (auto* drop = curr->dynCast<Drop>()) { curr = drop->value; } - if (curr->is<If>()) { + if (curr->is<If>() || curr->is<BrOnExn>()) { return true; } if (auto* br = curr->dynCast<Break>()) { diff --git a/src/passes/Vacuum.cpp b/src/passes/Vacuum.cpp index 54707fddc..9b67a3a16 100644 --- a/src/passes/Vacuum.cpp +++ b/src/passes/Vacuum.cpp @@ -80,9 +80,12 @@ struct Vacuum : public WalkerPass<ExpressionStackWalker<Vacuum>> { return curr; // not always needed, but handled in visitLoop() case Expression::Id::DropId: return curr; // not always needed, but handled in visitDrop() + case Expression::Id::TryId: + return curr; // not always needed, but handled in visitTry() case Expression::Id::BreakId: case Expression::Id::SwitchId: + case Expression::Id::BrOnExnId: case Expression::Id::CallId: case Expression::Id::CallIndirectId: case Expression::Id::LocalSetId: diff --git a/src/wasm-traversal.h b/src/wasm-traversal.h index eae4634b5..ee6d22aa5 100644 --- a/src/wasm-traversal.h +++ b/src/wasm-traversal.h @@ -1159,7 +1159,7 @@ struct ControlFlowWalker : public PostWalker<SubType, VisitorType> { return curr; } } else { - // an if, ignorable + // an if or try, ignorable assert(curr->template is<If>() || curr->template is<Try>()); } if (i == 0) { |