File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -180,12 +180,18 @@ ModuleDependencies::collectCrossImportOverlayNames(ASTContext &ctx,
180
180
llvm::StringMap<llvm::SmallSetVector<Identifier, 4 >> result;
181
181
// Mimic getModuleDefiningPath() for Swift and Clang module.
182
182
if (auto *swiftDep = getAsSwiftTextualModule ()) {
183
- // Prefer interface path to binary module path if we have it.
184
- modulePath = swiftDep->swiftInterfaceFile ;
185
- assert (modulePath.hasValue ());
186
- StringRef parentDir = llvm::sys::path::parent_path (*modulePath);
187
- if (llvm::sys::path::extension (parentDir) == " .swiftmodule" ) {
188
- modulePath = parentDir.str ();
183
+ if (swiftDep->swiftInterfaceFile .hasValue ()) {
184
+ // Prefer interface path to binary module path if we have it.
185
+ modulePath = swiftDep->swiftInterfaceFile ;
186
+ assert (modulePath.hasValue ());
187
+ StringRef parentDir = llvm::sys::path::parent_path (*modulePath);
188
+ if (llvm::sys::path::extension (parentDir) == " .swiftmodule" ) {
189
+ modulePath = parentDir.str ();
190
+ }
191
+ } else {
192
+ // This must be a module compiled from source-code
193
+ assert (!swiftDep->sourceFiles .empty ());
194
+ return result;
189
195
}
190
196
} else if (auto *swiftBinaryDep = getAsSwiftBinaryModule ()) {
191
197
modulePath = swiftBinaryDep->compiledModulePath ;
You can’t perform that action at this time.
0 commit comments