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

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 11 17:29:36 PDT 2016


compnerd added inline comments.

================
Comment at: COFF/Librarian.cpp:141
@@ +140,3 @@
+}
+
+static const std::string NullImportDescriptorSymbolName =
----------------
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.


http://reviews.llvm.org/D22206





More information about the llvm-commits mailing list