================
@@ -181,23 +181,42 @@ class DarwinSDKInfo {
using PlatformInfoStorageType = SmallVector<SDKPlatformInfo, 2>;
DarwinSDKInfo(
- VersionTuple Version, VersionTuple MaximumDeploymentTarget,
+ StringRef DisplayName, VersionTuple Version,
+ VersionTuple MaximumDeploymentTarget,
PlatformInfoStorageType PlatformInfos,
llvm::DenseMap<OSEnvPair::StorageType,
std::optional<RelatedTargetVersionMapping>>
VersionMappings =
llvm::DenseMap<OSEnvPair::StorageType,
std::optional<RelatedTargetVersionMapping>>())
- : Version(Version), MaximumDeploymentTarget(MaximumDeploymentTarget),
+ : DisplayName(DisplayName), Version(Version),
+ MaximumDeploymentTarget(MaximumDeploymentTarget),
PlatformInfos(std::move(PlatformInfos)),
VersionMappings(std::move(VersionMappings)) {}
+ const StringRef getDisplayName() const { return DisplayName; }
+
const llvm::VersionTuple &getVersion() const { return Version; }
const SDKPlatformInfo &getCanonicalPlatformInfo() const {
return PlatformInfos[0];
}
+ bool supportsPlatformInfo(SDKPlatformInfo PlatformInfo) const {
+ // Consider a platform info supported if its triple parts match.
+ auto MatchesPlatformInfo =
----------------
cyndyishida wrote:
This comparator should move the definition of `SDKPlatformInfo` as another
equality operator. It also seems unfortunate that this check has to be written
twice, with all the same function calls between different types. Maybe it could
be templated instead?
https://github.com/llvm/llvm-project/pull/176541
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits