aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/gold
diff options
context:
space:
mode:
authorNoah Shutty <shutty@google.com>2021-11-04 12:59:59 -0700
committerPetr Hosek <phosek@google.com>2021-11-04 13:00:44 -0700
commitd788c44f5cddb3e73069cd4d965bbf55b0d602d5 (patch)
tree728ea3a88252303ed623da0524b528dea987109d /llvm/tools/gold
parent48dc5c8e731b1198c4ba4b2f08b235c55e6d5aef (diff)
downloadllvm-d788c44f5cddb3e73069cd4d965bbf55b0d602d5.zip
llvm-d788c44f5cddb3e73069cd4d965bbf55b0d602d5.tar.gz
llvm-d788c44f5cddb3e73069cd4d965bbf55b0d602d5.tar.bz2
[Support] Improve Caching conformance with Support library behavior
This diff makes several amendments to the local file caching mechanism which was migrated from ThinLTO to Support in rGe678c51177102845c93529d457b020f969125373 in response to follow-up discussion on that commit. Patch By: noajshu Differential Revision: https://reviews.llvm.org/D113080
Diffstat (limited to 'llvm/tools/gold')
-rw-r--r--llvm/tools/gold/gold-plugin.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp
index ef30c5b..8d35dfe 100644
--- a/llvm/tools/gold/gold-plugin.cpp
+++ b/llvm/tools/gold/gold-plugin.cpp
@@ -1081,11 +1081,11 @@ static std::vector<std::pair<SmallString<128>, bool>> runLTO() {
size_t MaxTasks = Lto->getMaxTasks();
std::vector<std::pair<SmallString<128>, bool>> Files(MaxTasks);
- auto AddStream = [&](size_t Task) -> std::unique_ptr<NativeObjectStream> {
+ auto AddStream = [&](size_t Task) -> std::unique_ptr<CachedFileStream> {
Files[Task].second = !SaveTemps;
int FD = getOutputFileName(Filename, /* TempOutFile */ !SaveTemps,
Files[Task].first, Task);
- return std::make_unique<NativeObjectStream>(
+ return std::make_unique<CachedFileStream>(
std::make_unique<llvm::raw_fd_ostream>(FD, true));
};
@@ -1093,7 +1093,7 @@ static std::vector<std::pair<SmallString<128>, bool>> runLTO() {
*AddStream(Task)->OS << MB->getBuffer();
};
- NativeObjectCache Cache;
+ FileCache Cache;
if (!options::cache_dir.empty())
Cache = check(localCache("ThinLTO", "Thin", options::cache_dir, AddBuffer));