[PATCH] D42750: [WebAssembly] Pre-symtab tidy of LLVM globals. NFC.

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 31 11:42:40 PST 2018


sbc100 added inline comments.


================
Comment at: lib/MC/WasmObjectWriter.cpp:728
   for (const WasmGlobal &Global : Globals) {
-    writeValueType(Global.Type);
-    write8(Global.IsMutable);
+    writeValueType(static_cast<wasm::ValType>(Global.Type.Type));
+    write8(Global.Type.Mutable);
----------------
I would revert to encodeSLEB128, not that its just a uint32_t.


================
Comment at: lib/MC/WasmObjectWriter.cpp:1141
       WasmGlobal Global;
-      Global.Type = PtrType;
-      Global.IsMutable = false;
-      Global.HasImport = false;
+      Global.Type.Type = static_cast<int32_t>(PtrType);
+      Global.Type.Mutable = false;
----------------
I would change PtrType .. since both uses now have a type cast.


Repository:
  rL LLVM

https://reviews.llvm.org/D42750





More information about the llvm-commits mailing list