Skip to content

Commit a4aaa10

Browse files
authored
Merge pull request swiftlang#80098 from xymus/upstream-swiftmodule-blocklist
Frontend: Upstream blocklist check when ignoring adjacent swiftmodule files
2 parents 4da795f + 7d3ed78 commit a4aaa10

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

lib/Frontend/ModuleInterfaceLoader.cpp

+11-3
Original file line numberDiff line numberDiff line change
@@ -836,12 +836,20 @@ class ModuleInterfaceLoaderImpl {
836836

837837
// Don't use the adjacent swiftmodule for frameworks from the public
838838
// Frameworks folder of the SDK.
839-
if (isInSystemFrameworks(modulePath, /*publicFramework*/true) ||
840-
isInSystemSubFrameworks(modulePath)) {
839+
bool blocklistSwiftmodule =
840+
ctx.blockListConfig.hasBlockListAction(moduleName,
841+
BlockListKeyKind::ModuleName,
842+
BlockListAction::ShouldUseBinaryModule);
843+
844+
if ((isInSystemFrameworks(modulePath, /*publicFramework*/true) ||
845+
isInSystemSubFrameworks(modulePath)) &&
846+
!blocklistSwiftmodule) {
841847
shouldLoadAdjacentModule = false;
842848
rebuildInfo.addIgnoredModule(modulePath,
843849
ReasonIgnored::PublicFramework);
844-
} else if (isInSystemLibraries(modulePath) && moduleName != STDLIB_NAME) {
850+
} else if (isInSystemLibraries(modulePath) &&
851+
moduleName != STDLIB_NAME &&
852+
!blocklistSwiftmodule) {
845853
shouldLoadAdjacentModule = false;
846854
rebuildInfo.addIgnoredModule(modulePath,
847855
ReasonIgnored::PublicLibrary);

test/ModuleInterface/prefer-swiftinterface-by-default.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ import SDKModuleAtUnusualPath
7878
import HostResourceDirModule // expected-remark {{rebuilding module 'HostResourceDirModule' from interface}}
7979
// expected-note @-1 {{was ignored because it's a compiler host module}}
8080
import LocalModule
81-
import BlocklistedModule // expected-remark {{rebuilding module 'BlocklistedModule' from interface}}
82-
// expected-note @-1 {{was ignored because it belongs to a framework in the SDK}}
81+
import BlocklistedModule
8382

8483
//--- blocklistDisabled.yml
8584
---

0 commit comments

Comments
 (0)