#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>
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();
+ });
}
};