mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
[X86] Add support for elfiamcu triple
This adds support for the i?86-*-elfiamcu triple, which indicates the IAMCU psABI is used. Differential Revision: http://reviews.llvm.org/D13977 llvm-svn: 251222
This commit is contained in:
parent
53b91789eb
commit
f5ce8355a3
@ -174,7 +174,8 @@ public:
|
||||
Cygnus,
|
||||
AMDOpenCL,
|
||||
CoreCLR,
|
||||
LastEnvironmentType = CoreCLR
|
||||
ELFIAMCU,
|
||||
LastEnvironmentType = ELFIAMCU
|
||||
};
|
||||
enum ObjectFormatType {
|
||||
UnknownObjectFormat,
|
||||
@ -431,6 +432,10 @@ public:
|
||||
return getOS() == Triple::Bitrig;
|
||||
}
|
||||
|
||||
bool isEnvironmentIAMCU() const {
|
||||
return getEnvironment() == Triple::ELFIAMCU;
|
||||
}
|
||||
|
||||
bool isWindowsMSVCEnvironment() const {
|
||||
return getOS() == Triple::Win32 &&
|
||||
(getEnvironment() == Triple::UnknownEnvironment ||
|
||||
|
@ -202,6 +202,7 @@ const char *Triple::getEnvironmentTypeName(EnvironmentType Kind) {
|
||||
case Cygnus: return "cygnus";
|
||||
case AMDOpenCL: return "amdopencl";
|
||||
case CoreCLR: return "coreclr";
|
||||
case ELFIAMCU: return "elfiamcu";
|
||||
}
|
||||
|
||||
llvm_unreachable("Invalid EnvironmentType!");
|
||||
@ -453,6 +454,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
|
||||
.StartsWith("cygnus", Triple::Cygnus)
|
||||
.StartsWith("amdopencl", Triple::AMDOpenCL)
|
||||
.StartsWith("coreclr", Triple::CoreCLR)
|
||||
.StartsWith("elfiamcu", Triple::ELFIAMCU)
|
||||
.Default(Triple::UnknownEnvironment);
|
||||
}
|
||||
|
||||
|
@ -418,6 +418,7 @@ public:
|
||||
bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
|
||||
bool isTargetNaCl32() const { return isTargetNaCl() && !is64Bit(); }
|
||||
bool isTargetNaCl64() const { return isTargetNaCl() && is64Bit(); }
|
||||
bool isTargetMCU() const { return TargetTriple.isEnvironmentIAMCU(); }
|
||||
|
||||
bool isTargetWindowsMSVC() const {
|
||||
return TargetTriple.isWindowsMSVCEnvironment();
|
||||
|
@ -81,6 +81,12 @@ TEST(TripleTest, ParsedIDs) {
|
||||
EXPECT_EQ(Triple::Darwin, T.getOS());
|
||||
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
|
||||
|
||||
T = Triple("i386-pc-linux-elfiamcu");
|
||||
EXPECT_EQ(Triple::x86, T.getArch());
|
||||
EXPECT_EQ(Triple::PC, T.getVendor());
|
||||
EXPECT_EQ(Triple::Linux, T.getOS());
|
||||
EXPECT_EQ(Triple::ELFIAMCU, T.getEnvironment());
|
||||
|
||||
T = Triple("x86_64-pc-linux-gnu");
|
||||
EXPECT_EQ(Triple::x86_64, T.getArch());
|
||||
EXPECT_EQ(Triple::PC, T.getVendor());
|
||||
|
Loading…
Reference in New Issue
Block a user