summaryrefslogtreecommitdiff
path: root/src/wasm-s-parser.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-11-24 15:07:47 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-11-24 15:09:49 -0800
commit83cd8a4e2618e2883c97fc3a2fe58b544f8bf778 (patch)
treee8cadfd3c00f461e66c5eba2c8781eda1c5345bf /src/wasm-s-parser.h
parente97c5c94c14e83ff7535bafb80a9ae0bae332030 (diff)
downloadbinaryen-83cd8a4e2618e2883c97fc3a2fe58b544f8bf778.tar.gz
binaryen-83cd8a4e2618e2883c97fc3a2fe58b544f8bf778.tar.bz2
binaryen-83cd8a4e2618e2883c97fc3a2fe58b544f8bf778.zip
create an AllocatingModule which handles allocation for its elements
Diffstat (limited to 'src/wasm-s-parser.h')
-rw-r--r--src/wasm-s-parser.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index 8fbedcbf2..718c459ca 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -233,15 +233,15 @@ private:
//
class SExpressionWasmBuilder {
- Module& wasm;
- MixedArena allocator;
+ AllocatingModule& wasm;
+ MixedArena& allocator;
std::function<void ()> onError;
int functionCounter;
std::vector<Call*> calls; // we only know call types afterwards, so we set their type in a post-pass
public:
// Assumes control of and modifies the input.
- SExpressionWasmBuilder(Module& wasm, Element& module, std::function<void ()> onError) : wasm(wasm), onError(onError), functionCounter(0) {
+ SExpressionWasmBuilder(AllocatingModule& wasm, Element& module, std::function<void ()> onError) : wasm(wasm), allocator(wasm.allocator), onError(onError), functionCounter(0) {
assert(module[0]->str() == MODULE);
for (unsigned i = 1; i < module.size(); i++) {
parseModuleElement(*module[i]);