[CAS] Allow SwiftDependencyScanningService be shared

When the CASOptions are the same, SwiftDependencyScanningService can be
shared with multiple swift driver invocation for scanning.
This commit is contained in:
Steven Wu
2023-06-13 12:29:25 -07:00
parent 2b7d38dc16
commit 744e01ea47
4 changed files with 31 additions and 7 deletions

View File

@@ -279,7 +279,8 @@ DependencyScanningTool::initCompilerInstanceForScan(
}
// Setup the caching service after the instance finishes setup.
ScanningService->setupCachingDependencyScanningService(*Instance);
if (ScanningService->setupCachingDependencyScanningService(*Instance))
return std::make_error_code(std::errc::invalid_argument);
(void)Instance->getMainModule();