mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[DependencyScanner] Drop macro search path if not needed
When scanning swift modules and constructing their build commands, there is no need to pass any external plugin search paths if there are no macro dependencies for the module. rdar://135221984
This commit is contained in:
@@ -120,6 +120,18 @@ void ModuleDependencyInfo::addMacroDependency(StringRef macroModuleName,
|
||||
llvm_unreachable("Unexpected dependency kind");
|
||||
}
|
||||
|
||||
bool ModuleDependencyInfo::hasMacroDependencies() const {
|
||||
if (auto sourceModule =
|
||||
dyn_cast<SwiftSourceModuleDependenciesStorage>(storage.get()))
|
||||
return !sourceModule->textualModuleDetails.macroDependencies.empty();
|
||||
|
||||
if (auto interfaceModule =
|
||||
dyn_cast<SwiftInterfaceModuleDependenciesStorage>(storage.get()))
|
||||
return !interfaceModule->textualModuleDetails.macroDependencies.empty();
|
||||
|
||||
llvm_unreachable("Unexpected dependency kind");
|
||||
}
|
||||
|
||||
bool ModuleDependencyInfo::isTestableImport(StringRef moduleName) const {
|
||||
if (auto swiftSourceDepStorage = getAsSwiftSourceModule())
|
||||
return swiftSourceDepStorage->testableImports.contains(moduleName);
|
||||
|
||||
Reference in New Issue
Block a user