summaryrefslogtreecommitdiff
path: root/src/wasm-traversal.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-10-22 09:10:11 -0700
committerGitHub <noreply@github.com>2016-10-22 09:10:11 -0700
commit58123ff10f075100bfb4fc5885cae04607564139 (patch)
tree8a48f4845d0936abc1934b64598025380b4a5e25 /src/wasm-traversal.h
parent9afa80951a3e9e59d5348780370a8b67d829ded1 (diff)
parent64e9b3fa53e5b4a88ad424f4cdf00f923664246f (diff)
downloadbinaryen-58123ff10f075100bfb4fc5885cae04607564139.tar.gz
binaryen-58123ff10f075100bfb4fc5885cae04607564139.tar.bz2
binaryen-58123ff10f075100bfb4fc5885cae04607564139.zip
Merge pull request #799 from WebAssembly/pass-cleanup
Some tiny pass cleanups
Diffstat (limited to 'src/wasm-traversal.h')
-rw-r--r--src/wasm-traversal.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/wasm-traversal.h b/src/wasm-traversal.h
index 47b9d26e8..620ff0161 100644
--- a/src/wasm-traversal.h
+++ b/src/wasm-traversal.h
@@ -581,7 +581,9 @@ struct LinearExecutionWalker : public PostWalker<SubType, VisitorType> {
case Expression::Id::InvalidId: abort();
case Expression::Id::BlockId: {
self->pushTask(SubType::doVisitBlock, currp);
- self->pushTask(SubType::doNoteNonLinear, currp);
+ if (curr->cast<Block>()->name.is()) {
+ self->pushTask(SubType::doNoteNonLinear, currp);
+ }
auto& list = curr->cast<Block>()->list;
for (int i = int(list.size()) - 1; i >= 0; i--) {
self->pushTask(SubType::scan, &list[i]);
@@ -624,6 +626,11 @@ struct LinearExecutionWalker : public PostWalker<SubType, VisitorType> {
self->maybePushTask(SubType::scan, &curr->cast<Return>()->value);
break;
}
+ case Expression::Id::UnreachableId: {
+ self->pushTask(SubType::doVisitUnreachable, currp);
+ self->pushTask(SubType::doNoteNonLinear, currp);
+ break;
+ }
default: {
// other node types do not have control flow, use regular post-order
PostWalker<SubType, VisitorType>::scan(self, currp);