LLVM 22.0.0git
llvm::Triple Class Reference

Triple - Helper class for working with autoconf configuration names. More...

#include "llvm/TargetParser/Triple.h"

Public Types

enum  ArchType {
  UnknownArch , arm , armeb , aarch64 ,
  aarch64_be , aarch64_32 , arc , avr ,
  bpfel , bpfeb , csky , dxil ,
  hexagon , loongarch32 , loongarch64 , m68k ,
  mips , mipsel , mips64 , mips64el ,
  msp430 , ppc , ppcle , ppc64 ,
  ppc64le , r600 , amdgcn , riscv32 ,
  riscv64 , riscv32be , riscv64be , sparc ,
  sparcv9 , sparcel , systemz , tce ,
  tcele , thumb , thumbeb , x86 ,
  x86_64 , xcore , xtensa , nvptx ,
  nvptx64 , amdil , amdil64 , hsail ,
  hsail64 , spir , spir64 , spirv ,
  spirv32 , spirv64 , kalimba , shave ,
  lanai , wasm32 , wasm64 , renderscript32 ,
  renderscript64 , ve , LastArchType = ve
}
enum  SubArchType {
  NoSubArch , ARMSubArch_v9_6a , ARMSubArch_v9_5a , ARMSubArch_v9_4a ,
  ARMSubArch_v9_3a , ARMSubArch_v9_2a , ARMSubArch_v9_1a , ARMSubArch_v9 ,
  ARMSubArch_v8_9a , ARMSubArch_v8_8a , ARMSubArch_v8_7a , ARMSubArch_v8_6a ,
  ARMSubArch_v8_5a , ARMSubArch_v8_4a , ARMSubArch_v8_3a , ARMSubArch_v8_2a ,
  ARMSubArch_v8_1a , ARMSubArch_v8 , ARMSubArch_v8r , ARMSubArch_v8m_baseline ,
  ARMSubArch_v8m_mainline , ARMSubArch_v8_1m_mainline , ARMSubArch_v7 , ARMSubArch_v7em ,
  ARMSubArch_v7m , ARMSubArch_v7s , ARMSubArch_v7k , ARMSubArch_v7ve ,
  ARMSubArch_v6 , ARMSubArch_v6m , ARMSubArch_v6k , ARMSubArch_v6t2 ,
  ARMSubArch_v5 , ARMSubArch_v5te , ARMSubArch_v4t , AArch64SubArch_arm64e ,
  AArch64SubArch_arm64ec , KalimbaSubArch_v3 , KalimbaSubArch_v4 , KalimbaSubArch_v5 ,
  MipsSubArch_r6 , PPCSubArch_spe , SPIRVSubArch_v10 , SPIRVSubArch_v11 ,
  SPIRVSubArch_v12 , SPIRVSubArch_v13 , SPIRVSubArch_v14 , SPIRVSubArch_v15 ,
  SPIRVSubArch_v16 , DXILSubArch_v1_0 , DXILSubArch_v1_1 , DXILSubArch_v1_2 ,
  DXILSubArch_v1_3 , DXILSubArch_v1_4 , DXILSubArch_v1_5 , DXILSubArch_v1_6 ,
  DXILSubArch_v1_7 , DXILSubArch_v1_8 , DXILSubArch_v1_9 , LatestDXILSubArch = DXILSubArch_v1_9
}
enum  VendorType {
  UnknownVendor , Apple , PC , SCEI ,
  Freescale , IBM , ImaginationTechnologies , MipsTechnologies ,
  NVIDIA , CSR , AMD , Mesa ,
  SUSE , OpenEmbedded , Intel , Meta ,
  LastVendorType = Meta
}
enum  OSType {
  UnknownOS , Darwin , DragonFly , FreeBSD ,
  Fuchsia , IOS , KFreeBSD , Linux ,
  Lv2 , MacOSX , Managarm , NetBSD ,
  OpenBSD , Solaris , UEFI , Win32 ,
  ZOS , Haiku , RTEMS , AIX ,
  CUDA , NVCL , AMDHSA , PS4 ,
  PS5 , ELFIAMCU , TvOS , WatchOS ,
  BridgeOS , DriverKit , XROS , Mesa3D ,
  AMDPAL , HermitCore , Hurd , WASI ,
  Emscripten , ShaderModel , LiteOS , Serenity ,
  Vulkan , CheriotRTOS , LastOSType = CheriotRTOS
}
enum  EnvironmentType {
  UnknownEnvironment , GNU , GNUT64 , GNUABIN32 ,
  GNUABI64 , GNUEABI , GNUEABIT64 , GNUEABIHF ,
  GNUEABIHFT64 , GNUF32 , GNUF64 , GNUSF ,
  GNUX32 , GNUILP32 , CODE16 , EABI ,
  EABIHF , Android , Musl , MuslABIN32 ,
  MuslABI64 , MuslEABI , MuslEABIHF , MuslF32 ,
  MuslSF , MuslX32 , LLVM , MSVC ,
  Itanium , Cygnus , CoreCLR , Simulator ,
  MacABI , Pixel , Vertex , Geometry ,
  Hull , Domain , Compute , Library ,
  RayGeneration , Intersection , AnyHit , ClosestHit ,
  Miss , Callable , Mesh , Amplification ,
  RootSignature , OpenCL , OpenHOS , Mlibc ,
  PAuthTest , MTIA , LastEnvironmentType = MTIA
}
enum  ObjectFormatType {
  UnknownObjectFormat , COFF , DXContainer , ELF ,
  GOFF , MachO , SPIRV , Wasm ,
  XCOFF
}

Public Member Functions

LLVM_ABI ExceptionHandling getDefaultExceptionHandling () const
LLVM_ABI std::string computeDataLayout (StringRef ABIName="") const
 Compute the LLVM IR data layout string based on the triple.
Constructors
 Triple ()=default
 Default constructor is the same as an empty string and leaves all triple fields unknown.
LLVM_ABI Triple (std::string &&Str)
 Construct a triple from the string representation provided.
 Triple (StringRef Str)
 Triple (const char *Str)
 Triple (const std::string &Str)
LLVM_ABI Triple (const Twine &Str)
LLVM_ABI Triple (const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr)
 Construct a triple from string representations of the architecture, vendor, and OS.
LLVM_ABI Triple (const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr, const Twine &EnvironmentStr)
 Construct a triple from string representations of the architecture, vendor, OS, and environment.
bool operator== (const Triple &Other) const
bool operator!= (const Triple &Other) const
Typed Component Access
ArchType getArch () const
 Get the parsed architecture type of this triple.
SubArchType getSubArch () const
 get the parsed subarchitecture type for this triple.
VendorType getVendor () const
 Get the parsed vendor type of this triple.
OSType getOS () const
 Get the parsed operating system type of this triple.
bool hasEnvironment () const
 Does this triple have the optional environment (fourth) component?
EnvironmentType getEnvironment () const
 Get the parsed environment type of this triple.
LLVM_ABI VersionTuple getEnvironmentVersion () const
 Parse the version number from the OS name component of the triple, if present.
ObjectFormatType getObjectFormat () const
 Get the object format for this triple.
LLVM_ABI VersionTuple getOSVersion () const
 Parse the version number from the OS name component of the triple, if present.
unsigned getOSMajorVersion () const
 Return just the major version number, this is specialized because it is a common query.
LLVM_ABI bool getMacOSXVersion (VersionTuple &Version) const
 Parse the version number as with getOSVersion and then translate generic "darwin" versions to the corresponding OS X versions.
LLVM_ABI VersionTuple getiOSVersion () const
 Parse the version number as with getOSVersion.
LLVM_ABI VersionTuple getWatchOSVersion () const
 Parse the version number as with getOSVersion.
LLVM_ABI VersionTuple getDriverKitVersion () const
 Parse the version number as with getOSVersion.
LLVM_ABI VersionTuple getVulkanVersion () const
 Parse the Vulkan version number from the OSVersion and SPIR-V version (SubArch).
LLVM_ABI VersionTuple getDXILVersion () const
 Parse the DXIL version number from the OSVersion and DXIL version (SubArch).
Direct Component Access
const std::string & str () const
const std::string & getTriple () const
bool empty () const
 Whether the triple is empty / default constructed.
LLVM_ABI StringRef getArchName () const
 Get the architecture (first) component of the triple.
LLVM_ABI StringRef getVendorName () const
 Get the vendor (second) component of the triple.
LLVM_ABI StringRef getOSName () const
 Get the operating system (third) component of the triple.
LLVM_ABI StringRef getEnvironmentName () const
 Get the optional environment (fourth) component of the triple, or "" if empty.
LLVM_ABI StringRef getOSAndEnvironmentName () const
 Get the operating system and optional environment components as a single string (separated by a '-' if the environment component is present).
LLVM_ABI StringRef getEnvironmentVersionString () const
 Get the version component of the environment component as a single string (the version after the environment).
Mutators
LLVM_ABI void setArch (ArchType Kind, SubArchType SubArch=NoSubArch)
 Set the architecture (first) component of the triple to a known type.
LLVM_ABI void setVendor (VendorType Kind)
 Set the vendor (second) component of the triple to a known type.
LLVM_ABI void setOS (OSType Kind)
 Set the operating system (third) component of the triple to a known type.
LLVM_ABI void setEnvironment (EnvironmentType Kind)
 Set the environment (fourth) component of the triple to a known type.
LLVM_ABI void setObjectFormat (ObjectFormatType Kind)
 Set the object file format.
LLVM_ABI void setTriple (const Twine &Str)
 Set all components to the new triple Str.
LLVM_ABI void setArchName (StringRef Str)
 Set the architecture (first) component of the triple by name.
LLVM_ABI void setVendorName (StringRef Str)
 Set the vendor (second) component of the triple by name.
LLVM_ABI void setOSName (StringRef Str)
 Set the operating system (third) component of the triple by name.
LLVM_ABI void setEnvironmentName (StringRef Str)
 Set the optional environment (fourth) component of the triple by name.
LLVM_ABI void setOSAndEnvironmentName (StringRef Str)
 Set the operating system and optional environment components with a single string.
Helpers to build variants of a particular triple.
LLVM_ABI llvm::Triple get32BitArchVariant () const
 Form a triple with a 32-bit variant of the current architecture.
LLVM_ABI llvm::Triple get64BitArchVariant () const
 Form a triple with a 64-bit variant of the current architecture.
LLVM_ABI llvm::Triple getBigEndianArchVariant () const
 Form a triple with a big endian variant of the current architecture.
LLVM_ABI llvm::Triple getLittleEndianArchVariant () const
 Form a triple with a little endian variant of the current architecture.
LLVM_ABI bool isLittleEndian () const
 Tests whether the target triple is little endian.
LLVM_ABI bool isCompatibleWith (const Triple &Other) const
 Test whether target triples are compatible.
bool isGPU () const
 Test whether the target triple is for a GPU.
LLVM_ABI std::string merge (const Triple &Other) const
 Merge target triples.
LLVM_ABI VersionTuple getMinimumSupportedOSVersion () const
 Some platforms have different minimum supported OS versions that varies by the architecture specified in the triple.

Static Public Member Functions

static LLVM_ABI VersionTuple getCanonicalVersionForOS (OSType OSKind, const VersionTuple &Version, bool IsInValidRange)
 Returns a canonicalized OS version number for the specified OS.
static LLVM_ABI bool isValidVersionForOS (OSType OSKind, const VersionTuple &Version)
 Returns whether an OS version is invalid and would not map to an Apple OS.
Static helpers for IDs.
static LLVM_ABI StringRef getArchTypeName (ArchType Kind)
 Get the canonical name for the Kind architecture.
static LLVM_ABI StringRef getArchName (ArchType Kind, SubArchType SubArch=NoSubArch)
 Get the architecture name based on Kind and SubArch.
static LLVM_ABI StringRef getArchTypePrefix (ArchType Kind)
 Get the "prefix" canonical name for the Kind architecture.
static LLVM_ABI StringRef getVendorTypeName (VendorType Kind)
 Get the canonical name for the Kind vendor.
static LLVM_ABI StringRef getOSTypeName (OSType Kind)
 Get the canonical name for the Kind operating system.
static LLVM_ABI StringRef getEnvironmentTypeName (EnvironmentType Kind)
 Get the canonical name for the Kind environment.
static LLVM_ABI StringRef getObjectFormatTypeName (ObjectFormatType ObjectFormat)
 Get the name for the Object format.
Static helpers for converting alternate architecture names.
static LLVM_ABI ArchType getArchTypeForLLVMName (StringRef Str)
 The canonical type for the given LLVM architecture name (e.g., "x86").

Normalization

enum class  CanonicalForm { ANY = 0 , THREE_IDENT = 3 , FOUR_IDENT = 4 , FIVE_IDENT = 5 }
 Canonical form. More...
std::string normalize (CanonicalForm Form=CanonicalForm::ANY) const
 Return the normalized form of this triple's string.
static LLVM_ABI std::string normalize (StringRef Str, CanonicalForm Form=CanonicalForm::ANY)
 Turn an arbitrary machine specification into the canonical triple form (or something sensible that the Triple class understands if nothing better can reasonably be done).

Convenience Predicates

unsigned getArchPointerBitWidth () const
 Returns the pointer width of this architecture.
LLVM_ABI unsigned getTrampolineSize () const
 Returns the trampoline size in bytes for this configuration.
LLVM_ABI bool isArch64Bit () const
 Test whether the architecture is 64-bit.
LLVM_ABI bool isArch32Bit () const
 Test whether the architecture is 32-bit.
LLVM_ABI bool isArch16Bit () const
 Test whether the architecture is 16-bit.
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 isOSVersionLT (const Triple &Other) const
LLVM_ABI bool isMacOSXVersionLT (unsigned Major, unsigned Minor=0, unsigned Micro=0) const
 Comparison function for checking OS X version compatibility, which handles supporting skewed version numbering schemes used by the "darwin" triples.
bool isMacOSX () const
 Is this a Mac OS X triple.
bool isiOS () const
 Is this an iOS triple.
bool isTvOS () const
 Is this an Apple tvOS triple.
bool isWatchOS () const
 Is this an Apple watchOS triple.
bool isWatchABI () const
bool isXROS () const
 Is this an Apple XROS triple.
bool isBridgeOS () const
 Is this an Apple BridgeOS triple.
bool isDriverKit () const
 Is this an Apple DriverKit triple.
bool isOSzOS () const
bool isAppleMachO () const
 Is this an Apple MachO triple.
bool isOSDarwin () const
 Is this a "Darwin" OS (macOS, iOS, tvOS, watchOS, DriverKit, XROS, or bridgeOS).
bool isSimulatorEnvironment () const
bool isMacCatalystEnvironment () const
bool isTargetMachineMac () const
 Returns true for targets that run on a macOS machine.
bool isOSNetBSD () const
bool isOSOpenBSD () const
bool isOSFreeBSD () const
bool isOSFuchsia () const
bool isOSDragonFly () const
bool isOSSolaris () const
bool isOSIAMCU () const
bool isOSUnknown () const
bool isGNUEnvironment () const
bool isOSHaiku () const
 Tests whether the OS is Haiku.
bool isUEFI () const
 Tests whether the OS is UEFI.
bool isOSWindows () const
 Tests whether the OS is Windows.
bool isKnownWindowsMSVCEnvironment () const
 Checks if the environment is MSVC.
bool isWindowsMSVCEnvironment () const
 Checks if the environment could be MSVC.
bool isWindowsArm64EC () const
bool isWindowsCoreCLREnvironment () const
bool isWindowsItaniumEnvironment () const
bool isWindowsCygwinEnvironment () const
bool isWindowsGNUEnvironment () const
bool isOSCygMing () const
 Tests for either Cygwin or MinGW OS.
bool isOSMSVCRT () const
 Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
bool isOSLinux () const
 Tests whether the OS is Linux.
bool isOSKFreeBSD () const
 Tests whether the OS is kFreeBSD.
bool isOSHurd () const
 Tests whether the OS is Hurd.
bool isOSWASI () const
 Tests whether the OS is WASI.
bool isOSEmscripten () const
 Tests whether the OS is Emscripten.
bool isOSGlibc () const
 Tests whether the OS uses glibc.
bool isOSAIX () const
 Tests whether the OS is AIX.
bool isOSSerenity () const
bool isOSBinFormatELF () const
 Tests whether the OS uses the ELF binary format.
bool isOSBinFormatCOFF () const
 Tests whether the OS uses the COFF binary format.
bool isOSBinFormatGOFF () const
 Tests whether the OS uses the GOFF binary format.
bool isOSBinFormatMachO () const
 Tests whether the environment is MachO.
bool isOSBinFormatWasm () const
 Tests whether the OS uses the Wasm binary format.
bool isOSBinFormatXCOFF () const
 Tests whether the OS uses the XCOFF binary format.
bool isOSBinFormatDXContainer () const
 Tests whether the OS uses the DXContainer binary format.
bool isPS4 () const
 Tests whether the target is the PS4 platform.
bool isPS5 () const
 Tests whether the target is the PS5 platform.
bool isPS () const
 Tests whether the target is the PS4 or PS5 platform.
bool isAndroid () const
 Tests whether the target is Android.
bool isAndroidVersionLT (unsigned Major) const
bool isMusl () const
 Tests whether the environment is musl-libc.
bool isOHOSFamily () const
 Tests whether the target is OHOS LiteOS default enviroment is also OHOS, but omited on triple.
bool isOpenHOS () const
bool isOSLiteOS () const
bool isDXIL () const
 Tests whether the target is DXIL.
bool isShaderModelOS () const
bool isVulkanOS () const
bool isOSManagarm () const
bool isShaderStageEnvironment () const
bool isSPIR () const
 Tests whether the target is SPIR (32- or 64-bit).
bool isSPIRV () const
 Tests whether the target is SPIR-V (32/64-bit/Logical).
bool isSPIROrSPIRV () const
bool isSPIRVLogical () const
 Tests whether the target is SPIR-V Logical.
bool isNVPTX () const
 Tests whether the target is NVPTX (32- or 64-bit).
bool isAMDGCN () const
 Tests whether the target is AMDGCN.
bool isAMDGPU () const
bool isThumb () const
 Tests whether the target is Thumb (little and big endian).
bool isARM () const
 Tests whether the target is ARM (little and big endian).
bool isTargetEHABICompatible () const
 Tests whether the target supports the EHABI exception handling standard.
bool isTargetAEABI () const
bool isTargetGNUAEABI () const
bool isTargetMuslAEABI () const
bool isArmT32 () const
 Tests whether the target is T32.
bool isArmMClass () const
 Tests whether the target is an M-class.
bool isAArch64 () const
 Tests whether the target is AArch64 (little and big endian).
bool isAArch64 (int PointerWidth) const
 Tests whether the target is AArch64 and pointers are the size specified by PointerWidth.
bool isLoongArch32 () const
 Tests whether the target is 32-bit LoongArch.
bool isLoongArch64 () const
 Tests whether the target is 64-bit LoongArch.
bool isLoongArch () const
 Tests whether the target is LoongArch (32- and 64-bit).
bool isMIPS32 () const
 Tests whether the target is MIPS 32-bit (little and big endian).
bool isMIPS64 () const
 Tests whether the target is MIPS 64-bit (little and big endian).
bool isMIPS () const
 Tests whether the target is MIPS (little and big endian, 32- or 64-bit).
bool isPPC () const
 Tests whether the target is PowerPC (32- or 64-bit LE or BE).
bool isPPC32 () const
 Tests whether the target is 32-bit PowerPC (little and big endian).
bool isPPC64 () const
 Tests whether the target is 64-bit PowerPC (little and big endian).
bool isPPC64ELFv2ABI () const
 Tests whether the target 64-bit PowerPC big endian ABI is ELFv2.
bool isPPC32SecurePlt () const
 Tests whether the target 32-bit PowerPC uses Secure PLT.
bool isRISCV32 () const
 Tests whether the target is 32-bit RISC-V.
bool isRISCV64 () const
 Tests whether the target is 64-bit RISC-V.
bool isRISCV () const
 Tests whether the target is RISC-V (32- and 64-bit).
bool isSPARC32 () const
 Tests whether the target is 32-bit SPARC (little and big endian).
bool isSPARC64 () const
 Tests whether the target is 64-bit SPARC (big endian).
bool isSPARC () const
 Tests whether the target is SPARC.
bool isSystemZ () const
 Tests whether the target is SystemZ.
bool isX86 () const
 Tests whether the target is x86 (32- or 64-bit).
bool isVE () const
 Tests whether the target is VE.
bool isWasm () const
 Tests whether the target is wasm (32- and 64-bit).
bool isCSKY () const
bool isArm64e () const
 Tests whether the target is the Apple "arm64e" AArch64 subarch.
bool isABIN32 () const
bool isX32 () const
 Tests whether the target is X32.
bool isBPF () const
 Tests whether the target is eBPF.
bool isTime64ABI () const
 Tests if the target forces 64-bit time_t on a 32-bit architecture.
bool isHardFloatABI () const
 Tests if the target forces hardfloat.
bool supportsCOMDAT () const
 Tests whether the target supports comdat.
bool hasDefaultEmulatedTLS () const
 Tests whether the target uses emulated TLS as default.
bool hasDefaultTLSDESC () const
 True if the target uses TLSDESC by default.
bool hasDefaultDataSections () const
 Tests whether the target uses -data-sections as default.
bool hasDLLImportExport () const
 Tests if the environment supports dllimport/export annotations.
static LLVM_ABI unsigned getArchPointerBitWidth (llvm::Triple::ArchType Arch)
 Returns the pointer width of this architecture.

Detailed Description

Triple - Helper class for working with autoconf configuration names.

For historical reasons, we also call these 'triples' (they used to contain exactly three fields).

Configuration names are strings in the canonical form: ARCHITECTURE-VENDOR-OPERATING_SYSTEM or ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT

This class is used for clients which want to support arbitrary configuration names, but also want to implement certain special behavior for particular configurations. This class isolates the mapping from the components of the configuration name to well known IDs.

At its core the Triple class is designed to be a wrapper for a triple string; the constructor does not change or normalize the triple string. Clients that need to handle the non-canonical triples that users often specify should use the normalize method.

See autoconf/config.guess for a glimpse into what configuration names look like in practice.

Definition at line 47 of file Triple.h.

Member Enumeration Documentation

◆ ArchType

Enumerator
UnknownArch 
arm 
armeb 
aarch64 
aarch64_be 
aarch64_32 
arc 
avr 
bpfel 
bpfeb 
csky 
dxil 
hexagon 
loongarch32 
loongarch64 
m68k 
mips 
mipsel 
mips64 
mips64el 
msp430 
ppc 
ppcle 
ppc64 
ppc64le 
r600 
amdgcn 
riscv32 
riscv64 
riscv32be 
riscv64be 
sparc 
sparcv9 
sparcel 
systemz 
tce 
tcele 
thumb 
thumbeb 
x86 
x86_64 
xcore 
xtensa 
nvptx 
nvptx64 
amdil 
amdil64 
hsail 
hsail64 
spir 
spir64 
spirv 
spirv32 
spirv64 
kalimba 
shave 
lanai 
wasm32 
wasm64 
renderscript32 
renderscript64 
ve 
LastArchType 

Definition at line 49 of file Triple.h.

◆ CanonicalForm

enum class llvm::Triple::CanonicalForm
strong

Canonical form.

Enumerator
ANY 
THREE_IDENT 
FOUR_IDENT 
FIVE_IDENT 

Definition at line 386 of file Triple.h.

◆ EnvironmentType

Enumerator
UnknownEnvironment 
GNU 
GNUT64 
GNUABIN32 
GNUABI64 
GNUEABI 
GNUEABIT64 
GNUEABIHF 
GNUEABIHFT64 
GNUF32 
GNUF64 
GNUSF 
GNUX32 
GNUILP32 
CODE16 
EABI 
EABIHF 
Android 
Musl 
MuslABIN32 
MuslABI64 
MuslEABI 
MuslEABIHF 
MuslF32 
MuslSF 
MuslX32 
LLVM 
MSVC 
Itanium 
Cygnus 
CoreCLR 
Simulator 
MacABI 
Pixel 
Vertex 
Geometry 
Hull 
Domain 
Compute 
Library 
RayGeneration 
Intersection 
AnyHit 
ClosestHit 
Miss 
Callable 
Mesh 
Amplification 
RootSignature 
OpenCL 
OpenHOS 
Mlibc 
PAuthTest 
MTIA 
LastEnvironmentType 

Definition at line 252 of file Triple.h.

◆ ObjectFormatType

Enumerator
UnknownObjectFormat 
COFF 
DXContainer 
ELF 
GOFF 
MachO 
SPIRV 
Wasm 
XCOFF 

Definition at line 317 of file Triple.h.

◆ OSType

Enumerator
UnknownOS 
Darwin 
DragonFly 
FreeBSD 
Fuchsia 
IOS 
KFreeBSD 
Linux 
Lv2 
MacOSX 
Managarm 
NetBSD 
OpenBSD 
Solaris 
UEFI 
Win32 
ZOS 
Haiku 
RTEMS 
AIX 
CUDA 
NVCL 
AMDHSA 
PS4 
PS5 
ELFIAMCU 
TvOS 
WatchOS 
BridgeOS 
DriverKit 
XROS 
Mesa3D 
AMDPAL 
HermitCore 
Hurd 
WASI 
Emscripten 
ShaderModel 
LiteOS 
Serenity 
Vulkan 
CheriotRTOS 
LastOSType 

Definition at line 206 of file Triple.h.

◆ SubArchType

Enumerator
NoSubArch 
ARMSubArch_v9_6a 
ARMSubArch_v9_5a 
ARMSubArch_v9_4a 
ARMSubArch_v9_3a 
ARMSubArch_v9_2a 
ARMSubArch_v9_1a 
ARMSubArch_v9 
ARMSubArch_v8_9a 
ARMSubArch_v8_8a 
ARMSubArch_v8_7a 
ARMSubArch_v8_6a 
ARMSubArch_v8_5a 
ARMSubArch_v8_4a 
ARMSubArch_v8_3a 
ARMSubArch_v8_2a 
ARMSubArch_v8_1a 
ARMSubArch_v8 
ARMSubArch_v8r 
ARMSubArch_v8m_baseline 
ARMSubArch_v8m_mainline 
ARMSubArch_v8_1m_mainline 
ARMSubArch_v7 
ARMSubArch_v7em 
ARMSubArch_v7m 
ARMSubArch_v7s 
ARMSubArch_v7k 
ARMSubArch_v7ve 
ARMSubArch_v6 
ARMSubArch_v6m 
ARMSubArch_v6k 
ARMSubArch_v6t2 
ARMSubArch_v5 
ARMSubArch_v5te 
ARMSubArch_v4t 
AArch64SubArch_arm64e 
AArch64SubArch_arm64ec 
KalimbaSubArch_v3 
KalimbaSubArch_v4 
KalimbaSubArch_v5 
MipsSubArch_r6 
PPCSubArch_spe 
SPIRVSubArch_v10 
SPIRVSubArch_v11 
SPIRVSubArch_v12 
SPIRVSubArch_v13 
SPIRVSubArch_v14 
SPIRVSubArch_v15 
SPIRVSubArch_v16 
DXILSubArch_v1_0 
DXILSubArch_v1_1 
DXILSubArch_v1_2 
DXILSubArch_v1_3 
DXILSubArch_v1_4 
DXILSubArch_v1_5 
DXILSubArch_v1_6 
DXILSubArch_v1_7 
DXILSubArch_v1_8 
DXILSubArch_v1_9 
LatestDXILSubArch 

Definition at line 115 of file Triple.h.

◆ VendorType

Enumerator
UnknownVendor 
Apple 
PC 
SCEI 
Freescale 
IBM 
ImaginationTechnologies 
MipsTechnologies 
NVIDIA 
CSR 
AMD 
Mesa 
SUSE 
OpenEmbedded 
Intel 
Meta 
LastVendorType 

Definition at line 186 of file Triple.h.

Constructor & Destructor Documentation

◆ Triple() [1/8]

llvm::Triple::Triple ( )
default

Default constructor is the same as an empty string and leaves all triple fields unknown.

References LLVM_ABI.

Referenced by get32BitArchVariant(), get64BitArchVariant(), getBigEndianArchVariant(), getLittleEndianArchVariant(), isCompatibleWith(), isOSVersionLT(), merge(), operator!=(), operator==(), setTriple(), Triple(), Triple(), Triple(), Triple(), and Triple().

◆ Triple() [2/8]

Triple::Triple ( std::string && Str)
explicit

◆ Triple() [3/8]

llvm::Triple::Triple ( StringRef Str)
inlineexplicit

Definition at line 360 of file Triple.h.

References str(), and Triple().

◆ Triple() [4/8]

llvm::Triple::Triple ( const char * Str)
inlineexplicit

Definition at line 361 of file Triple.h.

References Triple().

◆ Triple() [5/8]

llvm::Triple::Triple ( const std::string & Str)
inlineexplicit

Definition at line 362 of file Triple.h.

References Triple().

◆ Triple() [6/8]

Triple::Triple ( const Twine & Str)
explicit

Definition at line 1079 of file Triple.cpp.

References str(), and Triple().

◆ Triple() [7/8]

Triple::Triple ( const Twine & ArchStr,
const Twine & VendorStr,
const Twine & OSStr )

Construct a triple from string representations of the architecture, vendor, and OS.

This joins each argument into a canonical string representation and parses them into enum members. It leaves the environment unknown and omits it from the string representation.

Definition at line 1087 of file Triple.cpp.

References getDefaultFormat(), parseArch(), parseOS(), parseSubArch(), parseVendor(), str(), Triple(), and UnknownObjectFormat.

◆ Triple() [8/8]

Triple::Triple ( const Twine & ArchStr,
const Twine & VendorStr,
const Twine & OSStr,
const Twine & EnvironmentStr )

Construct a triple from string representations of the architecture, vendor, OS, and environment.

This joins each argument into a canonical string representation and parses them into enum members.

Definition at line 1102 of file Triple.cpp.

References getDefaultFormat(), parseArch(), parseEnvironment(), parseFormat(), parseOS(), parseSubArch(), parseVendor(), str(), and UnknownObjectFormat.

Member Function Documentation

◆ computeDataLayout()

◆ empty()

bool llvm::Triple::empty ( ) const
inline

Whether the triple is empty / default constructed.

Definition at line 483 of file Triple.h.

Referenced by isPPC32SecurePlt(), isPPC64ELFv2ABI(), and normalize().

◆ get32BitArchVariant()

Triple Triple::get32BitArchVariant ( ) const

Form a triple with a 32-bit variant of the current architecture.

This can be used to move across "families" of architectures where useful.

Returns
A new triple with a 32-bit architecture or an unknown architecture if no such variant can be found.

Definition at line 1796 of file Triple.cpp.

References aarch64, aarch64_32, aarch64_be, amdgcn, amdil, amdil64, arc, arm, armeb, avr, bpfeb, bpfel, csky, dxil, getArch(), getSubArch(), hexagon, hsail, hsail64, kalimba, lanai, loongarch32, loongarch64, m68k, mips, mips64, mips64el, mipsel, msp430, nvptx, nvptx64, ppc, ppc64, ppc64le, ppcle, r600, renderscript32, renderscript64, riscv32, riscv32be, riscv64, riscv64be, shave, sparc, sparcel, sparcv9, spir, spir64, spirv, spirv32, spirv64, systemz, T, tce, tcele, thumb, thumbeb, Triple(), UnknownArch, ve, wasm32, wasm64, x86, x86_64, xcore, and xtensa.

Referenced by llvm::sys::getProcessTriple().

◆ get64BitArchVariant()

Triple Triple::get64BitArchVariant ( ) const

Form a triple with a 64-bit variant of the current architecture.

This can be used to move across "families" of architectures where useful.

Returns
A new triple with a 64-bit architecture or an unknown architecture if no such variant can be found.

Definition at line 1879 of file Triple.cpp.

References aarch64, aarch64_32, aarch64_be, amdgcn, amdil, amdil64, arc, arm, armeb, avr, bpfeb, bpfel, csky, dxil, getArch(), getSubArch(), hexagon, hsail, hsail64, kalimba, lanai, loongarch32, loongarch64, m68k, mips, mips64, mips64el, mipsel, msp430, nvptx, nvptx64, ppc, ppc64, ppc64le, ppcle, r600, renderscript32, renderscript64, riscv32, riscv32be, riscv64, riscv64be, shave, sparc, sparcel, sparcv9, spir, spir64, spirv, spirv32, spirv64, systemz, T, tce, tcele, thumb, thumbeb, Triple(), UnknownArch, ve, wasm32, wasm64, x86, x86_64, xcore, and xtensa.

Referenced by llvm::sys::getProcessTriple().

◆ getArch()

ArchType llvm::Triple::getArch ( ) const
inline

Get the parsed architecture type of this triple.

Definition at line 411 of file Triple.h.

Referenced by llvm::TargetLibraryInfoImpl::addVectorizableFunctionsFromVecLib(), adjustInlineAsm(), llvm::ARMELFMCAsmInfo::ARMELFMCAsmInfo(), llvm::ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(), computeDataLayout(), createAArch64MCAsmInfo(), createPPCMCAsmInfo(), CreateVarArgHelper(), createX86MCAsmInfo(), emplace(), llvm::X86_MC::X86MCInstrAnalysis::findPltEntries(), get32BitArchVariant(), get64BitArchVariant(), getArchPointerBitWidth(), getBigEndianArchVariant(), getDefaultExceptionHandling(), llvm::SubtargetFeatures::getDefaultSubtargetFeatures(), getDXILVersion(), getiOSVersion(), getLittleEndianArchVariant(), llvm::AMDGPUMCAsmInfo::getMaxInstLength(), llvm::AMDGPU::getMCReg(), getMinimumSupportedOSVersion(), llvm::memtag::getPC(), llvm::object::ELFObjectFileBase::getPltEntries(), getShadowMapping(), llvm::getSubDirectoryPath(), llvm::lto::getThinLTODefaultCPU(), getTrampolineSize(), getVulkanVersion(), llvm::TargetLoweringObjectFileELF::Initialize(), isAArch64(), isAArch64(), isAlignmentPreservedForAddrCast(), isAMDGCN(), isAMDGPU(), isArch16Bit(), isArch32Bit(), isArch64Bit(), isARM(), isArm64e(), isBPF(), isCompatibleWith(), isCSKY(), isDXIL(), isLittleEndian(), isLoongArch32(), isLoongArch64(), isMIPS32(), isMIPS64(), isNVPTX(), isPPC(), isPPC32(), isPPC32SecurePlt(), isPPC64(), isPPC64ELFv2ABI(), isPS4(), isPS5(), isRISCV32(), isRISCV64(), isSPARC32(), isSPARC64(), isSPIR(), isSPIRV(), isSPIRVLogical(), isSystemZ(), isThumb(), isVE(), isWasm(), isWindowsArm64EC(), isX86(), llvm::jitlink::LinkGraph::LinkGraph(), llvm::NVPTXMCAsmInfo::NVPTXMCAsmInfo(), llvm::omp::OMPContext::OMPContext(), llvm::ifs::parseTriple(), runImpl(), llvm::FastISel::selectXRayCustomEvent(), llvm::FastISel::selectXRayTypedEvent(), llvm::setGlobalVariableLargeSection(), llvm::BasicTTIImplBase< BasicTTIImpl >::shouldBuildRelLookupTables(), llvm::SparcELFMCAsmInfo::SparcELFMCAsmInfo(), llvm::X86MCAsmInfoGNUCOFF::X86MCAsmInfoGNUCOFF(), and llvm::X86MCAsmInfoMicrosoft::X86MCAsmInfoMicrosoft().

◆ getArchName() [1/2]

StringRef Triple::getArchName ( ) const

Get the architecture (first) component of the triple.

Definition at line 1389 of file Triple.cpp.

References llvm::StringRef::split().

Referenced by llvm::ARM::getARMCPUForArch(), getDXILArchNameFromShaderModel(), getDXILVersion(), setArch(), setEnvironmentName(), setOSAndEnvironmentName(), setOSName(), and setVendorName().

◆ getArchName() [2/2]

◆ getArchPointerBitWidth() [1/2]

unsigned llvm::Triple::getArchPointerBitWidth ( ) const
inline

Returns the pointer width of this architecture.

Definition at line 516 of file Triple.h.

References getArch(), and getArchPointerBitWidth().

Referenced by getArchPointerBitWidth(), isArch16Bit(), isArch32Bit(), and isArch64Bit().

◆ getArchPointerBitWidth() [2/2]

◆ getArchTypeForLLVMName()

◆ getArchTypeName()

◆ getArchTypePrefix()

StringRef Triple::getArchTypePrefix ( ArchType Kind)
static

Get the "prefix" canonical name for the Kind architecture.

This is the prefix used by the architecture specific builtins, and is suitable for passing to

See also
Intrinsic::getIntrinsicForClangBuiltin().
Returns
- The architecture prefix, or 0 if none is defined.

Definition at line 173 of file Triple.cpp.

References aarch64, aarch64_32, aarch64_be, amdgcn, amdil, amdil64, arc, arm, armeb, avr, bpfeb, bpfel, csky, dxil, hexagon, hsail, hsail64, kalimba, lanai, loongarch32, loongarch64, m68k, mips, mips64, mips64el, mipsel, nvptx, nvptx64, ppc, ppc64, ppc64le, ppcle, r600, riscv32, riscv32be, riscv64, riscv64be, shave, sparc, sparcel, sparcv9, spir, spir64, spirv, spirv32, spirv64, systemz, thumb, thumbeb, ve, wasm32, wasm64, x86, x86_64, xcore, and xtensa.

◆ getBigEndianArchVariant()

Triple Triple::getBigEndianArchVariant ( ) const

Form a triple with a big endian variant of the current architecture.

This can be used to move across "families" of architectures where useful.

Returns
A new triple with a big endian architecture or an unknown architecture if no such variant can be found.

Definition at line 1962 of file Triple.cpp.

References aarch64, aarch64_be, amdgcn, amdil, amdil64, arm, avr, bpfeb, bpfel, csky, dxil, getArch(), getSubArch(), hexagon, hsail, hsail64, isLittleEndian(), kalimba, llvm_unreachable, loongarch32, loongarch64, mips, mips64, mips64el, mipsel, msp430, nvptx, nvptx64, ppc, ppc64, ppc64le, ppcle, r600, renderscript32, renderscript64, riscv32, riscv32be, riscv64, riscv64be, shave, sparc, sparcel, spir, spir64, spirv, spirv32, spirv64, T, tce, tcele, thumb, Triple(), UnknownArch, ve, wasm32, wasm64, x86, x86_64, xcore, and xtensa.

◆ getCanonicalVersionForOS()

VersionTuple Triple::getCanonicalVersionForOS ( OSType OSKind,
const VersionTuple & Version,
bool IsInValidRange )
static

Returns a canonicalized OS version number for the specified OS.

Definition at line 2225 of file Triple.cpp.

References IOS, MacOSX, TvOS, llvm::Version, WatchOS, and XROS.

Referenced by getiOSVersion(), and llvm::MachO::mapToSupportedOSVersion().

◆ getDefaultExceptionHandling()

◆ getDriverKitVersion()

VersionTuple Triple::getDriverKitVersion ( ) const

Parse the version number as with getOSVersion.

Definition at line 1584 of file Triple.cpp.

References DriverKit, getOS(), getOSVersion(), llvm_unreachable, and llvm::Version.

◆ getDXILVersion()

VersionTuple Triple::getDXILVersion ( ) const

Parse the DXIL version number from the OSVersion and DXIL version (SubArch).

This should only be called with DXIL triples.

Definition at line 1621 of file Triple.cpp.

References dxil, getArch(), getArchName(), getDXILArchNameFromShaderModel(), getOS(), getOSName(), getSubArch(), llvm_unreachable, NoSubArch, parseVersionFromName(), and ShaderModel.

◆ getEnvironment()

◆ getEnvironmentName()

StringRef Triple::getEnvironmentName ( ) const

Get the optional environment (fourth) component of the triple, or "" if empty.

Definition at line 1404 of file Triple.cpp.

References llvm::StringRef::split().

Referenced by getEnvironmentVersionString(), hasEnvironment(), and setOSName().

◆ getEnvironmentTypeName()

◆ getEnvironmentVersion()

VersionTuple Triple::getEnvironmentVersion ( ) const

Parse the version number from the OS name component of the triple, if present.

For example, "fooos1.2.3" would return (1, 2, 3).

Definition at line 1421 of file Triple.cpp.

References getEnvironmentVersionString(), and parseVersionFromName().

Referenced by isAndroidVersionLT().

◆ getEnvironmentVersionString()

StringRef Triple::getEnvironmentVersionString ( ) const

Get the version component of the environment component as a single string (the version after the environment).

For example, "fooos1.2.3" would return "1.2.3".

Definition at line 1425 of file Triple.cpp.

References llvm::StringRef::consume_back(), llvm::StringRef::consume_front(), llvm::StringRef::contains(), getEnvironment(), getEnvironmentName(), getEnvironmentTypeName(), getObjectFormat(), getObjectFormatTypeName(), str(), and UnknownObjectFormat.

Referenced by getEnvironmentVersion().

◆ getiOSVersion()

VersionTuple Triple::getiOSVersion ( ) const

Parse the version number as with getOSVersion.

This should only be called with IOS or generic triples.

Definition at line 1510 of file Triple.cpp.

References aarch64, BridgeOS, Darwin, DriverKit, getArch(), getCanonicalVersionForOS(), getOS(), getOSVersion(), IOS, isValidVersionForOS(), llvm_unreachable, MacOSX, TvOS, llvm::Version, WatchOS, and XROS.

◆ getLittleEndianArchVariant()

Triple Triple::getLittleEndianArchVariant ( ) const

Form a triple with a little endian variant of the current architecture.

This can be used to move across "families" of architectures where useful.

Returns
A new triple with a little endian architecture or an unknown architecture if no such variant can be found.

Definition at line 2032 of file Triple.cpp.

References aarch64, aarch64_be, armeb, bpfeb, bpfel, getArch(), getSubArch(), isLittleEndian(), lanai, llvm_unreachable, m68k, mips, mips64, mips64el, mipsel, ppc, ppc64, ppc64le, ppcle, riscv32, riscv32be, riscv64, riscv64be, sparc, sparcel, sparcv9, systemz, T, tce, tcele, thumbeb, Triple(), and UnknownArch.

◆ getMacOSXVersion()

bool Triple::getMacOSXVersion ( VersionTuple & Version) const

Parse the version number as with getOSVersion and then translate generic "darwin" versions to the corresponding OS X versions.

This may also be called with IOS triples but the OS X version number is just set to a constant 10.4.0 in that case. Returns true if successful.

Definition at line 1462 of file Triple.cpp.

References Darwin, DriverKit, getOS(), getOSVersion(), IOS, llvm_unreachable, MacOSX, TvOS, llvm::Version, WatchOS, and XROS.

◆ getMinimumSupportedOSVersion()

VersionTuple Triple::getMinimumSupportedOSVersion ( ) const

Some platforms have different minimum supported OS versions that varies by the architecture specified in the triple.

This function returns the minimum supported OS version for this triple if one an exists, or an invalid version tuple if this triple doesn't have one.

Definition at line 2188 of file Triple.cpp.

References aarch64, aarch64_32, Apple, assert(), DriverKit, getArch(), getOS(), getVendor(), IOS, isArm64e(), isMacCatalystEnvironment(), isSimulatorEnvironment(), MacOSX, TvOS, and WatchOS.

Referenced by llvm::MachO::mapToSupportedOSVersion().

◆ getObjectFormat()

◆ getObjectFormatTypeName()

StringRef Triple::getObjectFormatTypeName ( ObjectFormatType ObjectFormat)
static

◆ getOS()

OSType llvm::Triple::getOS ( ) const
inline

◆ getOSAndEnvironmentName()

StringRef Triple::getOSAndEnvironmentName ( ) const

Get the operating system and optional environment components as a single string (separated by a '-' if the environment component is present).

Definition at line 1410 of file Triple.cpp.

References llvm::StringRef::split().

Referenced by setArchName(), and setVendorName().

◆ getOSMajorVersion()

unsigned llvm::Triple::getOSMajorVersion ( ) const
inline

Return just the major version number, this is specialized because it is a common query.

Definition at line 447 of file Triple.h.

References llvm::VersionTuple::getMajor(), and getOSVersion().

Referenced by isPPC32SecurePlt(), and isPPC64ELFv2ABI().

◆ getOSName()

StringRef Triple::getOSName ( ) const

Get the operating system (third) component of the triple.

Definition at line 1398 of file Triple.cpp.

References llvm::StringRef::split().

Referenced by getDXILVersion(), getOSVersion(), and setEnvironmentName().

◆ getOSTypeName()

StringRef Triple::getOSTypeName ( OSType Kind)
static

Get the canonical name for the Kind operating system.

Definition at line 289 of file Triple.cpp.

References AIX, AMDHSA, AMDPAL, BridgeOS, CheriotRTOS, CUDA, Darwin, DragonFly, DriverKit, ELFIAMCU, Emscripten, FreeBSD, Fuchsia, Haiku, HermitCore, Hurd, IOS, KFreeBSD, Linux, LiteOS, llvm_unreachable, Lv2, MacOSX, Managarm, Mesa3D, NetBSD, NVCL, OpenBSD, PS4, PS5, RTEMS, Serenity, ShaderModel, Solaris, TvOS, UEFI, UnknownOS, Vulkan, WASI, WatchOS, Win32, XROS, and ZOS.

Referenced by getOSVersion(), and setOS().

◆ getOSVersion()

◆ getSubArch()

◆ getTrampolineSize()

unsigned Triple::getTrampolineSize ( ) const

Returns the trampoline size in bytes for this configuration.

Definition at line 1766 of file Triple.cpp.

References getArch(), isOSLinux(), ppc, ppc64, ppc64le, and ppcle.

◆ getTriple()

◆ getVendor()

VendorType llvm::Triple::getVendor ( ) const
inline

Get the parsed vendor type of this triple.

Definition at line 417 of file Triple.h.

Referenced by llvm::SubtargetFeatures::getDefaultSubtargetFeatures(), getMinimumSupportedOSVersion(), isAppleMachO(), isCompatibleWith(), isPS4(), isPS5(), and merge().

◆ getVendorName()

StringRef Triple::getVendorName ( ) const

Get the vendor (second) component of the triple.

Definition at line 1393 of file Triple.cpp.

References llvm::StringRef::split().

Referenced by setArchName(), setEnvironmentName(), setOSAndEnvironmentName(), and setOSName().

◆ getVendorTypeName()

StringRef Triple::getVendorTypeName ( VendorType Kind)
static

Get the canonical name for the Kind vendor.

Definition at line 263 of file Triple.cpp.

References AMD, Apple, CSR, Freescale, IBM, ImaginationTechnologies, Intel, llvm_unreachable, Mesa, Meta, MipsTechnologies, NVIDIA, OpenEmbedded, PC, SCEI, SUSE, and UnknownVendor.

Referenced by setVendor().

◆ getVulkanVersion()

VersionTuple Triple::getVulkanVersion ( ) const

Parse the Vulkan version number from the OSVersion and SPIR-V version (SubArch).

This should only be called with Vulkan SPIR-V triples.

Definition at line 1596 of file Triple.cpp.

References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::contains(), getArch(), getOS(), getOSVersion(), getSubArch(), llvm_unreachable, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup(), NoSubArch, spirv, SPIRVSubArch_v15, SPIRVSubArch_v16, and Vulkan.

◆ getWatchOSVersion()

VersionTuple Triple::getWatchOSVersion ( ) const

Parse the version number as with getOSVersion.

This should only be called with WatchOS or generic triples.

Definition at line 1559 of file Triple.cpp.

References Darwin, DriverKit, getOS(), getOSVersion(), IOS, llvm_unreachable, MacOSX, llvm::Version, WatchOS, and XROS.

◆ hasDefaultDataSections()

bool llvm::Triple::hasDefaultDataSections ( ) const
inline

Tests whether the target uses -data-sections as default.

Definition at line 1180 of file Triple.h.

References isOSBinFormatXCOFF(), and isWasm().

Referenced by llvm::codegen::InitTargetOptionsFromCodeGenFlags().

◆ hasDefaultEmulatedTLS()

bool llvm::Triple::hasDefaultEmulatedTLS ( ) const
inline

Tests whether the target uses emulated TLS as default.

Note: Android API level 29 (10) introduced ELF TLS.

Definition at line 1169 of file Triple.h.

References isAndroid(), isAndroidVersionLT(), isOHOSFamily(), isOSOpenBSD(), and isWindowsCygwinEnvironment().

Referenced by llvm::codegen::InitTargetOptionsFromCodeGenFlags().

◆ hasDefaultTLSDESC()

bool llvm::Triple::hasDefaultTLSDESC ( ) const
inline

True if the target uses TLSDESC by default.

Definition at line 1175 of file Triple.h.

References isAArch64(), isAndroid(), isOSFuchsia(), and isRISCV64().

Referenced by llvm::codegen::InitTargetOptionsFromCodeGenFlags().

◆ hasDLLImportExport()

bool llvm::Triple::hasDLLImportExport ( ) const
inline

Tests if the environment supports dllimport/export annotations.

Definition at line 1185 of file Triple.h.

References isOSWindows(), and isPS().

◆ hasEnvironment()

bool llvm::Triple::hasEnvironment ( ) const
inline

Does this triple have the optional environment (fourth) component?

Definition at line 423 of file Triple.h.

References getEnvironmentName().

Referenced by setOSName().

◆ isAArch64() [1/2]

bool llvm::Triple::isAArch64 ( ) const
inline

◆ isAArch64() [2/2]

bool llvm::Triple::isAArch64 ( int PointerWidth) const
inline

Tests whether the target is AArch64 and pointers are the size specified by PointerWidth.

Definition at line 1005 of file Triple.h.

References aarch64_32, assert(), getArch(), getEnvironment(), GNUILP32, and isAArch64().

◆ isABIN32()

bool llvm::Triple::isABIN32 ( ) const
inline

Definition at line 1128 of file Triple.h.

References getEnvironment(), GNUABIN32, and MuslABIN32.

Referenced by getShadowMapping().

◆ isAMDGCN()

bool llvm::Triple::isAMDGCN ( ) const
inline

Tests whether the target is AMDGCN.

Definition at line 904 of file Triple.h.

References amdgcn, and getArch().

Referenced by llvm::AMDGPUSubtarget::get(), llvm::AMDGPU::IsaInfo::getMaxWorkGroupsPerCU(), and isAMDGPU().

◆ isAMDGPU()

bool llvm::Triple::isAMDGPU ( ) const
inline

◆ isAndroid()

bool llvm::Triple::isAndroid ( ) const
inline

Tests whether the target is Android.

Definition at line 819 of file Triple.h.

References Android, and getEnvironment().

Referenced by getShadowMapping(), hasDefaultEmulatedTLS(), hasDefaultTLSDESC(), hasStackGuardSlotTLS(), isAndroidVersionLT(), isOSGlibc(), and isTargetEHABICompatible().

◆ isAndroidVersionLT()

bool llvm::Triple::isAndroidVersionLT ( unsigned Major) const
inline

◆ isAppleMachO()

bool llvm::Triple::isAppleMachO ( ) const
inline

Is this an Apple MachO triple.

Definition at line 605 of file Triple.h.

References Apple, getVendor(), and isOSBinFormatMachO().

◆ isArch16Bit()

bool Triple::isArch16Bit ( ) const

Test whether the architecture is 16-bit.

Note that this tests for 16-bit pointer width, and nothing else.

Definition at line 1792 of file Triple.cpp.

References getArch(), and getArchPointerBitWidth().

◆ isArch32Bit()

bool Triple::isArch32Bit ( ) const

Test whether the architecture is 32-bit.

Note that this tests for 32-bit pointer width, and nothing else.

Definition at line 1788 of file Triple.cpp.

References getArch(), and getArchPointerBitWidth().

Referenced by llvm::RISCVTargetStreamer::emitNoteGnuPropertySection(), and llvm::sys::getProcessTriple().

◆ isArch64Bit()

bool Triple::isArch64Bit ( ) const

Test whether the architecture is 64-bit.

Note that this tests for 64-bit pointer width, and nothing else. Note that we intentionally expose only three predicates, 64-bit, 32-bit, and 16-bit. The inner details of pointer width for particular architectures is not summed up in the triple, and so only a coarse grained predicate system is provided.

Definition at line 1784 of file Triple.cpp.

References getArch(), and getArchPointerBitWidth().

Referenced by llvm::X86AsmPrinter::emitKCFITypeId(), llvm::RISCVTargetStreamer::emitNoteGnuPropertySection(), llvm::WebAssembly::getOrCreateFunctionTableSymbol(), llvm::sys::getProcessTriple(), llvm::object::IRObjectFile::is64Bit(), isAndroidVersionLT(), llvm::ifs::parseTriple(), and llvm::BasicTTIImplBase< BasicTTIImpl >::shouldBuildRelLookupTables().

◆ isARM()

bool llvm::Triple::isARM ( ) const
inline

Tests whether the target is ARM (little and big endian).

Definition at line 914 of file Triple.h.

References arm, armeb, and getArch().

Referenced by CreateVarArgHelper(), getDefaultExceptionHandling(), getShadowMapping(), and isTargetEHABICompatible().

◆ isArm64e()

bool llvm::Triple::isArm64e ( ) const
inline

Tests whether the target is the Apple "arm64e" AArch64 subarch.

Definition at line 1122 of file Triple.h.

References aarch64, AArch64SubArch_arm64e, getArch(), and getSubArch().

Referenced by getMinimumSupportedOSVersion(), and llvm::lto::getThinLTODefaultCPU().

◆ isArmMClass()

bool llvm::Triple::isArmMClass ( ) const
inline

Tests whether the target is an M-class.

Definition at line 983 of file Triple.h.

References ARMSubArch_v6m, ARMSubArch_v7em, ARMSubArch_v7m, ARMSubArch_v8_1m_mainline, ARMSubArch_v8m_baseline, ARMSubArch_v8m_mainline, and getSubArch().

◆ isArmT32()

bool llvm::Triple::isArmT32 ( ) const
inline

◆ isBPF()

bool llvm::Triple::isBPF ( ) const
inline

Tests whether the target is eBPF.

Definition at line 1140 of file Triple.h.

References bpfeb, bpfel, and getArch().

Referenced by getDefaultExceptionHandling(), and llvm::symbolize::useBTFContext().

◆ isBridgeOS()

bool llvm::Triple::isBridgeOS ( ) const
inline

Is this an Apple BridgeOS triple.

Definition at line 597 of file Triple.h.

References BridgeOS, and getOS().

Referenced by isOSDarwin().

◆ isCompatibleWith()

bool Triple::isCompatibleWith ( const Triple & Other) const

Test whether target triples are compatible.

Definition at line 2127 of file Triple.cpp.

References Apple, arm, armeb, getArch(), getEnvironment(), getObjectFormat(), getOS(), getSubArch(), getVendor(), isWindowsGNUEnvironment(), llvm::Other, thumb, thumbeb, and Triple().

◆ isCSKY()

bool llvm::Triple::isCSKY ( ) const
inline

Definition at line 1117 of file Triple.h.

References csky, and getArch().

◆ isDriverKit()

bool llvm::Triple::isDriverKit ( ) const
inline

Is this an Apple DriverKit triple.

Definition at line 600 of file Triple.h.

References DriverKit, and getOS().

Referenced by getShadowMapping(), and isOSDarwin().

◆ isDXIL()

bool llvm::Triple::isDXIL ( ) const
inline

Tests whether the target is DXIL.

Definition at line 855 of file Triple.h.

References dxil, and getArch().

◆ isGNUEnvironment()

bool llvm::Triple::isGNUEnvironment ( ) const
inline

◆ isGPU()

bool llvm::Triple::isGPU ( ) const
inline

Test whether the target triple is for a GPU.

Definition at line 1270 of file Triple.h.

References isAMDGPU(), isNVPTX(), and isSPIRV().

◆ isHardFloatABI()

bool llvm::Triple::isHardFloatABI ( ) const
inline

Tests if the target forces hardfloat.

Definition at line 1152 of file Triple.h.

References EABIHF, getEnvironment(), GNUEABIHF, GNUEABIHFT64, and MuslEABIHF.

◆ isiOS()

bool llvm::Triple::isiOS ( ) const
inline

Is this an iOS triple.

Note: This identifies tvOS as a variant of iOS. If that ever changes, i.e., if the two operating systems diverge or their version numbers get out of sync, that will need to be changed. watchOS has completely different version numbers so it is not included.

Definition at line 575 of file Triple.h.

References getOS(), IOS, and isTvOS().

Referenced by getShadowMapping(), and isOSDarwin().

◆ isKnownWindowsMSVCEnvironment()

bool llvm::Triple::isKnownWindowsMSVCEnvironment ( ) const
inline

Checks if the environment is MSVC.

Definition at line 684 of file Triple.h.

References getEnvironment(), isOSWindows(), and MSVC.

Referenced by isWindowsMSVCEnvironment(), and runImpl().

◆ isLittleEndian()

bool Triple::isLittleEndian ( ) const

◆ isLoongArch()

bool llvm::Triple::isLoongArch ( ) const
inline

Tests whether the target is LoongArch (32- and 64-bit).

Definition at line 1022 of file Triple.h.

References isLoongArch32(), and isLoongArch64().

Referenced by getDefaultExceptionHandling(), and insertCall().

◆ isLoongArch32()

bool llvm::Triple::isLoongArch32 ( ) const
inline

Tests whether the target is 32-bit LoongArch.

Definition at line 1016 of file Triple.h.

References getArch(), and loongarch32.

Referenced by isLoongArch().

◆ isLoongArch64()

bool llvm::Triple::isLoongArch64 ( ) const
inline

Tests whether the target is 64-bit LoongArch.

Definition at line 1019 of file Triple.h.

References getArch(), and loongarch64.

Referenced by CreateVarArgHelper(), getShadowMapping(), and isLoongArch().

◆ isMacCatalystEnvironment()

bool llvm::Triple::isMacCatalystEnvironment ( ) const
inline

Definition at line 620 of file Triple.h.

References getEnvironment(), and MacABI.

Referenced by getMinimumSupportedOSVersion(), and isTargetMachineMac().

◆ isMacOSX()

bool llvm::Triple::isMacOSX ( ) const
inline

Is this a Mac OS X triple.

For legacy reasons, we support both "darwin" and "osx" as OS X triples.

Definition at line 566 of file Triple.h.

References Darwin, getOS(), and MacOSX.

Referenced by llvm::MCStreamer::emitVersionForTarget(), getShadowMapping(), isMacOSXVersionLT(), isOSDarwin(), and isTargetMachineMac().

◆ isMacOSXVersionLT()

bool Triple::isMacOSXVersionLT ( unsigned Major,
unsigned Minor = 0,
unsigned Micro = 0 ) const

Comparison function for checking OS X version compatibility, which handles supporting skewed version numbering schemes used by the "darwin" triples.

Definition at line 2171 of file Triple.cpp.

References assert(), getOS(), isMacOSX(), isOSVersionLT(), and MacOSX.

◆ isMIPS()

bool llvm::Triple::isMIPS ( ) const
inline

Tests whether the target is MIPS (little and big endian, 32- or 64-bit).

Definition at line 1035 of file Triple.h.

References isMIPS32(), and isMIPS64().

Referenced by getDefaultExceptionHandling().

◆ isMIPS32()

bool llvm::Triple::isMIPS32 ( ) const
inline

Tests whether the target is MIPS 32-bit (little and big endian).

Definition at line 1025 of file Triple.h.

References getArch(), mips, and mipsel.

Referenced by CreateVarArgHelper(), getShadowMapping(), and isMIPS().

◆ isMIPS64()

bool llvm::Triple::isMIPS64 ( ) const
inline

Tests whether the target is MIPS 64-bit (little and big endian).

Definition at line 1030 of file Triple.h.

References getArch(), mips64, and mips64el.

Referenced by CreateVarArgHelper(), getShadowMapping(), isMIPS(), and llvm::MipsELFMCAsmInfo::MipsELFMCAsmInfo().

◆ isMusl()

bool llvm::Triple::isMusl ( ) const
inline

Tests whether the environment is musl-libc.

Definition at line 834 of file Triple.h.

References getEnvironment(), isOSLiteOS(), Musl, MuslABI64, MuslABIN32, MuslEABI, MuslEABIHF, MuslF32, MuslSF, MuslX32, and OpenHOS.

Referenced by isPPC32SecurePlt(), and isPPC64ELFv2ABI().

◆ isNVPTX()

bool llvm::Triple::isNVPTX ( ) const
inline

◆ isOHOSFamily()

bool llvm::Triple::isOHOSFamily ( ) const
inline

Tests whether the target is OHOS LiteOS default enviroment is also OHOS, but omited on triple.

Definition at line 848 of file Triple.h.

References isOpenHOS(), and isOSLiteOS().

Referenced by hasDefaultEmulatedTLS().

◆ isOpenHOS()

bool llvm::Triple::isOpenHOS ( ) const
inline

Definition at line 850 of file Triple.h.

References getEnvironment(), and OpenHOS.

Referenced by isOHOSFamily().

◆ isOSAIX()

bool llvm::Triple::isOSAIX ( ) const
inline

Tests whether the OS is AIX.

Definition at line 760 of file Triple.h.

References AIX, and getOS().

Referenced by createPPCAsmPrinterPass(), and insertCall().

◆ isOSBinFormatCOFF()

◆ isOSBinFormatDXContainer()

bool llvm::Triple::isOSBinFormatDXContainer ( ) const
inline

Tests whether the OS uses the DXContainer binary format.

Definition at line 797 of file Triple.h.

References DXContainer, and getObjectFormat().

Referenced by supportsCOMDAT().

◆ isOSBinFormatELF()

◆ isOSBinFormatGOFF()

bool llvm::Triple::isOSBinFormatGOFF ( ) const
inline

Tests whether the OS uses the GOFF binary format.

Definition at line 779 of file Triple.h.

References getObjectFormat(), and GOFF.

Referenced by getDefaultExceptionHandling().

◆ isOSBinFormatMachO()

◆ isOSBinFormatWasm()

bool llvm::Triple::isOSBinFormatWasm ( ) const
inline

Tests whether the OS uses the Wasm binary format.

Definition at line 787 of file Triple.h.

References getObjectFormat(), and Wasm.

◆ isOSBinFormatXCOFF()

bool llvm::Triple::isOSBinFormatXCOFF ( ) const
inline

Tests whether the OS uses the XCOFF binary format.

Definition at line 792 of file Triple.h.

References getObjectFormat(), and XCOFF.

Referenced by createPPCMCAsmInfo(), emitGlobalConstantImpl(), getDefaultExceptionHandling(), hasDefaultDataSections(), and supportsCOMDAT().

◆ isOSCygMing()

bool llvm::Triple::isOSCygMing ( ) const
inline

Tests for either Cygwin or MinGW OS.

Definition at line 717 of file Triple.h.

References isWindowsCygwinEnvironment(), and isWindowsGNUEnvironment().

Referenced by createX86MCAsmInfo(), and getDefaultExceptionHandling().

◆ isOSDarwin()

◆ isOSDragonFly()

bool llvm::Triple::isOSDragonFly ( ) const
inline

Definition at line 646 of file Triple.h.

References DragonFly, and getOS().

◆ isOSEmscripten()

bool llvm::Triple::isOSEmscripten ( ) const
inline

Tests whether the OS is Emscripten.

Definition at line 748 of file Triple.h.

References Emscripten, and getOS().

Referenced by GetCtorAndDtorPriority().

◆ isOSFreeBSD()

bool llvm::Triple::isOSFreeBSD ( ) const
inline

Definition at line 638 of file Triple.h.

References FreeBSD, and getOS().

Referenced by getShadowMapping(), and llvm::TargetLoweringObjectFileELF::Initialize().

◆ isOSFuchsia()

bool llvm::Triple::isOSFuchsia ( ) const
inline

Definition at line 642 of file Triple.h.

References Fuchsia, and getOS().

Referenced by getShadowMapping(), hasDefaultTLSDESC(), and hasStackGuardSlotTLS().

◆ isOSGlibc()

bool llvm::Triple::isOSGlibc ( ) const
inline

Tests whether the OS uses glibc.

Definition at line 753 of file Triple.h.

References getOS(), Hurd, isAndroid(), KFreeBSD, and Linux.

Referenced by hasStackGuardSlotTLS().

◆ isOSHaiku()

bool llvm::Triple::isOSHaiku ( ) const
inline

Tests whether the OS is Haiku.

Definition at line 669 of file Triple.h.

References getOS(), and Haiku.

Referenced by getShadowMapping().

◆ isOSHurd()

bool llvm::Triple::isOSHurd ( ) const
inline

Tests whether the OS is Hurd.

Definition at line 738 of file Triple.h.

References getOS(), and Hurd.

◆ isOSIAMCU()

bool llvm::Triple::isOSIAMCU ( ) const
inline

Definition at line 652 of file Triple.h.

References ELFIAMCU, and getOS().

Referenced by llvm::createX86_32AsmBackend().

◆ isOSKFreeBSD()

bool llvm::Triple::isOSKFreeBSD ( ) const
inline

Tests whether the OS is kFreeBSD.

Definition at line 733 of file Triple.h.

References getOS(), and KFreeBSD.

◆ isOSLinux()

bool llvm::Triple::isOSLinux ( ) const
inline

Tests whether the OS is Linux.

Definition at line 728 of file Triple.h.

References getOS(), and Linux.

Referenced by getShadowMapping(), and getTrampolineSize().

◆ isOSLiteOS()

bool llvm::Triple::isOSLiteOS ( ) const
inline

Definition at line 852 of file Triple.h.

References getOS(), and LiteOS.

Referenced by isMusl(), and isOHOSFamily().

◆ isOSManagarm()

bool llvm::Triple::isOSManagarm ( ) const
inline

Definition at line 865 of file Triple.h.

References getOS(), and Managarm.

◆ isOSMSVCRT()

bool llvm::Triple::isOSMSVCRT ( ) const
inline

Is this a "Windows" OS targeting a "MSVCRT.dll" environment.

Definition at line 722 of file Triple.h.

References isWindowsGNUEnvironment(), isWindowsItaniumEnvironment(), and isWindowsMSVCEnvironment().

Referenced by computeBytesPoppedByCalleeForSRet(), and hasCalleePopSRet().

◆ isOSNetBSD()

bool llvm::Triple::isOSNetBSD ( ) const
inline

Definition at line 630 of file Triple.h.

References getOS(), and NetBSD.

Referenced by getShadowMapping(), and isTargetEHABICompatible().

◆ isOSOpenBSD()

bool llvm::Triple::isOSOpenBSD ( ) const
inline

Definition at line 634 of file Triple.h.

References getOS(), and OpenBSD.

Referenced by hasDefaultEmulatedTLS().

◆ isOSSerenity()

bool llvm::Triple::isOSSerenity ( ) const
inline

Definition at line 764 of file Triple.h.

References getOS(), and Serenity.

◆ isOSSolaris()

bool llvm::Triple::isOSSolaris ( ) const
inline

Definition at line 648 of file Triple.h.

References getOS(), and Solaris.

◆ isOSUnknown()

bool llvm::Triple::isOSUnknown ( ) const
inline

Definition at line 656 of file Triple.h.

References getOS(), and UnknownOS.

◆ isOSVersionLT() [1/2]

bool llvm::Triple::isOSVersionLT ( const Triple & Other) const
inline

Definition at line 555 of file Triple.h.

References getOSVersion(), llvm::Other, and Triple().

◆ isOSVersionLT() [2/2]

bool llvm::Triple::isOSVersionLT ( unsigned Major,
unsigned Minor = 0,
unsigned Micro = 0 ) const
inline

Helper function for doing comparisons against version numbers included in the target triple.

Definition at line 544 of file Triple.h.

References getOSVersion().

Referenced by isMacOSXVersionLT().

◆ isOSWASI()

bool llvm::Triple::isOSWASI ( ) const
inline

Tests whether the OS is WASI.

Definition at line 743 of file Triple.h.

References getOS(), and WASI.

◆ isOSWindows()

◆ isOSzOS()

bool llvm::Triple::isOSzOS ( ) const
inline

Definition at line 602 of file Triple.h.

References getOS(), and ZOS.

Referenced by createAsmTargetStreamer(), createObjectTargetStreamer(), and llvm::createSystemZMCAsmBackend().

◆ isPPC()

bool llvm::Triple::isPPC ( ) const
inline

Tests whether the target is PowerPC (32- or 64-bit LE or BE).

Definition at line 1040 of file Triple.h.

References getArch(), ppc, ppc64, ppc64le, and ppcle.

Referenced by getDefaultExceptionHandling().

◆ isPPC32()

bool llvm::Triple::isPPC32 ( ) const
inline

Tests whether the target is 32-bit PowerPC (little and big endian).

Definition at line 1046 of file Triple.h.

References getArch(), ppc, and ppcle.

Referenced by CreateVarArgHelper().

◆ isPPC32SecurePlt()

bool llvm::Triple::isPPC32SecurePlt ( ) const
inline

Tests whether the target 32-bit PowerPC uses Secure PLT.

Definition at line 1064 of file Triple.h.

References empty(), FreeBSD, getArch(), getOS(), getOSMajorVersion(), getOSVersion(), isMusl(), NetBSD, OpenBSD, ppc, and ppcle.

◆ isPPC64()

bool llvm::Triple::isPPC64 ( ) const
inline

Tests whether the target is 64-bit PowerPC (little and big endian).

Definition at line 1051 of file Triple.h.

References getArch(), ppc64, and ppc64le.

Referenced by CreateVarArgHelper().

◆ isPPC64ELFv2ABI()

bool llvm::Triple::isPPC64ELFv2ABI ( ) const
inline

Tests whether the target 64-bit PowerPC big endian ABI is ELFv2.

Definition at line 1056 of file Triple.h.

References empty(), FreeBSD, getArch(), getOS(), getOSMajorVersion(), getOSVersion(), isMusl(), OpenBSD, and ppc64.

◆ isPS()

bool llvm::Triple::isPS ( ) const
inline

Tests whether the target is the PS4 or PS5 platform.

Definition at line 816 of file Triple.h.

References isPS4(), and isPS5().

Referenced by getShadowMapping(), and hasDLLImportExport().

◆ isPS4()

bool llvm::Triple::isPS4 ( ) const
inline

Tests whether the target is the PS4 platform.

Definition at line 802 of file Triple.h.

References getArch(), getOS(), getVendor(), PS4, SCEI, and x86_64.

Referenced by isPS().

◆ isPS5()

bool llvm::Triple::isPS5 ( ) const
inline

Tests whether the target is the PS5 platform.

Definition at line 809 of file Triple.h.

References getArch(), getOS(), getVendor(), PS5, SCEI, and x86_64.

Referenced by isPS().

◆ isRISCV()

bool llvm::Triple::isRISCV ( ) const
inline

Tests whether the target is RISC-V (32- and 64-bit).

Definition at line 1083 of file Triple.h.

References isRISCV32(), and isRISCV64().

Referenced by getDefaultExceptionHandling(), and insertCall().

◆ isRISCV32()

bool llvm::Triple::isRISCV32 ( ) const
inline

Tests whether the target is 32-bit RISC-V.

Definition at line 1073 of file Triple.h.

References getArch(), riscv32, and riscv32be.

Referenced by CreateVarArgHelper(), and isRISCV().

◆ isRISCV64()

bool llvm::Triple::isRISCV64 ( ) const
inline

Tests whether the target is 64-bit RISC-V.

Definition at line 1078 of file Triple.h.

References getArch(), riscv64, and riscv64be.

Referenced by CreateVarArgHelper(), hasDefaultTLSDESC(), and isRISCV().

◆ isShaderModelOS()

bool llvm::Triple::isShaderModelOS ( ) const
inline

Definition at line 859 of file Triple.h.

References getOS(), and ShaderModel.

◆ isShaderStageEnvironment()

bool llvm::Triple::isShaderStageEnvironment ( ) const
inline

◆ isSimulatorEnvironment()

bool llvm::Triple::isSimulatorEnvironment ( ) const
inline

Definition at line 616 of file Triple.h.

References getEnvironment(), and Simulator.

Referenced by getMinimumSupportedOSVersion(), and isTargetMachineMac().

◆ isSPARC()

bool llvm::Triple::isSPARC ( ) const
inline

Tests whether the target is SPARC.

Definition at line 1094 of file Triple.h.

References isSPARC32(), and isSPARC64().

Referenced by getDefaultExceptionHandling().

◆ isSPARC32()

bool llvm::Triple::isSPARC32 ( ) const
inline

Tests whether the target is 32-bit SPARC (little and big endian).

Definition at line 1086 of file Triple.h.

References getArch(), sparc, and sparcel.

Referenced by isSPARC(), and llvm::SparcInstPrinter::printCTILabel().

◆ isSPARC64()

bool llvm::Triple::isSPARC64 ( ) const
inline

Tests whether the target is 64-bit SPARC (big endian).

Definition at line 1091 of file Triple.h.

References getArch(), and sparcv9.

Referenced by isSPARC().

◆ isSPIR()

bool llvm::Triple::isSPIR ( ) const
inline

Tests whether the target is SPIR (32- or 64-bit).

Definition at line 880 of file Triple.h.

References getArch(), spir, and spir64.

Referenced by isSPIROrSPIRV().

◆ isSPIROrSPIRV()

bool llvm::Triple::isSPIROrSPIRV ( ) const
inline

Definition at line 891 of file Triple.h.

References isSPIR(), and isSPIRV().

Referenced by getDefaultExceptionHandling().

◆ isSPIRV()

bool llvm::Triple::isSPIRV ( ) const
inline

Tests whether the target is SPIR-V (32/64-bit/Logical).

Definition at line 885 of file Triple.h.

References getArch(), spirv, spirv32, and spirv64.

Referenced by isGPU(), and isSPIROrSPIRV().

◆ isSPIRVLogical()

bool llvm::Triple::isSPIRVLogical ( ) const
inline

Tests whether the target is SPIR-V Logical.

Definition at line 894 of file Triple.h.

References getArch(), and spirv.

◆ isSystemZ()

bool llvm::Triple::isSystemZ ( ) const
inline

Tests whether the target is SystemZ.

Definition at line 1097 of file Triple.h.

References getArch(), and systemz.

Referenced by CreateVarArgHelper(), and insertCall().

◆ isTargetAEABI()

bool llvm::Triple::isTargetAEABI ( ) const
inline

Definition at line 941 of file Triple.h.

References EABI, EABIHF, getEnvironment(), isOSDarwin(), and isOSWindows().

◆ isTargetEHABICompatible()

bool llvm::Triple::isTargetEHABICompatible ( ) const
inline

Tests whether the target supports the EHABI exception handling standard.

Definition at line 920 of file Triple.h.

References EABI, EABIHF, getEnvironment(), GNUEABI, GNUEABIHF, GNUEABIHFT64, GNUEABIT64, isAndroid(), isARM(), isOSBinFormatELF(), isOSNetBSD(), isThumb(), MuslEABI, MuslEABIHF, and OpenHOS.

◆ isTargetGNUAEABI()

bool llvm::Triple::isTargetGNUAEABI ( ) const
inline

Definition at line 947 of file Triple.h.

References getEnvironment(), GNUEABI, GNUEABIHF, GNUEABIHFT64, GNUEABIT64, isOSDarwin(), and isOSWindows().

◆ isTargetMachineMac()

bool llvm::Triple::isTargetMachineMac ( ) const
inline

Returns true for targets that run on a macOS machine.

Definition at line 625 of file Triple.h.

References isMacCatalystEnvironment(), isMacOSX(), isOSDarwin(), and isSimulatorEnvironment().

◆ isTargetMuslAEABI()

bool llvm::Triple::isTargetMuslAEABI ( ) const
inline

Definition at line 955 of file Triple.h.

References getEnvironment(), isOSDarwin(), isOSWindows(), MuslEABI, MuslEABIHF, and OpenHOS.

◆ isThumb()

bool llvm::Triple::isThumb ( ) const
inline

Tests whether the target is Thumb (little and big endian).

Definition at line 909 of file Triple.h.

References getArch(), thumb, and thumbeb.

Referenced by getDefaultExceptionHandling(), getShadowMapping(), isTargetEHABICompatible(), and llvm::object::ELFObjectFileBase::setARMSubArch().

◆ isTime64ABI()

bool llvm::Triple::isTime64ABI ( ) const
inline

Tests if the target forces 64-bit time_t on a 32-bit architecture.

Definition at line 1145 of file Triple.h.

References getEnvironment(), GNUEABIHFT64, GNUEABIT64, and GNUT64.

◆ isTvOS()

bool llvm::Triple::isTvOS ( ) const
inline

Is this an Apple tvOS triple.

Definition at line 580 of file Triple.h.

References getOS(), and TvOS.

Referenced by isiOS().

◆ isUEFI()

bool llvm::Triple::isUEFI ( ) const
inline

Tests whether the OS is UEFI.

Definition at line 674 of file Triple.h.

References getOS(), and UEFI.

Referenced by llvm::createX86_64AsmBackend(), createX86MCAsmInfo(), llvm::X86FrameLowering::emitEpilogue(), and llvm::X86MCAsmInfoGNUCOFF::X86MCAsmInfoGNUCOFF().

◆ isValidVersionForOS()

bool Triple::isValidVersionForOS ( OSType OSKind,
const VersionTuple & Version )
static

Returns whether an OS version is invalid and would not map to an Apple OS.

This constant is used to capture gaps in versioning.

Definition at line 2276 of file Triple.cpp.

References IOS, llvm_unreachable, MacOSX, TvOS, llvm::Version, WatchOS, and XROS.

Referenced by getiOSVersion(), and llvm::MachO::mapToSupportedOSVersion().

◆ isVE()

bool llvm::Triple::isVE ( ) const
inline

Tests whether the target is VE.

Definition at line 1107 of file Triple.h.

References getArch(), and ve.

◆ isVulkanOS()

bool llvm::Triple::isVulkanOS ( ) const
inline

Definition at line 863 of file Triple.h.

References getOS(), and Vulkan.

◆ isWasm()

bool llvm::Triple::isWasm ( ) const
inline

Tests whether the target is wasm (32- and 64-bit).

Definition at line 1112 of file Triple.h.

References getArch(), wasm32, and wasm64.

Referenced by llvm::DwarfDebug::emitDebugLocValue(), getDefaultExceptionHandling(), getShadowMapping(), and hasDefaultDataSections().

◆ isWatchABI()

bool llvm::Triple::isWatchABI ( ) const
inline

◆ isWatchOS()

bool llvm::Triple::isWatchOS ( ) const
inline

Is this an Apple watchOS triple.

Definition at line 585 of file Triple.h.

References getOS(), and WatchOS.

Referenced by getShadowMapping(), and isOSDarwin().

◆ isWindowsArm64EC()

bool llvm::Triple::isWindowsArm64EC ( ) const
inline

◆ isWindowsCoreCLREnvironment()

bool llvm::Triple::isWindowsCoreCLREnvironment ( ) const
inline

Definition at line 700 of file Triple.h.

References CoreCLR, getEnvironment(), and isOSWindows().

Referenced by createX86MCAsmInfo().

◆ isWindowsCygwinEnvironment()

bool llvm::Triple::isWindowsCygwinEnvironment ( ) const
inline

Definition at line 708 of file Triple.h.

References Cygnus, getEnvironment(), and isOSWindows().

Referenced by hasDefaultEmulatedTLS(), and isOSCygMing().

◆ isWindowsGNUEnvironment()

bool llvm::Triple::isWindowsGNUEnvironment ( ) const
inline

Definition at line 712 of file Triple.h.

References getEnvironment(), GNU, and isOSWindows().

Referenced by isCompatibleWith(), isOSCygMing(), and isOSMSVCRT().

◆ isWindowsItaniumEnvironment()

bool llvm::Triple::isWindowsItaniumEnvironment ( ) const
inline

Definition at line 704 of file Triple.h.

References getEnvironment(), isOSWindows(), and Itanium.

Referenced by createX86MCAsmInfo(), getDefaultExceptionHandling(), and isOSMSVCRT().

◆ isWindowsMSVCEnvironment()

bool llvm::Triple::isWindowsMSVCEnvironment ( ) const
inline

Checks if the environment could be MSVC.

Definition at line 689 of file Triple.h.

References getEnvironment(), isKnownWindowsMSVCEnvironment(), isOSWindows(), and UnknownEnvironment.

Referenced by createAArch64MCAsmInfo(), createARMMCAsmInfo(), createX86MCAsmInfo(), and isOSMSVCRT().

◆ isX32()

bool llvm::Triple::isX32 ( ) const
inline

Tests whether the target is X32.

Definition at line 1134 of file Triple.h.

References getEnvironment(), GNUX32, and MuslX32.

Referenced by llvm::createX86_64AsmBackend().

◆ isX86()

bool llvm::Triple::isX86 ( ) const
inline

Tests whether the target is x86 (32- or 64-bit).

Definition at line 1102 of file Triple.h.

References getArch(), x86, and x86_64.

Referenced by getDefaultExceptionHandling().

◆ isXROS()

bool llvm::Triple::isXROS ( ) const
inline

Is this an Apple XROS triple.

Definition at line 594 of file Triple.h.

References getOS(), and XROS.

Referenced by isOSDarwin().

◆ merge()

std::string Triple::merge ( const Triple & Other) const

Merge target triples.

Definition at line 2162 of file Triple.cpp.

References Apple, getVendor(), llvm::Other, str(), and Triple().

◆ normalize() [1/2]

std::string llvm::Triple::normalize ( CanonicalForm Form = CanonicalForm::ANY) const
inline

Return the normalized form of this triple's string.

Definition at line 402 of file Triple.h.

References ANY, and normalize().

◆ normalize() [2/2]

std::string Triple::normalize ( StringRef Str,
CanonicalForm Form = CanonicalForm::ANY )
static

Turn an arbitrary machine specification into the canonical triple form (or something sensible that the Triple class understands if nothing better can reasonably be done).

In particular, it handles the common case in which otherwise valid components are in the wrong order. Form is used to specify the output canonical form.

Definition at line 1165 of file Triple.cpp.

References Android, ANY, assert(), llvm::CallingConv::C, COFF, llvm::StringRef::empty(), empty(), FIVE_IDENT, FOUR_IDENT, getDXILArchNameFromShaderModel(), getObjectFormatTypeName(), GNUEABI, llvm::join(), llvm_unreachable, parseArch(), parseEnvironment(), parseFormat(), parseOS(), parseVendor(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorImpl< T >::resize(), ShaderModel, llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::StringRef::starts_with(), starts_with(), llvm::Twine::str(), SUSE, std::swap(), THREE_IDENT, UnknownArch, UnknownEnvironment, UnknownObjectFormat, UnknownOS, UnknownVendor, and Win32.

Referenced by llvm::sys::getProcessTriple(), LLVMNormalizeTargetTriple(), normalize(), and llvm::SPIRVTranslateModule().

◆ operator!=()

bool llvm::Triple::operator!= ( const Triple & Other) const
inline

Definition at line 377 of file Triple.h.

References llvm::Other, and Triple().

◆ operator==()

bool llvm::Triple::operator== ( const Triple & Other) const
inline

Definition at line 370 of file Triple.h.

References llvm::Other, and Triple().

◆ setArch()

void Triple::setArch ( ArchType Kind,
SubArchType SubArch = NoSubArch )

Set the architecture (first) component of the triple to a known type.

Definition at line 1638 of file Triple.cpp.

References getArchName(), and setArchName().

Referenced by llvm::TargetRegistry::lookupTarget(), llvm::object::ObjectFile::makeTriple(), and llvm::EngineBuilder::selectTarget().

◆ setArchName()

void Triple::setArchName ( StringRef Str)

Set the architecture (first) component of the triple by name.

Definition at line 1666 of file Triple.cpp.

References getOSAndEnvironmentName(), getVendorName(), and setTriple().

Referenced by setArch(), and llvm::object::ELFObjectFileBase::setARMSubArch().

◆ setEnvironment()

void Triple::setEnvironment ( EnvironmentType Kind)

Set the environment (fourth) component of the triple to a known type.

Definition at line 1650 of file Triple.cpp.

References getDefaultFormat(), getEnvironmentTypeName(), getObjectFormatTypeName(), setEnvironmentName(), and str().

◆ setEnvironmentName()

void Triple::setEnvironmentName ( StringRef Str)

Set the optional environment (fourth) component of the triple by name.

Definition at line 1682 of file Triple.cpp.

References getArchName(), getOSName(), getVendorName(), and setTriple().

Referenced by setEnvironment(), and setObjectFormat().

◆ setObjectFormat()

void Triple::setObjectFormat ( ObjectFormatType Kind)

Set the object file format.

Definition at line 1658 of file Triple.cpp.

References getEnvironmentTypeName(), getObjectFormatTypeName(), setEnvironmentName(), str(), and UnknownEnvironment.

Referenced by llvm::object::ObjectFile::makeTriple().

◆ setOS()

void Triple::setOS ( OSType Kind)

Set the operating system (third) component of the triple to a known type.

Definition at line 1646 of file Triple.cpp.

References getOSTypeName(), and setOSName().

Referenced by llvm::object::ObjectFile::makeTriple().

◆ setOSAndEnvironmentName()

void Triple::setOSAndEnvironmentName ( StringRef Str)

Set the operating system and optional environment components with a single string.

Definition at line 1687 of file Triple.cpp.

References getArchName(), getVendorName(), and setTriple().

◆ setOSName()

void Triple::setOSName ( StringRef Str)

Set the operating system (third) component of the triple by name.

Definition at line 1674 of file Triple.cpp.

References getArchName(), getEnvironmentName(), getVendorName(), hasEnvironment(), and setTriple().

Referenced by setOS().

◆ setTriple()

void Triple::setTriple ( const Twine & Str)

◆ setVendor()

void Triple::setVendor ( VendorType Kind)

Set the vendor (second) component of the triple to a known type.

Definition at line 1642 of file Triple.cpp.

References getVendorTypeName(), and setVendorName().

Referenced by llvm::object::ObjectFile::makeTriple().

◆ setVendorName()

void Triple::setVendorName ( StringRef Str)

Set the vendor (second) component of the triple by name.

Definition at line 1670 of file Triple.cpp.

References getArchName(), getOSAndEnvironmentName(), and setTriple().

Referenced by setVendor().

◆ str()

◆ supportsCOMDAT()

bool llvm::Triple::supportsCOMDAT ( ) const
inline

Tests whether the target supports comdat.

Definition at line 1161 of file Triple.h.

References isOSBinFormatDXContainer(), isOSBinFormatMachO(), and isOSBinFormatXCOFF().


The documentation for this class was generated from the following files: