ModuleInterface: Don't alias Foundation module in swiftinterfaces.

Skip aliasing Foundation when `-alias-module-names-in-module-interface` is
specified since it appears to confuse the typechecker. The module name
"Foundation" is hardcoded and checked in several places, so aliasing Foundation
may be changing some subtle behaviors.

Resolves rdar://128897610.
This commit is contained in:
Allan Shortlidge
2024-09-04 20:26:56 -07:00
parent 736faacbde
commit a0a4ac3d55
2 changed files with 23 additions and 0 deletions

View File

@@ -97,6 +97,10 @@ static void printToolVersionAndFlagsComment(raw_ostream &out,
importedName == BUILTIN_NAME)
continue;
// Aliasing Foundation confuses the typechecker (rdar://128897610).
if (importedName == "Foundation")
continue;
if (AliasModuleNamesTargets.insert(importedName).second) {
out << " -module-alias " << MODULE_DISAMBIGUATING_PREFIX <<
importedName << "=" << importedName;