[ScanDependencies] Fix a bug in rewrite from #81454

When improving the speed of dependency scanning when the new clang API
to speed up bridging, some unintended change was introduced. This
restore the scanner to the behavior before #81454

rdar://153851818
(cherry picked from commit cebe173ada)
This commit is contained in:
Steven Wu
2025-06-28 14:06:05 -07:00
parent 9b66d7c7d3
commit bf32a8bb14
2 changed files with 65 additions and 5 deletions

View File

@@ -144,11 +144,11 @@ ModuleDependencyVector ClangImporter::bridgeClangModuleDependencies(
if (!ctx.CASOpts.EnableCaching) {
auto &overlayFiles = invocation.getMutHeaderSearchOpts().VFSOverlayFiles;
for (auto overlay : overlayFiles) {
if (llvm::is_contained(ctx.SearchPathOpts.VFSOverlayFiles, overlay))
continue;
swiftArgs.push_back("-vfsoverlay");
swiftArgs.push_back(overlay);
}
// Clear overlay files since they are forwarded from swift to clang.
overlayFiles.clear();
}
// Add args reported by the scanner.