1//===-- llvm/TargetParser/Triple.h - Target triple helper class--*- C++ -*-===// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7//===----------------------------------------------------------------------===// 9#ifndef LLVM_TARGETPARSER_TRIPLE_H 10#define LLVM_TARGETPARSER_TRIPLE_H 15// Some system headers or GCC predefined macros conflict with identifiers in 16// this file. Undefine them here. 23/// Triple - Helper class for working with autoconf configuration names. For 24/// historical reasons, we also call these 'triples' (they used to contain 25/// exactly three fields). 27/// Configuration names are strings in the canonical form: 28/// ARCHITECTURE-VENDOR-OPERATING_SYSTEM 30/// ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT 32/// This class is used for clients which want to support arbitrary 33/// configuration names, but also want to implement certain special 34/// behavior for particular configurations. This class isolates the mapping 35/// from the components of the configuration name to well known IDs. 37/// At its core the Triple class is designed to be a wrapper for a triple 38/// string; the constructor does not change or normalize the triple string. 39/// Clients that need to handle the non-canonical triples that users often 40/// specify should use the normalize method. 42/// See autoconf/config.guess for a glimpse into what configuration names 43/// look like in practice. 49arm,
// ARM (little endian): arm, armv.*, xscale 51aarch64,
// AArch64 (little endian): aarch64 54arc,
// ARC: Synopsys ARC 55avr,
// AVR: Atmel AVR microcontroller 56bpfel,
// eBPF or extended BPF or 64-bit BPF (little endian) 57bpfeb,
// eBPF or extended BPF or 64-bit BPF (big endian) 59dxil,
// DXIL 32-bit DirectX bytecode 63m68k,
// M68k: Motorola 680x0 family 64mips,
// MIPS: mips, mipsallegrex, mipsr6 65mipsel,
// MIPSEL: mipsel, mipsallegrexe, mipsr6el 66mips64,
// MIPS64: mips64, mips64r6, mipsn32, mipsn32r6 67mips64el,
// MIPS64EL: mips64el, mips64r6el, mipsn32el, mipsn32r6el 70ppcle,
// PPCLE: powerpc (little endian) 73r600,
// R600: AMD GPUs HD2XXX - HD6XXX 79sparcel,
// Sparc: (endianness = little). NB: 'Sparcle' is a CPU variant 81tce,
// TCE (http://tce.cs.tut.fi/): tce 82tcele,
// TCE little endian (http://tce.cs.tut.fi/): tcele 83thumb,
// Thumb (little endian): thumb, thumbv.* 95spir,
// SPIR: standard portable IR for OpenCL 32-bit version 96spir64,
// SPIR: standard portable IR for OpenCL 64-bit version 97spirv,
// SPIR-V with logical memory layout. 101shave,
// SHAVE: Movidius vector VLIW processors 103wasm32,
// WebAssembly with 32-bit pointers 104wasm64,
// WebAssembly with 64-bit pointers 107ve,
// NEC SX-Aurora Vector Engine 159// SPIR-V sub-arch corresponds to its version. 168// DXIL sub-arch corresponds to its version. 236WASI,
// Experimental WebAssembly OS 278Simulator,
// Simulator variants of other systems, e.g., Apple's iOS 279MacABI,
// Mac Catalyst variant of Apple's iOS deployment target. 282// The order of these values matters, and must be kept in sync with the 283// language options enum in Clang. The ordering is enforced in 284// static_asserts in Triple.cpp and in Clang. 323 /// The parsed arch type. 326 /// The parsed subarchitecture type. 329 /// The parsed vendor type. 332 /// The parsed OS type. 335 /// The parsed Environment type. 338 /// The object format type. 342 /// @name Constructors 345 /// Default constructor is the same as an empty string and leaves all 346 /// triple fields unknown. 352constTwine &EnvironmentStr);
355return Arch ==
Other.Arch && SubArch ==
Other.SubArch &&
357 Environment ==
Other.Environment &&
358 ObjectFormat ==
Other.ObjectFormat;
362return !(*
this ==
Other);
366 /// @name Normalization 372THREE_IDENT = 3,
// ARCHITECTURE-VENDOR-OPERATING_SYSTEM 373FOUR_IDENT = 4,
// ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT 374FIVE_IDENT = 5,
// ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT-FORMAT 377 /// Turn an arbitrary machine specification into the canonical triple form (or 378 /// something sensible that the Triple class understands if nothing better can 379 /// reasonably be done). In particular, it handles the common case in which 380 /// otherwise valid components are in the wrong order. \p Form is used to 381 /// specify the output canonical form. 385 /// Return the normalized form of this triple's string. 391 /// @name Typed Component Access 394 /// Get the parsed architecture type of this triple. 397 /// get the parsed subarchitecture type for this triple. 400 /// Get the parsed vendor type of this triple. 403 /// Get the parsed operating system type of this triple. 406 /// Does this triple have the optional environment (fourth) component? 411 /// Get the parsed environment type of this triple. 414 /// Parse the version number from the OS name component of the 415 /// triple, if present. 417 /// For example, "fooos1.2.3" would return (1, 2, 3). 420 /// Get the object format for this triple. 423 /// Parse the version number from the OS name component of the triple, if 426 /// For example, "fooos1.2.3" would return (1, 2, 3). 429 /// Return just the major version number, this is specialized because it is a 433 /// Parse the version number as with getOSVersion and then translate generic 434 /// "darwin" versions to the corresponding OS X versions. This may also be 435 /// called with IOS triples but the OS X version number is just set to a 436 /// constant 10.4.0 in that case. Returns true if successful. 439 /// Parse the version number as with getOSVersion. This should only be called 440 /// with IOS or generic triples. 443 /// Parse the version number as with getOSVersion. This should only be called 444 /// with WatchOS or generic triples. 447 /// Parse the version number as with getOSVersion. 450 /// Parse the Vulkan version number from the OSVersion and SPIR-V version 451 /// (SubArch). This should only be called with Vulkan SPIR-V triples. 454 /// Parse the DXIL version number from the OSVersion and DXIL version 455 /// (SubArch). This should only be called with DXIL triples. 459 /// @name Direct Component Access 462const std::string &
str()
const{
return Data; }
466 /// Get the architecture (first) component of the triple. 469 /// Get the vendor (second) component of the triple. 472 /// Get the operating system (third) component of the triple. 475 /// Get the optional environment (fourth) component of the triple, or "" if 479 /// Get the operating system and optional environment components as a single 480 /// string (separated by a '-' if the environment component is present). 483 /// Get the version component of the environment component as a single 484 /// string (the version after the environment). 486 /// For example, "fooos1.2.3" would return "1.2.3". 490 /// @name Convenience Predicates 493 /// Returns the pointer width of this architecture. 496 /// Returns the pointer width of this architecture. 501 /// Returns the trampoline size in bytes for this configuration. 504 /// Test whether the architecture is 64-bit 506 /// Note that this tests for 64-bit pointer width, and nothing else. Note 507 /// that we intentionally expose only three predicates, 64-bit, 32-bit, and 508 /// 16-bit. The inner details of pointer width for particular architectures 509 /// is not summed up in the triple, and so only a coarse grained predicate 510 /// system is provided. 513 /// Test whether the architecture is 32-bit 515 /// Note that this tests for 32-bit pointer width, and nothing else. 518 /// Test whether the architecture is 16-bit 520 /// Note that this tests for 16-bit pointer width, and nothing else. 523 /// Helper function for doing comparisons against version numbers included in 524 /// the target triple. 526unsigned Micro = 0)
const{
540 /// Comparison function for checking OS X version compatibility, which handles 541 /// supporting skewed version numbering schemes used by the "darwin" triples. 543unsigned Micro = 0)
const;
545 /// Is this a Mac OS X triple. For legacy reasons, we support both "darwin" 546 /// and "osx" as OS X triples. 551 /// Is this an iOS triple. 552 /// Note: This identifies tvOS as a variant of iOS. If that ever 553 /// changes, i.e., if the two operating systems diverge or their version 554 /// numbers get out of sync, that will need to be changed. 555 /// watchOS has completely different version numbers so it is not included. 560 /// Is this an Apple tvOS triple. 565 /// Is this an Apple watchOS triple. 574 /// Is this an Apple XROS triple. 577 /// Is this an Apple DriverKit triple. 582 /// Is this an Apple MachO triple. 587 /// Is this a "Darwin" OS (macOS, iOS, tvOS, watchOS, XROS, or DriverKit). 600 /// Returns true for targets that run on a macOS machine. 644 /// Tests whether the OS is Haiku. 649 /// Tests whether the OS is UEFI. 654 /// Tests whether the OS is Windows. 659 /// Checks if the environment is MSVC. 664 /// Checks if the environment could be MSVC. 670// Checks if we're using the Windows Arm64EC ABI. 692 /// Tests for either Cygwin or MinGW OS 697 /// Is this a "Windows" OS targeting a "MSVCRT.dll" environment. 703 /// Tests whether the OS is NaCl (Native Client) 708 /// Tests whether the OS is Linux. 713 /// Tests whether the OS is kFreeBSD. 718 /// Tests whether the OS is Hurd. 723 /// Tests whether the OS is WASI. 728 /// Tests whether the OS is Emscripten. 733 /// Tests whether the OS uses glibc. 740 /// Tests whether the OS is AIX. 749 /// Tests whether the OS uses the ELF binary format. 754 /// Tests whether the OS uses the COFF binary format. 759 /// Tests whether the OS uses the GOFF binary format. 762 /// Tests whether the environment is MachO. 767 /// Tests whether the OS uses the Wasm binary format. 772 /// Tests whether the OS uses the XCOFF binary format. 777 /// Tests whether the OS uses the DXContainer binary format. 782 /// Tests whether the target is the PS4 platform. 789 /// Tests whether the target is the PS5 platform. 796 /// Tests whether the target is the PS4 or PS5 platform. 799 /// Tests whether the target is Android 807// 64-bit targets did not exist before API level 21 (Lollipop). 814 /// Tests whether the environment is musl-libc 827 /// Tests whether the target is OHOS 828 /// LiteOS default enviroment is also OHOS, but omited on triple. 835 /// Tests whether the target is DXIL. 858 /// Tests whether the target is SPIR (32- or 64-bit). 863 /// Tests whether the target is SPIR-V (32/64-bit/Logical). 869// Tests whether the target is SPIR-V or SPIR. 872 /// Tests whether the target is SPIR-V Logical 877 /// Tests whether the target is NVPTX (32- or 64-bit). 882 /// Tests whether the target is AMDGCN 889 /// Tests whether the target is Thumb (little and big endian). 894 /// Tests whether the target is ARM (little and big endian). 899 /// Tests whether the target supports the EHABI exception 900 /// handling standard. 915 /// Tests whether the target is T32. 935 /// Tests whether the target is an M-class. 950 /// Tests whether the target is AArch64 (little and big endian). 956 /// Tests whether the target is AArch64 and pointers are the size specified by 959assert(PointerWidth == 64 || PointerWidth == 32);
965 : PointerWidth == 64;
968 /// Tests whether the target is 32-bit LoongArch. 971 /// Tests whether the target is 64-bit LoongArch. 974 /// Tests whether the target is LoongArch (32- and 64-bit). 977 /// Tests whether the target is MIPS 32-bit (little and big endian). 982 /// Tests whether the target is MIPS 64-bit (little and big endian). 987 /// Tests whether the target is MIPS (little and big endian, 32- or 64-bit). 992 /// Tests whether the target is PowerPC (32- or 64-bit LE or BE). 998 /// Tests whether the target is 32-bit PowerPC (little and big endian). 1003 /// Tests whether the target is 64-bit PowerPC (little and big endian). 1008 /// Tests whether the target 64-bit PowerPC big endian ABI is ELFv2. 1016 /// Tests whether the target 32-bit PowerPC uses Secure PLT. 1025 /// Tests whether the target is 32-bit RISC-V. 1028 /// Tests whether the target is 64-bit RISC-V. 1031 /// Tests whether the target is RISC-V (32- and 64-bit). 1034 /// Tests whether the target is 32-bit SPARC (little and big endian). 1039 /// Tests whether the target is 64-bit SPARC (big endian). 1042 /// Tests whether the target is SPARC. 1045 /// Tests whether the target is SystemZ. 1050 /// Tests whether the target is x86 (32- or 64-bit). 1055 /// Tests whether the target is VE 1060 /// Tests whether the target is wasm (32- and 64-bit). 1065// Tests whether the target is CSKY 1070 /// Tests whether the target is the Apple "arm64e" AArch64 subarch. 1076// Tests whether the target is N32. 1082 /// Tests whether the target is X32. 1088 /// Tests whether the target is eBPF. 1093 /// Tests if the target forces 64-bit time_t on a 32-bit architecture. 1100 /// Tests if the target forces hardfloat. 1109 /// Tests whether the target supports comdat 1115 /// Tests whether the target uses emulated TLS as default. 1117 /// Note: Android API level 29 (10) introduced ELF TLS. 1123 /// True if the target supports both general-dynamic and TLSDESC, and TLSDESC 1124 /// is enabled by default. 1127 /// Tests whether the target uses -data-sections as default. 1132 /// Tests if the environment supports dllimport/export annotations. 1139 /// Set the architecture (first) component of the triple to a known type. 1142 /// Set the vendor (second) component of the triple to a known type. 1145 /// Set the operating system (third) component of the triple to a known type. 1148 /// Set the environment (fourth) component of the triple to a known type. 1151 /// Set the object file format. 1154 /// Set all components to the new triple \p Str. 1157 /// Set the architecture (first) component of the triple by name. 1160 /// Set the vendor (second) component of the triple by name. 1163 /// Set the operating system (third) component of the triple by name. 1166 /// Set the optional environment (fourth) component of the triple by name. 1169 /// Set the operating system and optional environment components with a single 1174 /// @name Helpers to build variants of a particular triple. 1177 /// Form a triple with a 32-bit variant of the current architecture. 1179 /// This can be used to move across "families" of architectures where useful. 1181 /// \returns A new triple with a 32-bit architecture or an unknown 1182 /// architecture if no such variant can be found. 1185 /// Form a triple with a 64-bit variant of the current architecture. 1187 /// This can be used to move across "families" of architectures where useful. 1189 /// \returns A new triple with a 64-bit architecture or an unknown 1190 /// architecture if no such variant can be found. 1193 /// Form a triple with a big endian variant of the current architecture. 1195 /// This can be used to move across "families" of architectures where useful. 1197 /// \returns A new triple with a big endian architecture or an unknown 1198 /// architecture if no such variant can be found. 1201 /// Form a triple with a little endian variant of the current architecture. 1203 /// This can be used to move across "families" of architectures where useful. 1205 /// \returns A new triple with a little endian architecture or an unknown 1206 /// architecture if no such variant can be found. 1209 /// Tests whether the target triple is little endian. 1211 /// \returns true if the triple is little endian, false otherwise. 1214 /// Test whether target triples are compatible. 1217 /// Merge target triples. 1220 /// Some platforms have different minimum supported OS versions that 1221 /// varies by the architecture specified in the triple. This function 1222 /// returns the minimum supported OS version for this triple if one an exists, 1223 /// or an invalid version tuple if this triple doesn't have one. 1227 /// @name Static helpers for IDs. 1230 /// Get the canonical name for the \p Kind architecture. 1233 /// Get the architecture name based on \p Kind and \p SubArch. 1236 /// Get the "prefix" canonical name for the \p Kind architecture. This is the 1237 /// prefix used by the architecture specific builtins, and is suitable for 1238 /// passing to \see Intrinsic::getIntrinsicForClangBuiltin(). 1240 /// \return - The architecture prefix, or 0 if none is defined. 1243 /// Get the canonical name for the \p Kind vendor. 1246 /// Get the canonical name for the \p Kind operating system. 1249 /// Get the canonical name for the \p Kind environment. 1252 /// Get the name for the \p Object format. 1256 /// @name Static helpers for converting alternate architecture names. 1259 /// The canonical type for the given LLVM architecture name (e.g., "x86"). 1264 /// Returns a canonicalized OS version number for the specified OS. 1269}
// End llvm namespace assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Defines the llvm::VersionTuple class, which represents a version in the form major[....
StringRef - Represent a constant reference to a string, i.e.
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.
bool isPPC() const
Tests whether the target is PowerPC (32- or 64-bit LE or BE).
bool isOSDragonFly() const
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.
bool isTargetMachineMac() const
Returns true for targets that run on a macOS machine.
bool isArmT32() const
Tests whether the target is T32.
bool isOSNaCl() const
Tests whether the OS is NaCl (Native Client)
void setObjectFormat(ObjectFormatType Kind)
Set the object file format.
bool isAndroidVersionLT(unsigned Major) const
llvm::Triple get32BitArchVariant() const
Form a triple with a 32-bit variant of the current architecture.
bool isOSCygMing() const
Tests for either Cygwin or MinGW OS.
Triple()=default
Default constructor is the same as an empty string and leaves all triple fields unknown.
bool isThumb() const
Tests whether the target is Thumb (little and big endian).
bool isPS4() const
Tests whether the target is the PS4 platform.
bool isPPC64ELFv2ABI() const
Tests whether the target 64-bit PowerPC big endian ABI is ELFv2.
bool isOSWASI() const
Tests whether the OS is WASI.
bool isSPIR() const
Tests whether the target is SPIR (32- or 64-bit).
CanonicalForm
Canonical form.
bool isOSBinFormatWasm() const
Tests whether the OS uses the Wasm binary format.
bool isDriverKit() const
Is this an Apple DriverKit triple.
unsigned getArchPointerBitWidth() const
Returns the pointer width of this architecture.
llvm::Triple getLittleEndianArchVariant() const
Form a triple with a little endian variant of the current architecture.
bool isOSHurd() const
Tests whether the OS is Hurd.
bool isHardFloatABI() const
Tests if the target forces hardfloat.
bool isBPF() const
Tests whether the target is eBPF.
bool isX32() const
Tests whether the target is X32.
static StringRef getVendorTypeName(VendorType Kind)
Get the canonical name for the Kind vendor.
ObjectFormatType getObjectFormat() const
Get the object format for this triple.
bool isAArch64(int PointerWidth) const
Tests whether the target is AArch64 and pointers are the size specified by PointerWidth.
SubArchType getSubArch() const
get the parsed subarchitecture type for this triple.
bool isX86() const
Tests whether the target is x86 (32- or 64-bit).
bool isArm64e() const
Tests whether the target is the Apple "arm64e" AArch64 subarch.
std::string normalize(CanonicalForm Form=CanonicalForm::ANY) const
Return the normalized form of this triple's string.
bool isTargetEHABICompatible() const
Tests whether the target supports the EHABI exception handling standard.
bool isOSBinFormatGOFF() const
Tests whether the OS uses the GOFF binary format.
bool isWindowsGNUEnvironment() const
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.
bool isAndroid() const
Tests whether the target is Android.
bool hasDefaultTLSDESC() const
True if the target supports both general-dynamic and TLSDESC, and TLSDESC is enabled by default.
llvm::Triple get64BitArchVariant() const
Form a triple with a 64-bit variant of the current architecture.
bool isOSMSVCRT() const
Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
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.
bool supportsCOMDAT() const
Tests whether the target supports comdat.
bool isWindowsCoreCLREnvironment() const
bool isSPIROrSPIRV() const
bool isMIPS64() const
Tests whether the target is MIPS 64-bit (little and big endian).
bool hasDefaultDataSections() const
Tests whether the target uses -data-sections as default.
bool isRISCV32() const
Tests whether the target is 32-bit RISC-V.
bool isOSKFreeBSD() const
Tests whether the OS is kFreeBSD.
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 std::string normalize(StringRef Str, CanonicalForm Form=CanonicalForm::ANY)
Turn an arbitrary machine specification into the canonical triple form (or something sensible that th...
static ArchType getArchTypeForLLVMName(StringRef Str)
The canonical type for the given LLVM architecture name (e.g., "x86").
bool isOSVersionLT(const Triple &Other) const
bool isPPC32() const
Tests whether the target is 32-bit PowerPC (little and big endian).
ArchType getArch() const
Get the parsed architecture type of this triple.
unsigned getTrampolineSize() const
Returns the trampoline size in bytes for this configuration.
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
bool isRISCV64() const
Tests whether the target is 64-bit RISC-V.
bool isLoongArch64() const
Tests whether the target is 64-bit LoongArch.
StringRef getEnvironmentName() const
Get the optional environment (fourth) component of the triple, or "" if empty.
bool isSPARC32() const
Tests whether the target is 32-bit SPARC (little and big endian).
bool isSimulatorEnvironment() const
VersionTuple getDXILVersion() const
Parse the DXIL version number from the OSVersion and DXIL version (SubArch).
const std::string & str() const
bool isOSSerenity() const
bool isOHOSFamily() const
Tests whether the target is OHOS LiteOS default enviroment is also OHOS, but omited on triple.
EnvironmentType getEnvironment() const
Get the parsed environment type of this triple.
VersionTuple getVulkanVersion() const
Parse the Vulkan version number from the OSVersion and SPIR-V version (SubArch).
VersionTuple getDriverKitVersion() const
Parse the version number as with getOSVersion.
bool isMIPS32() const
Tests whether the target is MIPS 32-bit (little and big endian).
bool isShaderModelOS() const
bool isUEFI() const
Tests whether the OS is UEFI.
bool isOSWindows() const
Tests whether the OS is Windows.
bool isMusl() const
Tests whether the environment is musl-libc.
const std::string & getTriple() const
static StringRef getArchTypeName(ArchType Kind)
Get the canonical name for the Kind architecture.
bool isOSBinFormatDXContainer() const
Tests whether the OS uses the DXContainer binary format.
bool isOSBinFormatXCOFF() const
Tests whether the OS uses the XCOFF binary format.
static StringRef getOSTypeName(OSType Kind)
Get the canonical name for the Kind operating system.
bool isARM() const
Tests whether the target is ARM (little and big endian).
std::string merge(const Triple &Other) const
Merge target triples.
bool isArmMClass() const
Tests whether the target is an M-class.
bool isOSLinux() const
Tests whether the OS is Linux.
bool isRISCV() const
Tests whether the target is RISC-V (32- and 64-bit).
bool isAMDGCN() const
Tests whether the target is AMDGCN.
bool isLoongArch32() const
Tests whether the target is 32-bit LoongArch.
@ ImaginationTechnologies
bool isNVPTX() const
Tests whether the target is NVPTX (32- or 64-bit).
bool isOSAIX() const
Tests whether the OS is AIX.
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 isSPARC64() const
Tests whether the target is 64-bit SPARC (big endian).
bool isWindowsCygwinEnvironment() const
bool isMacOSX() const
Is this a Mac OS X triple.
bool isXROS() const
Is this an Apple XROS 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.
bool isSPARC() const
Tests whether the target is SPARC.
bool isPPC64() const
Tests whether the target is 64-bit PowerPC (little and big endian).
bool isOSDarwin() const
Is this a "Darwin" OS (macOS, iOS, tvOS, watchOS, XROS, or DriverKit).
bool hasDLLImportExport() const
Tests if the environment supports dllimport/export annotations.
bool isSPIRVLogical() const
Tests whether the target is SPIR-V Logical.
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.
bool isTvOS() const
Is this an Apple tvOS triple.
bool isOSEmscripten() const
Tests whether the OS is Emscripten.
bool isWindowsArm64EC() const
bool operator==(const Triple &Other) const
bool isWatchOS() const
Is this an Apple watchOS triple.
bool isiOS() const
Is this an iOS triple.
bool isMIPS() const
Tests whether the target is MIPS (little and big endian, 32- or 64-bit).
bool isOSGlibc() const
Tests whether the OS uses glibc.
static VersionTuple getCanonicalVersionForOS(OSType OSKind, const VersionTuple &Version)
Returns a canonicalized OS version number for the specified OS.
bool isPS() const
Tests whether the target is the PS4 or PS5 platform.
bool isWasm() const
Tests whether the target is wasm (32- and 64-bit).
StringRef getArchName() const
Get the architecture (first) component of the triple.
bool isMacCatalystEnvironment() const
bool isPS5() const
Tests whether the target is the PS5 platform.
bool isSPIRV() const
Tests whether the target is SPIR-V (32/64-bit/Logical).
bool isAArch64() const
Tests whether the target is AArch64 (little and big endian).
static StringRef getObjectFormatTypeName(ObjectFormatType ObjectFormat)
Get the name for the Object format.
bool isAppleMachO() const
Is this an Apple MachO triple.
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 hasDefaultEmulatedTLS() const
Tests whether the target uses emulated TLS as default.
bool isSystemZ() const
Tests whether the target is SystemZ.
StringRef getEnvironmentVersionString() const
Get the version component of the environment component as a single string (the version after the envi...
bool isPPC32SecurePlt() const
Tests whether the target 32-bit PowerPC uses Secure PLT.
bool isTime64ABI() const
Tests if the target forces 64-bit time_t on a 32-bit architecture.
bool isArch32Bit() const
Test whether the architecture is 32-bit.
bool operator!=(const Triple &Other) const
unsigned getOSMajorVersion() const
Return just the major version number, this is specialized because it is a common query.
bool isCompatibleWith(const Triple &Other) const
Test whether target triples are compatible.
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
bool isWindowsMSVCEnvironment() const
Checks if the environment could be MSVC.
bool hasEnvironment() const
Does this triple have the optional environment (fourth) component?
bool isKnownWindowsMSVCEnvironment() const
Checks if the environment is MSVC.
static StringRef getArchTypePrefix(ArchType Kind)
Get the "prefix" canonical name for the Kind architecture.
bool isOSHaiku() const
Tests whether the OS is Haiku.
void setArch(ArchType Kind, SubArchType SubArch=NoSubArch)
Set the architecture (first) component of the triple to a known type.
bool isDXIL() const
Tests whether the target is DXIL.
void setVendor(VendorType Kind)
Set the vendor (second) component of the triple to a known type.
bool isGNUEnvironment() const
bool isLoongArch() const
Tests whether the target is LoongArch (32- and 64-bit).
bool isShaderStageEnvironment() const
bool isWindowsItaniumEnvironment() const
bool isVE() const
Tests whether the target is VE.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Represents a version number in the form major[.minor[.subminor[.build]]].
unsigned getMajor() const
Retrieve the major version number.
This is an optimization pass for GlobalISel generic memory operations.