mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Dependency Scanning] Refactor dependency scanner to return an in-memory format as a result
This commit refactors ScanDependencies.cpp to split the functionality into two functional groups: - Scan execution code that performs the mechanics of the scan and produces an in-memory result - Dependency scanner entry-points used when the scanning action is invoked as a `swift-frontend` execution mode This commit also adds the aforementioned in-memory dependency scanning result in `FullDependencies.h`, modeled after the InterModuleDependencyGraph representation in swift-driver
This commit is contained in:
@@ -1137,11 +1137,14 @@ static bool performScanDependencies(CompilerInstance &Instance) {
|
||||
ModuleDependenciesCache SingleUseCache;
|
||||
if (batchScanInput.empty()) {
|
||||
if (Instance.getInvocation().getFrontendOptions().ImportPrescan)
|
||||
return dependencies::prescanMainModuleDependencies(Instance);
|
||||
return dependencies::prescanDependencies(Instance);
|
||||
else
|
||||
return dependencies::scanDependencies(Instance);
|
||||
} else {
|
||||
return dependencies::batchScanDependencies(Instance, batchScanInput);
|
||||
if (Instance.getInvocation().getFrontendOptions().ImportPrescan)
|
||||
return dependencies::batchPrescanDependencies(Instance, batchScanInput);
|
||||
else
|
||||
return dependencies::batchScanDependencies(Instance, batchScanInput);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user