[PATCH] D47565: Fix /WholeArchive bug.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 1 11:15:26 PDT 2018


ruiu added inline comments.


================
Comment at: lld/COFF/Driver.cpp:134
+  for (StringRef Path : FilePaths) {
+    if (sys::fs::equivalent(Path, Filename)) {
+      warn(Filename + ": object specified more than once");
----------------
rnk wrote:
> I think O(n**2) stats on input object files is going to be too much. Once we have the FD, you can do `fs::getUniqueId(FD)` to get the inode number, and then build a set of those. I guess if it's not a file MemoryBuffer, don't do the inode check. It probably comes from a whole archive.
Since this is a MemoryBuffer and not a MemoryBufferRef, I think anything that comes to this function is a file and not a slice of a file.


https://reviews.llvm.org/D47565





More information about the llvm-commits mailing list