diff options
author | Thomas Lively <tlively@google.com> | 2019-10-18 20:27:30 +0000 |
---|---|---|
committer | Thomas Lively <tlively@google.com> | 2019-10-18 20:27:30 +0000 |
commit | 393d0f799f8828e9d8002766a9e9db21797451df (patch) | |
tree | 3d8ab2119713681752d60d57ab898349973380f2 /llvm/tools/obj2yaml/wasm2yaml.cpp | |
parent | c6921379f55ee566fb62ba5aa47b217cf7c5d960 (diff) | |
download | llvm-393d0f799f8828e9d8002766a9e9db21797451df.zip llvm-393d0f799f8828e9d8002766a9e9db21797451df.tar.gz llvm-393d0f799f8828e9d8002766a9e9db21797451df.tar.bz2 |
[WebAssembly] Allow multivalue signatures in object files
Summary:
Also changes the wasm YAML format to reflect the possibility of having
multiple return types and to put the returns after the params for
consistency with the binary encoding.
Reviewers: aheejin, sbc100
Subscribers: dschuff, jgravelle-google, hiraditya, sunfish, arphaman, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69156
llvm-svn: 375283
Diffstat (limited to 'llvm/tools/obj2yaml/wasm2yaml.cpp')
-rw-r--r-- | llvm/tools/obj2yaml/wasm2yaml.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/tools/obj2yaml/wasm2yaml.cpp b/llvm/tools/obj2yaml/wasm2yaml.cpp index 7a54097..ea7a1e98 100644 --- a/llvm/tools/obj2yaml/wasm2yaml.cpp +++ b/llvm/tools/obj2yaml/wasm2yaml.cpp @@ -198,13 +198,10 @@ ErrorOr<WasmYAML::Object *> WasmDumper::dump() { for (const auto &FunctionSig : Obj.types()) { WasmYAML::Signature Sig; Sig.Index = Index++; - Sig.ReturnType = wasm::WASM_TYPE_NORESULT; - assert(FunctionSig.Returns.size() <= 1 && - "Functions with multiple returns are not supported"); - if (FunctionSig.Returns.size()) - Sig.ReturnType = static_cast<uint32_t>(FunctionSig.Returns[0]); for (const auto &ParamType : FunctionSig.Params) Sig.ParamTypes.emplace_back(static_cast<uint32_t>(ParamType)); + for (const auto &ReturnType : FunctionSig.Returns) + Sig.ReturnTypes.emplace_back(static_cast<uint32_t>(ReturnType)); TypeSec->Signatures.push_back(Sig); } S = std::move(TypeSec); |