summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/BinaryFormat/Wasm.h
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2018-12-15 00:58:12 +0000
committerHeejin Ahn <aheejin@gmail.com>2018-12-15 00:58:12 +0000
commitfeef720bb86001ba3173d5022fd329fb385c7794 (patch)
tree8ecf5eaf9c3c4a7f05549f44ed6d5881dfb954bb /llvm/include/llvm/BinaryFormat/Wasm.h
parentc214bc2b8da91f38c4d2c060831229a17b6af816 (diff)
downloadbcm5719-llvm-feef720bb86001ba3173d5022fd329fb385c7794.tar.gz
bcm5719-llvm-feef720bb86001ba3173d5022fd329fb385c7794.zip
[WebAssembly] Check if the section order is correct
Summary: This patch checks if the section order is correct when reading a wasm object file in `WasmObjectFile` and converting YAML to wasm object in yaml2wasm. (It is not possible to check when reading YAML because it is handled exclusively by the YAML reader.) This checks the ordering of all known sections (core sections + known custom sections). This also adds section ID DataCount section that will be scheduled to be added in near future. Reviewers: sbc100 Subscribers: dschuff, mgorny, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D54924 llvm-svn: 349221
Diffstat (limited to 'llvm/include/llvm/BinaryFormat/Wasm.h')
-rw-r--r--llvm/include/llvm/BinaryFormat/Wasm.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/llvm/include/llvm/BinaryFormat/Wasm.h b/llvm/include/llvm/BinaryFormat/Wasm.h
index 9b8ca28de66..ca752374e15 100644
--- a/llvm/include/llvm/BinaryFormat/Wasm.h
+++ b/llvm/include/llvm/BinaryFormat/Wasm.h
@@ -188,19 +188,20 @@ struct WasmLinkingData {
};
enum : unsigned {
- WASM_SEC_CUSTOM = 0, // Custom / User-defined section
- WASM_SEC_TYPE = 1, // Function signature declarations
- WASM_SEC_IMPORT = 2, // Import declarations
- WASM_SEC_FUNCTION = 3, // Function declarations
- WASM_SEC_TABLE = 4, // Indirect function table and other tables
- WASM_SEC_MEMORY = 5, // Memory attributes
- WASM_SEC_GLOBAL = 6, // Global declarations
- WASM_SEC_EXPORT = 7, // Exports
- WASM_SEC_START = 8, // Start function declaration
- WASM_SEC_ELEM = 9, // Elements section
- WASM_SEC_CODE = 10, // Function bodies (code)
- WASM_SEC_DATA = 11, // Data segments
- WASM_SEC_EVENT = 13 // Event declarations
+ WASM_SEC_CUSTOM = 0, // Custom / User-defined section
+ WASM_SEC_TYPE = 1, // Function signature declarations
+ WASM_SEC_IMPORT = 2, // Import declarations
+ WASM_SEC_FUNCTION = 3, // Function declarations
+ WASM_SEC_TABLE = 4, // Indirect function table and other tables
+ WASM_SEC_MEMORY = 5, // Memory attributes
+ WASM_SEC_GLOBAL = 6, // Global declarations
+ WASM_SEC_EXPORT = 7, // Exports
+ WASM_SEC_START = 8, // Start function declaration
+ WASM_SEC_ELEM = 9, // Elements section
+ WASM_SEC_CODE = 10, // Function bodies (code)
+ WASM_SEC_DATA = 11, // Data segments
+ WASM_SEC_DATACOUNT = 12, // Data segment count
+ WASM_SEC_EVENT = 13 // Event declarations
};
// Type immediate encodings used in various contexts.
OpenPOWER on IntegriCloud