[PATCH] D22206: COFF: drop the dependency on LIB.EXE for implibs

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 11 17:33:09 PDT 2016


ruiu added inline comments.

================
Comment at: COFF/Librarian.cpp:141
@@ +140,3 @@
+}
+
+static const std::string NullImportDescriptorSymbolName =
----------------
compnerd wrote:
> ruiu wrote:
> > What I was trying to say is something like this. If you define a function to append data to a std::vector,
> > 
> >   template <class T> append(std::vector<uint8_t> &Vec, const T &Data) {
> >     size_t S = Vec.size();
> >     Vec.resize(S + sizeof(T));
> >     memcpy(&Vec[S], Data, sizeof(T));
> >   }
> > 
> > and use that to append data, then you don't need to compute the buffer size beforehand.
> Okay.  So, you want to replace the local bump ptr allocator with a `std::vector<char>`?
> 
> I guess that the write* functions would do the allocation + write.
Yeah. More precisely, I want to replace the buffers allocated using the bump ptr allocator with `std::vector<uint8_t>`.


http://reviews.llvm.org/D22206





More information about the llvm-commits mailing list