[PATCH] D64097: [triple] add 'macCatalyst
Alex Lorenz via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 2 13:26:04 PDT 2019
arphaman created this revision.
Herald added subscribers: llvm-commits, kristina, dexonsmith, jkorous, hiraditya.
Herald added a project: LLVM.
Repository:
rL LLVM
https://reviews.llvm.org/D64097
Files:
llvm/include/llvm/ADT/Triple.h
llvm/lib/Support/Triple.cpp
llvm/unittests/ADT/TripleTest.cpp
Index: llvm/unittests/ADT/TripleTest.cpp
===================================================================
--- llvm/unittests/ADT/TripleTest.cpp
+++ llvm/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/lib/Support/Triple.cpp
===================================================================
--- llvm/lib/Support/Triple.cpp
+++ llvm/lib/Support/Triple.cpp
@@ -239,6 +239,8 @@
case Cygnus: return "cygnus";
case CoreCLR: return "coreclr";
case Simulator: return "simulator";
+ case MacCatalyst:
+ return "maccatalyst";
}
llvm_unreachable("Invalid EnvironmentType!");
@@ -541,6 +543,7 @@
.StartsWith("cygnus", Triple::Cygnus)
.StartsWith("coreclr", Triple::CoreCLR)
.StartsWith("simulator", Triple::Simulator)
+ .StartsWith("maccatalyst", Triple::MacCatalyst)
.Default(Triple::UnknownEnvironment);
}
Index: llvm/include/llvm/ADT/Triple.h
===================================================================
--- llvm/include/llvm/ADT/Triple.h
+++ llvm/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.207616.patch
Type: text/x-patch
Size: 2228 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190702/5db507d2/attachment.bin>
More information about the llvm-commits
mailing list