forked from OSchip/llvm-project
Add amdopencl environment to triple
This is used by the AMD x86 OpenCL implementation to change some ABI details on Windows and Linux. llvm-svn: 243627
This commit is contained in:
parent
98a857140b
commit
f1ffbe7bb3
|
@ -170,7 +170,8 @@ public:
|
|||
MSVC,
|
||||
Itanium,
|
||||
Cygnus,
|
||||
LastEnvironmentType = Cygnus
|
||||
AMDOpenCL,
|
||||
LastEnvironmentType = AMDOpenCL
|
||||
};
|
||||
enum ObjectFormatType {
|
||||
UnknownObjectFormat,
|
||||
|
|
|
@ -196,6 +196,7 @@ const char *Triple::getEnvironmentTypeName(EnvironmentType Kind) {
|
|||
case MSVC: return "msvc";
|
||||
case Itanium: return "itanium";
|
||||
case Cygnus: return "cygnus";
|
||||
case AMDOpenCL: return "amdopencl";
|
||||
}
|
||||
|
||||
llvm_unreachable("Invalid EnvironmentType!");
|
||||
|
@ -430,6 +431,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
|
|||
.StartsWith("msvc", Triple::MSVC)
|
||||
.StartsWith("itanium", Triple::Itanium)
|
||||
.StartsWith("cygnus", Triple::Cygnus)
|
||||
.StartsWith("amdopencl", Triple::AMDOpenCL)
|
||||
.Default(Triple::UnknownEnvironment);
|
||||
}
|
||||
|
||||
|
|
|
@ -354,6 +354,8 @@ TEST(TripleTest, MutateName) {
|
|||
EXPECT_EQ(Triple::Darwin, T.getOS());
|
||||
EXPECT_EQ("i386-pc-darwin", T.getTriple());
|
||||
|
||||
T.setEnvironmentName("amdopencl");
|
||||
EXPECT_EQ(Triple::AMDOpenCL, T.getEnvironment());
|
||||
}
|
||||
|
||||
TEST(TripleTest, BitWidthPredicates) {
|
||||
|
|
Loading…
Reference in New Issue