mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Dependency Scanning] Refactor primary scan operations into 'ModuleDependencyScanner' class
From being a scattered collection of 'static' methods in ScanDependencies.cpp and member methods of ASTContext. This makes 'ScanDependencies.cpp' much easier to read, and abstracts the actual scanning logic away to a place with common state which will make it easier to reason about in the future.
This commit is contained in:
@@ -35,6 +35,15 @@ enum class ModuleLoadingMode {
|
||||
OnlySerialized
|
||||
};
|
||||
|
||||
/// How a dependency should be loaded.
|
||||
///
|
||||
/// \sa getTransitiveLoadingBehavior
|
||||
enum class ModuleLoadingBehavior {
|
||||
Required,
|
||||
Optional,
|
||||
Ignored
|
||||
};
|
||||
|
||||
/// Helper type used to pass and compute the sets of related filenames used by
|
||||
/// \c SerializedModuleLoader subclasses.
|
||||
struct SerializedModuleBaseName {
|
||||
@@ -232,8 +241,11 @@ public:
|
||||
|
||||
virtual void verifyAllModules() override;
|
||||
|
||||
virtual llvm::Optional<const ModuleDependencyInfo *>
|
||||
getModuleDependencies(StringRef moduleName, ModuleDependenciesCache &cache,
|
||||
virtual llvm::SmallVector<std::pair<ModuleDependencyID, ModuleDependencyInfo>, 1>
|
||||
getModuleDependencies(StringRef moduleName, StringRef moduleOutputPath,
|
||||
llvm::IntrusiveRefCntPtr<llvm::cas::CachingOnDiskFileSystem> CacheFS,
|
||||
const llvm::DenseSet<clang::tooling::dependencies::ModuleID> &alreadySeenClangModules,
|
||||
clang::tooling::dependencies::DependencyScanningTool &clangScanningTool,
|
||||
InterfaceSubContextDelegate &delegate,
|
||||
bool isTestableImport) override;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user