[LTO] Remove unused Path parameter to AddBufferFn

Summary:
With D43396, no clients use the Path parameter anymore.

Depends on D43396.

Reviewers: pcc

Subscribers: mehdi_amini, inglorion, llvm-commits

Differential Revision: https://reviews.llvm.org/D43400

llvm-svn: 325619
This commit is contained in:
Teresa Johnson 2018-02-20 20:21:53 +00:00
parent b145cca85e
commit a344fd3db6
4 changed files with 5 additions and 12 deletions

View File

@ -24,13 +24,8 @@ namespace lto {
/// 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

View File

@ -36,7 +36,7 @@ Expected<NativeObjectCache> lto::localCache(StringRef CacheDirectoryPath,
ErrorOr<std::unique_ptr<MemoryBuffer>> MBOrErr =
MemoryBuffer::getFile(EntryPath);
if (MBOrErr) {
AddBuffer(Task, std::move(*MBOrErr), EntryPath);
AddBuffer(Task, std::move(*MBOrErr));
return AddStreamFn();
}
@ -103,7 +103,7 @@ Expected<NativeObjectCache> lto::localCache(StringRef CacheDirectoryPath,
TempFile.TmpName + " to " + EntryPath + ": " +
toString(std::move(E)) + "\n");
AddBuffer(Task, std::move(*MBOrErr), EntryPath);
AddBuffer(Task, std::move(*MBOrErr));
}
};

View File

@ -917,8 +917,7 @@ static ld_plugin_status allSymbolsReadHook() {
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();
};

View File

@ -296,8 +296,7 @@ static int run(int argc, char **argv) {
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();
};