[lld] [llvm] DTLTO Cache optimization - rebased (PR #203971)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 1 18:13:49 PDT 2026


================
@@ -151,19 +151,24 @@ Expected<FileCache> llvm::localCache(const Twine &CacheNameRef,
     // stream.
     struct MoveFileToCache : CachedFileStream {
       AddBufferFn AddBuffer;
+      std::string ModuleName;
       size_t Task;
-      SmallString<0> FilePath;
-      MoveFileToCache(AddBufferFn AddBuffer, std::string EntryPath, size_t Task)
-          : CachedFileStream(std::make_unique<raw_svector_ostream>(FilePath),
-                             std::move(EntryPath)),
-            AddBuffer(std::move(AddBuffer)), Task(Task) {}
+      StringRef FilePath;
+
+      MoveFileToCache(AddBufferFn AddBuffer, std::string EntryPath,
+                      std::string ModuleID, size_t Task)
+          : CachedFileStream({}, std::move(EntryPath)),
+            AddBuffer(std::move(AddBuffer)), ModuleName(ModuleID), Task(Task) {}
       virtual ~MoveFileToCache() = default;
 
-      virtual Error commit() override {
+      virtual Error commit(std::unique_ptr<MemoryBuffer> MemBuf) override {
         if (Committed)
----------------
teresajohnson wrote:

Like CacheStream::commit() you could do the checking and setting of Committed via a call to  CachedFileStream::commit().

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


More information about the llvm-commits mailing list