@@ -713,15 +713,16 @@ class ModuleInterfaceLoaderImpl {
713
713
return pathStartsWith (hostPath, path);
714
714
}
715
715
716
- bool isInSystemFrameworks (StringRef path) {
716
+ bool isInSystemFrameworks (StringRef path, bool publicFramework ) {
717
717
StringRef sdkPath = ctx.SearchPathOpts .getSDKPath ();
718
718
if (sdkPath.empty ()) return false ;
719
719
720
- SmallString<128 > publicFrameworksPath;
721
- llvm::sys::path::append (publicFrameworksPath,
722
- sdkPath, " System" , " Library" , " Frameworks" );
720
+ SmallString<128 > frameworksPath;
721
+ llvm::sys::path::append (frameworksPath,
722
+ sdkPath, " System" , " Library" ,
723
+ publicFramework ? " Frameworks" : " PrivateFrameworks" );
723
724
724
- return pathStartsWith (publicFrameworksPath , path);
725
+ return pathStartsWith (frameworksPath , path);
725
726
}
726
727
727
728
std::pair<std::string, std::string> getCompiledModuleCandidates () {
@@ -732,11 +733,7 @@ class ModuleInterfaceLoaderImpl {
732
733
733
734
// Don't use the adjacent swiftmodule for frameworks from the public
734
735
// Frameworks folder of the SDK.
735
- SmallString<128 > publicFrameworksPath;
736
- llvm::sys::path::append (publicFrameworksPath,
737
- ctx.SearchPathOpts .getSDKPath (),
738
- " System" , " Library" , " Frameworks" );
739
- if (isInSystemFrameworks (modulePath)) {
736
+ if (isInSystemFrameworks (modulePath, /* publicFramework*/ true )) {
740
737
shouldLoadAdjacentModule = false ;
741
738
rebuildInfo.addIgnoredModule (modulePath, ReasonIgnored::PublicFramework);
742
739
} else if (isInResourceHostDir (modulePath)) {
0 commit comments