ModuleInterface: allow blocklist to configure module names from SDKs that we use textual interfaces exclusively

This commit is contained in:
Xi Ge
2023-10-27 23:07:50 -07:00
parent b99a4f89d9
commit 09d6944497
3 changed files with 46 additions and 1 deletions

View File

@@ -236,6 +236,7 @@ struct ModuleRebuildInfo {
PublicFramework,
InterfacePreferred,
CompilerHostModule,
Blocklisted,
};
struct CandidateModule {
std::string path;
@@ -758,6 +759,14 @@ class ModuleInterfaceLoaderImpl {
// Should we attempt to load a swiftmodule adjacent to the swiftinterface?
bool shouldLoadAdjacentModule = !ctx.IgnoreAdjacentModules;
if (modulePath.contains(".sdk")) {
if (ctx.blockListConfig.hasBlockListAction(moduleName,
BlockListKeyKind::ModuleName, BlockListAction::ShouldUseTextualModule)) {
shouldLoadAdjacentModule = false;
rebuildInfo.addIgnoredModule(modulePath, ReasonIgnored::Blocklisted);
}
}
// Don't use the adjacent swiftmodule for frameworks from the public
// Frameworks folder of the SDK.
if (isInSystemFrameworks(modulePath, /*publicFramework*/true)) {