diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-09-16 11:18:04 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-09-16 15:14:04 -0700 |
commit | 444d7f66182c091b2e207a7bc842309f0925e228 (patch) | |
tree | 327f4d437e3f3b2fd97462e13f3e79ea74616d4f /src/wasm-s-parser.h | |
parent | 7292ef9c863a0766c697cc0a77516447ff652820 (diff) | |
download | binaryen-444d7f66182c091b2e207a7bc842309f0925e228.tar.gz binaryen-444d7f66182c091b2e207a7bc842309f0925e228.tar.bz2 binaryen-444d7f66182c091b2e207a7bc842309f0925e228.zip |
call_import changes: no more call_import, shared index space with functions
Diffstat (limited to 'src/wasm-s-parser.h')
-rw-r--r-- | src/wasm-s-parser.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index 9abdea744..1a9e71bd4 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -1207,8 +1207,18 @@ private: } Expression* makeCall(Element& s) { + auto target = s[1]->str(); + auto* import = wasm.checkImport(target); + if (import && import->kind == Import::Function) { + auto ret = allocator.alloc<CallImport>(); + ret->target = target; + Import* import = wasm.getImport(ret->target); + ret->type = import->functionType->result; + parseCallOperands(s, 2, s.size(), ret); + return ret; + } auto ret = allocator.alloc<Call>(); - ret->target = s[1]->str(); + ret->target = target; ret->type = functionTypes[ret->target]; parseCallOperands(s, 2, s.size(), ret); return ret; |