[WebAssembly] Improve support for WebAssembly binary format
authorDerek Schuff <dschuff@google.com>
Thu, 30 Mar 2017 19:44:09 +0000 (19:44 +0000)
committerDerek Schuff <dschuff@google.com>
Thu, 30 Mar 2017 19:44:09 +0000 (19:44 +0000)
commitd3d84fdda185356e8f2a9f660e064427566d9798
tree33908ea553d83fa422b2f354b6d445dee6e7d9a0
parentd3209f932f73087c33ccae4b7e7403ca4ad94d28
[WebAssembly] Improve support for WebAssembly binary format

Mostly this change adds support converting to and from
YAML which will allow us to write more test cases for
the WebAssembly MC and lld ports.

Better support for objdump, readelf, and nm will be in
followup CLs.

I had to update the two wasm test binaries because they
used the old style 'name' section which is no longer
supported.

Differential Revision: https://reviews.llvm.org/D31099

Patch by Sam Clegg

llvm-svn: 299101
35 files changed:
llvm/include/llvm/Object/Wasm.h
llvm/include/llvm/ObjectYAML/ObjectYAML.h
llvm/include/llvm/ObjectYAML/WasmYAML.h [new file with mode: 0644]
llvm/include/llvm/Support/Wasm.h
llvm/lib/Object/WasmObjectFile.cpp
llvm/lib/ObjectYAML/CMakeLists.txt
llvm/lib/ObjectYAML/ObjectYAML.cpp
llvm/lib/ObjectYAML/WasmYAML.cpp [new file with mode: 0644]
llvm/test/ObjectYAML/wasm/code_section.yaml [new file with mode: 0644]
llvm/test/ObjectYAML/wasm/custom_section.yaml [new file with mode: 0644]
llvm/test/ObjectYAML/wasm/data_section.yaml [new file with mode: 0644]
llvm/test/ObjectYAML/wasm/elem_section.yaml [new file with mode: 0644]
llvm/test/ObjectYAML/wasm/export_section.yaml [new file with mode: 0644]
llvm/test/ObjectYAML/wasm/function_section.yaml [new file with mode: 0644]
llvm/test/ObjectYAML/wasm/global_section.yaml [new file with mode: 0644]
llvm/test/ObjectYAML/wasm/header.yaml [new file with mode: 0644]
llvm/test/ObjectYAML/wasm/header_invalid_version.yaml [new file with mode: 0644]
llvm/test/ObjectYAML/wasm/import_section.yaml [new file with mode: 0644]
llvm/test/ObjectYAML/wasm/memory_section.yaml [new file with mode: 0644]
llvm/test/ObjectYAML/wasm/start_section.yaml [new file with mode: 0644]
llvm/test/ObjectYAML/wasm/table_section.yaml [new file with mode: 0644]
llvm/test/ObjectYAML/wasm/type_section.yaml [new file with mode: 0644]
llvm/test/tools/llvm-objdump/Inputs/test.wasm
llvm/test/tools/llvm-objdump/wasm.txt
llvm/test/tools/llvm-readobj/Inputs/trivial.obj.wasm
llvm/test/tools/llvm-readobj/sections.test
llvm/tools/llvm-readobj/WasmDumper.cpp
llvm/tools/obj2yaml/CMakeLists.txt
llvm/tools/obj2yaml/obj2yaml.cpp
llvm/tools/obj2yaml/obj2yaml.h
llvm/tools/obj2yaml/wasm2yaml.cpp [new file with mode: 0644]
llvm/tools/yaml2obj/CMakeLists.txt
llvm/tools/yaml2obj/yaml2obj.cpp
llvm/tools/yaml2obj/yaml2obj.h
llvm/tools/yaml2obj/yaml2wasm.cpp [new file with mode: 0644]