Index: include/llvm/LTO/Caching.h =================================================================== --- include/llvm/LTO/Caching.h +++ include/llvm/LTO/Caching.h @@ -24,13 +24,8 @@ /// This type defines the callback to add a pre-existing native object file /// (e.g. in a cache). /// -/// Path is generally expected to be a valid path for the file at the point when -/// the AddBufferFn function is called, but clients should prefer to access MB -/// directly in order to avoid a potential race condition. -/// /// Buffer callbacks must be thread safe. -typedef std::function MB, - StringRef Path)> +typedef std::function MB)> AddBufferFn; /// Create a local file system cache which uses the given cache directory and Index: lib/LTO/Caching.cpp =================================================================== --- lib/LTO/Caching.cpp +++ lib/LTO/Caching.cpp @@ -36,7 +36,7 @@ ErrorOr> MBOrErr = MemoryBuffer::getFile(EntryPath); if (MBOrErr) { - AddBuffer(Task, std::move(*MBOrErr), EntryPath); + AddBuffer(Task, std::move(*MBOrErr)); return AddStreamFn(); } @@ -103,7 +103,7 @@ TempFile.TmpName + " to " + EntryPath + ": " + toString(std::move(E)) + "\n"); - AddBuffer(Task, std::move(*MBOrErr), EntryPath); + AddBuffer(Task, std::move(*MBOrErr)); } }; Index: tools/gold/gold-plugin.cpp =================================================================== --- tools/gold/gold-plugin.cpp +++ tools/gold/gold-plugin.cpp @@ -901,8 +901,7 @@ llvm::make_unique(FD, true)); }; - auto AddBuffer = [&](size_t Task, std::unique_ptr MB, - StringRef Path) { + auto AddBuffer = [&](size_t Task, std::unique_ptr MB) { *AddStream(Task)->OS << MB->getBuffer(); }; Index: tools/llvm-lto2/llvm-lto2.cpp =================================================================== --- tools/llvm-lto2/llvm-lto2.cpp +++ tools/llvm-lto2/llvm-lto2.cpp @@ -296,8 +296,7 @@ return llvm::make_unique(std::move(S)); }; - auto AddBuffer = [&](size_t Task, std::unique_ptr MB, - StringRef Path) { + auto AddBuffer = [&](size_t Task, std::unique_ptr MB) { *AddStream(Task)->OS << MB->getBuffer(); };