OSDN Git Service

[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)
commit349a48faddee68d15fa370fe86f3bd4bac1b848f
tree55ca34330e288bcb353a058b7571358b9e2ca4d4
parent38ad05a6a6a669c107ee9da686e37ea7d2f7aace
[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

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