[ModuleInterface] Always ignore export-as in private swiftinterfaces

Always print the real module name for references in private
swiftinterfaces, ignoring export-as declarations. Keep using the
export-as name for the public swiftinterface only.

The flag `ModuleInterfaceExportAs` used to enable this behavior and
we're removing it to make it the default.

rdar://115922907
This commit is contained in:
Alexis Laferrière
2023-10-16 12:04:08 -07:00
parent 042ccdda01
commit 6f1a774e7d
5 changed files with 26 additions and 55 deletions

View File

@@ -821,13 +821,7 @@ bool swift::emitSwiftInterface(raw_ostream &out,
printImports(out, Opts, M, aliasModuleNamesTargets);
static bool forceUseExportedModuleNameInPublicOnly =
getenv("SWIFT_DEBUG_USE_EXPORTED_MODULE_NAME_IN_PUBLIC_ONLY");
bool useExportedModuleNameInPublicOnly =
M->getASTContext().LangOpts.hasFeature(Feature::ModuleInterfaceExportAs) ||
forceUseExportedModuleNameInPublicOnly;
bool useExportedModuleNames = !(useExportedModuleNameInPublicOnly &&
Opts.PrintPrivateInterfaceContent);
bool useExportedModuleNames = !Opts.PrintPrivateInterfaceContent;
const PrintOptions printOptions = PrintOptions::printSwiftInterfaceFile(
M, Opts.PreserveTypesAsWritten, Opts.PrintFullConvention,