mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add swift::getNonSimulatorPlatform for DarwinPlatformKind
And use it in getDarwinLibraryNameSuffixForTriple, making the logic there clearer. Suggested by David U!
This commit is contained in:
@@ -76,6 +76,22 @@ DarwinPlatformKind swift::getDarwinPlatformKind(const llvm::Triple &triple) {
|
||||
llvm_unreachable("Unsupported Darwin platform");
|
||||
}
|
||||
|
||||
DarwinPlatformKind swift::getNonSimulatorPlatform(DarwinPlatformKind platform) {
|
||||
switch (platform) {
|
||||
case DarwinPlatformKind::MacOS:
|
||||
return DarwinPlatformKind::MacOS;
|
||||
case DarwinPlatformKind::IPhoneOS:
|
||||
case DarwinPlatformKind::IPhoneOSSimulator:
|
||||
return DarwinPlatformKind::IPhoneOS;
|
||||
case DarwinPlatformKind::TvOS:
|
||||
case DarwinPlatformKind::TvOSSimulator:
|
||||
return DarwinPlatformKind::TvOS;
|
||||
case DarwinPlatformKind::WatchOS:
|
||||
case DarwinPlatformKind::WatchOSSimulator:
|
||||
return DarwinPlatformKind::WatchOS;
|
||||
}
|
||||
}
|
||||
|
||||
static StringRef getPlatformNameForDarwin(const DarwinPlatformKind platform) {
|
||||
switch (platform) {
|
||||
case DarwinPlatformKind::MacOS:
|
||||
|
||||
Reference in New Issue
Block a user