[triple] Use 'macabi' environment name for the Mac Catalyst triples

The 'macabi' environment name is preferred instead of 'maccatalyst'.

llvm-svn: 364988
This commit is contained in:
Alex Lorenz 2019-07-03 01:02:43 +00:00
parent 4b3d4276c6
commit b9cd7ccd58
5 changed files with 9 additions and 9 deletions

View File

@ -215,8 +215,8 @@ public:
Cygnus,
CoreCLR,
Simulator, // Simulator variants of other systems, e.g., Apple's iOS
MacCatalyst,
LastEnvironmentType = MacCatalyst
MacABI, // Mac Catalyst variant of Apple's iOS deployment target.
LastEnvironmentType = MacABI
};
enum ObjectFormatType {
UnknownObjectFormat,
@ -487,7 +487,7 @@ public:
}
bool isMacCatalystEnvironment() const {
return getEnvironment() == Triple::MacCatalyst;
return getEnvironment() == Triple::MacABI;
}
bool isOSNetBSD() const {

View File

@ -239,7 +239,7 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) {
case Cygnus: return "cygnus";
case CoreCLR: return "coreclr";
case Simulator: return "simulator";
case MacCatalyst: return "maccatalyst";
case MacABI: return "macabi";
}
llvm_unreachable("Invalid EnvironmentType!");
@ -542,7 +542,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
.StartsWith("cygnus", Triple::Cygnus)
.StartsWith("coreclr", Triple::CoreCLR)
.StartsWith("simulator", Triple::Simulator)
.StartsWith("maccatalyst", Triple::MacCatalyst)
.StartsWith("macabi", Triple::MacABI)
.Default(Triple::UnknownEnvironment);
}

View File

@ -1,3 +1,3 @@
; RUN: llc %s -o - | FileCheck %s
target triple="x86_64-apple-ios13.0-maccatalyst"
target triple="x86_64-apple-ios13.0-macabi"
; CHECK: .build_version maccatalyst, 13, 0

View File

@ -1,7 +1,7 @@
// RUN: llvm-mc -triple x86_64-apple-macosx10.10.0 %s -filetype=obj -o - | llvm-objdump -macho -private-headers - | FileCheck %s
// RUN: llvm-mc -triple x86_64-apple-ios8.0.0 %s -filetype=obj -o - | llvm-objdump -macho -private-headers - | FileCheck %s --check-prefix=CHECK-IOS
// RUN: llvm-mc -triple x86_64-apple-darwin %s -filetype=obj -o - | llvm-objdump -macho -private-headers - | FileCheck %s --check-prefix=CHECK-DARWIN
// RUN: llvm-mc -triple x86_64-apple-ios13.0-maccatalyst %s -filetype=obj -o - | llvm-objdump -macho -private-headers - | FileCheck %s --check-prefix=CHECK-MACCATALYST
// RUN: llvm-mc -triple x86_64-apple-ios13.0-macabi %s -filetype=obj -o - | llvm-objdump -macho -private-headers - | FileCheck %s --check-prefix=CHECK-MACCATALYST
// Test version-min load command should be inferred from triple and should always be generated on Darwin
// CHECK: Load command

View File

@ -1239,13 +1239,13 @@ TEST(TripleTest, getOSVersion) {
EXPECT_TRUE(T.isSimulatorEnvironment());
EXPECT_FALSE(T.isMacCatalystEnvironment());
T = Triple("x86_64-apple-ios13.0-maccatalyst");
T = Triple("x86_64-apple-ios13.0-macabi");
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.getEnvironment() == Triple::MacABI);
EXPECT_TRUE(T.isMacCatalystEnvironment());
EXPECT_FALSE(T.isSimulatorEnvironment());
}