[PATCH] D43400: [LTO] Remove unused Path parameter to AddBufferFn
Teresa Johnson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 16 11:25:04 PST 2018
tejohnson created this revision.
tejohnson added a reviewer: pcc.
Herald added subscribers: inglorion, mehdi_amini.
With https://reviews.llvm.org/D43396, no clients use the Path parameter anymore.
Depends on https://reviews.llvm.org/D43396.
Repository:
rL LLVM
https://reviews.llvm.org/D43400
Files:
include/llvm/LTO/Caching.h
lib/LTO/Caching.cpp
tools/gold/gold-plugin.cpp
tools/llvm-lto2/llvm-lto2.cpp
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<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();
};
Index: tools/gold/gold-plugin.cpp
===================================================================
--- tools/gold/gold-plugin.cpp
+++ tools/gold/gold-plugin.cpp
@@ -901,8 +901,7 @@
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();
};
Index: lib/LTO/Caching.cpp
===================================================================
--- lib/LTO/Caching.cpp
+++ lib/LTO/Caching.cpp
@@ -36,7 +36,7 @@
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 @@
TempFile.TmpName + " to " + EntryPath + ": " +
toString(std::move(E)) + "\n");
- AddBuffer(Task, std::move(*MBOrErr), EntryPath);
+ AddBuffer(Task, std::move(*MBOrErr));
}
};
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<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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43400.134664.patch
Type: text/x-patch
Size: 2564 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180216/ee6c5d80/attachment.bin>
More information about the llvm-commits
mailing list