[ScanDependency] Add -experimental-clang-importer-direct-cc1-scan

Add an experimental option to tell dependency scanner to report clang
cc1 args should be used to construct clang importer in all constructed
swift-frontend tasks.
This commit is contained in:
Steven Wu
2024-02-23 12:15:57 -08:00
parent fb3c268abc
commit cb17ea8e66
7 changed files with 50 additions and 3 deletions

View File

@@ -1709,6 +1709,8 @@ static bool ParseClangImporterArgs(ClangImporterOptions &Opts, ArgList &Args,
Opts.DisableSourceImport |=
Args.hasArg(OPT_disable_clangimporter_source_import);
Opts.ClangImporterDirectCC1Scan |=
Args.hasArg(OPT_experimental_clang_importer_direct_cc1_scan);
// Forward the FrontendOptions to clang importer option so it can be
// accessed when creating clang module compilation invocation.
if (CASOpts.EnableCaching) {
@@ -1716,6 +1718,8 @@ static bool ParseClangImporterArgs(ClangImporterOptions &Opts, ArgList &Args,
// useful in non-caching context.
Opts.UseClangIncludeTree |= !Args.hasArg(OPT_no_clang_include_tree);
Opts.HasClangIncludeTreeRoot |= Args.hasArg(OPT_clang_include_tree_root);
// Caching requires direct clang import cc1 scanning.
Opts.ClangImporterDirectCC1Scan = true;
}
// If in direct clang cc1 module build mode, return early.