@@ -719,15 +719,16 @@ class ModuleInterfaceLoaderImpl {
719
719
return pathStartsWith (hostPath, path);
720
720
}
721
721
722
- bool isInSystemFrameworks (StringRef path) {
722
+ bool isInSystemFrameworks (StringRef path, bool publicFramework ) {
723
723
StringRef sdkPath = ctx.SearchPathOpts .getSDKPath ();
724
724
if (sdkPath.empty ()) return false ;
725
725
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" );
729
730
730
- return pathStartsWith (publicFrameworksPath , path);
731
+ return pathStartsWith (frameworksPath , path);
731
732
}
732
733
733
734
std::pair<std::string, std::string> getCompiledModuleCandidates () {
@@ -738,11 +739,7 @@ class ModuleInterfaceLoaderImpl {
738
739
739
740
// Don't use the adjacent swiftmodule for frameworks from the public
740
741
// 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 )) {
746
743
shouldLoadAdjacentModule = false ;
747
744
rebuildInfo.addIgnoredModule (modulePath, ReasonIgnored::PublicFramework);
748
745
} else if (isInResourceHostDir (modulePath)) {
0 commit comments