[PATCH] D42233: [WebAssembly] Better support for WASM Object format

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 20 21:59:55 PST 2018


sbc100 added inline comments.


================
Comment at: include/llvm/Object/Wasm.h:213
+
+  const ArrayRef<uint8_t> &getDataRefContent(DataRefImpl Ref) const;
+
----------------
This method seems like it could use a better name since "DetaRef" is can refer to many things, not just segment.  Also, what is wrong with using the existing `getSectionContents` method?


================
Comment at: lib/MC/WasmObjectWriter.cpp:856
+    
+    assert(OffsetToAlignment(getStream().tell(), Segment.Alignment) == 0 && "DataSegments is not aligned");
     Segment.Section->setSectionOffset(getStream().tell() - Section.ContentsOffset);
----------------
Unlike other formats that wasm file formats is not designed to be mapped into memory, so the file alignment should not be relevent.  If it is particularly important for bitcode data perhaps you could just align those segments, but I don't think we want padding for data segments in general.


https://reviews.llvm.org/D42233





More information about the llvm-commits mailing list