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";
73 case spirv:
return "spirv";
77 case tce:
return "tce";
78 case tcele:
return "tcele";
79 case thumb:
return "thumb";
82 case wasm32:
return "wasm32";
83 case wasm64:
return "wasm64";
84 case x86:
return "i386";
85 case x86_64:
return "x86_64";
86 case xcore:
return "xcore";
87 case xtensa:
return "xtensa";
102 case arc:
return "arc";
109 case avr:
return "avr";
114 case ppcle:
return "ppc";
116 case m68k:
return "m68k";
123 case hexagon:
return "hexagon";
125 case amdgcn:
return "amdgcn";
126 case r600:
return "r600";
129 case bpfeb:
return "bpf";
133 case sparc:
return "sparc";
138 case x86_64:
return "x86";
140 case xcore:
return "xcore";
143 case nvptx:
return "nvvm";
146 case le32:
return "le32";
147 case le64:
return "le64";
156 case spir64:
return "spir";
162 case kalimba:
return "kalimba";
163 case lanai:
return "lanai";
164 case shave:
return "shave";
166 case wasm64:
return "wasm";
171 case ve:
return "ve";
172 case csky:
return "csky";
177 case dxil:
return "dx";
179 case xtensa:
return "xtensa";
187 case AMD:
return "amd";
188 case Apple:
return "apple";
189 case CSR:
return "csr";
191 case IBM:
return "ibm";
193 case Mesa:
return "mesa";
195 case NVIDIA:
return "nvidia";
197 case PC:
return "pc";
198 case SCEI:
return "scei";
199 case SUSE:
return "suse";
209 case AIX:
return "aix";
210 case AMDHSA:
return "amdhsa";
211 case AMDPAL:
return "amdpal";
212 case CUDA:
return "cuda";
213 case Darwin:
return "darwin";
218 case FreeBSD:
return "freebsd";
219 case Fuchsia:
return "fuchsia";
220 case Haiku:
return "haiku";
222 case Hurd:
return "hurd";
223 case IOS:
return "ios";
225 case Linux:
return "linux";
226 case Lv2:
return "lv2";
227 case MacOSX:
return "macosx";
228 case Mesa3D:
return "mesa3d";
229 case NVCL:
return "nvcl";
230 case NaCl:
return "nacl";
231 case NetBSD:
return "netbsd";
232 case OpenBSD:
return "openbsd";
233 case PS4:
return "ps4";
234 case PS5:
return "ps5";
235 case RTEMS:
return "rtems";
236 case Solaris:
return "solaris";
237 case TvOS:
return "tvos";
238 case UEFI:
return "uefi";
239 case WASI:
return "wasi";
240 case WatchOS:
return "watchos";
241 case Win32:
return "windows";
242 case ZOS:
return "zos";
244 case LiteOS:
return "liteos";
253 case Android:
return "android";
254 case CODE16:
return "code16";
255 case CoreCLR:
return "coreclr";
256 case Cygnus:
return "cygnus";
257 case EABI:
return "eabi";
258 case EABIHF:
return "eabihf";
259 case GNU:
return "gnu";
262 case GNUEABI:
return "gnueabi";
264 case GNUF32:
return "gnuf32";
265 case GNUF64:
return "gnuf64";
266 case GNUSF:
return "gnusf";
267 case GNUX32:
return "gnux32";
269 case Itanium:
return "itanium";
270 case MSVC:
return "msvc";
271 case MacABI:
return "macabi";
272 case Musl:
return "musl";
275 case MuslX32:
return "muslx32";
277 case Pixel:
return "pixel";
278 case Vertex:
return "vertex";
280 case Hull:
return "hull";
281 case Domain:
return "domain";
282 case Compute:
return "compute";
283 case Library:
return "library";
286 case AnyHit:
return "anyhit";
288 case Miss:
return "miss";
290 case Mesh:
return "mesh";
301 case COFF:
return "coff";
302 case ELF:
return "elf";
303 case GOFF:
return "goff";
304 case MachO:
return "macho";
305 case Wasm:
return "wasm";
306 case XCOFF:
return "xcoff";
308 case SPIRV:
return "spirv";
314 if (ArchName.
equals(
"bpf")) {
319 }
else if (ArchName.
equals(
"bpf_be") || ArchName.
equals(
"bpfeb")) {
321 }
else if (ArchName.
equals(
"bpf_le") || ArchName.
equals(
"bpfel")) {
444 if (ArchName.
empty())
492 .
Cases(
"mips",
"mipseb",
"mipsallegrex",
"mipsisa32r6",
494 .
Cases(
"mipsel",
"mipsallegrexel",
"mipsisa32r6el",
"mipsr6el",
496 .
Cases(
"mips64",
"mips64eb",
"mipsn32",
"mipsisa64r6",
498 .
Cases(
"mips64el",
"mipsn32el",
"mipsisa64r6el",
"mips64r6el",
522 .
Cases(
"spirv",
"spirv1.0",
"spirv1.1",
"spirv1.2",
524 .
Cases(
"spirv32",
"spirv32v1.0",
"spirv32v1.1",
"spirv32v1.2",
526 .
Cases(
"spirv64",
"spirv64v1.0",
"spirv64v1.1",
"spirv64v1.2",
681 if (SubArchName ==
"powerpcspe")
684 if (SubArchName ==
"arm64e")
687 if (SubArchName ==
"arm64ec")
703 if (ARMSubArch.
empty())
712 case ARM::ArchKind::ARMV4:
714 case ARM::ArchKind::ARMV4T:
716 case ARM::ArchKind::ARMV5T:
718 case ARM::ArchKind::ARMV5TE:
719 case ARM::ArchKind::IWMMXT:
720 case ARM::ArchKind::IWMMXT2:
721 case ARM::ArchKind::XSCALE:
722 case ARM::ArchKind::ARMV5TEJ:
724 case ARM::ArchKind::ARMV6:
726 case ARM::ArchKind::ARMV6K:
727 case ARM::ArchKind::ARMV6KZ:
729 case ARM::ArchKind::ARMV6T2:
731 case ARM::ArchKind::ARMV6M:
733 case ARM::ArchKind::ARMV7A:
734 case ARM::ArchKind::ARMV7R:
736 case ARM::ArchKind::ARMV7VE:
738 case ARM::ArchKind::ARMV7K:
740 case ARM::ArchKind::ARMV7M:
742 case ARM::ArchKind::ARMV7S:
744 case ARM::ArchKind::ARMV7EM:
746 case ARM::ArchKind::ARMV8A:
748 case ARM::ArchKind::ARMV8_1A:
750 case ARM::ArchKind::ARMV8_2A:
752 case ARM::ArchKind::ARMV8_3A:
754 case ARM::ArchKind::ARMV8_4A:
756 case ARM::ArchKind::ARMV8_5A:
758 case ARM::ArchKind::ARMV8_6A:
760 case ARM::ArchKind::ARMV8_7A:
762 case ARM::ArchKind::ARMV8_8A:
764 case ARM::ArchKind::ARMV8_9A:
766 case ARM::ArchKind::ARMV9A:
768 case ARM::ArchKind::ARMV9_1A:
770 case ARM::ArchKind::ARMV9_2A:
772 case ARM::ArchKind::ARMV9_3A:
774 case ARM::ArchKind::ARMV9_4A:
776 case ARM::ArchKind::ARMV8R:
778 case ARM::ArchKind::ARMV8MBaseline:
780 case ARM::ArchKind::ARMV8MMainline:
782 case ARM::ArchKind::ARMV8_1MMainline:
792 switch (
T.getArch()) {
885 :
Data(Str.str()), Arch(UnknownArch), SubArch(NoSubArch),
886 Vendor(UnknownVendor),
OS(UnknownOS), Environment(UnknownEnvironment),
887 ObjectFormat(UnknownObjectFormat) {
891 if (Components.
size() > 0) {
894 if (Components.
size() > 1) {
896 if (Components.
size() > 2) {
898 if (Components.
size() > 3) {
925 :
Data((ArchStr +
Twine(
'-') + VendorStr +
Twine(
'-') + OSStr).str()),
930 Environment(), ObjectFormat(
Triple::UnknownObjectFormat) {
940 const Twine &EnvironmentStr)
942 EnvironmentStr).str()),
954 bool IsMinGW32 =
false;
955 bool IsCygwin =
false;
959 Str.split(Components,
'-');
967 if (Components.
size() > 0)
970 if (Components.
size() > 1)
973 if (Components.
size() > 2) {
975 IsCygwin = Components[2].startswith(
"cygwin");
976 IsMinGW32 = Components[2].startswith(
"mingw");
979 if (Components.
size() > 3)
982 if (Components.
size() > 4)
996 for (
unsigned Pos = 0; Pos != std::size(Found); ++Pos) {
1002 if (
Idx < std::size(Found) && Found[
Idx])
1048 for (
unsigned i = Pos; !CurrentComponent.
empty(); ++i) {
1050 while (i < std::size(Found) && Found[i])
1054 std::swap(CurrentComponent, Components[i]);
1056 }
else if (Pos >
Idx) {
1063 for (
unsigned i =
Idx; i < Components.
size();) {
1066 std::swap(CurrentComponent, Components[i]);
1068 if (CurrentComponent.
empty())
1071 while (++i < std::size(Found) && Found[i])
1075 if (!CurrentComponent.
empty())
1079 while (++
Idx < std::size(Found) && Found[
Idx])
1081 }
while (
Idx < Pos);
1083 assert(Pos < Components.
size() && Components[Pos] == Comp &&
1084 "Component moved wrong!");
1097 std::string NormalizedEnvironment;
1099 StringRef AndroidVersion = Components[3].drop_front(strlen(
"androideabi"));
1100 if (AndroidVersion.
empty()) {
1101 Components[3] =
"android";
1103 NormalizedEnvironment =
Twine(
"android", AndroidVersion).
str();
1104 Components[3] = NormalizedEnvironment;
1110 Components[3] =
"gnueabihf";
1114 Components[2] =
"windows";
1117 Components[3] =
"msvc";
1121 }
else if (IsMinGW32) {
1123 Components[2] =
"windows";
1124 Components[3] =
"gnu";
1125 }
else if (IsCygwin) {
1127 Components[2] =
"windows";
1128 Components[3] =
"cygnus";
1130 if (IsMinGW32 || IsCygwin ||
1139 return join(Components,
"-");
1150 return "mipsisa32r6";
1154 return "mipsisa32r6el";
1158 return "mipsisa64r6";
1162 return "mipsisa64r6el";
1176 return Tmp.
split(
'-').first;
1181 Tmp = Tmp.
split(
'-').second;
1182 return Tmp.
split(
'-').first;
1187 Tmp = Tmp.
split(
'-').second;
1188 return Tmp.
split(
'-').second;
1193 return Tmp.
split(
'-').second;
1198 Version.tryParse(
Name);
1199 return Version.withoutBuild();
1205 if (EnvironmentName.
startswith(EnvironmentTypeName))
1206 EnvironmentName = EnvironmentName.
substr(EnvironmentTypeName.
size());
1230 if (Version.getMajor() == 0)
1233 if (Version.getMajor() < 4) {
1236 if (Version.getMajor() <= 19) {
1245 if (Version.getMajor() == 0) {
1247 }
else if (Version.getMajor() < 10) {
1280 if (Version.getMajor() == 0)
1303 if (Version.getMajor() == 0)
1320 if (Version.getMajor() == 0)
1321 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 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
static StringRef getObjectFormatTypeName(ObjectFormatType ObjectFormat)
Get the name for the Object format.
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.