[PATCH] D40989: [WebAssembly] De-dup indirect function table

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 17:31:00 PST 2017


ruiu added inline comments.


================
Comment at: lld/trunk/wasm/InputFiles.cpp:142
 
 void ObjFile::initializeSymbols() {
   Symbols.reserve(WasmObj->getNumberOfSymbols());
----------------
This function is getting longer. Please consider splitting it into multiple functions in a follow-up patch.


================
Comment at: lld/trunk/wasm/InputFiles.cpp:200-209
+    const WasmElemSegment &Segment = WasmObj->elements()[0];
+    if (Segment.Offset.Opcode != WASM_OPCODE_I32_CONST)
+      fatal(getName() + ": unsupported element segment");
+    if (Segment.TableIndex != 0)
+      fatal(getName() + ": unsupported table index in elem segment");
+    if (Segment.Offset.Value.Int32 != 0)
+      fatal(getName() + ": unsupported element segment offset");
----------------
Could you add blank lines more often to split code into meaningful code blocks? For example, I'd add two blank lines at line 201 and line 207 so that the code is organized as (1) initialization, (2) error checking and (3) TableSymbols initialization.


Repository:
  rL LLVM

https://reviews.llvm.org/D40989





More information about the llvm-commits mailing list