mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Dependency Scanning] Make GlobalModuleDependenciesCache aware of the current scanning action's target triple
And only resolve cached dependencies that came from scanning actions with the same target triple. This change means that the `GlobalModuleDependenciesCache` must be configured with a specific target triple for every scannig action, and it will only resolve previously-found dependencies from previous scannig actions using the exact same triple. Furthermore, the `GlobalModuleDependenciesCache` separately tracks source-file-based module dependencies as those represent main Swift modules of previous scanning actions, and we must be able to resolve those regardless of the target triple. Resolves rdar://83105455
This commit is contained in:
@@ -118,7 +118,12 @@ void DependencyScanningTool::resetCache() {
|
||||
llvm::ErrorOr<std::unique_ptr<CompilerInstance>>
|
||||
DependencyScanningTool::initScannerForAction(
|
||||
ArrayRef<const char *> Command) {
|
||||
return initCompilerInstanceForScan(Command);
|
||||
auto instanceOrErr = initCompilerInstanceForScan(Command);
|
||||
if (instanceOrErr.getError())
|
||||
return instanceOrErr;
|
||||
SharedCache->configureForTriple((*instanceOrErr)->getInvocation()
|
||||
.getLangOptions().Target.str());
|
||||
return instanceOrErr;
|
||||
}
|
||||
|
||||
llvm::ErrorOr<std::unique_ptr<CompilerInstance>>
|
||||
|
||||
Reference in New Issue
Block a user