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";
246 case LiteOS:
return "liteos";
255 case Android:
return "android";
256 case CODE16:
return "code16";
257 case CoreCLR:
return "coreclr";
258 case Cygnus:
return "cygnus";
259 case EABI:
return "eabi";
260 case EABIHF:
return "eabihf";
261 case GNU:
return "gnu";
264 case GNUEABI:
return "gnueabi";
266 case GNUF32:
return "gnuf32";
267 case GNUF64:
return "gnuf64";
268 case GNUSF:
return "gnusf";
269 case GNUX32:
return "gnux32";
271 case Itanium:
return "itanium";
272 case MSVC:
return "msvc";
273 case MacABI:
return "macabi";
274 case Musl:
return "musl";
277 case MuslX32:
return "muslx32";
279 case Pixel:
return "pixel";
280 case Vertex:
return "vertex";
282 case Hull:
return "hull";
283 case Domain:
return "domain";
284 case Compute:
return "compute";
285 case Library:
return "library";
288 case AnyHit:
return "anyhit";
290 case Miss:
return "miss";
292 case Mesh:
return "mesh";
303 case COFF:
return "coff";
304 case ELF:
return "elf";
305 case GOFF:
return "goff";
306 case MachO:
return "macho";
307 case Wasm:
return "wasm";
308 case XCOFF:
return "xcoff";
310 case SPIRV:
return "spirv";
316 if (ArchName.
equals(
"bpf")) {
321 }
else if (ArchName.
equals(
"bpf_be") || ArchName.
equals(
"bpfeb")) {
323 }
else if (ArchName.
equals(
"bpf_le") || ArchName.
equals(
"bpfel")) {
445 if (ArchName.
empty())
493 .
Cases(
"mips",
"mipseb",
"mipsallegrex",
"mipsisa32r6",
495 .
Cases(
"mipsel",
"mipsallegrexel",
"mipsisa32r6el",
"mipsr6el",
497 .
Cases(
"mips64",
"mips64eb",
"mipsn32",
"mipsisa64r6",
499 .
Cases(
"mips64el",
"mipsn32el",
"mipsisa64r6el",
"mips64r6el",
523 .
Cases(
"spirv32",
"spirv32v1.0",
"spirv32v1.1",
"spirv32v1.2",
525 .
Cases(
"spirv64",
"spirv64v1.0",
"spirv64v1.1",
"spirv64v1.2",
684 if (SubArchName ==
"powerpcspe")
687 if (SubArchName ==
"arm64e")
690 if (SubArchName ==
"arm64ec")
706 if (ARMSubArch.
empty())
715 case ARM::ArchKind::ARMV4:
717 case ARM::ArchKind::ARMV4T:
719 case ARM::ArchKind::ARMV5T:
721 case ARM::ArchKind::ARMV5TE:
722 case ARM::ArchKind::IWMMXT:
723 case ARM::ArchKind::IWMMXT2:
724 case ARM::ArchKind::XSCALE:
725 case ARM::ArchKind::ARMV5TEJ:
727 case ARM::ArchKind::ARMV6:
729 case ARM::ArchKind::ARMV6K:
730 case ARM::ArchKind::ARMV6KZ:
732 case ARM::ArchKind::ARMV6T2:
734 case ARM::ArchKind::ARMV6M:
736 case ARM::ArchKind::ARMV7A:
737 case ARM::ArchKind::ARMV7R:
739 case ARM::ArchKind::ARMV7VE:
741 case ARM::ArchKind::ARMV7K:
743 case ARM::ArchKind::ARMV7M:
745 case ARM::ArchKind::ARMV7S:
747 case ARM::ArchKind::ARMV7EM:
749 case ARM::ArchKind::ARMV8A:
751 case ARM::ArchKind::ARMV8_1A:
753 case ARM::ArchKind::ARMV8_2A:
755 case ARM::ArchKind::ARMV8_3A:
757 case ARM::ArchKind::ARMV8_4A:
759 case ARM::ArchKind::ARMV8_5A:
761 case ARM::ArchKind::ARMV8_6A:
763 case ARM::ArchKind::ARMV8_7A:
765 case ARM::ArchKind::ARMV8_8A:
767 case ARM::ArchKind::ARMV8_9A:
769 case ARM::ArchKind::ARMV9A:
771 case ARM::ArchKind::ARMV9_1A:
773 case ARM::ArchKind::ARMV9_2A:
775 case ARM::ArchKind::ARMV9_3A:
777 case ARM::ArchKind::ARMV9_4A:
779 case ARM::ArchKind::ARMV8R:
781 case ARM::ArchKind::ARMV8MBaseline:
783 case ARM::ArchKind::ARMV8MMainline:
785 case ARM::ArchKind::ARMV8_1MMainline:
793 switch (
T.getArch()) {
803 else if (
T.isOSWindows())
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);
1814 return *
this ==
Other;
1820 if (
Other.isOSVersionLT(*
this))
1827 unsigned Micro)
const {
1838 assert(Major >= 11 &&
"Unexpected major version");
1892 "incorrect HLSL stage order");
1894 "incorrect HLSL stage order");
1896 "incorrect HLSL stage order");
1898 "incorrect HLSL stage order");
1900 "incorrect HLSL stage order");
1902 "incorrect HLSL stage order");
1904 "incorrect HLSL stage order");
1906 "incorrect HLSL stage order");
1908 "incorrect HLSL stage order");
1910 "incorrect HLSL stage order");
1912 "incorrect HLSL stage order");
1914 "incorrect HLSL stage order");
1916 "incorrect HLSL stage order");
1918 "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.