[PATCH] D43097: [WebAssembly] Allow for the creation of user-defined custom sections

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 14:16:10 PST 2018


sbc100 added inline comments.


================
Comment at: lib/MC/WasmObjectWriter.cpp:992
   SmallVector<WasmDataSegment, 4> DataSegments;
+  std::vector<std::pair<StringRef, const SmallVectorImpl<char>*>>
+      CustomSections;
----------------
ncw wrote:
> sunfish wrote:
> > sbc100 wrote:
> > > would ArrayRef<char> ? Or ArrayRef<uint8_t> work better here?
> > I initially did exactly that, with ArrayRef and uint8_t, however writeBytes takes a SmallVectorImpl<char>.
> It could be a bit less ugly with a typedef/"using=" for the std::pair (and in fact for all these vectors here which have rather long types)
Why does writeBytes not take an ArrayRef?  There is an overload that takes a StringRef..


Repository:
  rL LLVM

https://reviews.llvm.org/D43097





More information about the llvm-commits mailing list