From a2e170294c03d5fe0d91e2797d96acdb95b1d37c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 17 Jul 2017 10:23:06 -0700 Subject: fix blockifyMerge logic - it needs to not skip code in the block we merge to. since that's a fairly specific functionality needed in removeUnusedBrs, move it to there --- src/wasm-builder.h | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'src/wasm-builder.h') diff --git a/src/wasm-builder.h b/src/wasm-builder.h index 41aaf6766..f702342d2 100644 --- a/src/wasm-builder.h +++ b/src/wasm-builder.h @@ -315,28 +315,6 @@ public: return block; } - // ensures the first node is a block, if it isn't already, and merges in the second, - // either as a single element or, if a block, by appending to the first block - Block* blockifyMerge(Expression* any, Expression* append) { - Block* block = nullptr; - if (any) block = any->dynCast(); - if (!block) { - block = makeBlock(any); - } else { - assert(!isConcreteWasmType(block->type)); - } - auto* other = append->dynCast(); - if (!other) { - block->list.push_back(append); - } else { - for (auto* item : other->list) { - block->list.push_back(item); - } - } - block->finalize(); - return block; - } - // a helper for the common pattern of a sequence of two expressions. Similar to // blockify, but does *not* reuse a block if the first is one. Block* makeSequence(Expression* left, Expression* right) { -- cgit v1.2.3