[lld] [lld][MachO]Multi-threaded i/o. Twice as fast linking a large project. (PR #147134)

Ellis Hoag via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 25 16:51:01 PDT 2025


================
@@ -282,11 +286,119 @@ static void saveThinArchiveToRepro(ArchiveFile const *file) {
           ": Archive::children failed: " + toString(std::move(e)));
 }
 
-static InputFile *addFile(StringRef path, LoadType loadType,
-                          bool isLazy = false, bool isExplicit = true,
-                          bool isBundleLoader = false,
-                          bool isForceHidden = false) {
-  std::optional<MemoryBufferRef> buffer = readFile(path);
+class DeferredFile {
+public:
+  DeferredFile(StringRef path, bool isLazy, MemoryBufferRef buffer)
+      : path(path), isLazy(isLazy), buffer(buffer) {}
+  StringRef path;
+  bool isLazy;
+  MemoryBufferRef buffer;
+};
+using DeferredFiles = std::vector<DeferredFile>;
+
+class SerialBackgroundQueue {
----------------
ellishg wrote:

If we move this to some LLVM/common header, then the BackgroundQueue implemented in Clang you mentioned could share this implementation. Although it might take a lot more work to make sure you don't regress both cases by using a slightly different class

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


More information about the llvm-commits mailing list