From 255ffb6b06f5a7c01553134aef36bc4cd8c457e3 Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Wed, 3 Jul 2019 01:02:43 +0000 Subject: [PATCH] [triple] Use 'macabi' environment name for the Mac Catalyst triples 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 --- include/llvm/ADT/Triple.h | 6 +++--- lib/Support/Triple.cpp | 4 ++-- test/CodeGen/X86/macCatalyst.ll | 2 +- test/MC/MachO/darwin-version-min-load-command.s | 2 +- unittests/ADT/TripleTest.cpp | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/llvm/ADT/Triple.h b/include/llvm/ADT/Triple.h index 78fc4d7b624..926039ca598 100644 --- a/include/llvm/ADT/Triple.h +++ b/include/llvm/ADT/Triple.h @@ -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 { diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp index 54264903320..d419463e6a5 100644 --- a/lib/Support/Triple.cpp +++ b/lib/Support/Triple.cpp @@ -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); } diff --git a/test/CodeGen/X86/macCatalyst.ll b/test/CodeGen/X86/macCatalyst.ll index 190c467e93d..7a126f1665d 100644 --- a/test/CodeGen/X86/macCatalyst.ll +++ b/test/CodeGen/X86/macCatalyst.ll @@ -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 diff --git a/test/MC/MachO/darwin-version-min-load-command.s b/test/MC/MachO/darwin-version-min-load-command.s index 05f61f0bc49..2567686e873 100644 --- a/test/MC/MachO/darwin-version-min-load-command.s +++ b/test/MC/MachO/darwin-version-min-load-command.s @@ -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 diff --git a/unittests/ADT/TripleTest.cpp b/unittests/ADT/TripleTest.cpp index 5b00a011ab3..b0f089ac1d8 100644 --- a/unittests/ADT/TripleTest.cpp +++ b/unittests/ADT/TripleTest.cpp @@ -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()); } -- 2.50.1