Skip to content

Commit 2feac34

Browse files
committed
[clangd] Replace writeFileAtomically with writeToOutput, NFC
We're going to deprecate the writeFileAtomically API, in favour of writeToOutput.
1 parent 7a10179 commit 2feac34

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
#include "llvm/ADT/StringRef.h"
1515
#include "llvm/Support/Error.h"
1616
#include "llvm/Support/FileSystem.h"
17-
#include "llvm/Support/FileUtilities.h"
1817
#include "llvm/Support/MemoryBuffer.h"
1918
#include "llvm/Support/Path.h"
19+
#include "llvm/Support/raw_ostream.h"
2020
#include <functional>
2121
#include <optional>
2222

@@ -67,11 +67,10 @@ class DiskBackedIndexStorage : public BackgroundIndexStorage {
6767
llvm::Error storeShard(llvm::StringRef ShardIdentifier,
6868
IndexFileOut Shard) const override {
6969
auto ShardPath = getShardPathFromFilePath(DiskShardRoot, ShardIdentifier);
70-
return llvm::writeFileAtomically(ShardPath + ".tmp.%%%%%%%%", ShardPath,
71-
[&Shard](llvm::raw_ostream &OS) {
72-
OS << Shard;
73-
return llvm::Error::success();
74-
});
70+
return llvm::writeToOutput(ShardPath, [&Shard](llvm::raw_ostream &OS) {
71+
OS << Shard;
72+
return llvm::Error::success();
73+
});
7574
}
7675
};
7776

0 commit comments

Comments
 (0)