10 #ifndef LLVM_ADT_TRIPLE_H 11 #define LLVM_ADT_TRIPLE_H 253 : Data(), Arch(), SubArch(), Vendor(), OS(), Environment(),
259 const Twine &EnvironmentStr);
262 return Arch == Other.Arch && SubArch == Other.SubArch &&
263 Vendor == Other.Vendor && OS == Other.OS &&
264 Environment == Other.Environment &&
265 ObjectFormat == Other.ObjectFormat;
269 return !(*
this == Other);
317 unsigned &Micro)
const;
328 void getOSVersion(
unsigned &Major,
unsigned &Minor,
unsigned &Micro)
const;
333 unsigned Maj, Min, Micro;
343 unsigned &Micro)
const;
348 unsigned &Micro)
const;
353 unsigned &Micro)
const;
359 const std::string &
str()
const {
return Data; }
409 unsigned Micro = 0)
const {
414 return LHS[0] < Major;
416 return LHS[1] < Minor;
418 return LHS[1] < Micro;
433 unsigned Micro = 0)
const {
441 assert(Major == 10 &&
"Unexpected major version");
649 return Env[0] < Major;
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
bool isOSHaiku() const
Tests whether the OS is Haiku.
void getiOSVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const
getiOSVersion - Parse the version number as with getOSVersion.
bool isMIPS64() const
Tests whether the target is MIPS 64-bit (little and big endian).
bool isOSMSVCRT() const
Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
bool supportsCOMDAT() const
Tests whether the target supports comdat.
static StringRef getVendorTypeName(VendorType Kind)
getVendorTypeName - Get the canonical name for the Kind vendor.
This class represents lattice values for constants.
bool isMacOSX() const
isMacOSX - Is this a Mac OS X triple.
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
void setVendor(VendorType Kind)
setVendor - Set the vendor (second) component of the triple to a known type.
bool isArch16Bit() const
Test whether the architecture is 16-bit.
bool isOSNaCl() const
Tests whether the OS is NaCl (Native Client)
bool isWatchOS() const
Is this an Apple watchOS triple.
bool hasEnvironment() const
hasEnvironment - Does this triple have the optional environment (fourth) component?
void setOS(OSType Kind)
setOS - Set the operating system (third) component of the triple to a known type. ...
void setEnvironment(EnvironmentType Kind)
setEnvironment - Set the environment (fourth) component of the triple to a known type.
void getEnvironmentVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const
Parse the version number from the OS name component of the triple, if present.
bool isWindowsCygwinEnvironment() const
StringRef getARMCPUForArch(StringRef Arch=StringRef()) const
Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
bool isAArch64() const
Tests whether the target is AArch64 (little and big endian).
static StringRef getArchTypeName(ArchType Kind)
getArchTypeName - Get the canonical name for the Kind architecture.
bool isKnownWindowsMSVCEnvironment() const
Checks if the environment is MSVC.
bool isOSHurd() const
Tests whether the OS is Hurd.
bool hasDefaultEmulatedTLS() const
Tests whether the target uses emulated TLS as default.
void setVendorName(StringRef Str)
setVendorName - Set the vendor (second) component of the triple by name.
Triple()
Default constructor is the same as an empty string and leaves all triple fields unknown.
SubArchType getSubArch() const
getSubArch - get the parsed subarchitecture type for this triple.
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
bool isArch32Bit() const
Test whether the architecture is 32-bit.
bool isiOS() const
Is this an iOS triple.
bool isPS4() const
Tests whether the target is the PS4 platform.
bool isOSWASI() const
Tests whether the OS is WASI.
bool isWindowsItaniumEnvironment() const
bool isWindowsGNUEnvironment() const
static StringRef getOSTypeName(OSType Kind)
getOSTypeName - Get the canonical name for the Kind operating system.
bool isWindowsCoreCLREnvironment() const
const std::string & str() const
bool isOSDragonFly() const
bool isOSWindows() const
Tests whether the OS is Windows.
void getOSVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const
getOSVersion - Parse the version number from the OS name component of the triple, if present...
bool isMusl() const
Tests whether the environment is musl-libc.
void setObjectFormat(ObjectFormatType Kind)
setObjectFormat - Set the object file format
StringRef getOSAndEnvironmentName() const
getOSAndEnvironmentName - Get the operating system and optional environment components as a single st...
llvm::Triple get32BitArchVariant() const
Form a triple with a 32-bit variant of the current architecture.
bool isLittleEndian() const
Tests whether the target triple is little endian.
VendorType getVendor() const
getVendor - Get the parsed vendor type of this triple.
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
void setEnvironmentName(StringRef Str)
setEnvironmentName - Set the optional environment (fourth) component of the triple by name...
llvm::Triple getBigEndianArchVariant() const
Form a triple with a big endian variant of the current architecture.
void setTriple(const Twine &Str)
setTriple - Set all components to the new triple Str.
bool operator==(const Triple &Other) const
bool isCompatibleWith(const Triple &Other) const
Test whether target triples are compatible.
static StringRef getArchTypePrefix(ArchType Kind)
getArchTypePrefix - Get the "prefix" canonical name for the Kind architecture.
bool operator!=(const Triple &Other) const
bool isAndroidVersionLT(unsigned Major) const
bool isPS4CPU() const
Tests whether the target is the PS4 CPU.
void getWatchOSVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const
getWatchOSVersion - Parse the version number as with getOSVersion.
bool isOSKFreeBSD() const
Tests whether the OS is kFreeBSD.
void setArchName(StringRef Str)
setArchName - Set the architecture (first) component of the triple by name.
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
void setOSName(StringRef Str)
setOSName - Set the operating system (third) component of the triple by name.
unsigned getOSMajorVersion() const
getOSMajorVersion - Return just the major version number, this is specialized because it is a common ...
Triple - Helper class for working with autoconf configuration names.
StringRef getArchName() const
getArchName - Get the architecture (first) component of the triple.
bool getMacOSXVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const
getMacOSXVersion - Parse the version number as with getOSVersion and then translate generic "darwin" ...
static ArchType getArchTypeForLLVMName(StringRef Str)
getArchTypeForLLVMName - The canonical type for the given LLVM architecture name (e.g., "x86").
StringRef getOSName() const
getOSName - Get the operating system (third) component of the triple.
bool isOSLinux() const
Tests whether the OS is Linux.
EnvironmentType getEnvironment() const
getEnvironment - Get the parsed environment type of this triple.
std::string merge(const Triple &Other) const
Merge target triples.
bool isOSVersionLT(const Triple &Other) const
std::string normalize() const
Return the normalized form of this triple's string.
StringRef getEnvironmentName() const
getEnvironmentName - Get the optional environment (fourth) component of the triple, or "" if empty.
bool isMIPS() const
Tests whether the target is MIPS (little and big endian, 32- or 64-bit).
bool isOSCygMing() const
Tests for either Cygwin or MinGW OS.
const std::string & getTriple() const
bool isMIPS32() const
Tests whether the target is MIPS 32-bit (little and big endian).
bool isOSGlibc() const
Tests whether the OS uses glibc.
llvm::Triple getLittleEndianArchVariant() const
Form a triple with a little endian variant of the current architecture.
bool isThumb() const
Tests whether the target is Thumb (little and big endian).
ObjectFormatType getObjectFormat() const
getFormat - Get the object format for this triple.
void setOSAndEnvironmentName(StringRef Str)
setOSAndEnvironmentName - Set the operating system and optional environment components with a single ...
bool isArch64Bit() const
Test whether the architecture is 64-bit.
bool isGNUEnvironment() const
bool isMacOSXVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
isMacOSXVersionLT - Comparison function for checking OS X version compatibility, which handles suppor...
StringRef getVendorName() const
getVendorName - Get the vendor (second) component of the triple.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isSimulatorEnvironment() const
bool isTvOS() const
Is this an Apple tvOS triple.
bool isAndroid() const
Tests whether the target is Android.
llvm::Triple get64BitArchVariant() const
Form a triple with a 64-bit variant of the current architecture.
bool isNVPTX() const
Tests whether the target is NVPTX (32- or 64-bit).
StringRef - Represent a constant reference to a string, i.e.
bool isOSVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
isOSVersionLT - Helper function for doing comparisons against version numbers included in the target ...
bool isOSBinFormatWasm() const
Tests whether the OS uses the Wasm binary format.
bool isWindowsMSVCEnvironment() const
Checks if the environment could be MSVC.
bool isARM() const
Tests whether the target is ARM (little and big endian).
void setArch(ArchType Kind)
setArch - Set the architecture (first) component of the triple to a known type.
static StringRef getEnvironmentTypeName(EnvironmentType Kind)
getEnvironmentTypeName - Get the canonical name for the Kind environment.