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

Daniel Rodríguez Troitiño via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 29 18:08:17 PDT 2025


================
@@ -282,11 +286,122 @@ 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;
+};
----------------
drodriguez wrote:

I think we have gone back to this being a simple POD. It might require some changes where it is initialized, but it should be minimal.

```suggestion
struct DeferredFile {
  StringRef path;
  bool isLazy;
  MemoryBufferRef buffer;
};
```

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


More information about the llvm-commits mailing list