mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-02 17:29:03 +00:00
Define "contiki" OS specifier.
Patch by Michael LeMay Differential revision: http://reviews.llvm.org/D24897 llvm-svn: 284240
This commit is contained in:
parent
54524ed76a
commit
96ecdb67e0
@ -170,7 +170,8 @@ public:
|
||||
TvOS, // Apple tvOS
|
||||
WatchOS, // Apple watchOS
|
||||
Mesa3D,
|
||||
LastOSType = Mesa3D
|
||||
Contiki,
|
||||
LastOSType = Contiki
|
||||
};
|
||||
enum EnvironmentType {
|
||||
UnknownEnvironment,
|
||||
@ -489,6 +490,10 @@ public:
|
||||
Env == Triple::GNUX32;
|
||||
}
|
||||
|
||||
bool isOSContiki() const {
|
||||
return getOS() == Triple::Contiki;
|
||||
}
|
||||
|
||||
/// Checks if the environment could be MSVC.
|
||||
bool isWindowsMSVCEnvironment() const {
|
||||
return getOS() == Triple::Win32 &&
|
||||
|
@ -193,6 +193,7 @@ StringRef Triple::getOSTypeName(OSType Kind) {
|
||||
case TvOS: return "tvos";
|
||||
case WatchOS: return "watchos";
|
||||
case Mesa3D: return "mesa3d";
|
||||
case Contiki: return "contiki";
|
||||
}
|
||||
|
||||
llvm_unreachable("Invalid OSType");
|
||||
@ -465,6 +466,7 @@ static Triple::OSType parseOS(StringRef OSName) {
|
||||
.StartsWith("tvos", Triple::TvOS)
|
||||
.StartsWith("watchos", Triple::WatchOS)
|
||||
.StartsWith("mesa3d", Triple::Mesa3D)
|
||||
.StartsWith("contiki", Triple::Contiki)
|
||||
.Default(Triple::UnknownOS);
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,12 @@ TEST(TripleTest, ParsedIDs) {
|
||||
EXPECT_EQ(Triple::ELFIAMCU, T.getOS());
|
||||
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
|
||||
|
||||
T = Triple("i386-pc-contiki-unknown");
|
||||
EXPECT_EQ(Triple::x86, T.getArch());
|
||||
EXPECT_EQ(Triple::PC, T.getVendor());
|
||||
EXPECT_EQ(Triple::Contiki, T.getOS());
|
||||
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
|
||||
|
||||
T = Triple("x86_64-pc-linux-gnu");
|
||||
EXPECT_EQ(Triple::x86_64, T.getArch());
|
||||
EXPECT_EQ(Triple::PC, T.getVendor());
|
||||
|
Loading…
x
Reference in New Issue
Block a user