aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorFred Riss <friss@apple.com>2023-01-19 13:51:25 -0800
committerFred Riss <friss@apple.com>2023-01-19 14:07:34 -0800
commitcf12709222a4699ff5a4bb257cb891b55b5f6fba (patch)
tree4df424ee5e6d986e80a155d18cc4d1d6bfe456a4 /clang/lib/Frontend/CompilerInvocation.cpp
parentf33b5b1bf703ee5ff73126fefe2a9bcbd54db457 (diff)
downloadllvm-cf12709222a4699ff5a4bb257cb891b55b5f6fba.zip
llvm-cf12709222a4699ff5a4bb257cb891b55b5f6fba.tar.gz
llvm-cf12709222a4699ff5a4bb257cb891b55b5f6fba.tar.bz2
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.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp28
1 files changed, 1 insertions, 27 deletions
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<llvm::vfs::FileSystem> BaseFS) {
return createVFSFromOverlayFiles(CI.getHeaderSearchOpts().VFSOverlayFiles,
- CI.getHeaderSearchOpts().VFSStatCacheFiles,
Diags, std::move(BaseFS));
}
IntrusiveRefCntPtr<llvm::vfs::FileSystem> clang::createVFSFromOverlayFiles(
- ArrayRef<std::string> VFSOverlayFiles,
- ArrayRef<std::string> VFSStatCacheFiles, DiagnosticsEngine &Diags,
+ ArrayRef<std::string> VFSOverlayFiles, DiagnosticsEngine &Diags,
IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS) {
- for (const auto &File : VFSStatCacheFiles) {
- llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> 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;