[PATCH] D64097: [triple] add 'macCatalyst' environment

Alex Lorenz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 14:37:07 PDT 2019


This revision was automatically updated to reflect the committed changes.
arphaman marked an inline comment as done.
Closed by commit rL364971: [triple] add 'macCatalyst' environment type (authored by arphaman, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D64097?vs=207616&id=207633#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64097/new/

https://reviews.llvm.org/D64097

Files:
  llvm/trunk/include/llvm/ADT/Triple.h
  llvm/trunk/lib/Support/Triple.cpp
  llvm/trunk/unittests/ADT/TripleTest.cpp


Index: llvm/trunk/lib/Support/Triple.cpp
===================================================================
--- llvm/trunk/lib/Support/Triple.cpp
+++ llvm/trunk/lib/Support/Triple.cpp
@@ -239,6 +239,7 @@
   case Cygnus: return "cygnus";
   case CoreCLR: return "coreclr";
   case Simulator: return "simulator";
+  case MacCatalyst: return "maccatalyst";
   }
 
   llvm_unreachable("Invalid EnvironmentType!");
@@ -541,6 +542,7 @@
     .StartsWith("cygnus", Triple::Cygnus)
     .StartsWith("coreclr", Triple::CoreCLR)
     .StartsWith("simulator", Triple::Simulator)
+    .StartsWith("maccatalyst", Triple::MacCatalyst)
     .Default(Triple::UnknownEnvironment);
 }
 
Index: llvm/trunk/unittests/ADT/TripleTest.cpp
===================================================================
--- llvm/trunk/unittests/ADT/TripleTest.cpp
+++ llvm/trunk/unittests/ADT/TripleTest.cpp
@@ -1237,6 +1237,17 @@
   EXPECT_EQ((unsigned)3, Minor);
   EXPECT_EQ((unsigned)0, Micro);
   EXPECT_TRUE(T.isSimulatorEnvironment());
+  EXPECT_FALSE(T.isMacCatalystEnvironment());
+
+  T = Triple("x86_64-apple-ios13.0-maccatalyst");
+  EXPECT_TRUE(T.isiOS());
+  T.getiOSVersion(Major, Minor, Micro);
+  EXPECT_EQ((unsigned)13, Major);
+  EXPECT_EQ((unsigned)0, Minor);
+  EXPECT_EQ((unsigned)0, Micro);
+  EXPECT_TRUE(T.getEnvironment() == Triple::MacCatalyst);
+  EXPECT_TRUE(T.isMacCatalystEnvironment());
+  EXPECT_FALSE(T.isSimulatorEnvironment());
 }
 
 TEST(TripleTest, FileFormat) {
Index: llvm/trunk/include/llvm/ADT/Triple.h
===================================================================
--- llvm/trunk/include/llvm/ADT/Triple.h
+++ llvm/trunk/include/llvm/ADT/Triple.h
@@ -214,8 +214,9 @@
     Itanium,
     Cygnus,
     CoreCLR,
-    Simulator,  // Simulator variants of other systems, e.g., Apple's iOS
-    LastEnvironmentType = Simulator
+    Simulator, // Simulator variants of other systems, e.g., Apple's iOS
+    MacCatalyst,
+    LastEnvironmentType = MacCatalyst
   };
   enum ObjectFormatType {
     UnknownObjectFormat,
@@ -485,6 +486,10 @@
     return getEnvironment() == Triple::Simulator;
   }
 
+  bool isMacCatalystEnvironment() const {
+    return getEnvironment() == Triple::MacCatalyst;
+  }
+
   bool isOSNetBSD() const {
     return getOS() == Triple::NetBSD;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64097.207633.patch
Type: text/x-patch
Size: 2277 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190702/62488331/attachment.bin>


More information about the llvm-commits mailing list