[PATCH] D54096: [WebAssembly] Add support for the event section

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 5 10:05:03 PST 2018


sbc100 added inline comments.


================
Comment at: include/llvm/BinaryFormat/Wasm.h:189
   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 = 7,    // Event declarations
+  WASM_SEC_EXPORT = 8,   // Exports
----------------
These integer values are defined by the spec I think, which means you can't just change them.  I imagine you will have to use `13`, or what even number the spec decides on, but specify that it must come between section 6 and section 7.  

Of course this will make the section parsing a code a little complex but I don't see any way around this.


================
Comment at: lib/MC/WasmObjectWriter.cpp:62
 // TODO: Consider using WasmSignature directly instead.
-struct WasmFunctionType {
+struct WasmType {
   // Support empty and tombstone instances, needed by DenseMap.
----------------
Would `WasmSignature` be a better name?


Repository:
  rL LLVM

https://reviews.llvm.org/D54096





More information about the llvm-commits mailing list