[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
Wed Aug 6 10:20:52 PDT 2025


================
@@ -441,6 +522,24 @@ static InputFile *addFile(StringRef path, LoadType loadType,
   return newFile;
 }
 
+static InputFile *addFile(StringRef path, LoadType loadType,
+                          bool isLazy = false, bool isExplicit = true,
+                          bool isBundleLoader = false,
+                          bool isForceHidden = false) {
+  return processFile(readFile(path), nullptr, path, loadType, isLazy,
+                     isExplicit, isBundleLoader, isForceHidden);
+}
+
+static void deferFile(StringRef path, bool isLazy, DeferredFiles &deferred) {
+  std::optional<MemoryBufferRef> buffer = readFile(path);
+  if (!buffer)
+    return;
+  if (config->readThreads)
+    deferred.push_back({path, isLazy, *buffer});
----------------
drodriguez wrote:

Did `emplace_back` didn't work?

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


More information about the llvm-commits mailing list