mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Dependency Scanning] Refactor Swift Scanner loader to be standalone
- 'SwiftModuleScanner' will now be owned directly by the 'ModuleDependencyScanningWorker' and will contain all the necessary custom logic, instead of being instantiated by the module interface loader for each query - Moves ownership over module output path and sdk module output path directly into the scanning worker, instead of the cache
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
#include "swift/AST/Identifier.h"
|
||||
#include "swift/AST/ModuleDependencies.h"
|
||||
#include "swift/Frontend/ModuleInterfaceLoader.h"
|
||||
#include "swift/Serialization/SerializedModuleLoader.h"
|
||||
#include "swift/Serialization/ScanningLoaders.h"
|
||||
#include "llvm/CAS/CASReference.h"
|
||||
#include "llvm/Support/ThreadPool.h"
|
||||
|
||||
@@ -38,17 +38,14 @@ public:
|
||||
private:
|
||||
/// Retrieve the module dependencies for the Clang module with the given name.
|
||||
ModuleDependencyVector scanFilesystemForClangModuleDependency(
|
||||
Identifier moduleName, StringRef moduleOutputPath,
|
||||
StringRef sdkModuleOutputPath,
|
||||
Identifier moduleName,
|
||||
const llvm::DenseSet<clang::tooling::dependencies::ModuleID>
|
||||
&alreadySeenModules,
|
||||
llvm::PrefixMapper *prefixMapper);
|
||||
|
||||
/// Retrieve the module dependencies for the Swift module with the given name.
|
||||
ModuleDependencyVector scanFilesystemForSwiftModuleDependency(
|
||||
Identifier moduleName, StringRef moduleOutputPath,
|
||||
StringRef sdkModuleOutputPath, llvm::PrefixMapper *prefixMapper,
|
||||
bool isTestableImport = false);
|
||||
Identifier moduleName, bool isTestableImport = false);
|
||||
|
||||
/// Query dependency information for header dependencies
|
||||
/// of a binary Swift module.
|
||||
@@ -90,7 +87,7 @@ private:
|
||||
// The Clang scanner tool used by this worker.
|
||||
clang::tooling::dependencies::DependencyScanningTool clangScanningTool;
|
||||
// Swift and Clang module loaders acting as scanners.
|
||||
std::unique_ptr<ModuleInterfaceLoader> swiftScannerModuleLoader;
|
||||
std::unique_ptr<SwiftModuleScanner> swiftModuleScannerLoader;
|
||||
|
||||
// Base command line invocation for clang scanner queries (both module and header)
|
||||
std::vector<std::string> clangScanningBaseCommandLineArgs;
|
||||
@@ -102,6 +99,11 @@ private:
|
||||
// Working directory for clang module lookup queries
|
||||
std::string clangScanningWorkingDirectoryPath;
|
||||
|
||||
/// The location of where the explicitly-built modules will be output to
|
||||
std::string moduleOutputPath;
|
||||
/// The location of where the explicitly-built SDK modules will be output to
|
||||
std::string sdkModuleOutputPath;
|
||||
|
||||
// CAS instance.
|
||||
std::shared_ptr<llvm::cas::ObjectStore> CAS;
|
||||
std::shared_ptr<llvm::cas::ActionCache> ActionCache;
|
||||
|
||||
Reference in New Issue
Block a user