Index: llvm/trunk/include/llvm/LTO/Caching.h =================================================================== --- llvm/trunk/include/llvm/LTO/Caching.h +++ llvm/trunk/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: llvm/trunk/lib/LTO/Caching.cpp =================================================================== --- llvm/trunk/lib/LTO/Caching.cpp +++ llvm/trunk/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: llvm/trunk/tools/gold/gold-plugin.cpp =================================================================== --- llvm/trunk/tools/gold/gold-plugin.cpp +++ llvm/trunk/tools/gold/gold-plugin.cpp @@ -917,8 +917,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: llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp =================================================================== --- llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp +++ llvm/trunk/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(); };