LLVM
13.0.0git
|
Triple - Helper class for working with autoconf configuration names. More...
#include "llvm/ADT/Triple.h"
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 | isOSzOS () const |
bool | isOSDarwin () const |
isOSDarwin - Is this a "Darwin" OS (macOS, iOS, tvOS or watchOS). More... | |
bool | isSimulatorEnvironment () const |
bool | isMacCatalystEnvironment () const |
bool | isTargetMachineMac () const |
Returns true for targets that run on a macOS machine. More... | |
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 | isOSContiki () const |
bool | isOSHaiku () const |
Tests whether the OS is Haiku. More... | |
bool | isOSWindows () const |
Tests whether the OS is Windows. More... | |
bool | isKnownWindowsMSVCEnvironment () const |
Checks if the environment is MSVC. More... | |
bool | isWindowsMSVCEnvironment () const |
Checks if the environment could be 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 | 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 | isOSHurd () const |
Tests whether the OS is Hurd. More... | |
bool | isOSWASI () const |
Tests whether the OS is WASI. More... | |
bool | isOSEmscripten () const |
Tests whether the OS is Emscripten. More... | |
bool | isOSGlibc () const |
Tests whether the OS uses glibc. More... | |
bool | isOSAIX () const |
Tests whether the OS is AIX. 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 | isOSBinFormatGOFF () const |
Tests whether the OS uses the GOFF 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 | isOSBinFormatXCOFF () const |
Tests whether the OS uses the XCOFF 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 | isSPIR () const |
Tests whether the target is SPIR (32- or 64-bit). More... | |
bool | isNVPTX () const |
Tests whether the target is NVPTX (32- or 64-bit). More... | |
bool | isAMDGCN () const |
Tests whether the target is AMDGCN. More... | |
bool | isAMDGPU () const |
bool | isThumb () const |
Tests whether the target is Thumb (little and big endian). More... | |
bool | isARM () const |
Tests whether the target is ARM (little and big endian). More... | |
bool | isAArch64 () const |
Tests whether the target is AArch64 (little and big endian). More... | |
bool | isAArch64 (int PointerWidth) const |
Tests whether the target is AArch64 and pointers are the size specified by PointerWidth . More... | |
bool | isMIPS32 () const |
Tests whether the target is MIPS 32-bit (little and big endian). More... | |
bool | isMIPS64 () const |
Tests whether the target is MIPS 64-bit (little and big endian). More... | |
bool | isMIPS () const |
Tests whether the target is MIPS (little and big endian, 32- or 64-bit). More... | |
bool | isPPC () const |
Tests whether the target is PowerPC (32- or 64-bit LE or BE). More... | |
bool | isPPC32 () const |
Tests whether the target is 32-bit PowerPC (little and big endian). More... | |
bool | isPPC64 () const |
Tests whether the target is 64-bit PowerPC (little and big endian). More... | |
bool | isRISCV () const |
Tests whether the target is RISC-V (32- and 64-bit). More... | |
bool | isSystemZ () const |
Tests whether the target is SystemZ. More... | |
bool | isX86 () const |
Tests whether the target is x86 (32- or 64-bit). More... | |
bool | isVE () const |
Tests whether the target is VE. More... | |
bool | isWasm () const |
Tests whether the target is wasm (32- and 64-bit). More... | |
bool | isCSKY () const |
bool | isArm64e () const |
Tests whether the target is the Apple "arm64e" AArch64 subarch. More... | |
bool | supportsCOMDAT () const |
Tests whether the target supports comdat. More... | |
bool | hasDefaultEmulatedTLS () const |
Tests whether the target uses emulated TLS as default. More... | |
bool | hasDefaultDataSections () const |
Tests whether the target uses -data-sections as default. More... | |
bool | hasDLLImportExport () const |
Tests if the environment supports dllimport/export annotations. 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... | |
VersionTuple | getMinimumSupportedOSVersion () const |
Some platforms have different minimum supported OS versions that varies by the architecture specified in the triple. More... | |
Static Public Member Functions | |
static VersionTuple | getCanonicalVersionForOS (OSType OSKind, const VersionTuple &Version) |
Returns a canonicalized OS version number for the specified OS. More... | |
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... | |
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.
enum llvm::Triple::OSType |
|
inline |
Default constructor is the same as an empty string and leaves all triple fields unknown.
Definition at line 267 of file Triple.h.
References llvm::Data.
Referenced by setArchName(), and setTriple().
Construct a triple from the string representation provided.
This stores the string representation and parses the various pieces into enum members.
Definition at line 756 of file Triple.cpp.
References llvm::StringSwitch< T, R >::Cases(), llvm::StringSwitch< T, R >::Default(), getDefaultFormat(), GNU, GNUABI64, GNUABIN32, parseArch(), parseEnvironment(), parseFormat(), parseOS(), parseSubArch(), parseVendor(), llvm::StringRef::split(), llvm::StringSwitch< T, R >::StartsWith(), UnknownEnvironment, and UnknownObjectFormat.
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 796 of file Triple.cpp.
References getDefaultFormat().
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 811 of file Triple.cpp.
References getDefaultFormat(), and UnknownObjectFormat.
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.
Definition at line 1339 of file Triple.cpp.
References aarch64, aarch64_32, aarch64_be, amdgcn, amdil, amdil64, arc, arm, armeb, avr, bpfeb, bpfel, csky, getArch(), hexagon, hsail, hsail64, kalimba, lanai, le32, le64, mips, mips64, mips64el, mipsel, msp430, nvptx, nvptx64, ppc, ppc64, ppc64le, ppcle, r600, renderscript32, renderscript64, riscv32, riscv64, shave, sparc, sparcel, sparcv9, spir, spir64, systemz, T, tce, tcele, thumb, thumbeb, UnknownArch, ve, wasm32, wasm64, x86, x86_64, and xcore.
Referenced by llvm::sys::getProcessTriple().
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.
Definition at line 1406 of file Triple.cpp.
References aarch64, aarch64_32, aarch64_be, amdgcn, amdil, amdil64, arc, arm, armeb, avr, bpfeb, bpfel, csky, getArch(), hexagon, hsail, hsail64, kalimba, lanai, le32, le64, mips, mips64, mips64el, mipsel, msp430, nvptx, nvptx64, ppc, ppc64, ppc64le, ppcle, r600, renderscript32, renderscript64, riscv32, riscv64, shave, sparc, sparcel, sparcv9, spir, spir64, systemz, T, tce, tcele, thumb, thumbeb, UnknownArch, ve, wasm32, wasm64, x86, x86_64, and xcore.
Referenced by llvm::sys::getProcessTriple().
|
inline |
getArch - Get the parsed architecture type of this triple.
Definition at line 305 of file Triple.h.
Referenced by adjustInlineAsm(), llvm::ARMELFMCAsmInfo::ARMELFMCAsmInfo(), llvm::ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(), llvm::CodeViewDebug::beginModule(), createAArch64MCAsmInfo(), createPPCMCAsmInfo(), CreateVarArgHelper(), createX86MCAsmInfo(), llvm::X86_MC::X86MCInstrAnalysis::findPltEntries(), llvm::AMDGPUSubtarget::get(), get32BitArchVariant(), get64BitArchVariant(), getBigEndianArchVariant(), getBitcodeFileMachine(), llvm::SubtargetFeatures::getDefaultSubtargetFeatures(), getiOSVersion(), getLittleEndianArchVariant(), llvm::AMDGPUMCAsmInfo::getMaxInstLength(), llvm::AMDGPU::IsaInfo::getMaxWorkGroupsPerCU(), llvm::AMDGPU::getMCReg(), getMinimumSupportedOSVersion(), getShadowMapping(), llvm::TargetLoweringObjectFileELF::Initialize(), isAArch64(), isAMDGCN(), isAMDGPU(), isArch16Bit(), isArch32Bit(), isArch64Bit(), isARM(), isArm64e(), isCompatibleWith(), isCSKY(), llvm::AMDGPUSubtarget::isGCN(), isLittleEndian(), isMIPS32(), isMIPS64(), isNVPTX(), isPPC(), isPPC32(), isPPC64(), isPS4CPU(), isRISCV(), isSPIR(), isSystemZ(), isThumb(), isVE(), isWasm(), isX86(), llvm::TargetRegistry::lookupTarget(), llvm::MipsTargetELFStreamer::MipsTargetELFStreamer(), llvm::NVPTXMCAsmInfo::NVPTXMCAsmInfo(), llvm::omp::OMPContext::OMPContext(), llvm::orc::LLJITBuilderState::prepareForConstruction(), llvm::FastISel::selectXRayCustomEvent(), llvm::FastISel::selectXRayTypedEvent(), llvm::SparcELFMCAsmInfo::SparcELFMCAsmInfo(), llvm::DwarfCompileUnit::updateSubprogramScopeDIE(), llvm::X86MCAsmInfoGNUCOFF::X86MCAsmInfoGNUCOFF(), and llvm::X86MCAsmInfoMicrosoft::X86MCAsmInfoMicrosoft().
StringRef Triple::getArchName | ( | ) | const |
getArchName - Get the architecture (first) component of the triple.
Definition at line 1015 of file Triple.cpp.
References llvm::StringRef::split().
Referenced by getARMCPUForArch(), setEnvironmentName(), setOSAndEnvironmentName(), setOSName(), setVendorName(), and llvm::ThinLTOCodeGenerator::writeGeneratedObject().
|
static |
getArchTypeForLLVMName - The canonical type for the given LLVM architecture name (e.g., "x86").
Definition at line 271 of file Triple.cpp.
References aarch64, aarch64_32, aarch64_be, amdgcn, amdil, amdil64, arc, arm, armeb, avr, llvm::StringSwitch< T, R >::Case(), csky, llvm::StringSwitch< T, R >::Default(), hexagon, hsail, hsail64, kalimba, lanai, le32, le64, mips, mips64, mips64el, mipsel, msp430, nvptx, nvptx64, parseBPFArch(), ppc, ppc64, ppc64le, ppcle, r600, renderscript32, renderscript64, riscv32, riscv64, shave, sparc, sparcel, sparcv9, spir, spir64, llvm::StringSwitch< T, R >::StartsWith(), systemz, tce, tcele, thumb, thumbeb, UnknownArch, ve, wasm32, wasm64, x86, x86_64, and xcore.
Referenced by llvm::TargetRegistry::lookupTarget(), and llvm::EngineBuilder::selectTarget().
getArchTypeName - Get the canonical name for the Kind
architecture.
Definition at line 23 of file Triple.cpp.
References aarch64, aarch64_32, aarch64_be, amdgcn, amdil, amdil64, arc, arm, armeb, avr, bpfeb, bpfel, csky, hexagon, hsail, hsail64, kalimba, lanai, le32, le64, llvm_unreachable, mips, mips64, mips64el, mipsel, msp430, nvptx, nvptx64, ppc, ppc64, ppc64le, ppcle, r600, renderscript32, renderscript64, riscv32, riscv64, shave, sparc, sparcel, sparcv9, spir, spir64, systemz, tce, tcele, thumb, thumbeb, UnknownArch, ve, wasm32, wasm64, x86, x86_64, and xcore.
Referenced by setArch().
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
Definition at line 85 of file Triple.cpp.
References aarch64, aarch64_32, aarch64_be, amdgcn, amdil, amdil64, arc, arm, armeb, avr, bpfeb, bpfel, csky, hexagon, hsail, hsail64, kalimba, lanai, le32, le64, mips, mips64, mips64el, mipsel, nvptx, nvptx64, ppc, ppc64, ppc64le, ppcle, r600, riscv32, riscv64, shave, sparc, sparcel, sparcv9, spir, spir64, systemz, thumb, thumbeb, ve, wasm32, wasm64, x86, x86_64, and xcore.
Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting.
Arch | the architecture name (e.g., "armv7s"). If it is an empty string then the triple's arch name is used. |
Definition at line 1691 of file Triple.cpp.
References EABI, EABIHF, llvm::StringRef::empty(), llvm::StringRef::equals(), FreeBSD, getArchName(), llvm::ARM::getCanonicalArchName(), llvm::ARM::getDefaultCPU(), getEnvironment(), getOS(), GNUEABI, GNUEABIHF, IOS, llvm_unreachable, MacOSX, MuslEABIHF, NaCl, NetBSD, OpenBSD, TvOS, WatchOS, and Win32.
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.
Definition at line 1473 of file Triple.cpp.
References aarch64, aarch64_be, amdgcn, amdil, amdil64, arm, avr, bpfeb, bpfel, csky, getArch(), hexagon, hsail, hsail64, isLittleEndian(), kalimba, le32, le64, llvm_unreachable, mips, mips64, mips64el, mipsel, msp430, nvptx, nvptx64, ppc, ppc64, ppc64le, ppcle, r600, renderscript32, renderscript64, riscv32, riscv64, shave, sparc, sparcel, spir, spir64, T, tce, tcele, thumb, UnknownArch, ve, wasm32, wasm64, x86, x86_64, and xcore.
|
static |
Returns a canonicalized OS version number for the specified OS.
Definition at line 1756 of file Triple.cpp.
References LLVM_FALLTHROUGH, MacOSX, and llvm::IndexedInstrProf::Version.
|
inline |
getEnvironment - Get the parsed environment type of this triple.
Definition at line 323 of file Triple.h.
Referenced by llvm::ARMBaseTargetMachine::ARMBaseTargetMachine(), llvm::createAArch64beAsmBackend(), llvm::createAArch64leAsmBackend(), llvm::createX86_64AsmBackend(), getARMCPUForArch(), getEnvironmentVersion(), llvm::TargetLoweringObjectFileELF::Initialize(), isAArch64(), isAndroid(), isCompatibleWith(), llvm::HexagonSubtarget::isEnvironmentMusl(), isGNUEnvironment(), isKnownWindowsMSVCEnvironment(), isMacCatalystEnvironment(), isMusl(), isSimulatorEnvironment(), llvm::X86Subtarget::isTarget64BitILP32(), llvm::X86Subtarget::isTarget64BitLP64(), llvm::ARMSubtarget::isTargetAEABI(), llvm::ARMSubtarget::isTargetEHABICompatible(), llvm::ARMSubtarget::isTargetGNUAEABI(), llvm::ARMBaseTargetMachine::isTargetHardFloat(), llvm::AArch64Subtarget::isTargetILP32(), llvm::ARMSubtarget::isTargetMuslAEABI(), isWindowsCoreCLREnvironment(), isWindowsCygwinEnvironment(), isWindowsGNUEnvironment(), isWindowsItaniumEnvironment(), and isWindowsMSVCEnvironment().
StringRef Triple::getEnvironmentName | ( | ) | const |
getEnvironmentName - Get the optional environment (fourth) component of the triple, or "" if empty.
Definition at line 1030 of file Triple.cpp.
References llvm::StringRef::split().
Referenced by getEnvironmentVersion(), hasEnvironment(), and setOSName().
|
static |
getEnvironmentTypeName - Get the canonical name for the Kind
environment.
Definition at line 228 of file Triple.cpp.
References Android, CODE16, CoreCLR, Cygnus, EABI, EABIHF, GNU, GNUABI64, GNUABIN32, GNUEABI, GNUEABIHF, GNUILP32, GNUX32, Itanium, llvm_unreachable, MacABI, MSVC, Musl, MuslEABI, MuslEABIHF, Simulator, and UnknownEnvironment.
Referenced by getEnvironmentVersion(), setEnvironment(), and setObjectFormat().
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 1076 of file Triple.cpp.
References getEnvironment(), getEnvironmentName(), getEnvironmentTypeName(), parseVersionFromName(), llvm::StringRef::size(), llvm::StringRef::startswith(), and llvm::StringRef::substr().
Referenced by isAndroidVersionLT().
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 1146 of file Triple.cpp.
References aarch64, Darwin, getArch(), getOS(), getOSVersion(), IOS, llvm_unreachable, MacOSX, TvOS, and WatchOS.
Referenced by llvm::AArch64Subtarget::supportsAddressTopByteIgnored().
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.
Definition at line 1530 of file Triple.cpp.
References aarch64, aarch64_be, armeb, bpfeb, bpfel, getArch(), isLittleEndian(), lanai, llvm_unreachable, mips, mips64, mips64el, mipsel, ppc, ppc64, ppc64le, ppcle, sparc, sparcel, sparcv9, systemz, T, tce, tcele, thumbeb, and UnknownArch.
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 1099 of file Triple.cpp.
References Darwin, getOS(), getOSVersion(), IOS, llvm_unreachable, MacOSX, TvOS, and WatchOS.
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 1659 of file Triple.cpp.
References aarch64, Apple, getArch(), getOS(), getVendor(), IOS, isArm64e(), isMacCatalystEnvironment(), isSimulatorEnvironment(), MacOSX, TvOS, and WatchOS.
|
inline |
getFormat - Get the object format for this triple.
Definition at line 335 of file Triple.h.
Referenced by createARMAsmBackend(), llvm::MCObjectFileInfo::InitMCObjectFileInfo(), isCompatibleWith(), isOSBinFormatCOFF(), isOSBinFormatELF(), isOSBinFormatGOFF(), isOSBinFormatMachO(), isOSBinFormatWasm(), isOSBinFormatXCOFF(), and shouldInstrumentReadWriteFromAddress().
|
inline |
getOS - Get the parsed operating system type of this triple.
Definition at line 314 of file Triple.h.
Referenced by llvm::AMDGPUAsmPrinter::AMDGPUAsmPrinter(), llvm::ARMELFMCAsmInfo::ARMELFMCAsmInfo(), llvm::createAArch64beAsmBackend(), llvm::createAArch64leAsmBackend(), createARMAsmBackend(), llvm::createAVRAsmBackend(), llvm::createSparcAsmBackend(), llvm::createSystemZMCAsmBackend(), llvm::createVEAsmBackend(), llvm::createX86_32AsmBackend(), llvm::createX86_64AsmBackend(), llvm::AMDGPUAsmPrinter::doFinalization(), llvm::AMDGPUAsmPrinter::emitEndOfAsmFile(), llvm::AMDGPUAsmPrinter::emitFunctionBodyEnd(), llvm::AMDGPUAsmPrinter::emitFunctionEntryLabel(), llvm::AMDGPUAsmPrinter::emitGlobalVariable(), llvm::AMDGPUAsmPrinter::emitStartOfAsmFile(), getARMCPUForArch(), llvm::AMDGPU::getHsaAbiVersion(), getiOSVersion(), getMacOSXVersion(), getMinimumSupportedOSVersion(), getOSVersion(), getWatchOSVersion(), llvm::AMDGPUSubtarget::isAmdHsaOS(), llvm::AMDGPUSubtarget::isAmdPalOS(), isCompatibleWith(), isiOS(), isMacOSX(), isMacOSXVersionLT(), llvm::AMDGPUSubtarget::isMesa3DOS(), isOSAIX(), isOSContiki(), isOSDragonFly(), isOSEmscripten(), isOSFreeBSD(), isOSFuchsia(), isOSGlibc(), isOSHaiku(), isOSHurd(), isOSIAMCU(), isOSKFreeBSD(), isOSLinux(), isOSNaCl(), isOSNetBSD(), isOSOpenBSD(), isOSSolaris(), isOSUnknown(), isOSWASI(), isOSWindows(), isOSzOS(), isPS4(), isPS4CPU(), isTvOS(), isWatchOS(), and llvm::SITargetLowering::shouldUseLDSConstAddress().
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 1036 of file Triple.cpp.
References llvm::StringRef::split().
Referenced by setArchName(), and setVendorName().
|
inline |
getOSMajorVersion - Return just the major version number, this is specialized because it is a common query.
Definition at line 347 of file Triple.h.
References getOSVersion().
StringRef Triple::getOSName | ( | ) | const |
getOSName - Get the operating system (third) component of the triple.
Definition at line 1024 of file Triple.cpp.
References llvm::StringRef::split().
Referenced by getOSVersion(), and setEnvironmentName().
getOSTypeName - Get the canonical name for the Kind
operating system.
Definition at line 184 of file Triple.cpp.
References AIX, AMDHSA, AMDPAL, Ananas, CloudABI, Contiki, CUDA, Darwin, DragonFly, ELFIAMCU, Emscripten, FreeBSD, Fuchsia, Haiku, HermitCore, Hurd, IOS, KFreeBSD, Linux, llvm_unreachable, Lv2, MacOSX, Mesa3D, Minix, NaCl, NetBSD, NVCL, OpenBSD, PS4, RTEMS, Solaris, TvOS, UnknownOS, WASI, WatchOS, Win32, and ZOS.
Referenced by getOSVersion(), and setOS().
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 1086 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 getiOSVersion(), getMacOSXVersion(), getOSMajorVersion(), getWatchOSVersion(), and isOSVersionLT().
|
inline |
getSubArch - get the parsed subarchitecture type for this triple.
Definition at line 308 of file Triple.h.
Referenced by isArm64e(), isCompatibleWith(), llvm::ARMBaseTargetMachine::isTargetHardFloat(), isWatchABI(), and llvm::object::ELFObjectFileBase::setARMSubArch().
|
inline |
Definition at line 376 of file Triple.h.
References llvm::Data.
Referenced by llvm::orc::JITTargetMachineBuilder::createTargetMachine(), llvm::DwarfStreamer::init(), llvm::TargetRegistry::lookupTarget(), and llvm::EngineBuilder::selectTarget().
|
inline |
getVendor - Get the parsed vendor type of this triple.
Definition at line 311 of file Triple.h.
Referenced by llvm::SubtargetFeatures::getDefaultSubtargetFeatures(), getMinimumSupportedOSVersion(), getShadowMapping(), isCompatibleWith(), isPS4(), isPS4CPU(), and merge().
StringRef Triple::getVendorName | ( | ) | const |
getVendorName - Get the vendor (second) component of the triple.
Definition at line 1019 of file Triple.cpp.
References llvm::StringRef::split().
Referenced by setArchName(), setEnvironmentName(), setOSAndEnvironmentName(), and setOSName().
|
static |
getVendorTypeName - Get the canonical name for the Kind
vendor.
Definition at line 161 of file Triple.cpp.
References AMD, Apple, CSR, Freescale, IBM, ImaginationTechnologies, llvm_unreachable, Mesa, MipsTechnologies, Myriad, NVIDIA, OpenEmbedded, PC, SCEI, SUSE, and UnknownVendor.
Referenced by setVendor().
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 1172 of file Triple.cpp.
References Darwin, getOS(), getOSVersion(), IOS, llvm_unreachable, MacOSX, and WatchOS.
|
inline |
Tests whether the target uses -data-sections as default.
Definition at line 816 of file Triple.h.
References isOSBinFormatXCOFF(), and isWasm().
Referenced by llvm::codegen::InitTargetOptionsFromCodeGenFlags().
|
inline |
Tests whether the target uses emulated TLS as default.
Definition at line 811 of file Triple.h.
References isAndroid(), isOSOpenBSD(), and isWindowsCygwinEnvironment().
Referenced by llvm::TargetMachine::useEmulatedTLS().
|
inline |
Tests if the environment supports dllimport/export annotations.
Definition at line 821 of file Triple.h.
References isOSWindows(), and isPS4CPU().
|
inline |
hasEnvironment - Does this triple have the optional environment (fourth) component?
Definition at line 318 of file Triple.h.
References getEnvironmentName().
Referenced by setOSName().
|
inline |
Tests whether the target is AArch64 (little and big endian).
Definition at line 721 of file Triple.h.
References aarch64, aarch64_32, aarch64_be, and getArch().
Referenced by isAArch64(), and llvm::WinException::WinException().
|
inline |
Tests whether the target is AArch64 and pointers are the size specified by PointerWidth
.
Definition at line 728 of file Triple.h.
References aarch64_32, assert(), getArch(), getEnvironment(), GNUILP32, and isAArch64().
|
inline |
Tests whether the target is AMDGCN.
Definition at line 704 of file Triple.h.
References amdgcn, and getArch().
Referenced by llvm::OpenMPIRBuilder::getLanemaskType().
|
inline |
|
inline |
Tests whether the target is Android.
Definition at line 671 of file Triple.h.
References Android, and getEnvironment().
Referenced by llvm::TargetLoweringBase::getSafeStackPointerLocation(), getShadowMapping(), hasDefaultEmulatedTLS(), hasStackGuardSlotTLS(), isAndroidVersionLT(), isOSGlibc(), llvm::AArch64Subtarget::isTargetAndroid(), llvm::ARMSubtarget::isTargetAndroid(), and llvm::X86Subtarget::isTargetAndroid().
|
inline |
Definition at line 673 of file Triple.h.
References assert(), getEnvironmentVersion(), isAndroid(), and isArch64Bit().
Referenced by getShadowMapping(), and hasStackGuardSlotTLS().
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 1335 of file Triple.cpp.
References getArch(), and getArchPointerBitWidth().
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 1331 of file Triple.cpp.
References getArch(), and getArchPointerBitWidth().
Referenced by llvm::sys::getProcessTriple(), llvm::TargetLoweringObjectFileXCOFF::Initialize(), llvm::AArch64Subtarget::isTargetILP32(), and loadObj().
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 1327 of file Triple.cpp.
References getArch(), and getArchPointerBitWidth().
Referenced by calculateCXXStateNumbers(), llvm::WebAssemblyRegisterInfo::getFrameRegister(), llvm::sys::getProcessTriple(), llvm::WebAssemblySubtarget::hasAddr64(), and isAndroidVersionLT().
|
inline |
|
inline |
Tests whether the target is the Apple "arm64e" AArch64 subarch.
Definition at line 800 of file Triple.h.
References aarch64, AArch64SubArch_arm64e, getArch(), and getSubArch().
Referenced by getMinimumSupportedOSVersion().
Test whether target triples are compatible.
Definition at line 1609 of file Triple.cpp.
References Apple, arm, armeb, getArch(), getEnvironment(), getObjectFormat(), getOS(), getSubArch(), getVendor(), Other, thumb, and thumbeb.
Referenced by llvm::ThinLTOCodeGenerator::addModule().
|
inline |
|
inline |
|
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 461 of file Triple.h.
References getOS(), IOS, and isTvOS().
Referenced by getShadowMapping(), isCallingConvCCompatible(), isOSDarwin(), llvm::AArch64Subtarget::isTargetIOS(), llvm::ARMSubtarget::isTargetIOS(), and llvm::AArch64Subtarget::supportsAddressTopByteIgnored().
|
inline |
Checks if the environment is MSVC.
Definition at line 550 of file Triple.h.
References getEnvironment(), isOSWindows(), and MSVC.
Referenced by isWindowsMSVCEnvironment().
bool Triple::isLittleEndian | ( | ) | const |
Tests whether the target triple is little endian.
Definition at line 1562 of file Triple.cpp.
References aarch64, aarch64_32, amdgcn, amdil, amdil64, arm, avr, bpfel, csky, getArch(), hexagon, hsail, hsail64, kalimba, le32, le64, mips64el, mipsel, msp430, nvptx, nvptx64, ppc64le, ppcle, r600, renderscript32, renderscript64, riscv32, riscv64, shave, sparcel, spir, spir64, tcele, thumb, ve, wasm32, wasm64, x86, x86_64, and xcore.
Referenced by getBigEndianArchVariant(), getLittleEndianArchVariant(), getUUID(), lowerMSASplatZExt(), llvm::MipsMCAsmInfo::MipsMCAsmInfo(), and truncateVecElts().
|
inline |
Definition at line 490 of file Triple.h.
References getEnvironment(), and MacABI.
Referenced by getMinimumSupportedOSVersion(), and isTargetMachineMac().
|
inline |
isMacOSX - Is this a Mac OS X triple.
For legacy reasons, we support both "darwin" and "osx" as OS X triples.
Definition at line 452 of file Triple.h.
References Darwin, getOS(), and MacOSX.
Referenced by getShadowMapping(), isMacOSXVersionLT(), isOSDarwin(), and isTargetMachineMac().
bool Triple::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.
Definition at line 1642 of file Triple.cpp.
References assert(), getOS(), isMacOSX(), isOSVersionLT(), and MacOSX.
|
inline |
Tests whether the target is MIPS (little and big endian, 32- or 64-bit).
Definition at line 749 of file Triple.h.
References isMIPS32(), and isMIPS64().
|
inline |
|
inline |
Tests whether the target is MIPS 64-bit (little and big endian).
Definition at line 744 of file Triple.h.
References getArch(), mips64, and mips64el.
Referenced by CreateVarArgHelper(), getShadowMapping(), isMIPS(), and llvm::MipsMCAsmInfo::MipsMCAsmInfo().
|
inline |
Tests whether the environment is musl-libc.
Definition at line 687 of file Triple.h.
References getEnvironment(), Musl, MuslEABI, and MuslEABIHF.
|
inline |
|
inline |
Tests whether the OS is AIX.
Definition at line 625 of file Triple.h.
Referenced by createPPCAsmPrinterPass(), llvm::PPCSubtarget::isAIXABI(), llvm::AsmPrinter::preprocessXXStructorList(), llvm::PPCInstPrinter::printBranchOperand(), llvm::PPCInstPrinter::printInst(), and llvm::AsmPrinter::SetupMachineFunction().
|
inline |
Tests whether the OS uses the COFF binary format.
Definition at line 635 of file Triple.h.
References COFF, and getObjectFormat().
Referenced by adjustFixupValue(), llvm::createAArch64leAsmBackend(), createAArch64MCAsmInfo(), llvm::createX86_32AsmBackend(), llvm::createX86_64AsmBackend(), llvm::createX86ObjectTargetStreamer(), llvm::AsmPrinter::doFinalization(), llvm::AArch64MCInstLower::GetGlobalAddressSymbol(), llvm::AArch64Subtarget::isTargetCOFF(), llvm::ARMSubtarget::isTargetCOFF(), llvm::X86Subtarget::isTargetCOFF(), and llvm::AArch64MCInstLower::LowerSymbolOperand().
|
inline |
Tests whether the OS uses the ELF binary format.
Definition at line 630 of file Triple.h.
References ELF, and getObjectFormat().
Referenced by llvm::lto::LTO::add(), llvm::ARMAsmBackend::adjustFixupValue(), llvm::GlobalObject::canIncreaseAlignment(), llvm::createAArch64beAsmBackend(), llvm::createAArch64leAsmBackend(), createAArch64MCAsmInfo(), createARMAsmBackend(), createX86MCAsmInfo(), llvm::AsmPrinter::doFinalization(), llvm::AsmPrinter::emitFunctionEntryLabel(), llvm::AsmPrinter::emitPatchableFunctionEntries(), llvm::ARMAsmBackend::getFixupKind(), llvm::RISCVAsmBackend::getFixupKind(), llvm::AsmPrinter::getSymbolPreferLocal(), llvm::AArch64RegisterInfo::getTLSCallPreservedMask(), llvm::SystemZSubtarget::isTargetELF(), llvm::MipsSubtarget::isTargetELF(), llvm::PPCSubtarget::isTargetELF(), llvm::AArch64Subtarget::isTargetELF(), llvm::ARMSubtarget::isTargetELF(), llvm::X86Subtarget::isTargetELF(), and llvm::AArch64MCInstLower::LowerSymbolOperand().
|
inline |
Tests whether the OS uses the GOFF binary format.
Definition at line 640 of file Triple.h.
References getObjectFormat(), and GOFF.
Referenced by llvm::SystemZSubtarget::isTargetGOFF().
|
inline |
Tests whether the environment is MachO.
Definition at line 643 of file Triple.h.
References getObjectFormat(), and MachO.
Referenced by llvm::orc::TPCEHFrameRegistrar::Create(), llvm::createAArch64leAsmBackend(), createAArch64MCAsmInfo(), createARMMCAsmInfo(), llvm::createX86_32AsmBackend(), llvm::createX86_64AsmBackend(), createX86MCAsmInfo(), llvm::AsmPrinter::emitXRayTable(), llvm::ARMBaseTargetMachine::isTargetHardFloat(), llvm::PPCSubtarget::isTargetMachO(), llvm::AArch64Subtarget::isTargetMachO(), llvm::ARMSubtarget::isTargetMachO(), llvm::X86Subtarget::isTargetMachO(), llvm::orc::LLJITBuilderState::prepareForConstruction(), llvm::orc::SelfTargetProcessControl::SelfTargetProcessControl(), and supportsCOMDAT().
|
inline |
Tests whether the OS uses the Wasm binary format.
Definition at line 648 of file Triple.h.
References getObjectFormat(), and Wasm.
|
inline |
Tests whether the OS uses the XCOFF binary format.
Definition at line 653 of file Triple.h.
References getObjectFormat(), and XCOFF.
Referenced by createPPCMCAsmInfo(), llvm::AsmPrinter::doFinalization(), hasDefaultDataSections(), and supportsCOMDAT().
|
inline |
Definition at line 535 of file Triple.h.
References Contiki, and getOS().
Referenced by llvm::X86TargetLowering::getSafeStackPointerLocation().
|
inline |
Tests for either Cygwin or MinGW OS.
Definition at line 577 of file Triple.h.
References isWindowsCygwinEnvironment(), and isWindowsGNUEnvironment().
Referenced by createX86MCAsmInfo(), and llvm::X86Subtarget::isTargetCygMing().
|
inline |
isOSDarwin - Is this a "Darwin" OS (macOS, iOS, tvOS or watchOS).
Definition at line 482 of file Triple.h.
References isiOS(), isMacOSX(), and isWatchOS().
Referenced by llvm::ARMBaseTargetMachine::ARMBaseTargetMachine(), llvm::ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(), createARMMCAsmInfo(), llvm::X86FrameLowering::emitEpilogue(), llvm::AArch64RegisterInfo::getRegPressureLimit(), llvm::AArch64RegisterInfo::getReservedRegs(), llvm::AArch64RegisterInfo::getTLSCallPreservedMask(), llvm::AArch64Subtarget::isTargetDarwin(), llvm::ARMSubtarget::isTargetDarwin(), llvm::X86Subtarget::isTargetDarwin(), isTargetMachineMac(), llvm::AArch64MCInstLower::LowerSymbolOperand(), and shouldLowerMemFuncForSize().
|
inline |
Definition at line 516 of file Triple.h.
References DragonFly, and getOS().
Referenced by llvm::X86Subtarget::isTargetDragonFly().
|
inline |
Tests whether the OS is Emscripten.
Definition at line 613 of file Triple.h.
References Emscripten, and getOS().
Referenced by GetCtorAndDtorPriority(), and getShadowMapping().
|
inline |
Definition at line 508 of file Triple.h.
References FreeBSD, and getOS().
Referenced by getShadowMapping(), llvm::TargetLoweringObjectFileELF::Initialize(), and llvm::X86Subtarget::isTargetFreeBSD().
|
inline |
Definition at line 512 of file Triple.h.
References Fuchsia, and getOS().
Referenced by getShadowMapping(), hasStackGuardSlotTLS(), llvm::AArch64Subtarget::isTargetFuchsia(), and llvm::X86Subtarget::isTargetFuchsia().
|
inline |
Tests whether the OS uses glibc.
Definition at line 618 of file Triple.h.
References getOS(), Hurd, isAndroid(), KFreeBSD, and Linux.
Referenced by hasStackGuardSlotTLS(), and llvm::X86Subtarget::isTargetGlibc().
|
inline |
|
inline |
|
inline |
Definition at line 522 of file Triple.h.
References ELFIAMCU, and getOS().
Referenced by llvm::createX86_32AsmBackend(), and llvm::X86Subtarget::isTargetMCU().
|
inline |
Tests whether the OS is kFreeBSD.
Definition at line 598 of file Triple.h.
References getOS(), and KFreeBSD.
Referenced by llvm::X86Subtarget::isTargetKFreeBSD().
|
inline |
Tests whether the OS is Linux.
Definition at line 593 of file Triple.h.
References getOS(), and Linux.
Referenced by getShadowMapping(), llvm::VESubtarget::isTargetLinux(), llvm::SparcSubtarget::isTargetLinux(), llvm::PPCSubtarget::isTargetLinux(), llvm::AArch64Subtarget::isTargetLinux(), llvm::ARMSubtarget::isTargetLinux(), llvm::X86Subtarget::isTargetLinux(), llvm::FastISel::selectXRayCustomEvent(), and llvm::FastISel::selectXRayTypedEvent().
|
inline |
Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
Definition at line 582 of file Triple.h.
References isWindowsGNUEnvironment(), isWindowsItaniumEnvironment(), and isWindowsMSVCEnvironment().
Referenced by llvm::AArch64TargetLowering::AArch64TargetLowering(), llvm::ARMTargetLowering::ARMTargetLowering(), computeBytesPoppedByCalleeForSRet(), llvm::X86TargetLowering::useStackGuardXorFP(), and llvm::X86TargetLowering::X86TargetLowering().
|
inline |
Tests whether the OS is NaCl (Native Client)
Definition at line 588 of file Triple.h.
Referenced by llvm::X86Subtarget::isTarget64BitILP32(), llvm::X86Subtarget::isTarget64BitLP64(), llvm::MipsSubtarget::isTargetNaCl(), llvm::ARMSubtarget::isTargetNaCl(), and llvm::X86Subtarget::isTargetNaCl().
|
inline |
Definition at line 500 of file Triple.h.
References getOS(), and NetBSD.
Referenced by getShadowMapping(), and llvm::ARMSubtarget::isTargetNetBSD().
|
inline |
Definition at line 504 of file Triple.h.
References getOS(), and OpenBSD.
Referenced by hasDefaultEmulatedTLS().
|
inline |
Definition at line 518 of file Triple.h.
References getOS(), and Solaris.
Referenced by llvm::X86Subtarget::isTargetSolaris().
|
inline |
Definition at line 438 of file Triple.h.
References isOSVersionLT(), and Other.
|
inline |
isOSVersionLT - Helper function for doing comparisons against version numbers included in the target triple.
Definition at line 423 of file Triple.h.
References getOSVersion().
Referenced by llvm::ARMTargetLowering::ARMTargetLowering(), isMacOSXVersionLT(), and isOSVersionLT().
|
inline |
|
inline |
Tests whether the OS is Windows.
Definition at line 545 of file Triple.h.
References getOS(), and Win32.
Referenced by llvm::ARMBaseTargetMachine::ARMBaseTargetMachine(), createARMAsmBackend(), createARMMCAsmInfo(), llvm::createX86_32AsmBackend(), llvm::createX86_64AsmBackend(), llvm::AsmPrinter::doInitialization(), llvm::X86FrameLowering::emitEpilogue(), llvm::cl::expandResponseFiles(), llvm::AArch64MCInstLower::GetGlobalAddressSymbol(), getShadowMapping(), hasDLLImportExport(), llvm::MCObjectFileInfo::InitMCObjectFileInfo(), isKnownWindowsMSVCEnvironment(), llvm::X86Subtarget::isOSWindows(), llvm::ARMBaseTargetMachine::isTargetHardFloat(), llvm::AArch64Subtarget::isTargetWindows(), llvm::ARMSubtarget::isTargetWindows(), isWindowsCoreCLREnvironment(), isWindowsCygwinEnvironment(), isWindowsGNUEnvironment(), isWindowsItaniumEnvironment(), isWindowsMSVCEnvironment(), and llvm::X86MCAsmInfoGNUCOFF::X86MCAsmInfoGNUCOFF().
|
inline |
Definition at line 479 of file Triple.h.
Referenced by llvm::SystemZSubtarget::isTargetzOS().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Tests whether the target is the PS4 CPU.
Definition at line 658 of file Triple.h.
References getArch(), getOS(), getVendor(), PS4, SCEI, and x86_64.
Referenced by getShadowMapping(), hasDLLImportExport(), llvm::X86Subtarget::isTargetPS4(), and llvm::SelectionDAGBuilder::visitSPDescriptorFailure().
|
inline |
|
inline |
Definition at line 486 of file Triple.h.
References getEnvironment(), and Simulator.
Referenced by getMinimumSupportedOSVersion(), and isTargetMachineMac().
|
inline |
|
inline |
|
inline |
Returns true for targets that run on a macOS machine.
Definition at line 495 of file Triple.h.
References isMacCatalystEnvironment(), isMacOSX(), isOSDarwin(), and isSimulatorEnvironment().
|
inline |
Tests whether the target is Thumb (little and big endian).
Definition at line 711 of file Triple.h.
References getArch(), thumb, and thumbeb.
Referenced by getShadowMapping(), and llvm::object::ELFObjectFileBase::setARMSubArch().
|
inline |
|
inline |
|
inline |
Tests whether the target is wasm (32- and 64-bit).
Definition at line 790 of file Triple.h.
References getArch(), wasm32, and wasm64.
Referenced by llvm::DwarfDebug::emitDebugLocValue(), hasDefaultDataSections(), and llvm::SelectionDAGBuilder::visitSPDescriptorFailure().
|
inline |
Definition at line 475 of file Triple.h.
References ARMSubArch_v7k, and getSubArch().
Referenced by llvm::ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(), and llvm::ARMSubtarget::isTargetWatchABI().
|
inline |
Is this an Apple watchOS triple.
Definition at line 471 of file Triple.h.
References getOS(), and WatchOS.
Referenced by getShadowMapping(), isOSDarwin(), and llvm::ARMSubtarget::isTargetWatchOS().
|
inline |
Definition at line 560 of file Triple.h.
References CoreCLR, getEnvironment(), and isOSWindows().
Referenced by createX86MCAsmInfo(), and llvm::X86Subtarget::isTargetWindowsCoreCLR().
|
inline |
Definition at line 568 of file Triple.h.
References Cygnus, getEnvironment(), and isOSWindows().
Referenced by hasDefaultEmulatedTLS(), isOSCygMing(), and llvm::X86Subtarget::isTargetWindowsCygwin().
|
inline |
Definition at line 572 of file Triple.h.
References getEnvironment(), GNU, and isOSWindows().
Referenced by llvm::TargetLoweringBase::insertSSPDeclarations(), isOSCygMing(), isOSMSVCRT(), and llvm::X86Subtarget::isTargetWindowsGNU().
|
inline |
Definition at line 564 of file Triple.h.
References getEnvironment(), isOSWindows(), and Itanium.
Referenced by createX86MCAsmInfo(), llvm::X86TargetLowering::getSDagStackGuard(), llvm::X86TargetLowering::getSSPStackGuardCheck(), llvm::X86TargetLowering::insertSSPDeclarations(), isOSMSVCRT(), and llvm::X86Subtarget::isTargetWindowsItanium().
|
inline |
Checks if the environment could be MSVC.
Definition at line 555 of file Triple.h.
References getEnvironment(), isKnownWindowsMSVCEnvironment(), isOSWindows(), and UnknownEnvironment.
Referenced by createAArch64MCAsmInfo(), createARMMCAsmInfo(), createX86MCAsmInfo(), llvm::ARMTargetLowering::getSDagStackGuard(), llvm::AArch64TargetLowering::getSDagStackGuard(), llvm::X86TargetLowering::getSDagStackGuard(), llvm::ARMTargetLowering::getSSPStackGuardCheck(), llvm::AArch64TargetLowering::getSSPStackGuardCheck(), llvm::X86TargetLowering::getSSPStackGuardCheck(), llvm::ARMTargetLowering::insertSSPDeclarations(), llvm::AArch64TargetLowering::insertSSPDeclarations(), llvm::X86TargetLowering::insertSSPDeclarations(), isOSMSVCRT(), and llvm::X86Subtarget::isTargetWindowsMSVC().
|
inline |
Merge target triples.
Definition at line 1633 of file Triple.cpp.
References Apple, getVendor(), Other, and str().
Referenced by llvm::ThinLTOCodeGenerator::addModule().
|
inline |
Return the normalized form of this triple's string.
Definition at line 298 of file Triple.h.
References llvm::Data, and normalize().
Referenced by llvm::sys::getProcessTriple(), LLVMNormalizeTargetTriple(), and normalize().
|
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 825 of file Triple.cpp.
References Android, llvm::array_lengthof(), assert(), COFF, llvm::numbers::e, llvm::StringRef::empty(), llvm::empty(), getObjectFormatTypeName(), GNUEABI, i, llvm_unreachable, parseArch(), parseEnvironment(), parseFormat(), parseOS(), parseVendor(), llvm::SmallVectorImpl< T >::resize(), llvm::StringRef::split(), startswith(), llvm::StringRef::startswith(), llvm::Twine::str(), SUSE, std::swap(), UnknownArch, UnknownEnvironment, UnknownObjectFormat, UnknownOS, UnknownVendor, and Win32.
void Triple::setArch | ( | ArchType | Kind | ) |
setArch - Set the architecture (first) component of the triple to a known type.
Definition at line 1200 of file Triple.cpp.
References getArchTypeName(), and setArchName().
Referenced by llvm::TargetRegistry::lookupTarget(), llvm::object::ObjectFile::makeTriple(), and llvm::EngineBuilder::selectTarget().
void Triple::setArchName | ( | StringRef | Str | ) |
setArchName - Set the architecture (first) component of the triple by name.
Definition at line 1228 of file Triple.cpp.
References getOSAndEnvironmentName(), getVendorName(), setTriple(), and Triple().
Referenced by setArch(), and llvm::object::ELFObjectFileBase::setARMSubArch().
void Triple::setEnvironment | ( | EnvironmentType | Kind | ) |
setEnvironment - Set the environment (fourth) component of the triple to a known type.
Definition at line 1212 of file Triple.cpp.
References getDefaultFormat(), getEnvironmentTypeName(), getObjectFormatTypeName(), setEnvironmentName(), and str().
void Triple::setEnvironmentName | ( | StringRef | Str | ) |
setEnvironmentName - Set the optional environment (fourth) component of the triple by name.
Definition at line 1251 of file Triple.cpp.
References getArchName(), getOSName(), getVendorName(), and setTriple().
Referenced by setEnvironment(), and setObjectFormat().
void Triple::setObjectFormat | ( | ObjectFormatType | Kind | ) |
setObjectFormat - Set the object file format
Definition at line 1220 of file Triple.cpp.
References getEnvironmentTypeName(), getObjectFormatTypeName(), setEnvironmentName(), str(), and UnknownEnvironment.
Referenced by llvm::object::ObjectFile::makeTriple().
void Triple::setOS | ( | OSType | Kind | ) |
setOS - Set the operating system (third) component of the triple to a known type.
Definition at line 1208 of file Triple.cpp.
References getOSTypeName(), and setOSName().
Referenced by llvm::object::ObjectFile::makeTriple().
void Triple::setOSAndEnvironmentName | ( | StringRef | Str | ) |
setOSAndEnvironmentName - Set the operating system and optional environment components with a single string.
Definition at line 1256 of file Triple.cpp.
References getArchName(), getVendorName(), and setTriple().
void Triple::setOSName | ( | StringRef | Str | ) |
setOSName - Set the operating system (third) component of the triple by name.
Definition at line 1243 of file Triple.cpp.
References getArchName(), getEnvironmentName(), getVendorName(), hasEnvironment(), and setTriple().
Referenced by setOS().
setTriple - Set all components to the new triple Str
.
Definition at line 1196 of file Triple.cpp.
References Triple().
Referenced by llvm::object::ObjectFile::makeTriple(), llvm::EngineBuilder::selectTarget(), setArchName(), setEnvironmentName(), setOSAndEnvironmentName(), setOSName(), and setVendorName().
void Triple::setVendor | ( | VendorType | Kind | ) |
setVendor - Set the vendor (second) component of the triple to a known type.
Definition at line 1204 of file Triple.cpp.
References getVendorTypeName(), and setVendorName().
void Triple::setVendorName | ( | StringRef | Str | ) |
setVendorName - Set the vendor (second) component of the triple by name.
Definition at line 1239 of file Triple.cpp.
References getArchName(), getOSAndEnvironmentName(), and setTriple().
Referenced by setVendor().
|
inline |
Definition at line 374 of file Triple.h.
References llvm::Data.
Referenced by llvm::TargetMachineBuilder::create(), llvm::AsmPrinter::doInitialization(), llvm::sys::getProcessTriple(), merge(), llvm::orc::JITTargetMachineBuilderPrinter::print(), setEnvironment(), and setObjectFormat().
|
inline |
Tests whether the target supports comdat.
Definition at line 806 of file Triple.h.
References isOSBinFormatMachO(), and isOSBinFormatXCOFF().
Referenced by llvm::MCObjectFileInfo::getPseudoProbeDescSection(), llvm::SampleProfileProber::instrumentOneFunc(), and llvm::needsComdatForCounter().