Skip to content

[NFC][ScanDependency] Remove some ununsed code #76687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions include/swift/AST/ModuleDependencies.h
Original file line number Diff line number Diff line change
Expand Up @@ -992,9 +992,6 @@ class SwiftDependencyScanningService {
/// CAS ObjectStore Instance.
std::shared_ptr<llvm::cas::ObjectStore> CAS;

/// The common dependencies that is needed for every swift compiler instance.
std::vector<std::string> CommonDependencyFiles;

/// File prefix mapper.
std::unique_ptr<llvm::TreePathPrefixMapper> Mapper;

Expand Down
1 change: 0 additions & 1 deletion include/swift/AST/ModuleLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ class ModuleLoader {
virtual llvm::SmallVector<std::pair<ModuleDependencyID, ModuleDependencyInfo>, 1>
getModuleDependencies(Identifier moduleName,
StringRef moduleOutputPath,
llvm::IntrusiveRefCntPtr<llvm::cas::CachingOnDiskFileSystem> CacheFS,
const llvm::DenseSet<clang::tooling::dependencies::ModuleID> &alreadySeenClangModules,
clang::tooling::dependencies::DependencyScanningTool &clangScanningTool,
InterfaceSubContextDelegate &delegate,
Expand Down
1 change: 0 additions & 1 deletion include/swift/ClangImporter/ClangImporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,6 @@ class ClangImporter final : public ClangModuleLoader {

llvm::SmallVector<std::pair<ModuleDependencyID, ModuleDependencyInfo>, 1>
getModuleDependencies(Identifier moduleName, StringRef moduleOutputPath,
llvm::IntrusiveRefCntPtr<llvm::cas::CachingOnDiskFileSystem> CacheFS,
const llvm::DenseSet<clang::tooling::dependencies::ModuleID> &alreadySeenClangModules,
clang::tooling::dependencies::DependencyScanningTool &clangScanningTool,
InterfaceSubContextDelegate &delegate,
Expand Down
1 change: 0 additions & 1 deletion include/swift/Sema/SourceLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ class SourceLoader : public ModuleLoader {

llvm::SmallVector<std::pair<ModuleDependencyID, ModuleDependencyInfo>, 1>
getModuleDependencies(Identifier moduleName, StringRef moduleOutputPath,
llvm::IntrusiveRefCntPtr<llvm::cas::CachingOnDiskFileSystem> CacheFS,
const llvm::DenseSet<clang::tooling::dependencies::ModuleID> &alreadySeenClangModules,
clang::tooling::dependencies::DependencyScanningTool &clangScanningTool,
InterfaceSubContextDelegate &delegate,
Expand Down
1 change: 0 additions & 1 deletion include/swift/Serialization/SerializedModuleLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ class SerializedModuleLoaderBase : public ModuleLoader {

virtual llvm::SmallVector<std::pair<ModuleDependencyID, ModuleDependencyInfo>, 1>
getModuleDependencies(Identifier moduleName, StringRef moduleOutputPath,
llvm::IntrusiveRefCntPtr<llvm::cas::CachingOnDiskFileSystem> CacheFS,
const llvm::DenseSet<clang::tooling::dependencies::ModuleID> &alreadySeenClangModules,
clang::tooling::dependencies::DependencyScanningTool &clangScanningTool,
InterfaceSubContextDelegate &delegate,
Expand Down
21 changes: 0 additions & 21 deletions lib/AST/ModuleDependencies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,27 +691,6 @@ bool SwiftDependencyScanningService::setupCachingDependencyScanningService(
CASOpts = Instance.getInvocation().getCASOptions().CASOpts;
CAS = Instance.getSharedCASInstance();

// Add SDKSetting file.
SmallString<256> SDKSettingPath;
llvm::sys::path::append(
SDKSettingPath,
Instance.getInvocation().getSearchPathOptions().getSDKPath(),
"SDKSettings.json");
CommonDependencyFiles.emplace_back(SDKSettingPath.data(),
SDKSettingPath.size());

// Add Legacy layout file (maybe just hard code instead of searching).
for (auto RuntimeLibPath :
Instance.getInvocation().getSearchPathOptions().RuntimeLibraryPaths) {
auto &FS = Instance.getFileSystem();
std::error_code EC;
for (auto F = FS.dir_begin(RuntimeLibPath, EC);
!EC && F != llvm::vfs::directory_iterator(); F.increment(EC)) {
if (F->path().ends_with(".yaml"))
CommonDependencyFiles.emplace_back(F->path().str());
}
}

auto CachingFS =
llvm::cas::createCachingOnDiskFileSystem(Instance.getObjectStore());
if (!CachingFS) {
Expand Down
1 change: 0 additions & 1 deletion lib/ClangImporter/ClangModuleDependencyScanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ computeClangWorkingDirectory(const std::vector<std::string> &commandLineArgs,
ModuleDependencyVector
ClangImporter::getModuleDependencies(Identifier moduleName,
StringRef moduleOutputPath,
llvm::IntrusiveRefCntPtr<llvm::cas::CachingOnDiskFileSystem> CacheFS,
const llvm::DenseSet<clang::tooling::dependencies::ModuleID> &alreadySeenClangModules,
clang::tooling::dependencies::DependencyScanningTool &clangScanningTool,
InterfaceSubContextDelegate &delegate,
Expand Down
12 changes: 4 additions & 8 deletions lib/DependencyScan/ModuleDependencyScanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,13 @@ ModuleDependencyScanningWorker::scanFilesystemForModuleDependency(
ModuleDependencyVector moduleDependencies =
swiftScannerModuleLoader->getModuleDependencies(
moduleName, cache.getModuleOutputPath(),
cache.getScanService().getCachingFS(),
cache.getAlreadySeenClangModules(), clangScanningTool,
*scanningASTDelegate, cache.getScanService().getPrefixMapper(),
isTestableImport);

if (moduleDependencies.empty())
moduleDependencies = clangScannerModuleLoader->getModuleDependencies(
moduleName, cache.getModuleOutputPath(),
cache.getScanService().getCachingFS(),
cache.getAlreadySeenClangModules(), clangScanningTool,
*scanningASTDelegate, cache.getScanService().getPrefixMapper(),
isTestableImport);
Expand All @@ -239,19 +237,17 @@ ModuleDependencyScanningWorker::scanFilesystemForSwiftModuleDependency(
Identifier moduleName, const ModuleDependenciesCache &cache) {
return swiftScannerModuleLoader->getModuleDependencies(
moduleName, cache.getModuleOutputPath(),
cache.getScanService().getCachingFS(), cache.getAlreadySeenClangModules(),
clangScanningTool, *scanningASTDelegate,
cache.getScanService().getPrefixMapper(), false);
cache.getAlreadySeenClangModules(), clangScanningTool,
*scanningASTDelegate, cache.getScanService().getPrefixMapper(), false);
}

ModuleDependencyVector
ModuleDependencyScanningWorker::scanFilesystemForClangModuleDependency(
Identifier moduleName, const ModuleDependenciesCache &cache) {
return clangScannerModuleLoader->getModuleDependencies(
moduleName, cache.getModuleOutputPath(),
cache.getScanService().getCachingFS(), cache.getAlreadySeenClangModules(),
clangScanningTool, *scanningASTDelegate,
cache.getScanService().getPrefixMapper(), false);
cache.getAlreadySeenClangModules(), clangScanningTool,
*scanningASTDelegate, cache.getScanService().getPrefixMapper(), false);
}

template <typename Function, typename... Args>
Expand Down
1 change: 0 additions & 1 deletion lib/Sema/SourceLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ void SourceLoader::loadExtensions(NominalTypeDecl *nominal,
ModuleDependencyVector
SourceLoader::getModuleDependencies(Identifier moduleName,
StringRef moduleOutputPath,
llvm::IntrusiveRefCntPtr<llvm::cas::CachingOnDiskFileSystem> CacheFS,
const llvm::DenseSet<clang::tooling::dependencies::ModuleID> &alreadySeenClangModules,
clang::tooling::dependencies::DependencyScanningTool &clangScanningTool,
InterfaceSubContextDelegate &delegate,
Expand Down
1 change: 0 additions & 1 deletion lib/Serialization/ScanningLoaders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ SwiftModuleScanner::scanInterfaceFile(Twine moduleInterfacePath,

ModuleDependencyVector SerializedModuleLoaderBase::getModuleDependencies(
Identifier moduleName, StringRef moduleOutputPath,
llvm::IntrusiveRefCntPtr<llvm::cas::CachingOnDiskFileSystem> CacheFS,
const llvm::DenseSet<clang::tooling::dependencies::ModuleID>
&alreadySeenClangModules,
clang::tooling::dependencies::DependencyScanningTool &clangScanningTool,
Expand Down