mirror of
https://github.com/intel/llvm.git
synced 2026-01-23 07:58:23 +08:00
[clang] NFC, replace llvm::writeFileAtomically with llvm::writeToOutput API inGlobalModuleIndex.cpp
We're in favor of writeToOutput.
This commit is contained in:
@@ -25,12 +25,12 @@
|
||||
#include "llvm/Bitstream/BitstreamWriter.h"
|
||||
#include "llvm/Support/DJB.h"
|
||||
#include "llvm/Support/FileSystem.h"
|
||||
#include "llvm/Support/FileUtilities.h"
|
||||
#include "llvm/Support/LockFileManager.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include "llvm/Support/OnDiskHashTable.h"
|
||||
#include "llvm/Support/Path.h"
|
||||
#include "llvm/Support/TimeProfiler.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include <cstdio>
|
||||
using namespace clang;
|
||||
using namespace serialization;
|
||||
@@ -907,8 +907,10 @@ GlobalModuleIndex::writeIndex(FileManager &FileMgr,
|
||||
"failed writing index");
|
||||
}
|
||||
|
||||
return llvm::writeFileAtomically((IndexPath + "-%%%%%%%%").str(), IndexPath,
|
||||
OutputBuffer);
|
||||
return llvm::writeToOutput(IndexPath, [&OutputBuffer](llvm::raw_ostream &OS) {
|
||||
OS << OutputBuffer;
|
||||
return llvm::Error::success();
|
||||
});
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
Reference in New Issue
Block a user