diff options
author | Thomas Lively <tlively@google.com> | 2019-01-17 02:29:55 +0000 |
---|---|---|
committer | Thomas Lively <tlively@google.com> | 2019-01-17 02:29:55 +0000 |
commit | cbda16eb8ebf52e10a44bd6f15e2743d69e9632a (patch) | |
tree | 43a795712422a63a3f60e732ac9131ceaa0bfd32 /llvm/tools/obj2yaml/wasm2yaml.cpp | |
parent | 2a0868ff48cbf9b3b57858c0f95b89607b69aac9 (diff) | |
download | llvm-cbda16eb8ebf52e10a44bd6f15e2743d69e9632a.zip llvm-cbda16eb8ebf52e10a44bd6f15e2743d69e9632a.tar.gz llvm-cbda16eb8ebf52e10a44bd6f15e2743d69e9632a.tar.bz2 |
[WebAssembly] Parse llvm.ident into producers section
llvm-svn: 351413
Diffstat (limited to 'llvm/tools/obj2yaml/wasm2yaml.cpp')
-rw-r--r-- | llvm/tools/obj2yaml/wasm2yaml.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/tools/obj2yaml/wasm2yaml.cpp b/llvm/tools/obj2yaml/wasm2yaml.cpp index 7581bbe..0bd5642 100644 --- a/llvm/tools/obj2yaml/wasm2yaml.cpp +++ b/llvm/tools/obj2yaml/wasm2yaml.cpp @@ -133,6 +133,29 @@ WasmDumper::dumpCustomSection(const WasmSection &WasmSec) { } CustomSec = std::move(LinkingSec); + } else if (WasmSec.Name == "producers") { + std::unique_ptr<WasmYAML::ProducersSection> ProducersSec = + make_unique<WasmYAML::ProducersSection>(); + const llvm::wasm::WasmProducerInfo &Info = Obj.getProducerInfo(); + for (auto &E : Info.Languages) { + WasmYAML::ProducerEntry Producer; + Producer.Name = E.first; + Producer.Version = E.second; + ProducersSec->Languages.push_back(Producer); + } + for (auto &E : Info.Tools) { + WasmYAML::ProducerEntry Producer; + Producer.Name = E.first; + Producer.Version = E.second; + ProducersSec->Tools.push_back(Producer); + } + for (auto &E : Info.SDKs) { + WasmYAML::ProducerEntry Producer; + Producer.Name = E.first; + Producer.Version = E.second; + ProducersSec->SDKs.push_back(Producer); + } + CustomSec = std::move(ProducersSec); } else { CustomSec = make_unique<WasmYAML::CustomSection>(WasmSec.Name); } |