diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-09-07 10:55:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-07 10:55:02 -0700 |
commit | 135a20cd110d356d5d098a08a7b447205adaed7a (patch) | |
tree | f5200a6b35f19d1bf95dea1fa7e339f40391413b /src/wasm-linker.cpp | |
parent | fbe77b167002e8a49225b607ca8c37dc7e4b41fe (diff) | |
parent | dd197d3212ac28e778d372df9d03e58b21386648 (diff) | |
download | binaryen-135a20cd110d356d5d098a08a7b447205adaed7a.tar.gz binaryen-135a20cd110d356d5d098a08a7b447205adaed7a.tar.bz2 binaryen-135a20cd110d356d5d098a08a7b447205adaed7a.zip |
Merge pull request #678 from WebAssembly/stack
Stack machine + 0xc update
Diffstat (limited to 'src/wasm-linker.cpp')
-rw-r--r-- | src/wasm-linker.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/wasm-linker.cpp b/src/wasm-linker.cpp index b1160e94a..04deddf4a 100644 --- a/src/wasm-linker.cpp +++ b/src/wasm-linker.cpp @@ -49,7 +49,8 @@ void Linker::ensureImport(Name target, std::string signature) { auto import = new Import; import->name = import->base = target; import->module = ENV; - import->type = ensureFunctionType(signature, &out.wasm); + import->functionType = ensureFunctionType(signature, &out.wasm); + import->kind = Import::Function; out.wasm.addImport(import); } } @@ -106,7 +107,12 @@ void Linker::layout() { } if (userMaxMemory) out.wasm.memory.max = userMaxMemory / Memory::kPageSize; - out.wasm.memory.exportName = MEMORY; + + auto memoryExport = make_unique<Export>(); + memoryExport->name = MEMORY; + memoryExport->value = Name::fromInt(0); + memoryExport->kind = Export::Memory; + out.wasm.addExport(memoryExport.release()); // XXX For now, export all functions marked .globl. for (Name name : out.globls) exportFunction(name, false); @@ -333,7 +339,8 @@ void Linker::emscriptenGlue(std::ostream& o) { auto import = new Import; import->name = import->base = curr->target; import->module = ENV; - import->type = ensureFunctionType(getSig(curr), &parent->out.wasm); + import->functionType = ensureFunctionType(getSig(curr), &parent->out.wasm); + import->kind = Import::Function; parent->out.wasm.addImport(import); } } |