From cf12709222a4699ff5a4bb257cb891b55b5f6fba Mon Sep 17 00:00:00 2001 From: Fred Riss Date: Thu, 19 Jan 2023 13:51:25 -0800 Subject: Revert "[Clang] Give Clang the ability to use a shared stat cache" This reverts commit c5abe893120b115907376359a5809229a9f9608a. This reverts commit a033dbbe5c43247b60869b008e67ed86ed230eaa. This broke the build with -DLLVM_LINK_LLVM_DYLIB=ON. Reverting while I investigate. --- clang/lib/Frontend/CompilerInvocation.cpp | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index b0ef37fa..0bb9c8c 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -83,7 +83,6 @@ #include "llvm/Support/Path.h" #include "llvm/Support/Process.h" #include "llvm/Support/Regex.h" -#include "llvm/Support/StatCacheFileSystem.h" #include "llvm/Support/VersionTuple.h" #include "llvm/Support/VirtualFileSystem.h" #include "llvm/Support/raw_ostream.h" @@ -3085,9 +3084,6 @@ static void GenerateHeaderSearchArgs(HeaderSearchOptions &Opts, GenerateArg(Args, Opt, P.Prefix, SA); } - for (const std::string &F : Opts.VFSStatCacheFiles) - GenerateArg(Args, OPT_ivfsstatcache, F, SA); - for (const std::string &F : Opts.VFSOverlayFiles) GenerateArg(Args, OPT_ivfsoverlay, F, SA); } @@ -3221,9 +3217,6 @@ static bool ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args, Opts.AddSystemHeaderPrefix( A->getValue(), A->getOption().matches(OPT_system_header_prefix)); - for (const auto *A : Args.filtered(OPT_ivfsstatcache)) - Opts.AddVFSStatCacheFile(A->getValue()); - for (const auto *A : Args.filtered(OPT_ivfsoverlay)) Opts.AddVFSOverlayFile(A->getValue()); @@ -4754,31 +4747,12 @@ clang::createVFSFromCompilerInvocation( const CompilerInvocation &CI, DiagnosticsEngine &Diags, IntrusiveRefCntPtr BaseFS) { return createVFSFromOverlayFiles(CI.getHeaderSearchOpts().VFSOverlayFiles, - CI.getHeaderSearchOpts().VFSStatCacheFiles, Diags, std::move(BaseFS)); } IntrusiveRefCntPtr clang::createVFSFromOverlayFiles( - ArrayRef VFSOverlayFiles, - ArrayRef VFSStatCacheFiles, DiagnosticsEngine &Diags, + ArrayRef VFSOverlayFiles, DiagnosticsEngine &Diags, IntrusiveRefCntPtr BaseFS) { - for (const auto &File : VFSStatCacheFiles) { - llvm::ErrorOr> Buffer = - BaseFS->getBufferForFile(File); - if (!Buffer) { - Diags.Report(diag::err_missing_vfs_stat_cache_file) << File; - continue; - } - - auto StatCache = - llvm::vfs::StatCacheFileSystem::create(std::move(*Buffer), BaseFS); - - if (errorToBool(StatCache.takeError())) - Diags.Report(diag::err_invalid_vfs_stat_cache) << File; - else - BaseFS = std::move(*StatCache); - } - if (VFSOverlayFiles.empty()) return BaseFS; -- cgit v1.1