From 7fa27ce4a07f19b07799a767fc29416f3b625afb Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 26 Jul 2023 21:03:47 +0200 Subject: Vendor import of llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the last commit before the upstream release/17.x branch was created. --- clang/lib/Serialization/GlobalModuleIndex.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'clang/lib/Serialization/GlobalModuleIndex.cpp') diff --git a/clang/lib/Serialization/GlobalModuleIndex.cpp b/clang/lib/Serialization/GlobalModuleIndex.cpp index b2283c2b3987..d57f4cec2eab 100644 --- a/clang/lib/Serialization/GlobalModuleIndex.cpp +++ b/clang/lib/Serialization/GlobalModuleIndex.cpp @@ -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 using namespace clang; using namespace serialization; @@ -281,15 +281,6 @@ GlobalModuleIndex::readIndex(StringRef Path) { llvm::Error::success()); } -void -GlobalModuleIndex::getKnownModules(SmallVectorImpl &ModuleFiles) { - ModuleFiles.clear(); - for (unsigned I = 0, N = Modules.size(); I != N; ++I) { - if (ModuleFile *MF = Modules[I].File) - ModuleFiles.push_back(MF); - } -} - void GlobalModuleIndex::getModuleDependencies( ModuleFile *File, SmallVectorImpl &Dependencies) { @@ -634,6 +625,9 @@ llvm::Error GlobalModuleIndexBuilder::loadModuleFile(const FileEntry *File) { // Skip the imported kind ++Idx; + // Skip if it is standard C++ module + ++Idx; + // Skip the import location ++Idx; @@ -913,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 { -- cgit v1.2.3