Skip to content

Commit 606eef6

Browse files
authored
Merge pull request #66719 from nkcsgexi/clean-up-framework
2 parents c2f164d + f4d8761 commit 606eef6

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

lib/Frontend/ModuleInterfaceLoader.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -719,15 +719,16 @@ class ModuleInterfaceLoaderImpl {
719719
return pathStartsWith(hostPath, path);
720720
}
721721

722-
bool isInSystemFrameworks(StringRef path) {
722+
bool isInSystemFrameworks(StringRef path, bool publicFramework) {
723723
StringRef sdkPath = ctx.SearchPathOpts.getSDKPath();
724724
if (sdkPath.empty()) return false;
725725

726-
SmallString<128> publicFrameworksPath;
727-
llvm::sys::path::append(publicFrameworksPath,
728-
sdkPath, "System", "Library", "Frameworks");
726+
SmallString<128> frameworksPath;
727+
llvm::sys::path::append(frameworksPath,
728+
sdkPath, "System", "Library",
729+
publicFramework ? "Frameworks" : "PrivateFrameworks");
729730

730-
return pathStartsWith(publicFrameworksPath, path);
731+
return pathStartsWith(frameworksPath, path);
731732
}
732733

733734
std::pair<std::string, std::string> getCompiledModuleCandidates() {
@@ -738,11 +739,7 @@ class ModuleInterfaceLoaderImpl {
738739

739740
// Don't use the adjacent swiftmodule for frameworks from the public
740741
// Frameworks folder of the SDK.
741-
SmallString<128> publicFrameworksPath;
742-
llvm::sys::path::append(publicFrameworksPath,
743-
ctx.SearchPathOpts.getSDKPath(),
744-
"System", "Library", "Frameworks");
745-
if (isInSystemFrameworks(modulePath)) {
742+
if (isInSystemFrameworks(modulePath, /*publicFramework*/true)) {
746743
shouldLoadAdjacentModule = false;
747744
rebuildInfo.addIgnoredModule(modulePath, ReasonIgnored::PublicFramework);
748745
} else if (isInResourceHostDir(modulePath)) {

0 commit comments

Comments
 (0)