[PATCH] D97923: [WebAssembly][yaml2obj][obj2yaml] Elem sections for nonzero tables

Andy Wingo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 4 01:54:57 PST 2021


wingo added inline comments.


================
Comment at: llvm/lib/MC/WasmObjectWriter.cpp:937
+    W->OS << ElemKind;
+  }
+
----------------
inline comments from @sbc100, from https://reviews.llvm.org/D92321?id=323966#inline-917851:

> > Paging this back in -- this code was not dead.  See the definition for WASM_ELEM_SEGMENT_HAS_ELEM_KIND.  I have restored it here.  WDYT?

> Oh I see.. WASM_ELEM_SEGMENT_HAS_ELEM_KIND is defined as ~SOME_OTHER_FLAG.. that seem odd at best.   Perhaps better write to little helper function `elemSegmentNeedsElemKind()` rather than trying to make that part of the enum?   Otherwise folks will think that `WASM_ELEM_SEGMENT_HAS_ELEM_KIND` is just another flag they can `|` together.   Either that or maybe add MASK to its name and take it out of the enum with the others.

> It looks like WASM_ELEM_SEGMENT_HAS_ELEM_KIND is basically `PASSIVE | HAS_TABLE_NUMBER` ... maybe its more clear to just write that out here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97923



More information about the llvm-commits mailing list