llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang-modules @llvm/pr-subscribers-clang Author: Jan Svoboda (jansvoboda11) <details> <summary>Changes</summary> This was missed in the original PR and was causing "too many files open" errors on real workloads. --- Full diff: https://github.com/llvm/llvm-project/pull/191227.diff 1 Files Affected: - (modified) clang/lib/Serialization/ModuleCache.cpp (+2) ``````````diff diff --git a/clang/lib/Serialization/ModuleCache.cpp b/clang/lib/Serialization/ModuleCache.cpp index dd0b4b845331e..9ea4223a2eb83 100644 --- a/clang/lib/Serialization/ModuleCache.cpp +++ b/clang/lib/Serialization/ModuleCache.cpp @@ -10,6 +10,7 @@ #include "clang/Serialization/InMemoryModuleCache.h" #include "clang/Serialization/ModuleFile.h" +#include "llvm/ADT/ScopeExit.h" #include "llvm/Support/Error.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/IOSandbox.h" @@ -151,6 +152,7 @@ clang::readImpl(StringRef FileName, off_t &Size, time_t &ModTime) { llvm::sys::fs::openNativeFileForRead(FileName); if (!FD) return FD.takeError(); + llvm::scope_exit CloseFD([&FD]() { llvm::sys::fs::closeFile(*FD); }); llvm::sys::fs::file_status Status; if (std::error_code EC = llvm::sys::fs::status(*FD, Status)) return llvm::errorCodeToError(EC); `````````` </details> https://github.com/llvm/llvm-project/pull/191227 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
