[PATCH] D32317: [coff] for /msvclto, pass archive members with prevailing symbols first

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 17:56:25 PDT 2017


inglorion added inline comments.


================
Comment at: COFF/Driver.cpp:156
     Obj = make<ObjectFile>(MB);
+    if (Config->MSVCLTO) {
+      // Write the member to a temporary file so we can link it early
----------------
pcc wrote:
> Instead of handling this here, I think you can handle it entirely within the `/msvclto` implementation by creating temporary files for all members of `Symtab.ObjectFiles` that have a `ParentName`.
I like that idea, but I'm not sure how I would write the object file to disk. Its MemoryBufferRef is protected. I could make it public or create a public accessor. Or I could use the ParentName to try and locate the archive and find the object file in there...but that feels kind of brittle. I'm not sure I like either implementation better than what I've already written and tested. If you have a better suggestion, or prefer one of the alternatives I presented, I'll be happy to implement that, though.


https://reviews.llvm.org/D32317





More information about the llvm-commits mailing list