[Serialization] Support loading an aliased module with an underlying module

Importing a module using an alias (set with -module-alias) fails if the
imported module has an underlying clang module.

rdar://102217790
This commit is contained in:
Alexis Laferrière
2022-11-10 16:30:35 -08:00
parent 66586b5f63
commit a1270f66cc
3 changed files with 19 additions and 2 deletions

View File

@@ -614,7 +614,8 @@ class ModuleInterfaceLoaderImpl {
StringRef inParentDirName =
path::filename(path::parent_path(interfacePath));
if (path::extension(inParentDirName) == ".swiftmodule") {
assert(path::stem(inParentDirName) == moduleName);
assert(path::stem(inParentDirName) ==
ctx.getRealModuleName(ctx.getIdentifier(moduleName)).str());
path::append(scratch, inParentDirName);
}
path::append(scratch, path::filename(modulePath));