[Dependency Scanning] Disable Swift Parser ASTGen during dependency scan

On both input moduel source-files and interface files.
This currently yields dramatic scanning performance improvements at no cost - we do not require an AST during scan.
This commit is contained in:
Artem Chikin
2023-03-31 15:49:54 -07:00
parent 76c5e4f1ae
commit cc34ba00e2
4 changed files with 51 additions and 30 deletions

View File

@@ -1369,6 +1369,12 @@ CompilerInstance::getSourceFileParsingOptions(bool forPrimary) const {
opts |= SourceFile::ParsingFlags::SuppressWarnings;
}
// Dependency scanning does not require an AST, so disable Swift Parser
// ASTGen parsing completely.
if (frontendOpts.RequestedAction ==
FrontendOptions::ActionType::ScanDependencies)
opts |= SourceFile::ParsingFlags::DisableSwiftParserASTGen;
// Enable interface hash computation for primaries or emit-module-separately,
// but not in WMO, as it's only currently needed for incremental mode.
if (forPrimary ||