[AST] Treat platform modules as non-user

Modules defined within the SDK are considered
non-user modules, extend this to any module found
within the parent platform directory if there is
one. This ensures we include modules such as
XCTest and Testing.

rdar://131854240
This commit is contained in:
Hamish Knight
2024-08-23 14:23:37 +01:00
parent 7075c05d62
commit 940f5f7c2a
6 changed files with 70 additions and 4 deletions

View File

@@ -380,6 +380,8 @@ private:
std::optional<StringRef> SysRoot = std::nullopt;
mutable std::optional<std::string> SDKPlatformPath = std::nullopt;
public:
StringRef getSDKPath() const { return SDKPath; }
@@ -398,6 +400,12 @@ public:
Lookup.searchPathsDidChange();
}
/// Retrieves the corresponding parent platform path for the SDK, or
/// \c nullopt if there isn't one.
/// NOTE: This computes and caches the result, and as such will not respect
/// a different FileSystem being passed later.
std::optional<StringRef> getSDKPlatformPath(llvm::vfs::FileSystem *FS) const;
std::optional<StringRef> getWinSDKRoot() const { return WinSDKRoot; }
void setWinSDKRoot(StringRef root) {
WinSDKRoot = root;