llvm.org GIT mirror llvm / f5d1f57
[triple] add 'macCatalyst' environment type Mac Catalyst is a new deployment platform in macOS Catalina. Differential Revision: https://reviews.llvm.org/D64097 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364971 91177308-0d34-0410-b5e6-96231b3b80d8 Alex Lorenz a month ago
3 changed file(s) with 20 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
213213 Itanium,
214214 Cygnus,
215215 CoreCLR,
216 Simulator, // Simulator variants of other systems, e.g., Apple's iOS
217 LastEnvironmentType = Simulator
216 Simulator, // Simulator variants of other systems, e.g., Apple's iOS
217 MacCatalyst,
218 LastEnvironmentType = MacCatalyst
218219 };
219220 enum ObjectFormatType {
220221 UnknownObjectFormat,
484485 return getEnvironment() == Triple::Simulator;
485486 }
486487
488 bool isMacCatalystEnvironment() const {
489 return getEnvironment() == Triple::MacCatalyst;
490 }
491
487492 bool isOSNetBSD() const {
488493 return getOS() == Triple::NetBSD;
489494 }
238238 case Cygnus: return "cygnus";
239239 case CoreCLR: return "coreclr";
240240 case Simulator: return "simulator";
241 case MacCatalyst: return "maccatalyst";
241242 }
242243
243244 llvm_unreachable("Invalid EnvironmentType!");
540541 .StartsWith("cygnus", Triple::Cygnus)
541542 .StartsWith("coreclr", Triple::CoreCLR)
542543 .StartsWith("simulator", Triple::Simulator)
544 .StartsWith("maccatalyst", Triple::MacCatalyst)
543545 .Default(Triple::UnknownEnvironment);
544546 }
545547
12361236 EXPECT_EQ((unsigned)3, Minor);
12371237 EXPECT_EQ((unsigned)0, Micro);
12381238 EXPECT_TRUE(T.isSimulatorEnvironment());
1239 EXPECT_FALSE(T.isMacCatalystEnvironment());
1240
1241 T = Triple("x86_64-apple-ios13.0-maccatalyst");
1242 EXPECT_TRUE(T.isiOS());
1243 T.getiOSVersion(Major, Minor, Micro);
1244 EXPECT_EQ((unsigned)13, Major);
1245 EXPECT_EQ((unsigned)0, Minor);
1246 EXPECT_EQ((unsigned)0, Micro);
1247 EXPECT_TRUE(T.getEnvironment() == Triple::MacCatalyst);
1248 EXPECT_TRUE(T.isMacCatalystEnvironment());
1249 EXPECT_FALSE(T.isSimulatorEnvironment());
12391250 }
12401251
12411252 TEST(TripleTest, FileFormat) {