Skip to content

Commit 3a9ea6a

Browse files
committed
[clang] NFC, replace llvm::writeFileAtomically with llvm::writeToOutput API inGlobalModuleIndex.cpp
We're in favor of writeToOutput.
1 parent 2eefd19 commit 3a9ea6a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

clang/lib/Serialization/GlobalModuleIndex.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
#include "llvm/Bitstream/BitstreamWriter.h"
2626
#include "llvm/Support/DJB.h"
2727
#include "llvm/Support/FileSystem.h"
28-
#include "llvm/Support/FileUtilities.h"
2928
#include "llvm/Support/LockFileManager.h"
3029
#include "llvm/Support/MemoryBuffer.h"
3130
#include "llvm/Support/OnDiskHashTable.h"
3231
#include "llvm/Support/Path.h"
3332
#include "llvm/Support/TimeProfiler.h"
33+
#include "llvm/Support/raw_ostream.h"
3434
#include <cstdio>
3535
using namespace clang;
3636
using namespace serialization;
@@ -907,8 +907,10 @@ GlobalModuleIndex::writeIndex(FileManager &FileMgr,
907907
"failed writing index");
908908
}
909909

910-
return llvm::writeFileAtomically((IndexPath + "-%%%%%%%%").str(), IndexPath,
911-
OutputBuffer);
910+
return llvm::writeToOutput(IndexPath, [&OutputBuffer](llvm::raw_ostream &OS) {
911+
OS << OutputBuffer;
912+
return llvm::Error::success();
913+
});
912914
}
913915

914916
namespace {

0 commit comments

Comments
 (0)