mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Dependency Scanning] Skip over source-code (not interface) modules when collecting cross import overlays
This commit is contained in:
@@ -180,12 +180,18 @@ ModuleDependencies::collectCrossImportOverlayNames(ASTContext &ctx,
|
||||
llvm::StringMap<llvm::SmallSetVector<Identifier, 4>> result;
|
||||
// Mimic getModuleDefiningPath() for Swift and Clang module.
|
||||
if (auto *swiftDep = getAsSwiftTextualModule()) {
|
||||
// Prefer interface path to binary module path if we have it.
|
||||
modulePath = swiftDep->swiftInterfaceFile;
|
||||
assert(modulePath.hasValue());
|
||||
StringRef parentDir = llvm::sys::path::parent_path(*modulePath);
|
||||
if (llvm::sys::path::extension(parentDir) == ".swiftmodule") {
|
||||
modulePath = parentDir.str();
|
||||
if (swiftDep->swiftInterfaceFile.hasValue()) {
|
||||
// Prefer interface path to binary module path if we have it.
|
||||
modulePath = swiftDep->swiftInterfaceFile;
|
||||
assert(modulePath.hasValue());
|
||||
StringRef parentDir = llvm::sys::path::parent_path(*modulePath);
|
||||
if (llvm::sys::path::extension(parentDir) == ".swiftmodule") {
|
||||
modulePath = parentDir.str();
|
||||
}
|
||||
} else {
|
||||
// This must be a module compiled from source-code
|
||||
assert(!swiftDep->sourceFiles.empty());
|
||||
return result;
|
||||
}
|
||||
} else if (auto *swiftBinaryDep = getAsSwiftBinaryModule()) {
|
||||
modulePath = swiftBinaryDep->compiledModulePath;
|
||||
|
||||
Reference in New Issue
Block a user