Skip to content

Commit 6e7c6fd

Browse files
authored
Merge pull request #33148 from brentdax/runtime-revolution
Adjust to simulator compiler-rt change
2 parents 997fc5d + 86ff24b commit 6e7c6fd

File tree

4 files changed

+18
-33
lines changed

4 files changed

+18
-33
lines changed

include/swift/Basic/Platform.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ namespace swift {
7272
/// Returns the platform Kind for Darwin triples.
7373
DarwinPlatformKind getDarwinPlatformKind(const llvm::Triple &triple);
7474

75-
/// Maps an arbitrary platform to its non-simulator equivalent.
76-
///
77-
/// If \p platform is not a simulator platform, it will be returned as is.
78-
DarwinPlatformKind getNonSimulatorPlatform(DarwinPlatformKind platform);
79-
8075
/// Returns the architecture component of the path for a given target triple.
8176
///
8277
/// Typically this is used for mapping the architecture component of the

lib/Basic/Platform.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -123,23 +123,6 @@ DarwinPlatformKind swift::getDarwinPlatformKind(const llvm::Triple &triple) {
123123
llvm_unreachable("Unsupported Darwin platform");
124124
}
125125

126-
DarwinPlatformKind swift::getNonSimulatorPlatform(DarwinPlatformKind platform) {
127-
switch (platform) {
128-
case DarwinPlatformKind::MacOS:
129-
return DarwinPlatformKind::MacOS;
130-
case DarwinPlatformKind::IPhoneOS:
131-
case DarwinPlatformKind::IPhoneOSSimulator:
132-
return DarwinPlatformKind::IPhoneOS;
133-
case DarwinPlatformKind::TvOS:
134-
case DarwinPlatformKind::TvOSSimulator:
135-
return DarwinPlatformKind::TvOS;
136-
case DarwinPlatformKind::WatchOS:
137-
case DarwinPlatformKind::WatchOSSimulator:
138-
return DarwinPlatformKind::WatchOS;
139-
}
140-
llvm_unreachable("Unsupported Darwin platform");
141-
}
142-
143126
static StringRef getPlatformNameForDarwin(const DarwinPlatformKind platform) {
144127
switch (platform) {
145128
case DarwinPlatformKind::MacOS:

lib/Driver/DarwinToolChains.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,9 @@ toolchains::Darwin::constructInvocation(const InterpretJobAction &job,
8989
}
9090

9191
static StringRef
92-
getDarwinLibraryNameSuffixForTriple(const llvm::Triple &triple,
93-
bool distinguishSimulator = true) {
92+
getDarwinLibraryNameSuffixForTriple(const llvm::Triple &triple) {
9493
const DarwinPlatformKind kind = getDarwinPlatformKind(triple);
95-
const DarwinPlatformKind effectiveKind =
96-
distinguishSimulator ? kind : getNonSimulatorPlatform(kind);
97-
switch (effectiveKind) {
94+
switch (kind) {
9895
case DarwinPlatformKind::MacOS:
9996
return "osx";
10097
case DarwinPlatformKind::IPhoneOS:
@@ -709,7 +706,7 @@ toolchains::Darwin::constructInvocation(const DynamicLinkJobAction &job,
709706
llvm::sys::path::append(
710707
CompilerRTPath,
711708
Twine("libclang_rt.") +
712-
getDarwinLibraryNameSuffixForTriple(Triple, /*simulator*/false) +
709+
getDarwinLibraryNameSuffixForTriple(Triple) +
713710
".a");
714711
if (llvm::sys::fs::exists(CompilerRTPath))
715712
Arguments.push_back(context.Args.MakeArgString(CompilerRTPath));

test/Driver/linker-clang_rt.swift

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,28 @@
1111

1212
// RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-macosx10.9 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-NO-RUNTIME %s
1313

14-
// RUN: touch %t/lib/swift/clang/lib/darwin/libclang_rt.osx.a %t/lib/swift/clang/lib/darwin/libclang_rt.ios.a %t/lib/swift/clang/lib/darwin/libclang_rt.tvos.a %t/lib/swift/clang/lib/darwin/libclang_rt.watchos.a
14+
// RUN: touch %t/lib/swift/clang/lib/darwin/libclang_rt.osx.a %t/lib/swift/clang/lib/darwin/libclang_rt.ios.a %t/lib/swift/clang/lib/darwin/libclang_rt.iossim.a %t/lib/swift/clang/lib/darwin/libclang_rt.tvos.a %t/lib/swift/clang/lib/darwin/libclang_rt.tvossim.a %t/lib/swift/clang/lib/darwin/libclang_rt.watchos.a %t/lib/swift/clang/lib/darwin/libclang_rt.watchossim.a
1515

1616
// RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-macosx10.9 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-MACOS %s
1717
// RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-ios13.0-macabi %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-MACCATALYST %s
1818

19-
// RUN: %t/bin/swiftc -driver-print-jobs -target i386-apple-ios7 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOS %s
20-
// RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-ios7 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOS %s
19+
// RUN: %t/bin/swiftc -driver-print-jobs -target i386-apple-ios7-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOSSIM %s
20+
// RUN: %t/bin/swiftc -driver-print-jobs -target i386-apple-ios7 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOSSIM %s
21+
// RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-ios7-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOSSIM %s
22+
// RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-ios7 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOSSIM %s
2123
// RUN: %t/bin/swiftc -driver-print-jobs -target armv7s-apple-ios7 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOS %s
24+
// RUN: %t/bin/swiftc -driver-print-jobs -target arm64-apple-ios7-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOSSIM %s
2225
// RUN: %t/bin/swiftc -driver-print-jobs -target arm64-apple-ios7 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOS %s
2326

24-
// RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-tvos9 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-TVOS %s
27+
// RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-tvos9-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-TVOSSIM %s
28+
// RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-tvos9 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-TVOSSIM %s
29+
// RUN: %t/bin/swiftc -driver-print-jobs -target arm64-apple-tvos9-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-TVOSSIM %s
2530
// RUN: %t/bin/swiftc -driver-print-jobs -target arm64-apple-tvos9 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-TVOS %s
2631

27-
// RUN: %t/bin/swiftc -driver-print-jobs -target i386-apple-watchos2 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-WATCHOS %s
32+
// RUN: %t/bin/swiftc -driver-print-jobs -target i386-apple-watchos2-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-WATCHOSSIM %s
33+
// RUN: %t/bin/swiftc -driver-print-jobs -target i386-apple-watchos2 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-WATCHOSSIM %s
2834
// RUN: %t/bin/swiftc -driver-print-jobs -target armv7k-apple-watchos2 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-WATCHOS %s
35+
// RUN: %t/bin/swiftc -driver-print-jobs -target arm64-apple-watchos2-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-WATCHOSSIM %s
2936

3037
// Clean up the test executable because hard links are expensive.
3138
// RUN: rm -f %t/bin/swiftc
@@ -35,6 +42,9 @@
3542
// CHECK-MACCATALYST-SAME: {{[^ ]+(/|\\\\)lib(/|\\\\)swift(/|\\\\)clang(/|\\\\)lib(/|\\\\)darwin(/|\\\\)libclang_rt.osx.a}}
3643
// CHECK-MACOS-SAME: {{[^ ]+(/|\\\\)lib(/|\\\\)swift(/|\\\\)clang(/|\\\\)lib(/|\\\\)darwin(/|\\\\)libclang_rt.osx.a}}
3744
// CHECK-IOS-SAME: {{[^ ]+(/|\\\\)lib(/|\\\\)swift(/|\\\\)clang(/|\\\\)lib(/|\\\\)darwin(/|\\\\)libclang_rt.ios.a}}
45+
// CHECK-IOSSIM-SAME: {{[^ ]+(/|\\\\)lib(/|\\\\)swift(/|\\\\)clang(/|\\\\)lib(/|\\\\)darwin(/|\\\\)libclang_rt.iossim.a}}
3846
// CHECK-TVOS-SAME: {{[^ ]+(/|\\\\)lib(/|\\\\)swift(/|\\\\)clang(/|\\\\)lib(/|\\\\)darwin(/|\\\\)libclang_rt.tvos.a}}
47+
// CHECK-TVOSSIM-SAME: {{[^ ]+(/|\\\\)lib(/|\\\\)swift(/|\\\\)clang(/|\\\\)lib(/|\\\\)darwin(/|\\\\)libclang_rt.tvossim.a}}
3948
// CHECK-WATCHOS-SAME: {{[^ ]+(/|\\\\)lib(/|\\\\)swift(/|\\\\)clang(/|\\\\)lib(/|\\\\)darwin(/|\\\\)libclang_rt.watchos.a}}
49+
// CHECK-WATCHOSSIM-SAME: {{[^ ]+(/|\\\\)lib(/|\\\\)swift(/|\\\\)clang(/|\\\\)lib(/|\\\\)darwin(/|\\\\)libclang_rt.watchossim.a}}
4050
// CHECK-SAME: -o {{[^ ]+}}

0 commit comments

Comments
 (0)