diff options
author | Sam Clegg <sbc@chromium.org> | 2018-01-09 23:43:14 +0000 |
---|---|---|
committer | Sam Clegg <sbc@chromium.org> | 2018-01-09 23:43:14 +0000 |
commit | ea7caceedcc8d872bc31c141515ef2e3749ef659 (patch) | |
tree | 7499d1e4ee969bda41210ab8d2e5d7c339c07b44 /llvm/include/llvm/BinaryFormat/Wasm.h | |
parent | 29f5f987f1b76b5c43310b2062c9f447667a4f80 (diff) | |
download | bcm5719-llvm-ea7caceedcc8d872bc31c141515ef2e3749ef659.tar.gz bcm5719-llvm-ea7caceedcc8d872bc31c141515ef2e3749ef659.zip |
[WebAssembly] Add COMDAT support
This adds COMDAT support to the Wasm object-file format.
Spec: https://github.com/WebAssembly/tool-conventions/pull/31
Corresponding LLD change:
https://bugs.llvm.org/show_bug.cgi?id=35533, and D40845
Patch by Nicholas Wilson
Differential Revision: https://reviews.llvm.org/D40844
llvm-svn: 322135
Diffstat (limited to 'llvm/include/llvm/BinaryFormat/Wasm.h')
-rw-r--r-- | llvm/include/llvm/BinaryFormat/Wasm.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/llvm/include/llvm/BinaryFormat/Wasm.h b/llvm/include/llvm/BinaryFormat/Wasm.h index 7d436180f03..80fd9a47a8d 100644 --- a/llvm/include/llvm/BinaryFormat/Wasm.h +++ b/llvm/include/llvm/BinaryFormat/Wasm.h @@ -95,6 +95,7 @@ struct WasmFunction { ArrayRef<uint8_t> Body; uint32_t CodeSectionOffset; uint32_t Size; + StringRef Comdat; }; struct WasmDataSegment { @@ -104,6 +105,7 @@ struct WasmDataSegment { StringRef Name; uint32_t Alignment; uint32_t Flags; + StringRef Comdat; }; struct WasmElemSegment { @@ -174,11 +176,6 @@ enum : unsigned { }; enum : unsigned { - WASM_NAMES_FUNCTION = 0x1, - WASM_NAMES_LOCAL = 0x2, -}; - -enum : unsigned { WASM_LIMITS_FLAG_HAS_MAX = 0x1, }; @@ -190,12 +187,25 @@ enum class ValType { F64 = WASM_TYPE_F64, }; -// Linking metadata kinds. +// Kind codes used in the custom "name" section +enum : unsigned { + WASM_NAMES_FUNCTION = 0x1, + WASM_NAMES_LOCAL = 0x2, +}; + +// Kind codes used in the custom "linking" section enum : unsigned { WASM_SYMBOL_INFO = 0x2, WASM_DATA_SIZE = 0x3, WASM_SEGMENT_INFO = 0x5, WASM_INIT_FUNCS = 0x6, + WASM_COMDAT_INFO = 0x7, +}; + +// Kind codes used in the custom "linking" section in the WASM_COMDAT_INFO +enum : unsigned { + WASM_COMDAT_DATA = 0x0, + WASM_COMDAT_FUNCTION = 0x1, }; const unsigned WASM_SYMBOL_BINDING_MASK = 0x3; |