[lld] [lld][COFF] Add /linkreprofullpathrsp flag (PR #165449)

David Truby via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 05:14:56 PST 2025


================
@@ -318,11 +318,31 @@ void LinkerDriver::addBuffer(std::unique_ptr<MemoryBuffer> mb,
   }
 }
 
-void LinkerDriver::enqueuePath(StringRef path, bool wholeArchive, bool lazy) {
+void LinkerDriver::handleReproFile(StringRef path, InputType inputType) {
+  if (!reproFile)
+    return;
+
+  *reproFile << '"';
+  if (inputType == InputType::DefaultLib)
+    *reproFile << "/defaultlib:";
+  else if (inputType == InputType::WholeArchive)
+    *reproFile << "/wholearchive:";
+
+  SmallString<128> absPath = path;
+  std::error_code ec = sys::fs::make_absolute(absPath);
+  if (ec)
+    Err(ctx) << "cannot find absolute path for reproFile for " << absPath
+             << ": " << ec.message();
+  sys::path::remove_dots(absPath, true);
+  *reproFile << absPath << "\"\n";
+  reproFile->flush();
----------------
DavidTruby wrote:

Ah I see. Where would be the right place to flush and close the file then? Probably better to only do the flush once...

https://github.com/llvm/llvm-project/pull/165449


More information about the llvm-commits mailing list