1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

[X86] Make elfiamcu an OS, not an environment.

GNU tools require elfiamcu to take up the entire OS field, so, e.g.
i?86-*-linux-elfiamcu is not considered a legal triple.
Make us compatible.

Differential Revision: http://reviews.llvm.org/D14081

llvm-svn: 251390
This commit is contained in:
Michael Kuperstein 2015-10-27 07:23:59 +00:00
parent 9c9c14352f
commit 6d9717c9b3
5 changed files with 12 additions and 12 deletions

View File

@ -155,7 +155,8 @@ public:
NVCL, // NVIDIA OpenCL
AMDHSA, // AMD HSA Runtime
PS4,
LastOSType = PS4
ELFIAMCU,
LastOSType = ELFIAMCU
};
enum EnvironmentType {
UnknownEnvironment,
@ -174,8 +175,7 @@ public:
Cygnus,
AMDOpenCL,
CoreCLR,
ELFIAMCU,
LastEnvironmentType = ELFIAMCU
LastEnvironmentType = CoreCLR
};
enum ObjectFormatType {
UnknownObjectFormat,
@ -432,8 +432,8 @@ public:
return getOS() == Triple::Bitrig;
}
bool isEnvironmentIAMCU() const {
return getEnvironment() == Triple::ELFIAMCU;
bool isOSIAMCU() const {
return getOS() == Triple::ELFIAMCU;
}
bool isWindowsMSVCEnvironment() const {

View File

@ -181,6 +181,7 @@ const char *Triple::getOSTypeName(OSType Kind) {
case NVCL: return "nvcl";
case AMDHSA: return "amdhsa";
case PS4: return "ps4";
case ELFIAMCU: return "elfiamcu";
}
llvm_unreachable("Invalid OSType");
@ -202,7 +203,6 @@ 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!");
@ -436,6 +436,7 @@ static Triple::OSType parseOS(StringRef OSName) {
.StartsWith("nvcl", Triple::NVCL)
.StartsWith("amdhsa", Triple::AMDHSA)
.StartsWith("ps4", Triple::PS4)
.StartsWith("elfiamcu", Triple::ELFIAMCU)
.Default(Triple::UnknownOS);
}
@ -454,7 +455,6 @@ 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);
}

View File

@ -418,7 +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 isTargetMCU() const { return TargetTriple.isOSIAMCU(); }
bool isTargetWindowsMSVC() const {
return TargetTriple.isWindowsMSVCEnvironment();

View File

@ -1,4 +1,4 @@
; RUN: llc < %s -mtriple=i686-pc-linux-elfiamcu | FileCheck %s
; RUN: llc < %s -mtriple=i686-pc-elfiamcu | FileCheck %s
; CHECK-LABEL: test_lib_args:
; CHECK: movl %edx, %eax

View File

@ -81,11 +81,11 @@ TEST(TripleTest, ParsedIDs) {
EXPECT_EQ(Triple::Darwin, T.getOS());
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
T = Triple("i386-pc-linux-elfiamcu");
T = Triple("i386-pc-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());
EXPECT_EQ(Triple::ELFIAMCU, T.getOS());
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
T = Triple("x86_64-pc-linux-gnu");
EXPECT_EQ(Triple::x86_64, T.getArch());