[PATCH] D41094: Do not read the same .lib file more than once.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 11 15:09:57 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rLLD320434: Do not read the same .lib file more than once. (authored by ruiu).

Changed prior to commit:
  https://reviews.llvm.org/D41094?vs=126446&id=126457#toc

Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D41094

Files:
  COFF/Driver.cpp
  test/COFF/libpath.test


Index: test/COFF/libpath.test
===================================================================
--- test/COFF/libpath.test
+++ test/COFF/libpath.test
@@ -16,3 +16,11 @@
 # RUN: FileCheck -check-prefix=CHECK2 %s < %t.log
 
 CHECK2: a{{[/\\]}}std64.lib
+
+# RUN: lld-link /out:%t.exe /entry:main /verbose \
+# RUN:   %t/a/std64.lib /subsystem:console %p/Inputs/hello64.obj \
+# RUN:   /libpath:%t/b /verbose > %t.log 2>&1
+# RUN: FileCheck -check-prefix=CHECK3 %s < %t.log
+
+CHECK3:     Reading {{.*}}a/std64.lib
+CHECK3-NOT: Reading {{.*}}b/std64.lib
Index: COFF/Driver.cpp
===================================================================
--- COFF/Driver.cpp
+++ COFF/Driver.cpp
@@ -315,6 +315,8 @@
   bool Seen = !VisitedFiles.insert(Path.lower()).second;
   if (Seen)
     return None;
+  if (Path.endswith_lower(".lib"))
+    VisitedLibs.insert(sys::path::filename(Path));
   return Path;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41094.126457.patch
Type: text/x-patch
Size: 902 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171211/39faa8ab/attachment.bin>


More information about the llvm-commits mailing list