Skip to content

Commit

Permalink
[clangd] Replace writeFileAtomically with writeToOutput, NFC
Browse files Browse the repository at this point in the history
We're going to deprecate the writeFileAtomically API, in favour of
writeToOutput.
  • Loading branch information
hokein committed Jun 30, 2023
1 parent 7a10179 commit 2feac34
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include <functional>
#include <optional>

Expand Down Expand Up @@ -67,11 +67,10 @@ class DiskBackedIndexStorage : public BackgroundIndexStorage {
llvm::Error storeShard(llvm::StringRef ShardIdentifier,
IndexFileOut Shard) const override {
auto ShardPath = getShardPathFromFilePath(DiskShardRoot, ShardIdentifier);
return llvm::writeFileAtomically(ShardPath + ".tmp.%%%%%%%%", ShardPath,
[&Shard](llvm::raw_ostream &OS) {
OS << Shard;
return llvm::Error::success();
});
return llvm::writeToOutput(ShardPath, [&Shard](llvm::raw_ostream &OS) {
OS << Shard;
return llvm::Error::success();
});
}
};

Expand Down

0 comments on commit 2feac34

Please sign in to comment.