diff options
author | Teresa Johnson <tejohnson@google.com> | 2018-02-20 20:21:53 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2018-02-20 20:21:53 +0000 |
commit | a344fd3db6fa900fcca59e4fd3fb02f1bb6e00e1 (patch) | |
tree | 2f4abb27e4a9701c7871be8ec441b1cc5afd0afa | |
parent | b145cca85e97788d02aca7b47276d845c5c3d266 (diff) | |
download | bcm5719-llvm-a344fd3db6fa900fcca59e4fd3fb02f1bb6e00e1.tar.gz bcm5719-llvm-a344fd3db6fa900fcca59e4fd3fb02f1bb6e00e1.zip |
[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
-rw-r--r-- | llvm/include/llvm/LTO/Caching.h | 7 | ||||
-rw-r--r-- | llvm/lib/LTO/Caching.cpp | 4 | ||||
-rw-r--r-- | llvm/tools/gold/gold-plugin.cpp | 3 | ||||
-rw-r--r-- | llvm/tools/llvm-lto2/llvm-lto2.cpp | 3 |
4 files changed, 5 insertions, 12 deletions
diff --git a/llvm/include/llvm/LTO/Caching.h b/llvm/include/llvm/LTO/Caching.h index 25c719a68b9..7201ab31f5b 100644 --- a/llvm/include/llvm/LTO/Caching.h +++ b/llvm/include/llvm/LTO/Caching.h @@ -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 diff --git a/llvm/lib/LTO/Caching.cpp b/llvm/lib/LTO/Caching.cpp index dd47eb584b7..22bc82f7ba0 100644 --- a/llvm/lib/LTO/Caching.cpp +++ b/llvm/lib/LTO/Caching.cpp @@ -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)); } }; diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index aa4d1753e3b..be3abbd925c 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -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(); }; diff --git a/llvm/tools/llvm-lto2/llvm-lto2.cpp b/llvm/tools/llvm-lto2/llvm-lto2.cpp index a127ad80414..2ba7bd55747 100644 --- a/llvm/tools/llvm-lto2/llvm-lto2.cpp +++ b/llvm/tools/llvm-lto2/llvm-lto2.cpp @@ -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(); }; |