[PATCH] D57938: [WebAssembly] Update MC for bulk memory

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 11 18:34:33 PST 2019


tlively added inline comments.


================
Comment at: llvm/include/llvm/BinaryFormat/Wasm.h:136
+  uint32_t MemoryIndex; // present if flags == 2
+  WasmInitExpr Offset; // if flags != 1
   ArrayRef<uint8_t> Content;
----------------
tlively wrote:
> sbc100 wrote:
> > Is Flags and enum.. in which case should we name the number values and should these comments say flags & 2?
> No, in the bulk memory proposal, the meaningful values are referred to only as 1, 2, and 3. Perhaps it would make more sense to name this field "InitType" and the directive ".init_type" or similar and create a corresponding enum for the different values it can take on. I worry that there are already too many too many things called "types" floating around, though. What do you think?
I realized that there was a clean way to interpret the values as flags, so I went ahead and made that change.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57938/new/

https://reviews.llvm.org/D57938





More information about the llvm-commits mailing list