[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

@@ -763,10 +763,10 @@ static bool ParseCASArgs(CASOptions &Opts, ArgList &Args,
for (const auto &A : Args.getAllArgValues(OPT_cas_fs))
Opts.CASFSRootIDs.emplace_back(A);
for (const auto &A : Args.getAllArgValues(OPT_clang_include_tree_root))
Opts.ClangIncludeTrees.emplace_back(A);
for (const auto &A : Args.getAllArgValues(OPT_clang_include_tree_filelist))
Opts.ClangIncludeTreeFileList.emplace_back(A);
if (auto *A = Args.getLastArg(OPT_clang_include_tree_root))
Opts.ClangIncludeTree = A->getValue();
if (auto *A = Args.getLastArg(OPT_clang_include_tree_filelist))
Opts.ClangIncludeTreeFileList = A->getValue();
if (const Arg *A = Args.getLastArg(OPT_input_file_key))
Opts.InputFileKey = A->getValue();
@@ -774,7 +774,7 @@ static bool ParseCASArgs(CASOptions &Opts, ArgList &Args,
if (const Arg*A = Args.getLastArg(OPT_bridging_header_pch_key))
Opts.BridgingHeaderPCHCacheKey = A->getValue();
if (!Opts.CASFSRootIDs.empty() || !Opts.ClangIncludeTrees.empty() ||
if (!Opts.CASFSRootIDs.empty() || !Opts.ClangIncludeTree.empty() ||
!Opts.ClangIncludeTreeFileList.empty())
Opts.HasImmutableFileSystem = true;