30 case amdgcn:
return "amdgcn";
32 case amdil:
return "amdil";
33 case arc:
return "arc";
34 case arm:
return "arm";
35 case armeb:
return "armeb";
36 case avr:
return "avr";
37 case bpfeb:
return "bpfeb";
38 case bpfel:
return "bpfel";
39 case csky:
return "csky";
40 case dxil:
return "dxil";
43 case hsail:
return "hsail";
45 case lanai:
return "lanai";
46 case le32:
return "le32";
47 case le64:
return "le64";
50 case m68k:
return "m68k";
51 case mips64:
return "mips64";
53 case mips:
return "mips";
54 case mipsel:
return "mipsel";
55 case msp430:
return "msp430";
57 case nvptx:
return "nvptx";
58 case ppc64:
return "powerpc64";
59 case ppc64le:
return "powerpc64le";
60 case ppc:
return "powerpc";
61 case ppcle:
return "powerpcle";
62 case r600:
return "r600";
67 case shave:
return "shave";
68 case sparc:
return "sparc";
71 case spir64:
return "spir64";
72 case spir:
return "spir";
76 case tce:
return "tce";
77 case tcele:
return "tcele";
78 case thumb:
return "thumb";
81 case wasm32:
return "wasm32";
82 case wasm64:
return "wasm64";
83 case x86:
return "i386";
84 case x86_64:
return "x86_64";
85 case xcore:
return "xcore";
86 case xtensa:
return "xtensa";
101 case arc:
return "arc";
108 case avr:
return "avr";
113 case ppcle:
return "ppc";
115 case m68k:
return "m68k";
122 case hexagon:
return "hexagon";
124 case amdgcn:
return "amdgcn";
125 case r600:
return "r600";
128 case bpfeb:
return "bpf";
132 case sparc:
return "sparc";
137 case x86_64:
return "x86";
139 case xcore:
return "xcore";
142 case nvptx:
return "nvvm";
145 case le32:
return "le32";
146 case le64:
return "le64";
155 case spir64:
return "spir";
160 case kalimba:
return "kalimba";
161 case lanai:
return "lanai";
162 case shave:
return "shave";
164 case wasm64:
return "wasm";
169 case ve:
return "ve";
170 case csky:
return "csky";
175 case dxil:
return "dx";
177 case xtensa:
return "xtensa";
185 case AMD:
return "amd";
186 case Apple:
return "apple";
187 case CSR:
return "csr";
189 case IBM:
return "ibm";
191 case Mesa:
return "mesa";
193 case Myriad:
return "myriad";
194 case NVIDIA:
return "nvidia";
196 case PC:
return "pc";
197 case SCEI:
return "scei";
198 case SUSE:
return "suse";
208 case AIX:
return "aix";
209 case AMDHSA:
return "amdhsa";
210 case AMDPAL:
return "amdpal";
211 case Ananas:
return "ananas";
212 case CUDA:
return "cuda";
214 case Contiki:
return "contiki";
215 case Darwin:
return "darwin";
220 case FreeBSD:
return "freebsd";
221 case Fuchsia:
return "fuchsia";
222 case Haiku:
return "haiku";
224 case Hurd:
return "hurd";
225 case IOS:
return "ios";
227 case Linux:
return "linux";
228 case Lv2:
return "lv2";
229 case MacOSX:
return "macosx";
230 case Mesa3D:
return "mesa3d";
231 case Minix:
return "minix";
232 case NVCL:
return "nvcl";
233 case NaCl:
return "nacl";
234 case NetBSD:
return "netbsd";
235 case OpenBSD:
return "openbsd";
236 case PS4:
return "ps4";
237 case PS5:
return "ps5";
238 case RTEMS:
return "rtems";
239 case Solaris:
return "solaris";
240 case TvOS:
return "tvos";
241 case WASI:
return "wasi";
242 case WatchOS:
return "watchos";
243 case Win32:
return "windows";
244 case ZOS:
return "zos";
254 case Android:
return "android";
255 case CODE16:
return "code16";
256 case CoreCLR:
return "coreclr";
257 case Cygnus:
return "cygnus";
258 case EABI:
return "eabi";
259 case EABIHF:
return "eabihf";
260 case GNU:
return "gnu";
263 case GNUEABI:
return "gnueabi";
265 case GNUF32:
return "gnuf32";
266 case GNUF64:
return "gnuf64";
267 case GNUSF:
return "gnusf";
268 case GNUX32:
return "gnux32";
270 case Itanium:
return "itanium";
271 case MSVC:
return "msvc";
272 case MacABI:
return "macabi";
273 case Musl:
return "musl";
276 case MuslX32:
return "muslx32";
278 case Pixel:
return "pixel";
279 case Vertex:
return "vertex";
281 case Hull:
return "hull";
282 case Domain:
return "domain";
283 case Compute:
return "compute";
284 case Library:
return "library";
287 case AnyHit:
return "anyhit";
289 case Miss:
return "miss";
291 case Mesh:
return "mesh";
299 if (ArchName.
equals(
"bpf")) {
304 }
else if (ArchName.
equals(
"bpf_be") || ArchName.
equals(
"bpfeb")) {
306 }
else if (ArchName.
equals(
"bpf_le") || ArchName.
equals(
"bpfel")) {
428 if (ArchName.
empty())
476 .
Cases(
"mips",
"mipseb",
"mipsallegrex",
"mipsisa32r6",
478 .
Cases(
"mipsel",
"mipsallegrexel",
"mipsisa32r6el",
"mipsr6el",
480 .
Cases(
"mips64",
"mips64eb",
"mipsn32",
"mipsisa64r6",
482 .
Cases(
"mips64el",
"mipsn32el",
"mipsisa64r6el",
"mips64r6el",
506 .
Cases(
"spirv32",
"spirv32v1.0",
"spirv32v1.1",
"spirv32v1.2",
508 .
Cases(
"spirv64",
"spirv64v1.0",
"spirv64v1.1",
"spirv64v1.2",
665 if (SubArchName ==
"powerpcspe")
668 if (SubArchName ==
"arm64e")
671 if (SubArchName ==
"arm64ec")
687 if (ARMSubArch.
empty())
696 case ARM::ArchKind::ARMV4:
698 case ARM::ArchKind::ARMV4T:
700 case ARM::ArchKind::ARMV5T:
702 case ARM::ArchKind::ARMV5TE:
703 case ARM::ArchKind::IWMMXT:
704 case ARM::ArchKind::IWMMXT2:
705 case ARM::ArchKind::XSCALE:
706 case ARM::ArchKind::ARMV5TEJ:
708 case ARM::ArchKind::ARMV6:
710 case ARM::ArchKind::ARMV6K:
711 case ARM::ArchKind::ARMV6KZ:
713 case ARM::ArchKind::ARMV6T2:
715 case ARM::ArchKind::ARMV6M:
717 case ARM::ArchKind::ARMV7A:
718 case ARM::ArchKind::ARMV7R:
720 case ARM::ArchKind::ARMV7VE:
722 case ARM::ArchKind::ARMV7K:
724 case ARM::ArchKind::ARMV7M:
726 case ARM::ArchKind::ARMV7S:
728 case ARM::ArchKind::ARMV7EM:
730 case ARM::ArchKind::ARMV8A:
732 case ARM::ArchKind::ARMV8_1A:
734 case ARM::ArchKind::ARMV8_2A:
736 case ARM::ArchKind::ARMV8_3A:
738 case ARM::ArchKind::ARMV8_4A:
740 case ARM::ArchKind::ARMV8_5A:
742 case ARM::ArchKind::ARMV8_6A:
744 case ARM::ArchKind::ARMV8_7A:
746 case ARM::ArchKind::ARMV8_8A:
748 case ARM::ArchKind::ARMV8_9A:
750 case ARM::ArchKind::ARMV9A:
752 case ARM::ArchKind::ARMV9_1A:
754 case ARM::ArchKind::ARMV9_2A:
756 case ARM::ArchKind::ARMV9_3A:
758 case ARM::ArchKind::ARMV9_4A:
760 case ARM::ArchKind::ARMV8R:
762 case ARM::ArchKind::ARMV8MBaseline:
764 case ARM::ArchKind::ARMV8MMainline:
766 case ARM::ArchKind::ARMV8_1MMainline:
790 return "dxcontainer";
798 switch (
T.getArch()) {
808 else if (
T.isOSWindows())
890 :
Data(Str.str()), Arch(UnknownArch), SubArch(NoSubArch),
891 Vendor(UnknownVendor), OS(UnknownOS), Environment(UnknownEnvironment),
892 ObjectFormat(UnknownObjectFormat) {
896 if (Components.
size() > 0) {
899 if (Components.
size() > 1) {
901 if (Components.
size() > 2) {
903 if (Components.
size() > 3) {
930 :
Data((ArchStr +
Twine(
'-') + VendorStr +
Twine(
'-') + OSStr).str()),
935 Environment(), ObjectFormat(
Triple::UnknownObjectFormat) {
945 const Twine &EnvironmentStr)
947 EnvironmentStr).str()),
959 bool IsMinGW32 =
false;
960 bool IsCygwin =
false;
964 Str.split(Components,
'-');
972 if (Components.
size() > 0)
975 if (Components.
size() > 1)
978 if (Components.
size() > 2) {
980 IsCygwin = Components[2].startswith(
"cygwin");
981 IsMinGW32 = Components[2].startswith(
"mingw");
984 if (Components.
size() > 3)
987 if (Components.
size() > 4)
1001 for (
unsigned Pos = 0; Pos != std::size(Found); ++Pos) {
1007 if (
Idx < std::size(Found) && Found[
Idx])
1027 Valid = OS !=
UnknownOS || IsCygwin || IsMinGW32;
1053 for (
unsigned i = Pos; !CurrentComponent.
empty(); ++i) {
1055 while (i < std::size(Found) && Found[i])
1059 std::swap(CurrentComponent, Components[i]);
1061 }
else if (Pos >
Idx) {
1068 for (
unsigned i =
Idx; i < Components.
size();) {
1071 std::swap(CurrentComponent, Components[i]);
1073 if (CurrentComponent.
empty())
1076 while (++i < std::size(Found) && Found[i])
1080 if (!CurrentComponent.
empty())
1084 while (++
Idx < std::size(Found) && Found[
Idx])
1086 }
while (
Idx < Pos);
1088 assert(Pos < Components.
size() && Components[Pos] == Comp &&
1089 "Component moved wrong!");
1102 std::string NormalizedEnvironment;
1104 StringRef AndroidVersion = Components[3].drop_front(strlen(
"androideabi"));
1105 if (AndroidVersion.
empty()) {
1106 Components[3] =
"android";
1108 NormalizedEnvironment =
Twine(
"android", AndroidVersion).
str();
1109 Components[3] = NormalizedEnvironment;
1115 Components[3] =
"gnueabihf";
1119 Components[2] =
"windows";
1122 Components[3] =
"msvc";
1126 }
else if (IsMinGW32) {
1128 Components[2] =
"windows";
1129 Components[3] =
"gnu";
1130 }
else if (IsCygwin) {
1132 Components[2] =
"windows";
1133 Components[3] =
"cygnus";
1135 if (IsMinGW32 || IsCygwin ||
1144 return join(Components,
"-");
1155 return "mipsisa32r6";
1159 return "mipsisa32r6el";
1163 return "mipsisa64r6";
1167 return "mipsisa64r6el";
1181 return Tmp.
split(
'-').first;
1186 Tmp = Tmp.
split(
'-').second;
1187 return Tmp.
split(
'-').first;
1192 Tmp = Tmp.
split(
'-').second;
1193 return Tmp.
split(
'-').second;
1198 return Tmp.
split(
'-').second;
1203 Version.tryParse(
Name);
1204 return Version.withoutBuild();
1210 if (EnvironmentName.
startswith(EnvironmentTypeName))
1211 EnvironmentName = EnvironmentName.
substr(EnvironmentTypeName.
size());
1235 if (Version.getMajor() == 0)
1238 if (Version.getMajor() < 4) {
1241 if (Version.getMajor() <= 19) {
1250 if (Version.getMajor() == 0) {
1252 }
else if (Version.getMajor() < 10) {
1285 if (Version.getMajor() == 0)
1308 if (Version.getMajor() == 0)
1325 if (Version.getMajor() == 0)
1326 return Version.withMajorReplaced(19);
1819 return *
this ==
Other;
1825 if (
Other.isOSVersionLT(*
this))
1832 unsigned Micro)
const {
1843 assert(Major >= 11 &&
"Unexpected major version");
1897 "incorrect HLSL stage order");
1899 "incorrect HLSL stage order");
1901 "incorrect HLSL stage order");
1903 "incorrect HLSL stage order");
1905 "incorrect HLSL stage order");
1907 "incorrect HLSL stage order");
1909 "incorrect HLSL stage order");
1911 "incorrect HLSL stage order");
1913 "incorrect HLSL stage order");
1915 "incorrect HLSL stage order");
1917 "incorrect HLSL stage order");
1919 "incorrect HLSL stage order");
1921 "incorrect HLSL stage order");
1923 "incorrect HLSL stage order");
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
static bool startswith(StringRef Magic, const char(&S)[N])
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallString class.
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName)
static VersionTuple parseVersionFromName(StringRef Name)
static Triple::ObjectFormatType getDefaultFormat(const Triple &T)
static Triple::ArchType parseARMArch(StringRef ArchName)
static unsigned getArchPointerBitWidth(llvm::Triple::ArchType Arch)
static Triple::OSType parseOS(StringRef OSName)
static Triple::ArchType parseBPFArch(StringRef ArchName)
static StringRef getObjectFormatTypeName(Triple::ObjectFormatType Kind)
static Triple::SubArchType parseSubArch(StringRef SubArchName)
static Triple::ObjectFormatType parseFormat(StringRef EnvironmentName)
static Triple::ArchType parseArch(StringRef ArchName)
static Triple::VendorType parseVendor(StringRef VendorName)
Defines the llvm::VersionTuple class, which represents a version in the form major[....
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
constexpr StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
constexpr bool empty() const
empty - Check if the string is empty.
constexpr size_t size() const
size - Get the string size.
bool startswith(StringRef Prefix) const
bool consume_front(StringRef Prefix)
Returns true if this StringRef has the given prefix and removes that prefix.
bool equals(StringRef RHS) const
equals - Check for string equality, this is more efficient than compare() when the relative ordering ...
bool endswith(StringRef Suffix) const
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
StringSwitch & StartsWith(StringLiteral S, T Value)
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, T Value)
StringSwitch & EndsWith(StringLiteral S, T Value)
Triple - Helper class for working with autoconf configuration names.
bool isMacOSXVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
Comparison function for checking OS X version compatibility, which handles supporting skewed version ...
VersionTuple getOSVersion() const
Parse the version number from the OS name component of the triple, if present.
StringRef getVendorName() const
Get the vendor (second) component of the triple.
VersionTuple getWatchOSVersion() const
Parse the version number as with getOSVersion.
void setArchName(StringRef Str)
Set the architecture (first) component of the triple by name.
void setObjectFormat(ObjectFormatType Kind)
Set the object file format.
llvm::Triple get32BitArchVariant() const
Form a triple with a 32-bit variant of the current architecture.
Triple()=default
Default constructor is the same as an empty string and leaves all triple fields unknown.
std::string normalize() const
Return the normalized form of this triple's string.
llvm::Triple getLittleEndianArchVariant() const
Form a triple with a little endian variant of the current architecture.
static StringRef getVendorTypeName(VendorType Kind)
Get the canonical name for the Kind vendor.
ObjectFormatType getObjectFormat() const
Get the object format for this triple.
SubArchType getSubArch() const
get the parsed subarchitecture type for this triple.
bool isArm64e() const
Tests whether the target is the Apple "arm64e" AArch64 subarch.
void setVendorName(StringRef Str)
Set the vendor (second) component of the triple by name.
void setOSAndEnvironmentName(StringRef Str)
Set the operating system and optional environment components with a single string.
llvm::Triple get64BitArchVariant() const
Form a triple with a 64-bit variant of the current architecture.
bool isLittleEndian() const
Tests whether the target triple is little endian.
void setEnvironment(EnvironmentType Kind)
Set the environment (fourth) component of the triple to a known type.
StringRef getOSName() const
Get the operating system (third) component of the triple.
void setTriple(const Twine &Str)
Set all components to the new triple Str.
OSType getOS() const
Get the parsed operating system type of this triple.
VersionTuple getEnvironmentVersion() const
Parse the version number from the OS name component of the triple, if present.
static ArchType getArchTypeForLLVMName(StringRef Str)
The canonical type for the given LLVM architecture name (e.g., "x86").
ArchType getArch() const
Get the parsed architecture type of this triple.
StringRef getEnvironmentName() const
Get the optional environment (fourth) component of the triple, or "" if empty.
bool isSimulatorEnvironment() const
const std::string & str() const
EnvironmentType getEnvironment() const
Get the parsed environment type of this triple.
VersionTuple getDriverKitVersion() const
Parse the version number as with getOSVersion.
static StringRef getArchTypeName(ArchType Kind)
Get the canonical name for the Kind architecture.
static StringRef getOSTypeName(OSType Kind)
Get the canonical name for the Kind operating system.
std::string merge(const Triple &Other) const
Merge target triples.
@ ImaginationTechnologies
VersionTuple getMinimumSupportedOSVersion() const
Some platforms have different minimum supported OS versions that varies by the architecture specified...
bool isArch64Bit() const
Test whether the architecture is 64-bit.
StringRef getOSAndEnvironmentName() const
Get the operating system and optional environment components as a single string (separated by a '-' i...
@ ARMSubArch_v8m_mainline
@ ARMSubArch_v8m_baseline
@ ARMSubArch_v8_1m_mainline
bool getMacOSXVersion(VersionTuple &Version) const
Parse the version number as with getOSVersion and then translate generic "darwin" versions to the cor...
bool isMacOSX() const
Is this a Mac OS X triple.
void setEnvironmentName(StringRef Str)
Set the optional environment (fourth) component of the triple by name.
void setOS(OSType Kind)
Set the operating system (third) component of the triple to a known type.
void setOSName(StringRef Str)
Set the operating system (third) component of the triple by name.
VendorType getVendor() const
Get the parsed vendor type of this triple.
static StringRef getEnvironmentTypeName(EnvironmentType Kind)
Get the canonical name for the Kind environment.
bool isOSVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
Helper function for doing comparisons against version numbers included in the target triple.
static VersionTuple getCanonicalVersionForOS(OSType OSKind, const VersionTuple &Version)
Returns a canonicalized OS version number for the specified OS.
StringRef getArchName() const
Get the architecture (first) component of the triple.
bool isMacCatalystEnvironment() const
bool isArch16Bit() const
Test whether the architecture is 16-bit.
llvm::Triple getBigEndianArchVariant() const
Form a triple with a big endian variant of the current architecture.
VersionTuple getiOSVersion() const
Parse the version number as with getOSVersion.
bool isArch32Bit() const
Test whether the architecture is 32-bit.
bool isCompatibleWith(const Triple &Other) const
Test whether target triples are compatible.
bool hasEnvironment() const
Does this triple have the optional environment (fourth) component?
static StringRef getArchTypePrefix(ArchType Kind)
Get the "prefix" canonical name for the Kind architecture.
void setArch(ArchType Kind, SubArchType SubArch=NoSubArch)
Set the architecture (first) component of the triple to a known type.
void setVendor(VendorType Kind)
Set the vendor (second) component of the triple to a known type.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
std::string str() const
Return the twine contents as a std::string.
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.
StringRef getCanonicalArchName(StringRef Arch)
MArch is expected to be of the form (arm|thumb)?(eb)?(v.
ISAKind parseArchISA(StringRef Arch)
ArchKind parseArch(StringRef Arch)
ProfileKind parseArchProfile(StringRef Arch)
unsigned parseArchVersion(StringRef Arch)
EndianKind parseArchEndian(StringRef Arch)
@ C
The default llvm calling convention, compatible with C.
static const bool IsLittleEndianHost
This is an optimization pass for GlobalISel generic memory operations.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.