Skip to content

Commit

Permalink
[clang] NFC, replace llvm::writeFileAtomically with llvm::writeToOutp…
Browse files Browse the repository at this point in the history
…ut API inGlobalModuleIndex.cpp

We're in favor of writeToOutput.
  • Loading branch information
hokein committed Jun 30, 2023
1 parent 2eefd19 commit 3a9ea6a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions clang/lib/Serialization/GlobalModuleIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 3a9ea6a

Please sign in to comment.