[Caching] Reduce the number of cas ID passed on frontend commandline

Using IncludeTree::FileList to concat the include tree file systems that
are passed on the command-line. This significantly reduce the
command-line size, and also makes the cache key computation a lot
faster.

rdar://148752988
This commit is contained in:
Steven Wu
2025-04-23 13:45:55 -07:00
parent a3279afd08
commit 201e4faea7
11 changed files with 101 additions and 88 deletions

View File

@@ -64,9 +64,9 @@ static StringRef pluginModuleNameStringFromPath(StringRef path) {
static llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>
getPluginLoadingFS(ASTContext &Ctx) {
// If there is a clang include tree FS, using real file system to load plugin
// If there is an immutable file system, using real file system to load plugin
// as the FS in SourceMgr doesn't support directory iterator.
if (Ctx.ClangImporterOpts.HasClangIncludeTreeRoot)
if (Ctx.CASOpts.HasImmutableFileSystem)
return llvm::vfs::getRealFileSystem();
return Ctx.SourceMgr.getFileSystem();
}