Helper class for working with autoconf‐style target configuration names.
Synopsis
Declared in <llvm/TargetParser/Triple.h>
class Triple;
Description
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.
Enums
Name |
Description |
Architecture type of a target triple. |
|
Canonical form |
|
Environment / ABI component of a target triple. |
|
Operating system type of a target triple. |
|
Object file format component of a target triple. |
|
Sub‐architecture type of a target triple. |
|
Hardware/OS vendor component of a target triple. |
Member Functions
Name |
Description |
|
Constructors |
Compute the LLVM IR data layout string based on the triple. Some targets customize the layout based on the ABIName string. |
|
Whether the triple is empty / default constructed. |
|
Form a triple with a 32‐bit variant of the current architecture. |
|
Form a triple with a 64‐bit variant of the current architecture. |
|
Get the parsed architecture type of this triple. |
|
Get the architecture (first) component of the triple. |
|
Returns the pointer width of this architecture. |
|
Form a triple with a big endian variant of the current architecture. |
|
Parse the DXIL version number from the OSVersion and DXIL version (SubArch). This should only be called with DXIL triples. |
|
Returns the default exception‐handling model for this triple. |
|
Returns the default floating‐point ABI for this target triple, i.e. the ABI the code generator will resolve FloatABI::Default to |
|
Returns the default floating‐point format for the "long double" type. A particular module may override this default. |
|
Returns the default wchar_t size (in bytes) for this target triple. |
|
Parse the version number as with getOSVersion. |
|
Get the parsed environment type of this triple. |
|
Get the optional environment (fourth) component of the triple, or "" if empty. |
|
Parse the version number from the OS name component of the triple, if present. |
|
Get the version component of the environment component as a single string (the version after the environment). |
|
Form a triple with a little endian variant of the current architecture. |
|
Parse the OS version and translate generic Darwin versions to macOS versions. |
|
Return the minimum supported OS version for this triple, if any. |
|
Get the parsed operating system type of this triple. |
|
Get the operating system and optional environment components as a single string (separated by a '‐' if the environment component is present). |
|
Return just the major version number, this is specialized because it is a common query. |
|
Get the operating system (third) component of the triple. |
|
Parse the version number from the OS name component of the triple, if present. |
|
Get the object format for this triple. |
|
get the parsed subarchitecture type for this triple. |
|
Returns the trampoline size in bytes for this configuration. |
|
Get the full triple string. |
|
Get the parsed vendor type of this triple. |
|
Get the vendor (second) component of the triple. |
|
Parse the Vulkan version number from the OSVersion and SPIR‐V version (SubArch). This should only be called with Vulkan SPIR‐V triples. |
|
Parse the version number as with getOSVersion. This should only be called with WatchOS or generic triples. |
|
Parse the version number as with getOSVersion. This should only be called with IOS or generic triples. |
|
Tests if the environment supports dllimport/export annotations. |
|
Tests whether the target uses ‐data‐sections as default. |
|
Tests whether the target uses emulated TLS as default. |
|
True if the target uses TLSDESC by default. |
|
Does this triple have the optional environment (fourth) component? |
|
|
|
True if the environment is an N32 ABI (GNU or musl). |
|
Tests whether the target is AMDGCN True if the architecture is AMDGCN (amdgpu). |
|
True if the architecture is AMDGPU (AMDGCN or R600). |
|
Tests whether the target is ARM (little and big endian). |
|
Whether the triple is for the AVR architecture. |
|
Tests whether the target is Android |
|
True if this Android target's API level is less than |
|
Is this an Apple firmware triple. |
|
Is this an Apple MachO triple. |
|
Test whether the architecture is 16‐bit |
|
Test whether the architecture is 32‐bit |
|
Test whether the architecture is 64‐bit |
|
Tests whether the target is the Apple "arm64e" AArch64 subarch. |
|
Tests whether the target is an M‐class. |
|
Tests whether the target is T32. |
|
Tests whether the target is eBPF. |
|
Is this an Apple BridgeOS triple. |
|
Tests whether the target is CSKY. |
|
Test whether target triples are compatible. |
|
Tests whether the target is DXIL. |
|
Tests whether MSVC linker or UEFI targets. Used to default to ‐mincremental‐linker‐compatible if we are targeting the MSVC linker or *‐uefi triples. |
|
Is this an Apple DriverKit triple. |
|
Tests whether the environment is a GNU environment. |
|
Test whether the target triple is for a GPU. |
|
Tests if the target's default floating‐point ABI is hard float. |
|
Checks if the environment is MSVC. |
|
Tests whether the target is LFI. |
|
Tests whether the target triple is little endian. |
|
Tests whether the target is LoongArch (32‐ and 64‐bit). |
|
Tests whether the target is 32‐bit LoongArch. |
|
Tests whether the target is 64‐bit LoongArch. |
|
Tests whether the target is MIPS (little and big endian, 32‐ or 64‐bit). |
|
Tests whether the target is MIPS 32‐bit (little and big endian). |
|
Tests whether the target is MIPS 64‐bit (little and big endian). |
|
True if this is the Mac Catalyst (MacABI) environment. |
|
Is this a Mac OS X triple. For legacy reasons, we support both "darwin" and "osx" as OS X triples. |
|
True if this Mac OS X triple's version is greater than or equal to the given version. |
|
True if this Mac OS X triple's version is less than the given version. |
|
Tests whether the environment is musl‐libc |
|
Tests whether the target is NVPTX (32‐ or 64‐bit). |
|
Tests whether the target is OHOS LiteOS default enviroment is also OHOS, but omited on triple. |
|
Tests whether the OS is AIX. |
|
Tests whether the OS uses the COFF binary format. |
|
Tests whether the OS uses the DXContainer binary format. |
|
Tests whether the OS uses the ELF binary format. |
|
Tests whether the OS uses the GOFF binary format. |
|
Tests whether the environment is MachO. |
|
Tests whether the OS uses the Wasm binary format. |
|
Tests whether the OS uses the XCOFF binary format. |
|
Tests for either Cygwin or MinGW OS |
|
Is this a "Darwin" OS (macOS, iOS, tvOS, watchOS, DriverKit, XROS, or bridgeOS). |
|
Tests whether the OS is DragonFly BSD. |
|
Tests whether the OS is Emscripten. |
|
True if this is a bare‐metal firmware OS triple. |
|
Tests whether the OS is FreeBSD. |
|
Tests whether the OS is Fuchsia. |
|
Tests whether the OS uses glibc. |
|
Tests whether the OS is H2. |
|
Tests whether the OS is Haiku. |
|
Tests whether the OS is Hurd. |
|
True if this is the Intel MCU (ELFIAMCU) OS. |
|
Tests whether the OS is kFreeBSD. |
|
Tests whether the OS is Linux. |
|
Tests whether the OS is LiteOS. |
|
Is this a "Windows" OS targeting a "MSVCRT.dll" environment. |
|
Tests whether the OS is Managarm. |
|
Tests whether the OS is NetBSD. |
|
Tests whether the OS is OpenBSD. |
|
Tests whether the OS is QURT. |
|
True if this is a Serenity OS triple. |
|
Tests whether the OS is Solaris. |
|
Tests whether the OS is unknown/unspecified. |
|
|
|
|
|
Tests whether the OS is WASI. |
|
Tests whether the OS is Windows. |
|
Tests whether the OS is Windows or UEFI. |
|
True if this is a z/OS triple. |
|
True if the environment is OpenHarmony OS (OpenHOS). |
|
Tests whether the target is PowerPC (32‐ or 64‐bit LE or BE). |
|
Tests whether the target is 32‐bit PowerPC (little and big endian). |
|
Tests whether the target 32‐bit PowerPC uses Secure PLT. |
|
Tests whether the target is 64‐bit PowerPC (little and big endian). |
|
Tests whether the target 64‐bit PowerPC big endian ABI is ELFv2. |
|
Tests whether the target is the PS4 or PS5 platform. |
|
Tests whether the target is the PS4 platform. |
|
Tests whether the target is the PS5 platform. |
|
Tests whether the target is RISC‐V (32‐ and 64‐bit). |
|
Tests whether the target is 32‐bit RISC‐V. |
|
Tests whether the target is 64‐bit RISC‐V. |
|
Tests whether the target is SPARC. |
|
Tests whether the target is 32‐bit SPARC (little and big endian). |
|
Tests whether the target is 64‐bit SPARC (big endian). |
|
Tests whether the target is SPIR (32‐ or 64‐bit). |
|
Tests whether the target is SPIR‐V or SPIR. |
|
Tests whether the target is SPIR‐V (32/64‐bit/Logical). |
|
Tests whether the target is SPIR‐V Logical |
|
True if this is a DirectX ShaderModel OS triple. |
|
True if the environment names a DirectX/Vulkan shader stage. |
|
True if the environment is a simulator variant (e.g. Apple Simulator). |
|
Tests whether the target is SystemZ. |
|
True for bare‐metal ARM EABI/EABIHF (not Darwin or Windows). |
|
Tests whether the target supports the EHABI exception handling standard. |
|
True if the environment is a GNU EABI variant (non‐Darwin/Windows). |
|
Returns true for targets that run on a macOS machine. |
|
True if the environment is a musl EABI or OpenHOS variant (non‐Darwin/Windows). |
|
Tests whether the target is Thumb (little and big endian). |
|
Tests if the target forces 64‐bit time_t on a 32‐bit architecture. |
|
Is this an Apple tvOS triple. |
|
Tests whether the OS is UEFI. |
|
Tests whether the target is VE |
|
True if this is a Vulkan OS triple. |
|
Tests whether the target uses WALI Wasm |
|
Tests whether the target is wasm (32‐ and 64‐bit). |
|
True if this uses the Apple watchOS ABI (ARM v7k sub‐architecture). |
|
Is this an Apple watchOS triple. |
|
True if this is a Windows target using the Arm64EC ABI. |
|
True if this is Windows targeting the CoreCLR environment. |
|
Tests whether the environment is Cygwin on Windows. |
|
True if this is Windows targeting the GNU (MinGW) environment. |
|
True if this is Windows targeting the Itanium C++ ABI environment. |
|
Checks if the environment could be MSVC. |
|
Tests whether the target is X32. |
|
Tests whether the target is x86 (32‐ or 64‐bit). |
|
Tests whether the target is x86 (32‐bit). |
|
Tests whether the target is x86 (64‐bit). |
|
Is this an Apple XROS triple. |
|
True if this is an iOS (or tvOS) triple. |
|
Merge target triples. |
|
Return the normalized form of this triple's string. |
|
Set the architecture (first) component of the triple to a known type. |
|
Set the architecture (first) component of the triple by name. |
|
Set the environment (fourth) component of the triple to a known type. |
|
Set the optional environment (fourth) component of the triple by name. |
|
Set the operating system (third) component of the triple to a known type. |
|
Set the operating system and optional environment components with a single string. |
|
Set the operating system (third) component of the triple by name. |
|
Set the object file format. |
|
Set all components to the new triple |
|
Set the vendor (second) component of the triple to a known type. |
|
Set the vendor (second) component of the triple by name. |
|
Return the full triple string. |
|
Tests whether the target supports comdat |
|
True if this triple equals |
|
True if this triple is not equal to |
|
Lexicographical compare of the normalized triple string against |
Static Member Functions
Name |
Description |
Get the architecture name based on |
|
Returns the pointer width of this architecture. |
|
The canonical type for the given LLVM architecture name (e.g., "x86"). |
|
Get the canonical name for the |
|
Get the "prefix" canonical name for the |
|
Returns a canonicalized OS version number for the specified OS. |
|
Get the canonical name for the |
|
Get the canonical name for the |
|
Get the name for the |
|
Get the canonical name for the |
|
Returns whether an OS version is invalid and would not map to an Apple OS. |
|
Normalize an arbitrary machine specification into a canonical triple string. |
|
Parse anything recognized as an architecture for the first field of the triple. |
|
Parse a sub‐architecture from the architecture field of a triple. |
Non-Member Functions
Name |
Description |
Create a default MCRelocationInfo for the given triple. |
|
Create a default MCSymbolizer for the given triple. |
|
Fill AddressSanitizer shadow‐mapping parameters for a target. |
|
Returns the LLVM IR syncscope string that |
|
Return the default exception‐handling personality for target |
|
Parses a target syncscope string into its abstract scope. |
|
Place |
|
Return true if register X18 is reserved by default for triple |
|
Returns the canonical architecture name for |
|
Return true if the subarches of triples |
|
Returns the effective triple appropriate to use when linking |
|
Return the default ABI name string for triple |
|
Return the |
|
Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting. |
|
Map a target triple to a Mach‐O CPU subtype value. |
|
Map a target triple to a Mach‐O CPU subtype, including arm64e ptrauth ABI bits. |
|
Map a target triple to a Mach‐O CPUType value. |
|
Convert a target to an architecture slice. |
|
Map a target triple to a Mach‐O platform type. |
|
Map a triple to a supported OS version for TextAPI. |
|
Return the normalized PowerPC target CPU name for |
|
Return the normalized PowerPC tune CPU name for |
|
Return the default target features for PowerPC CPU |
|
Initialize a TargetOptions object from the registered CodeGen flags. |
|
Create a TargetMachine using the options defined on the command line. |
|
Create a TargetLibraryInfoImpl for a target triple and vector library. |
|
Create a |
|
Get target‐specific AnonymousPointerCreator |
|
Get target‐specific PointerJumpStubCreator |
|
Return the default ThinLTO CPU name for the given triple. |
|
Return the program counter value for the current insertion point. |
|
Create a local compile callback manager. |
|
Create a local indirect stubs manager builder. |
|
Create a LocalLazyCallThroughManager from the given triple and execution session. |
|
Return MachO header info appropriate for the given target triple. |
Created with MrDocs