/// 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<void(unsigned Task, std::unique_ptr<MemoryBuffer> MB,
- StringRef Path)>
+typedef std::function<void(unsigned Task, std::unique_ptr<MemoryBuffer> MB)>
AddBufferFn;
/// Create a local file system cache which uses the given cache directory and
ErrorOr<std::unique_ptr<MemoryBuffer>> MBOrErr =
MemoryBuffer::getFile(EntryPath);
if (MBOrErr) {
- AddBuffer(Task, std::move(*MBOrErr), EntryPath);
+ AddBuffer(Task, std::move(*MBOrErr));
return AddStreamFn();
}
TempFile.TmpName + " to " + EntryPath + ": " +
toString(std::move(E)) + "\n");
- AddBuffer(Task, std::move(*MBOrErr), EntryPath);
+ AddBuffer(Task, std::move(*MBOrErr));
}
};
llvm::make_unique<llvm::raw_fd_ostream>(FD, true));
};
- auto AddBuffer = [&](size_t Task, std::unique_ptr<MemoryBuffer> MB,
- StringRef Path) {
+ auto AddBuffer = [&](size_t Task, std::unique_ptr<MemoryBuffer> MB) {
*AddStream(Task)->OS << MB->getBuffer();
};
return llvm::make_unique<lto::NativeObjectStream>(std::move(S));
};
- auto AddBuffer = [&](size_t Task, std::unique_ptr<MemoryBuffer> MB,
- StringRef Path) {
+ auto AddBuffer = [&](size_t Task, std::unique_ptr<MemoryBuffer> MB) {
*AddStream(Task)->OS << MB->getBuffer();
};