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

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 5 10:17:48 PST 2018


dschuff 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
----------------
sbc100 wrote:
> 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.
I think these enums correspond to section IDs in the spec (https://webassembly.github.io/spec/core/binary/modules.html) and can't be changed. I guess Event should just get number 12, even though it goes here in the ordering? We should probably add that to the spec proposal too.


================
Comment at: include/llvm/CodeGen/WasmEHFuncInfo.h:24
 
+enum ThrowTag { CPP_EXCEPTION = 0, C_LONGJMP = 1 };
+
----------------
I don't see uses of these tags. Is the idea that these would be the tags used by LLVM to throw/catch? I guess we'd want to use event symbols for this? Something like `catch __cpp_exception` where cpp_exception is an event symbol that gets a relocation to point to the event section entry with the right signature?


Repository:
  rL LLVM

https://reviews.llvm.org/D54096





More information about the llvm-commits mailing list