[WebAssembly] Allow for the creation of user-defined custom sections
commit13c09234d667653edf53256f0f14cc55dd4a89ee
authorSam Clegg <sbc@chromium.org>
Thu, 5 Apr 2018 17:01:39 +0000 (5 17:01 +0000)
committerSam Clegg <sbc@chromium.org>
Thu, 5 Apr 2018 17:01:39 +0000 (5 17:01 +0000)
tree7bcf2f193e1d7b192026e0d3169bec014a6310d7
parent6fbc0600513f874f1ffa8ff934945540137355a5
[WebAssembly] Allow for the creation of user-defined custom sections

This patch adds a way for users to create their own custom sections to
be added to wasm files. At the LLVM IR layer, they are defined through
the "wasm.custom_sections" named metadata. The expected use case for
this is bindings generators such as wasm-bindgen.

Patch by Dan Gohman

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329315 91177308-0d34-0410-b5e6-96231b3b80d8
lib/MC/WasmObjectWriter.cpp
lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
test/CodeGen/WebAssembly/custom-sections.ll [new file with mode: 0644]
test/MC/WebAssembly/custom-sections.ll [new file with mode: 0644]