================
@@ -63,26 +63,102 @@ DarwinSDKInfo::RelatedTargetVersionMapping::parseJSON(
       Min, Max, MinValue, MaximumDeploymentTarget, std::move(Mapping));
 }
 
-static llvm::Triple::OSType parseOS(const llvm::json::Object &Obj) {
+static DarwinSDKInfo::PlatformInfoStorageType
+parsePlatformInfos(const llvm::json::Object &Obj, VersionTuple Version) {
   // The CanonicalName is the Xcode platform followed by a version, e.g.
-  // macosx16.0.
-  auto CanonicalName = Obj.getString("CanonicalName");
-  if (!CanonicalName)
-    return llvm::Triple::UnknownOS;
-  size_t VersionStart = CanonicalName->find_first_of("0123456789");
-  StringRef XcodePlatform = CanonicalName->slice(0, VersionStart);
-  return llvm::StringSwitch<llvm::Triple::OSType>(XcodePlatform)
-      .Case("macosx", llvm::Triple::MacOSX)
-      .Case("iphoneos", llvm::Triple::IOS)
-      .Case("iphonesimulator", llvm::Triple::IOS)
-      .Case("appletvos", llvm::Triple::TvOS)
-      .Case("appletvsimulator", llvm::Triple::TvOS)
-      .Case("watchos", llvm::Triple::WatchOS)
-      .Case("watchsimulator", llvm::Triple::WatchOS)
-      .Case("xros", llvm::Triple::XROS)
-      .Case("xrsimulator", llvm::Triple::XROS)
-      .Case("driverkit", llvm::Triple::DriverKit)
-      .Default(llvm::Triple::UnknownOS);
+  // macosx15.0.
----------------
cyndyishida wrote:

Could you add to this comment that the canonical platform should always be the 
first entry in the returned object?

https://github.com/llvm/llvm-project/pull/171970
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to