[PATCH] D35234: [WebAssembly] Expose the offset of each data segment

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 11 12:56:44 PDT 2017


dschuff added a comment.

So just to be sure I understand, we need this because we only have segments for initialized data (and there is implicitly BSS in between), so the offset can't just be calculated from the sizes of the segments?



================
Comment at: include/llvm/Object/Wasm.h:82
 
+struct WasmSegment {
+  uint32_t SectionOffset;
----------------
Maybe this should be called `WasmObjectSegment` or something like that `WasmSegment` made me think it should be some sort of generalization of data and elem segments, which are pretty similar, although we model them differently in LLVM. Or thinking of it another way, will we eventually want a similar model for elem segments (with an offset in the table instead of in the section?)

Actually I guess this is in the `llvm:object` namespace, so maybe ObjectSegment is redundant and this is unambiguous enough.


https://reviews.llvm.org/D35234





More information about the llvm-commits mailing list