LLVM  6.0.0svn
Public Types | List of all members
llvm::Triple Class Reference

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

#include "llvm/ADT/Triple.h"

Public Types

enum  ArchType {
  UnknownArch, arm, armeb, aarch64,
  aarch64_be, avr, bpfel, bpfeb,
  hexagon, mips, mipsel, mips64,
  mips64el, msp430, nios2, ppc,
  ppc64, ppc64le, r600, amdgcn,
  riscv32, riscv64, sparc, sparcv9,
  sparcel, systemz, tce, tcele,
  thumb, thumbeb, x86, x86_64,
  xcore, nvptx, nvptx64, le32,
  le64, amdil, amdil64, hsail,
  hsail64, spir, spir64, kalimba,
  shave, lanai, wasm32, wasm64,
  renderscript32, renderscript64, LastArchType = renderscript64
}
 
enum  SubArchType {
  NoSubArch, ARMSubArch_v8_2a, ARMSubArch_v8_1a, ARMSubArch_v8,
  ARMSubArch_v8r, ARMSubArch_v8m_baseline, ARMSubArch_v8m_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,
  KalimbaSubArch_v3, KalimbaSubArch_v4, KalimbaSubArch_v5
}
 
enum  VendorType {
  UnknownVendor, Apple, PC, SCEI,
  BGP, BGQ, Freescale, IBM,
  ImaginationTechnologies, MipsTechnologies, NVIDIA, CSR,
  Myriad, AMD, Mesa, SUSE,
  LastVendorType = SUSE
}
 
enum  OSType {
  UnknownOS, Ananas, CloudABI, Darwin,
  DragonFly, FreeBSD, Fuchsia, IOS,
  KFreeBSD, Linux, Lv2, MacOSX,
  NetBSD, OpenBSD, Solaris, Win32,
  Haiku, Minix, RTEMS, NaCl,
  CNK, AIX, CUDA, NVCL,
  AMDHSA, PS4, ELFIAMCU, TvOS,
  WatchOS, Mesa3D, Contiki, LastOSType = Contiki
}
 
enum  EnvironmentType {
  UnknownEnvironment, GNU, GNUABI64, GNUEABI,
  GNUEABIHF, GNUX32, CODE16, EABI,
  EABIHF, Android, Musl, MuslEABI,
  MuslEABIHF, MSVC, Itanium, Cygnus,
  AMDOpenCL, CoreCLR, OpenCL, LastEnvironmentType = OpenCL
}
 
enum  ObjectFormatType {
  UnknownObjectFormat, COFF, ELF, MachO,
  Wasm
}
 

Public Member Functions

Constructors
 Triple ()
 Default constructor is the same as an empty string and leaves all triple fields unknown. More...
 
 Triple (const Twine &Str)
 Construct a triple from the string representation provided. More...
 
 Triple (const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr)
 Construct a triple from string representations of the architecture, vendor, and OS. More...
 
 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. More...
 
bool operator== (const Triple &Other) const
 
bool operator!= (const Triple &Other) const
 
Typed Component Access
ArchType getArch () const
 getArch - Get the parsed architecture type of this triple. More...
 
SubArchType getSubArch () const
 getSubArch - get the parsed subarchitecture type for this triple. More...
 
VendorType getVendor () const
 getVendor - Get the parsed vendor type of this triple. More...
 
OSType getOS () const
 getOS - Get the parsed operating system type of this triple. More...
 
bool hasEnvironment () const
 hasEnvironment - Does this triple have the optional environment (fourth) component? More...
 
EnvironmentType getEnvironment () const
 getEnvironment - Get the parsed environment type of this triple. More...
 
void getEnvironmentVersion (unsigned &Major, unsigned &Minor, unsigned &Micro) const
 Parse the version number from the OS name component of the triple, if present. More...
 
ObjectFormatType getObjectFormat () const
 getFormat - Get the object format for this triple. More...
 
void getOSVersion (unsigned &Major, unsigned &Minor, unsigned &Micro) const
 getOSVersion - Parse the version number from the OS name component of the triple, if present. More...
 
unsigned getOSMajorVersion () const
 getOSMajorVersion - Return just the major version number, this is specialized because it is a common query. More...
 
bool getMacOSXVersion (unsigned &Major, unsigned &Minor, unsigned &Micro) const
 getMacOSXVersion - Parse the version number as with getOSVersion and then translate generic "darwin" versions to the corresponding OS X versions. More...
 
void getiOSVersion (unsigned &Major, unsigned &Minor, unsigned &Micro) const
 getiOSVersion - Parse the version number as with getOSVersion. More...
 
void getWatchOSVersion (unsigned &Major, unsigned &Minor, unsigned &Micro) const
 getWatchOSVersion - Parse the version number as with getOSVersion. More...
 
Direct Component Access
const std::string & str () const
 
const std::string & getTriple () const
 
StringRef getArchName () const
 getArchName - Get the architecture (first) component of the triple. More...
 
StringRef getVendorName () const
 getVendorName - Get the vendor (second) component of the triple. More...
 
StringRef getOSName () const
 getOSName - Get the operating system (third) component of the triple. More...
 
StringRef getEnvironmentName () const
 getEnvironmentName - Get the optional environment (fourth) component of the triple, or "" if empty. More...
 
StringRef getOSAndEnvironmentName () const
 getOSAndEnvironmentName - Get the operating system and optional environment components as a single string (separated by a '-' if the environment component is present). More...
 
Convenience Predicates
bool isArch64Bit () const
 Test whether the architecture is 64-bit. More...
 
bool isArch32Bit () const
 Test whether the architecture is 32-bit. More...
 
bool isArch16Bit () const
 Test whether the architecture is 16-bit. More...
 
bool isOSVersionLT (unsigned Major, unsigned Minor=0, unsigned Micro=0) const
 isOSVersionLT - Helper function for doing comparisons against version numbers included in the target triple. More...
 
bool isOSVersionLT (const Triple &Other) const
 
bool isMacOSXVersionLT (unsigned Major, unsigned Minor=0, unsigned Micro=0) const
 isMacOSXVersionLT - Comparison function for checking OS X version compatibility, which handles supporting skewed version numbering schemes used by the "darwin" triples. More...
 
bool isMacOSX () const
 isMacOSX - Is this a Mac OS X triple. More...
 
bool isiOS () const
 Is this an iOS triple. More...
 
bool isTvOS () const
 Is this an Apple tvOS triple. More...
 
bool isWatchOS () const
 Is this an Apple watchOS triple. More...
 
bool isWatchABI () const
 
bool isOSDarwin () const
 isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS). More...
 
bool isOSNetBSD () const
 
bool isOSOpenBSD () const
 
bool isOSFreeBSD () const
 
bool isOSFuchsia () const
 
bool isOSDragonFly () const
 
bool isOSSolaris () const
 
bool isOSIAMCU () const
 
bool isGNUEnvironment () const
 
bool isOSContiki () const
 
bool isWindowsMSVCEnvironment () const
 Checks if the environment could be MSVC. More...
 
bool isKnownWindowsMSVCEnvironment () const
 Checks if the environment is MSVC. More...
 
bool isWindowsCoreCLREnvironment () const
 
bool isWindowsItaniumEnvironment () const
 
bool isWindowsCygwinEnvironment () const
 
bool isWindowsGNUEnvironment () const
 
bool isOSCygMing () const
 Tests for either Cygwin or MinGW OS. More...
 
bool isOSMSVCRT () const
 Is this a "Windows" OS targeting a "MSVCRT.dll" environment. More...
 
bool isOSWindows () const
 Tests whether the OS is Windows. More...
 
bool isOSNaCl () const
 Tests whether the OS is NaCl (Native Client) More...
 
bool isOSLinux () const
 Tests whether the OS is Linux. More...
 
bool isOSKFreeBSD () const
 Tests whether the OS is kFreeBSD. More...
 
bool isOSGlibc () const
 Tests whether the OS uses glibc. More...
 
bool isOSBinFormatELF () const
 Tests whether the OS uses the ELF binary format. More...
 
bool isOSBinFormatCOFF () const
 Tests whether the OS uses the COFF binary format. More...
 
bool isOSBinFormatMachO () const
 Tests whether the environment is MachO. More...
 
bool isOSBinFormatWasm () const
 Tests whether the OS uses the Wasm binary format. More...
 
bool isPS4CPU () const
 Tests whether the target is the PS4 CPU. More...
 
bool isPS4 () const
 Tests whether the target is the PS4 platform. More...
 
bool isAndroid () const
 Tests whether the target is Android. More...
 
bool isAndroidVersionLT (unsigned Major) const
 
bool isMusl () const
 Tests whether the environment is musl-libc. More...
 
bool isNVPTX () const
 Tests whether the target is NVPTX (32- or 64-bit). More...
 
bool supportsCOMDAT () const
 Tests wether the target supports comdat. More...
 
Mutators
void setArch (ArchType Kind)
 setArch - Set the architecture (first) component of the triple to a known type. More...
 
void setVendor (VendorType Kind)
 setVendor - Set the vendor (second) component of the triple to a known type. More...
 
void setOS (OSType Kind)
 setOS - Set the operating system (third) component of the triple to a known type. More...
 
void setEnvironment (EnvironmentType Kind)
 setEnvironment - Set the environment (fourth) component of the triple to a known type. More...
 
void setObjectFormat (ObjectFormatType Kind)
 setObjectFormat - Set the object file format More...
 
void setTriple (const Twine &Str)
 setTriple - Set all components to the new triple Str. More...
 
void setArchName (StringRef Str)
 setArchName - Set the architecture (first) component of the triple by name. More...
 
void setVendorName (StringRef Str)
 setVendorName - Set the vendor (second) component of the triple by name. More...
 
void setOSName (StringRef Str)
 setOSName - Set the operating system (third) component of the triple by name. More...
 
void setEnvironmentName (StringRef Str)
 setEnvironmentName - Set the optional environment (fourth) component of the triple by name. More...
 
void setOSAndEnvironmentName (StringRef Str)
 setOSAndEnvironmentName - Set the operating system and optional environment components with a single string. More...
 
Helpers to build variants of a particular triple.
llvm::Triple get32BitArchVariant () const
 Form a triple with a 32-bit variant of the current architecture. More...
 
llvm::Triple get64BitArchVariant () const
 Form a triple with a 64-bit variant of the current architecture. More...
 
llvm::Triple getBigEndianArchVariant () const
 Form a triple with a big endian variant of the current architecture. More...
 
llvm::Triple getLittleEndianArchVariant () const
 Form a triple with a little endian variant of the current architecture. More...
 
StringRef getARMCPUForArch (StringRef Arch=StringRef()) const
 Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting. More...
 
bool isLittleEndian () const
 Tests whether the target triple is little endian. More...
 
bool isCompatibleWith (const Triple &Other) const
 Test whether target triples are compatible. More...
 
std::string merge (const Triple &Other) const
 Merge target triples. More...
 

Static Public Member Functions

Static helpers for IDs.
static StringRef getArchTypeName (ArchType Kind)
 getArchTypeName - Get the canonical name for the Kind architecture. More...
 
static StringRef getArchTypePrefix (ArchType Kind)
 getArchTypePrefix - Get the "prefix" canonical name for the Kind architecture. More...
 
static StringRef getVendorTypeName (VendorType Kind)
 getVendorTypeName - Get the canonical name for the Kind vendor. More...
 
static StringRef getOSTypeName (OSType Kind)
 getOSTypeName - Get the canonical name for the Kind operating system. More...
 
static StringRef getEnvironmentTypeName (EnvironmentType Kind)
 getEnvironmentTypeName - Get the canonical name for the Kind environment. More...
 
Static helpers for converting alternate architecture names.
static ArchType getArchTypeForLLVMName (StringRef Str)
 getArchTypeForLLVMName - The canonical type for the given LLVM architecture name (e.g., "x86"). More...
 

Normalization

std::string normalize () const
 Return the normalized form of this triple's string. More...
 
static std::string normalize (StringRef Str)
 normalize - 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). More...
 

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 44 of file Triple.h.

Member Enumeration Documentation

◆ ArchType

Enumerator
UnknownArch 
arm 
armeb 
aarch64 
aarch64_be 
avr 
bpfel 
bpfeb 
hexagon 
mips 
mipsel 
mips64 
mips64el 
msp430 
nios2 
ppc 
ppc64 
ppc64le 
r600 
amdgcn 
riscv32 
riscv64 
sparc 
sparcv9 
sparcel 
systemz 
tce 
tcele 
thumb 
thumbeb 
x86 
x86_64 
xcore 
nvptx 
nvptx64 
le32 
le64 
amdil 
amdil64 
hsail 
hsail64 
spir 
spir64 
kalimba 
shave 
lanai 
wasm32 
wasm64 
renderscript32 
renderscript64 
LastArchType 

Definition at line 46 of file Triple.h.

◆ EnvironmentType

Enumerator
UnknownEnvironment 
GNU 
GNUABI64 
GNUEABI 
GNUEABIHF 
GNUX32 
CODE16 
EABI 
EABIHF 
Android 
Musl 
MuslEABI 
MuslEABIHF 
MSVC 
Itanium 
Cygnus 
AMDOpenCL 
CoreCLR 
OpenCL 
LastEnvironmentType 

Definition at line 182 of file Triple.h.

◆ ObjectFormatType

Enumerator
UnknownObjectFormat 
COFF 
ELF 
MachO 
Wasm 

Definition at line 206 of file Triple.h.

◆ OSType

Enumerator
UnknownOS 
Ananas 
CloudABI 
Darwin 
DragonFly 
FreeBSD 
Fuchsia 
IOS 
KFreeBSD 
Linux 
Lv2 
MacOSX 
NetBSD 
OpenBSD 
Solaris 
Win32 
Haiku 
Minix 
RTEMS 
NaCl 
CNK 
AIX 
CUDA 
NVCL 
AMDHSA 
PS4 
ELFIAMCU 
TvOS 
WatchOS 
Mesa3D 
Contiki 
LastOSType 

Definition at line 147 of file Triple.h.

◆ SubArchType

Enumerator
NoSubArch 
ARMSubArch_v8_2a 
ARMSubArch_v8_1a 
ARMSubArch_v8 
ARMSubArch_v8r 
ARMSubArch_v8m_baseline 
ARMSubArch_v8m_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 
KalimbaSubArch_v3 
KalimbaSubArch_v4 
KalimbaSubArch_v5 

Definition at line 100 of file Triple.h.

◆ VendorType

Enumerator
UnknownVendor 
Apple 
PC 
SCEI 
BGP 
BGQ 
Freescale 
IBM 
ImaginationTechnologies 
MipsTechnologies 
NVIDIA 
CSR 
Myriad 
AMD 
Mesa 
SUSE 
LastVendorType 

Definition at line 127 of file Triple.h.

Constructor & Destructor Documentation

◆ Triple() [1/4]

llvm::Triple::Triple ( )
inline

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

Definition at line 242 of file Triple.h.

Referenced by setArchName(), and setTriple().

◆ Triple() [2/4]

Triple::Triple ( const Twine Str)
explicit

Construct a triple from the string representation provided.

This stores the string representation and parses the various pieces into enum members.

Definition at line 670 of file Triple.cpp.

References getDefaultFormat(), parseArch(), parseEnvironment(), parseFormat(), parseOS(), parseSubArch(), parseVendor(), llvm::SmallVectorTemplateCommon< T >::size(), llvm::StringRef::split(), and UnknownObjectFormat.

◆ Triple() [3/4]

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 701 of file Triple.cpp.

References getDefaultFormat().

◆ Triple() [4/4]

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 716 of file Triple.cpp.

References getDefaultFormat(), and UnknownObjectFormat.

Member Function Documentation

◆ 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 1233 of file Triple.cpp.

References aarch64, aarch64_be, amdgcn, amdil, amdil64, arm, armeb, avr, bpfeb, bpfel, getArch(), hexagon, hsail, hsail64, kalimba, lanai, le32, le64, mips, mips64, mips64el, mipsel, msp430, nios2, nvptx, nvptx64, ppc, ppc64, ppc64le, r600, renderscript32, renderscript64, riscv32, riscv64, setArch(), shave, sparc, sparcel, sparcv9, spir, spir64, systemz, T, tce, tcele, thumb, thumbeb, UnknownArch, wasm32, wasm64, x86, x86_64, and xcore.

Referenced by llvm::sys::getProcessTriple(), and supportsCOMDAT().

◆ 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 1296 of file Triple.cpp.

References aarch64, aarch64_be, amdgcn, amdil, amdil64, arm, armeb, avr, bpfeb, bpfel, getArch(), hexagon, hsail, hsail64, kalimba, lanai, le32, le64, mips, mips64, mips64el, mipsel, msp430, nios2, nvptx, nvptx64, ppc, ppc64, ppc64le, r600, renderscript32, renderscript64, riscv32, riscv64, setArch(), shave, sparc, sparcel, sparcv9, spir, spir64, systemz, T, tce, tcele, thumb, thumbeb, UnknownArch, wasm32, wasm64, x86, x86_64, and xcore.

Referenced by llvm::sys::getProcessTriple(), and supportsCOMDAT().

◆ getArch()

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

getArch - Get the parsed architecture type of this triple.

Definition at line 280 of file Triple.h.

Referenced by llvm::AArch64MCAsmInfoELF::AArch64MCAsmInfoELF(), adjustCodeGenOpts(), adjustFixupValue(), adjustInlineAsm(), llvm::AMDGPUTargetMachine::adjustPassManager(), llvm::AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(), llvm::ARMELFMCAsmInfo::ARMELFMCAsmInfo(), llvm::ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(), llvm::BPFMCAsmInfo::BPFMCAsmInfo(), llvm::LTOCodeGenerator::compile(), computeDataLayout(), computeFSAdditions(), llvm::MipsABIInfo::computeTargetABI(), computeTargetABI(), createELFStreamer(), llvm::orc::createLocalCompileCallbackManager(), llvm::orc::createLocalIndirectStubsManagerBuilder(), llvm::createPPCAsmBackend(), createPPCMCAsmInfo(), llvm::createPPCMCCodeEmitter(), createPPCMCRegisterInfo(), createSparcMCSubtargetInfo(), createTLOF(), createX86MCAsmInfo(), createX86MCRegisterInfo(), emitDarwinBCHeaderAndTrailer(), llvm::X86AsmPrinter::EmitEndOfAsmFile(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), llvm::X86AsmPrinter::EmitStartOfAsmFile(), get32BitArchVariant(), get64BitArchVariant(), getBigEndianArchVariant(), getCOFFSectionFlags(), getDataLayoutString(), getDefaultFormat(), llvm::SubtargetFeatures::getDefaultSubtargetFeatures(), llvm::X86_MC::getDwarfRegFlavour(), getEffectiveRelocModel(), getGPUOrDefault(), getiOSVersion(), llvm::ARMAsmPrinter::getISAEncoding(), getLittleEndianArchVariant(), llvm::DataLayout::getManglingComponent(), llvm::AMDGPUTargetMachine::getTargetIRAnalysis(), llvm::TargetLibraryInfoImpl::getTargetWCharSize(), getUnderlyingArgReg(), hasSinCosPiStret(), initialize(), INITIALIZE_PASS(), isArch16Bit(), isArch32Bit(), isArch64Bit(), isCompatibleWith(), isLittleEndian(), isNVPTX(), llvm::PPCTargetMachine::isPPC64(), isPS4CPU(), loadBinaryFormat(), llvm::TargetRegistry::lookupTarget(), llvm::MipsMCAsmInfo::MipsMCAsmInfo(), llvm::MipsTargetELFStreamer::MipsTargetELFStreamer(), llvm::NVPTXMCAsmInfo::NVPTXMCAsmInfo(), llvm::ARM_MC::ParseARMTriple(), parseBitcodeFileImpl(), llvm::X86_MC::ParseX86Triple(), llvm::PPCELFMCAsmInfo::PPCELFMCAsmInfo(), llvm::PPCSubtarget::PPCSubtarget(), llvm::MCSectionELF::PrintSwitchToSection(), llvm::MIPS_MC::selectMipsCPU(), llvm::EngineBuilder::selectTarget(), llvm::FastISel::selectXRayCustomEvent(), llvm::object::ELFObjectFileBase::setARMSubArch(), llvm::TargetMachine::shouldAssumeDSOLocal(), llvm::SparcELFMCAsmInfo::SparcELFMCAsmInfo(), useCompactUnwind(), llvm::X86ELFMCAsmInfo::X86ELFMCAsmInfo(), llvm::X86MCAsmInfoDarwin::X86MCAsmInfoDarwin(), llvm::X86MCAsmInfoGNUCOFF::X86MCAsmInfoGNUCOFF(), llvm::X86MCAsmInfoMicrosoft::X86MCAsmInfoMicrosoft(), and llvm::X86TargetMachine::X86TargetMachine().

◆ getArchName()

StringRef Triple::getArchName ( ) const

◆ getArchTypeForLLVMName()

Triple::ArchType Triple::getArchTypeForLLVMName ( StringRef  Str)
static

◆ getArchTypeName()

StringRef Triple::getArchTypeName ( ArchType  Kind)
static

getArchTypeName - Get the canonical name for the Kind architecture.

Definition at line 20 of file Triple.cpp.

References aarch64, aarch64_be, amdgcn, amdil, amdil64, arm, armeb, avr, bpfeb, bpfel, hexagon, hsail, hsail64, kalimba, lanai, le32, le64, llvm_unreachable, mips, mips64, mips64el, mipsel, msp430, nios2, nvptx, nvptx64, ppc, ppc64, ppc64le, r600, renderscript32, renderscript64, riscv32, riscv64, shave, sparc, sparcel, sparcv9, spir, spir64, systemz, tce, tcele, thumb, thumbeb, UnknownArch, wasm32, wasm64, x86, x86_64, and xcore.

Referenced by setArch(), and supportsCOMDAT().

◆ getArchTypePrefix()

StringRef Triple::getArchTypePrefix ( ArchType  Kind)
static

getArchTypePrefix - 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::getIntrinsicForGCCBuiltin().
Returns
- The architecture prefix, or 0 if none is defined.

Definition at line 78 of file Triple.cpp.

References aarch64, aarch64_be, amdgcn, amdil, amdil64, arm, armeb, avr, bpfeb, bpfel, hexagon, hsail, hsail64, kalimba, lanai, le32, le64, mips, mips64, mips64el, mipsel, nios2, nvptx, nvptx64, ppc, ppc64, ppc64le, r600, riscv32, riscv64, shave, sparc, sparcel, sparcv9, spir, spir64, systemz, thumb, thumbeb, wasm32, wasm64, x86, x86_64, and xcore.

Referenced by llvm::RuntimeDyldELF::loadObject(), and supportsCOMDAT().

◆ getARMCPUForArch()

StringRef Triple::getARMCPUForArch ( StringRef  Arch = StringRef()) const

Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting.

Parameters
Archthe architecture name (e.g., "armv7s"). If it is an empty string then the triple's arch name is used.

Definition at line 1523 of file Triple.cpp.

References EABI, EABIHF, llvm::StringRef::empty(), FreeBSD, getArchName(), llvm::ARM::getCanonicalArchName(), llvm::ARM::getDefaultCPU(), getEnvironment(), getOS(), GNUEABI, GNUEABIHF, IOS, llvm_unreachable, MacOSX, MuslEABIHF, NaCl, NetBSD, OpenBSD, TvOS, WatchOS, and Win32.

Referenced by supportsCOMDAT().

◆ 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 1359 of file Triple.cpp.

References aarch64, aarch64_be, amdgcn, amdil, amdil64, arm, avr, bpfeb, bpfel, getArch(), hexagon, hsail, hsail64, isLittleEndian(), kalimba, le32, le64, llvm_unreachable, mips, mips64, mips64el, mipsel, msp430, nios2, nvptx, nvptx64, ppc64, ppc64le, r600, renderscript32, renderscript64, riscv32, riscv64, setArch(), shave, sparc, sparcel, spir, spir64, T, tce, tcele, thumb, UnknownArch, wasm32, wasm64, x86, x86_64, and xcore.

Referenced by supportsCOMDAT().

◆ getEnvironment()

EnvironmentType llvm::Triple::getEnvironment ( ) const
inline

◆ getEnvironmentName()

StringRef Triple::getEnvironmentName ( ) const

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

Definition at line 934 of file Triple.cpp.

References llvm::StringRef::split().

Referenced by computeDataLayout(), llvm::AMDGPU::getAMDGPUAS(), getEnvironmentVersion(), getTriple(), hasEnvironment(), llvm::AMDGPUSubtarget::isOpenCLEnv(), and setOSName().

◆ getEnvironmentTypeName()

StringRef Triple::getEnvironmentTypeName ( EnvironmentType  Kind)
static

getEnvironmentTypeName - Get the canonical name for the Kind environment.

Definition at line 212 of file Triple.cpp.

References AMDOpenCL, Android, CODE16, CoreCLR, Cygnus, EABI, EABIHF, GNU, GNUABI64, GNUEABI, GNUEABIHF, GNUX32, Itanium, llvm_unreachable, MSVC, Musl, MuslEABI, MuslEABIHF, OpenCL, and UnknownEnvironment.

Referenced by getEnvironmentVersion(), setEnvironment(), setObjectFormat(), and supportsCOMDAT().

◆ getEnvironmentVersion()

void Triple::getEnvironmentVersion ( unsigned Major,
unsigned Minor,
unsigned Micro 
) 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).

If an entry is not defined, it will be returned as 0.

Definition at line 980 of file Triple.cpp.

References getEnvironment(), getEnvironmentName(), getEnvironmentTypeName(), parseVersionFromName(), llvm::StringRef::size(), llvm::StringRef::startswith(), and llvm::StringRef::substr().

Referenced by getEnvironment(), and isAndroidVersionLT().

◆ getiOSVersion()

void Triple::getiOSVersion ( unsigned Major,
unsigned Minor,
unsigned Micro 
) const

getiOSVersion - Parse the version number as with getOSVersion.

This should only be called with IOS or generic triples.

Definition at line 1044 of file Triple.cpp.

References aarch64, Darwin, getArch(), getOS(), getOSVersion(), IOS, llvm_unreachable, MacOSX, TvOS, and WatchOS.

Referenced by llvm::AsmPrinter::doInitialization(), getOSMajorVersion(), and llvm::AArch64Subtarget::supportsAddressTopByteIgnored().

◆ 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 1414 of file Triple.cpp.

References aarch64, aarch64_be, armeb, bpfeb, bpfel, getArch(), isLittleEndian(), lanai, llvm_unreachable, mips, mips64, mips64el, mipsel, ppc, ppc64, ppc64le, setArch(), sparc, sparcel, sparcv9, systemz, T, tce, tcele, thumbeb, and UnknownArch.

Referenced by supportsCOMDAT().

◆ getMacOSXVersion()

bool Triple::getMacOSXVersion ( unsigned Major,
unsigned Minor,
unsigned Micro 
) const

getMacOSXVersion - 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 1003 of file Triple.cpp.

References Darwin, getOS(), getOSVersion(), IOS, llvm_unreachable, MacOSX, TvOS, and WatchOS.

Referenced by llvm::AsmPrinter::doInitialization(), and getOSMajorVersion().

◆ getObjectFormat()

ObjectFormatType llvm::Triple::getObjectFormat ( ) const
inline

◆ getOS()

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

getOS - Get the parsed operating system type of this triple.

Definition at line 289 of file Triple.h.

Referenced by adjustFixupValue(), llvm::ARMELFMCAsmInfo::ARMELFMCAsmInfo(), llvm::ARM::computeDefaultTargetABI(), llvm::createAArch64beAsmBackend(), llvm::createAArch64leAsmBackend(), llvm::createARMAsmBackend(), llvm::createAVRAsmBackend(), llvm::createHexagonAsmBackend(), llvm::createLanaiAsmBackend(), llvm::orc::createLocalCompileCallbackManager(), llvm::orc::createLocalIndirectStubsManagerBuilder(), createMCStreamer(), llvm::createMipsAsmBackendEB32(), llvm::createMipsAsmBackendEB64(), llvm::createMipsAsmBackendEL32(), llvm::createMipsAsmBackendEL64(), llvm::createPPCAsmBackend(), llvm::createRISCVAsmBackend(), llvm::createSparcAsmBackend(), llvm::createSystemZMCAsmBackend(), llvm::createX86_32AsmBackend(), llvm::createX86_64AsmBackend(), llvm::NVPTXAsmPrinter::doInitialization(), llvm::AMDGPUAsmPrinter::EmitEndOfAsmFile(), llvm::AMDGPUAsmPrinter::EmitFunctionBodyStart(), llvm::AMDGPUAsmPrinter::EmitStartOfAsmFile(), getARMCPUForArch(), getDataLayoutString(), getGPUOrDefault(), getiOSVersion(), getMacOSXVersion(), getOSVersion(), getWatchOSVersion(), initialize(), llvm::AMDGPUSubtarget::isAmdHsaOS(), isCompatibleWith(), isiOS(), isKnownWindowsMSVCEnvironment(), isMacOSX(), isMacOSXVersionLT(), llvm::AMDGPUSubtarget::isMesa3DOS(), isOSContiki(), isOSDragonFly(), isOSFreeBSD(), isOSFuchsia(), isOSGlibc(), isOSIAMCU(), isOSKFreeBSD(), isOSLinux(), isOSNaCl(), isOSNetBSD(), isOSOpenBSD(), isOSSolaris(), isOSWindows(), isPS4(), isPS4CPU(), isTvOS(), isWatchOS(), isWindowsCoreCLREnvironment(), isWindowsCygwinEnvironment(), isWindowsGNUEnvironment(), isWindowsItaniumEnvironment(), isWindowsMSVCEnvironment(), llvm::NVPTXTargetMachine::NVPTXTargetMachine(), and llvm::AMDGPU::shouldEmitConstantsToTextSection().

◆ getOSAndEnvironmentName()

StringRef Triple::getOSAndEnvironmentName ( ) const

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

Definition at line 940 of file Triple.cpp.

References llvm::StringRef::split().

Referenced by getTriple(), setArchName(), and setVendorName().

◆ getOSMajorVersion()

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

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

Definition at line 322 of file Triple.h.

References getiOSVersion(), getMacOSXVersion(), getOSVersion(), getWatchOSVersion(), and fuzzer::Min().

Referenced by llvm::AsmPrinter::doInitialization().

◆ getOSName()

StringRef Triple::getOSName ( ) const

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

Definition at line 928 of file Triple.cpp.

References llvm::StringRef::split().

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

◆ getOSTypeName()

StringRef Triple::getOSTypeName ( OSType  Kind)
static

getOSTypeName - Get the canonical name for the Kind operating system.

Definition at line 173 of file Triple.cpp.

References AIX, AMDHSA, Ananas, CloudABI, CNK, Contiki, CUDA, Darwin, DragonFly, ELFIAMCU, FreeBSD, Fuchsia, Haiku, IOS, KFreeBSD, Linux, llvm_unreachable, Lv2, MacOSX, Mesa3D, Minix, NaCl, NetBSD, NVCL, OpenBSD, PS4, RTEMS, Solaris, TvOS, UnknownOS, WatchOS, and Win32.

Referenced by getOSVersion(), setOS(), and supportsCOMDAT().

◆ getOSVersion()

void Triple::getOSVersion ( unsigned Major,
unsigned Minor,
unsigned Micro 
) const

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

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

If an entry is not defined, it will be returned as 0.

Definition at line 990 of file Triple.cpp.

References llvm::StringRef::consume_front(), getOS(), getOSName(), getOSTypeName(), MacOSX, parseVersionFromName(), llvm::StringRef::size(), llvm::StringRef::startswith(), and llvm::StringRef::substr().

Referenced by llvm::createMachOStreamer(), getiOSVersion(), getMacOSXVersion(), getObjectFormat(), getOSMajorVersion(), getWatchOSVersion(), and isOSVersionLT().

◆ getSubArch()

SubArchType llvm::Triple::getSubArch ( ) const
inline

getSubArch - get the parsed subarchitecture type for this triple.

Definition at line 283 of file Triple.h.

Referenced by llvm::ARMAsmPrinter::EmitStartOfAsmFile(), llvm::ARMAsmPrinter::getISAEncoding(), isCompatibleWith(), isWatchABI(), and llvm::object::ELFObjectFileBase::setARMSubArch().

◆ getTriple()

const std::string& llvm::Triple::getTriple ( ) const
inline

◆ getVendor()

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

getVendor - Get the parsed vendor type of this triple.

Definition at line 286 of file Triple.h.

Referenced by llvm::SubtargetFeatures::getDefaultSubtargetFeatures(), llvm::PPCSubtarget::isBGQ(), isCompatibleWith(), isPS4(), isPS4CPU(), and merge().

◆ getVendorName()

StringRef Triple::getVendorName ( ) const

getVendorName - Get the vendor (second) component of the triple.

Definition at line 923 of file Triple.cpp.

References llvm::StringRef::split().

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

◆ getVendorTypeName()

StringRef Triple::getVendorTypeName ( VendorType  Kind)
static

getVendorTypeName - Get the canonical name for the Kind vendor.

Definition at line 149 of file Triple.cpp.

References AMD, Apple, BGP, BGQ, CSR, Freescale, IBM, ImaginationTechnologies, llvm_unreachable, Mesa, MipsTechnologies, Myriad, NVIDIA, PC, SCEI, SUSE, and UnknownVendor.

Referenced by setVendor(), and supportsCOMDAT().

◆ getWatchOSVersion()

void Triple::getWatchOSVersion ( unsigned Major,
unsigned Minor,
unsigned Micro 
) const

getWatchOSVersion - Parse the version number as with getOSVersion.

This should only be called with WatchOS or generic triples.

Definition at line 1070 of file Triple.cpp.

References Darwin, getOS(), getOSVersion(), IOS, llvm_unreachable, MacOSX, and WatchOS.

Referenced by llvm::AsmPrinter::doInitialization(), and getOSMajorVersion().

◆ hasEnvironment()

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

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

Definition at line 293 of file Triple.h.

References getEnvironmentName().

Referenced by setOSName().

◆ isAndroid()

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

◆ isAndroidVersionLT()

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

Definition at line 607 of file Triple.h.

References assert(), getEnvironmentVersion(), isAndroid(), and isArch64Bit().

Referenced by hasStackGuardSlotTLS().

◆ 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 1229 of file Triple.cpp.

References getArch(), and getArchPointerBitWidth().

Referenced by llvm::TargetLibraryInfoImpl::getTargetWCharSize(), and getTriple().

◆ 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 1225 of file Triple.cpp.

References getArch(), and getArchPointerBitWidth().

Referenced by computeDataLayout(), llvm::sys::getProcessTriple(), and getTriple().

◆ 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 1221 of file Triple.cpp.

References getArch(), and getArchPointerBitWidth().

Referenced by computeDataLayout(), llvm::createRISCVAsmBackend(), llvm::createWebAssemblyAsmBackend(), llvm::WebAssemblyRegisterInfo::getFrameRegister(), llvm::sys::getProcessTriple(), getTriple(), llvm::WebAssemblySubtarget::hasAddr64(), isAndroidVersionLT(), llvm::RISCVMCAsmInfo::RISCVMCAsmInfo(), llvm::WebAssemblyMCAsmInfo::WebAssemblyMCAsmInfo(), llvm::WebAssemblyMCAsmInfoELF::WebAssemblyMCAsmInfoELF(), and llvm::X86RegisterInfo::X86RegisterInfo().

◆ isCompatibleWith()

bool Triple::isCompatibleWith ( const Triple Other) const

Test whether target triples are compatible.

Definition at line 1490 of file Triple.cpp.

References Apple, arm, armeb, getArch(), getEnvironment(), getObjectFormat(), getOS(), getSubArch(), getVendor(), thumb, and thumbeb.

Referenced by supportsCOMDAT().

◆ isGNUEnvironment()

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

Definition at line 495 of file Triple.h.

References getEnvironment(), GNU, GNUABI64, GNUEABI, GNUEABIHF, and GNUX32.

Referenced by InitLibcallNames().

◆ 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 446 of file Triple.h.

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

Referenced by llvm::createMachOStreamer(), hasSinCosPiStret(), initialize(), instrumentMaskedLoadOrStore(), isOSDarwin(), llvm::AArch64Subtarget::isTargetIOS(), llvm::ARMSubtarget::isTargetIOS(), llvm::EngineBuilder::selectTarget(), llvm::AArch64Subtarget::supportsAddressTopByteIgnored(), and useCompactUnwind().

◆ isKnownWindowsMSVCEnvironment()

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

◆ isLittleEndian()

bool Triple::isLittleEndian ( ) const

Tests whether the target triple is little endian.

Returns
true if the triple is little endian, false otherwise.

Definition at line 1446 of file Triple.cpp.

References aarch64, amdgcn, amdil, amdil64, arm, avr, bpfel, getArch(), hexagon, hsail, hsail64, kalimba, le32, le64, mips64el, mipsel, msp430, nios2, nvptx, nvptx64, ppc64le, r600, renderscript32, renderscript64, riscv32, riscv64, shave, sparcel, spir, spir64, tcele, thumb, wasm32, wasm64, x86, x86_64, and xcore.

Referenced by getBigEndianArchVariant(), getLittleEndianArchVariant(), lowerMSASplatZExt(), llvm::MipsMCAsmInfo::MipsMCAsmInfo(), supportsCOMDAT(), and truncateVecElts().

◆ isMacOSX()

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

◆ isMacOSXVersionLT()

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

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

Definition at line 422 of file Triple.h.

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

Referenced by llvm::X86Subtarget::hasSinCos(), hasSinCosPiStret(), initialize(), instrumentMaskedLoadOrStore(), llvm::PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(), useCompactUnwind(), and llvm::X86MCAsmInfoDarwin::X86MCAsmInfoDarwin().

◆ isMusl()

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

Tests whether the environment is musl-libc.

Definition at line 621 of file Triple.h.

References getEnvironment(), Musl, MuslEABI, and MuslEABIHF.

◆ isNVPTX()

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

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

Definition at line 628 of file Triple.h.

References getArch(), nvptx, and nvptx64.

Referenced by initialize().

◆ isOSBinFormatCOFF()

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

◆ isOSBinFormatELF()

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

◆ isOSBinFormatMachO()

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

◆ isOSBinFormatWasm()

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

Tests whether the OS uses the Wasm binary format.

Definition at line 587 of file Triple.h.

References getObjectFormat(), and Wasm.

Referenced by instrumentMaskedLoadOrStore().

◆ isOSContiki()

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

Definition at line 502 of file Triple.h.

References Contiki, and getOS().

Referenced by llvm::X86TargetLowering::getSafeStackPointerLocation().

◆ isOSCygMing()

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

Tests for either Cygwin or MinGW OS.

Definition at line 535 of file Triple.h.

References isWindowsCygwinEnvironment(), and isWindowsGNUEnvironment().

Referenced by createX86MCAsmInfo(), llvm::X86_MC::getDwarfRegFlavour(), initialize(), and llvm::X86Subtarget::isTargetCygMing().

◆ isOSDarwin()

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

◆ isOSDragonFly()

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

Definition at line 485 of file Triple.h.

References DragonFly, and getOS().

Referenced by llvm::X86Subtarget::isTargetDragonFly().

◆ isOSFreeBSD()

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

Definition at line 477 of file Triple.h.

References FreeBSD, and getOS().

Referenced by createTLOF(), initialize(), llvm::X86Subtarget::isTargetFreeBSD(), and useCompactUnwind().

◆ isOSFuchsia()

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

◆ isOSGlibc()

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

Tests whether the OS uses glibc.

Definition at line 566 of file Triple.h.

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

Referenced by hasStackGuardSlotTLS(), and llvm::X86Subtarget::isTargetGlibc().

◆ isOSIAMCU()

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

◆ isOSKFreeBSD()

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

Tests whether the OS is kFreeBSD.

Definition at line 561 of file Triple.h.

References getOS(), and KFreeBSD.

Referenced by llvm::X86Subtarget::isTargetKFreeBSD().

◆ isOSLinux()

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

◆ isOSMSVCRT()

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

◆ isOSNaCl()

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

◆ isOSNetBSD()

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

Definition at line 469 of file Triple.h.

References getOS(), and NetBSD.

Referenced by llvm::ARM::computeDefaultTargetABI(), and llvm::ARMSubtarget::isTargetNetBSD().

◆ isOSOpenBSD()

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

Definition at line 473 of file Triple.h.

References getOS(), and OpenBSD.

Referenced by llvm::ARM::computeDefaultTargetABI(), CreatePrologue(), and InitLibcallNames().

◆ isOSSolaris()

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

Definition at line 487 of file Triple.h.

References getOS(), and Solaris.

Referenced by createTLOF(), llvm::X86Subtarget::isTargetSolaris(), and useCompactUnwind().

◆ isOSVersionLT() [1/2]

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

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

Definition at line 398 of file Triple.h.

References getOSVersion().

Referenced by llvm::ARMTargetLowering::ARMTargetLowering(), llvm::ARMSubtarget::hasSinCos(), hasSinCosPiStret(), initialize(), instrumentMaskedLoadOrStore(), isMacOSXVersionLT(), isOSVersionLT(), and merge().

◆ isOSVersionLT() [2/2]

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

Definition at line 413 of file Triple.h.

References getOSVersion(), and isOSVersionLT().

◆ isOSWindows()

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

◆ isPS4()

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

Tests whether the target is the PS4 platform.

Definition at line 599 of file Triple.h.

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

Referenced by llvm::TargetLibraryInfoImpl::getTargetWCharSize(), and llvm::X86TargetMachine::X86TargetMachine().

◆ isPS4CPU()

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

Tests whether the target is the PS4 CPU.

Definition at line 592 of file Triple.h.

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

Referenced by llvm::DwarfDebug::DwarfDebug(), and llvm::X86Subtarget::isTargetPS4().

◆ isTvOS()

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

Is this an Apple tvOS triple.

Definition at line 451 of file Triple.h.

References getOS(), and TvOS.

Referenced by llvm::createMachOStreamer(), llvm::AsmPrinter::doInitialization(), and isiOS().

◆ isWatchABI()

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

◆ isWatchOS()

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

◆ isWindowsCoreCLREnvironment()

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

◆ isWindowsCygwinEnvironment()

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

◆ isWindowsGNUEnvironment()

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

◆ isWindowsItaniumEnvironment()

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

◆ isWindowsMSVCEnvironment()

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

Checks if the environment could be MSVC.

Definition at line 507 of file Triple.h.

References getEnvironment(), getOS(), MSVC, UnknownEnvironment, and Win32.

Referenced by createARMMCAsmInfo(), createX86MCAsmInfo(), isOSMSVCRT(), and llvm::X86Subtarget::isTargetWindowsMSVC().

◆ merge()

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

Merge target triples.

Definition at line 1514 of file Triple.cpp.

References Apple, getVendor(), isOSVersionLT(), and str().

Referenced by supportsCOMDAT().

◆ normalize() [1/2]

std::string Triple::normalize ( StringRef  Str)
static

normalize - 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.

Definition at line 730 of file Triple.cpp.

References Android, llvm::array_lengthof(), assert(), COFF, llvm::StringRef::empty(), getObjectFormatTypeName(), GNUEABI, llvm_unreachable, parseArch(), parseEnvironment(), parseFormat(), parseOS(), parseVendor(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorImpl< T >::resize(), llvm::SmallVectorTemplateCommon< T >::size(), llvm::StringRef::split(), startswith(), llvm::StringRef::startswith(), llvm::Twine::str(), SUSE, std::swap(), UnknownArch, UnknownEnvironment, UnknownObjectFormat, UnknownOS, UnknownVendor, and Win32.

Referenced by llvm::TargetLibraryAnalysis::run().

◆ normalize() [2/2]

std::string llvm::Triple::normalize ( ) const
inline

Return the normalized form of this triple's string.

Definition at line 273 of file Triple.h.

References normalize().

Referenced by llvm::sys::getProcessTriple(), normalize(), and operator!=().

◆ operator!=()

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

Definition at line 258 of file Triple.h.

References normalize().

◆ operator==()

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

Definition at line 251 of file Triple.h.

◆ setArch()

void Triple::setArch ( ArchType  Kind)

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

Definition at line 1098 of file Triple.cpp.

References getArchTypeName(), and setArchName().

Referenced by get32BitArchVariant(), get64BitArchVariant(), getBigEndianArchVariant(), getLittleEndianArchVariant(), llvm::TargetRegistry::lookupTarget(), llvm::EngineBuilder::selectTarget(), and supportsCOMDAT().

◆ setArchName()

void Triple::setArchName ( StringRef  Str)

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

Definition at line 1126 of file Triple.cpp.

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

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

◆ setEnvironment()

void Triple::setEnvironment ( EnvironmentType  Kind)

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

Definition at line 1110 of file Triple.cpp.

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

Referenced by supportsCOMDAT().

◆ setEnvironmentName()

void Triple::setEnvironmentName ( StringRef  Str)

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

Definition at line 1149 of file Triple.cpp.

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

Referenced by setEnvironment(), setObjectFormat(), and supportsCOMDAT().

◆ setObjectFormat()

void Triple::setObjectFormat ( ObjectFormatType  Kind)

setObjectFormat - Set the object file format

Definition at line 1118 of file Triple.cpp.

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

Referenced by supportsCOMDAT().

◆ setOS()

void Triple::setOS ( OSType  Kind)

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

Definition at line 1106 of file Triple.cpp.

References getOSTypeName(), and setOSName().

Referenced by supportsCOMDAT().

◆ setOSAndEnvironmentName()

void Triple::setOSAndEnvironmentName ( StringRef  Str)

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

Definition at line 1154 of file Triple.cpp.

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

Referenced by supportsCOMDAT().

◆ setOSName()

void Triple::setOSName ( StringRef  Str)

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

Definition at line 1141 of file Triple.cpp.

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

Referenced by setOS(), and supportsCOMDAT().

◆ setTriple()

void Triple::setTriple ( const Twine Str)

setTriple - Set all components to the new triple Str.

Definition at line 1094 of file Triple.cpp.

References Triple().

Referenced by llvm::EngineBuilder::selectTarget(), setArchName(), setEnvironmentName(), setOSAndEnvironmentName(), setOSName(), setVendorName(), and supportsCOMDAT().

◆ setVendor()

void Triple::setVendor ( VendorType  Kind)

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

Definition at line 1102 of file Triple.cpp.

References getVendorTypeName(), and setVendorName().

Referenced by supportsCOMDAT().

◆ setVendorName()

void Triple::setVendorName ( StringRef  Str)

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

Definition at line 1137 of file Triple.cpp.

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

Referenced by setVendor(), and supportsCOMDAT().

◆ str()

const std::string& llvm::Triple::str ( ) const
inline

◆ supportsCOMDAT()

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

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