================
@@ -1382,26 +1382,61 @@ std::string Darwin::getCompilerRT(const ArgList &Args, 
StringRef Component,
   return std::string(FullPath);
 }
 
-StringRef Darwin::getPlatformFamily() const {
+static StringRef getPlatformFamily(Darwin::DarwinPlatformKind TargetPlatform) {
   switch (TargetPlatform) {
-    case DarwinPlatformKind::MacOS:
-      return "MacOSX";
-    case DarwinPlatformKind::IPhoneOS:
-      if (TargetEnvironment == MacCatalyst)
-        return "MacOSX";
-      return "iPhone";
-    case DarwinPlatformKind::TvOS:
-      return "AppleTV";
-    case DarwinPlatformKind::WatchOS:
-      return "Watch";
-    case DarwinPlatformKind::DriverKit:
-      return "DriverKit";
-    case DarwinPlatformKind::XROS:
-      return "XR";
+  case Darwin::DarwinPlatformKind::MacOS:
+    return "MacOSX";
+  case Darwin::DarwinPlatformKind::IPhoneOS:
+    return "iPhone";
+  case Darwin::DarwinPlatformKind::TvOS:
+    return "AppleTV";
+  case Darwin::DarwinPlatformKind::WatchOS:
+    return "Watch";
+  case Darwin::DarwinPlatformKind::DriverKit:
+    return "DriverKit";
+  default:
+    break;
   }
   llvm_unreachable("Unsupported platform");
 }
 
+static std::string getPlatformAndEnvironmentString(
----------------
ian-twilightcoder wrote:

This is just used in the diagnostic message for `-Wincompatible-sysroot`. The 
effective triple hasn't been computed when that diagnostic is emitted, but the 
platform/environment have been.

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

Reply via email to