diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-05-17 18:22:00 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-05-17 18:22:00 -0700 |
commit | 9700fca02229f4c3e15425a2396740384f7736cb (patch) | |
tree | ede0efefc90364ca3c6c56cbb43aeb40ae7f8c4d /src | |
parent | 3f137abe061fd060b2c9bbffcb8796144ecbada9 (diff) | |
download | binaryen-9700fca02229f4c3e15425a2396740384f7736cb.tar.gz binaryen-9700fca02229f4c3e15425a2396740384f7736cb.tar.bz2 binaryen-9700fca02229f4c3e15425a2396740384f7736cb.zip |
don't emit extra unnecessary blocks for loops in binary format (#523)
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-binary.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h index ad6abf5af..795e89d98 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -848,11 +848,10 @@ public: } void visitLoop(Loop *curr) { if (debug) std::cerr << "zz node: Loop" << std::endl; - // TODO: optimize, as we usually have a block as our singleton child o << int8_t(BinaryConsts::Loop); breakStack.push_back(curr->out); breakStack.push_back(curr->in); - recurse(curr->body); + recursePossibleBlockContents(curr->body); breakStack.pop_back(); breakStack.pop_back(); o << int8_t(BinaryConsts::End); |