26 return WantSim ? PLATFORM_IOSSIMULATOR : PLATFORM_IOS;
28 return WantSim ? PLATFORM_TVOSSIMULATOR : PLATFORM_TVOS;
29 case PLATFORM_WATCHOS:
30 return WantSim ? PLATFORM_WATCHOSSIMULATOR : PLATFORM_WATCHOS;
37 return PLATFORM_UNKNOWN;
39 return PLATFORM_MACOS;
41 if (
Target.isSimulatorEnvironment())
42 return PLATFORM_IOSSIMULATOR;
44 return PLATFORM_MACCATALYST;
47 return Target.isSimulatorEnvironment() ? PLATFORM_TVOSSIMULATOR
50 return Target.isSimulatorEnvironment() ? PLATFORM_WATCHOSSIMULATOR
58 for (
const auto &
Target : Targets)
65#define PLATFORM(platform, id, name, build_name, target, tapi_target, \
67 case PLATFORM_##platform: \
69#include "llvm/BinaryFormat/MachO.def"
76 .
Case(
"osx", PLATFORM_MACOS)
77#define PLATFORM(platform, id, name, build_name, target, tapi_target, \
79 .Case(#target, PLATFORM_##platform)
80#include "llvm/BinaryFormat/MachO.def"
85 std::string Version) {
87 case PLATFORM_UNKNOWN:
88 return "darwin" + Version;
90 return "macos" + Version;
92 return "ios" + Version;
94 return "tvos" + Version;
95 case PLATFORM_WATCHOS:
96 return "watchos" + Version;
97 case PLATFORM_BRIDGEOS:
98 return "bridgeos" + Version;
99 case PLATFORM_MACCATALYST:
100 return "ios" + Version +
"-macabi";
101 case PLATFORM_IOSSIMULATOR:
102 return "ios" + Version +
"-simulator";
103 case PLATFORM_TVOSSIMULATOR:
104 return "tvos" + Version +
"-simulator";
105 case PLATFORM_WATCHOSSIMULATOR:
106 return "watchos" + Version +
"-simulator";
107 case PLATFORM_DRIVERKIT:
108 return "driverkit" + Version;
116 return MinSupportedOS;
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
StringRef - Represent a constant reference to a string, i.e.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
Triple - Helper class for working with autoconf configuration names.
VersionTuple getOSVersion() const
Parse the version number from the OS name component of the triple, if present.
VersionTuple getMinimumSupportedOSVersion() const
Some platforms have different minimum supported OS versions that varies by the architecture specified...
Represents a version number in the form major[.minor[.subminor[.build]]].
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::string getOSAndEnvironmentName(PlatformType Platform, std::string Version="")
VersionTuple mapToSupportedOSVersion(const Triple &Triple)
PlatformSet mapToPlatformSet(ArrayRef< Triple > Targets)
PlatformType mapToPlatformType(PlatformType Platform, bool WantSim)
StringRef getPlatformName(PlatformType Platform)
PlatformType getPlatformFromName(StringRef Name)
This is an optimization pass for GlobalISel generic memory operations.