Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.
/ swift-llvm Public archive

Commit

Permalink
[triple] Use 'macabi' environment name for the Mac Catalyst triples
Browse files Browse the repository at this point in the history
The 'macabi' environment name is preferred instead of 'maccatalyst'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364988 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 255ffb6)
  • Loading branch information
hyp committed Jul 3, 2019
1 parent 5bbe5e0 commit 3f1fd4f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions include/llvm/ADT/Triple.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ class Triple {
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,
Expand Down Expand Up @@ -482,7 +482,7 @@ class Triple {
}

bool isMacCatalystEnvironment() const {
return getEnvironment() == Triple::MacCatalyst;
return getEnvironment() == Triple::MacABI;
}

bool isOSNetBSD() const {
Expand Down
4 changes: 2 additions & 2 deletions lib/Support/Triple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,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!");
Expand Down Expand Up @@ -534,7 +534,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);
}

Expand Down
2 changes: 1 addition & 1 deletion test/CodeGen/X86/macCatalyst.ll
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion test/MC/MachO/darwin-version-min-load-command.s
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions unittests/ADT/TripleTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1217,13 +1217,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());
}
Expand Down

0 comments on commit 3f1fd4f

Please sign in to comment.