diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-03 10:14:03 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-03 10:14:03 -0800 |
commit | 3b0fc2374d042ba81e16ee09f57cdef9891be065 (patch) | |
tree | 0e2397e4c00f88b13614ae66c92c81a9c4778859 /src/asm2wasm.h | |
parent | a18f879612876860429aa153336be293a9368310 (diff) | |
download | binaryen-3b0fc2374d042ba81e16ee09f57cdef9891be065.tar.gz binaryen-3b0fc2374d042ba81e16ee09f57cdef9891be065.tar.bz2 binaryen-3b0fc2374d042ba81e16ee09f57cdef9891be065.zip |
refactor arena code
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r-- | src/asm2wasm.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index 65d837496..2d045401a 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -1,6 +1,7 @@ #include "wasm.h" #include "optimizer.h" +#include "mixed_arena.h" namespace wasm { @@ -69,7 +70,7 @@ std::vector<Ref> AstStackHelper::astStack; class Asm2WasmBuilder { Module& wasm; - wasm::Arena allocator; + MixedArena allocator; // globals @@ -307,8 +308,6 @@ private: return -1; // avoid warning } - wasm::Arena tempAllocator; - std::map<unsigned, Ref> tempNums; Literal getLiteral(Ref ast) { @@ -503,10 +502,6 @@ void Asm2WasmBuilder::processAsm(Ref ast) { for (auto curr : toErase) { wasm.imports.erase(curr); } - - // cleanups - - tempAllocator.clear(); } Function* Asm2WasmBuilder::processFunction(Ref ast) { @@ -1063,8 +1058,6 @@ void Asm2WasmBuilder::optimize() { // Optimization passes. Note: no effort is made to free nodes that are no longer held on to. struct BlockBreakOptimizer : public WasmWalker { - BlockBreakOptimizer() : WasmWalker(nullptr) {} - void visitBlock(Block *curr) override { // if the block ends in a break on this very block, then just put the value there Break *last = curr->list[curr->list.size()-1]->dyn_cast<Break>(); |